@loaders.gl/3d-tiles 4.3.0-alpha.6 → 4.3.0-alpha.8
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/3d-tiles-archive-loader.js +1 -1
- package/dist/cesium-ion-loader.d.ts +1 -1
- package/dist/dist.dev.js +11624 -12546
- package/dist/dist.min.js +1 -1
- package/dist/index.cjs +71 -71
- package/dist/index.cjs.map +2 -2
- package/dist/lib/classes/helpers/tile-3d-accessor-utils.d.ts +1 -1
- package/dist/lib/classes/tile-3d-batch-table.d.ts +1 -1
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts +35 -19
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.d.ts.map +1 -1
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js +108 -85
- package/dist/lib/utils/version.js +1 -1
- package/package.json +14 -14
- package/src/lib/parsers/helpers/parse-3d-implicit-tiles.ts +130 -116
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 zd=Object.create;var go=Object.defineProperty;var Qd=Object.getOwnPropertyDescriptor;var Vd=Object.getOwnPropertyNames;var jd=Object.getPrototypeOf,Kd=Object.prototype.hasOwnProperty;var ct=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ut=(e,t)=>{for(var r in t)go(e,r,{get:t[r],enumerable:!0})},po=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Vd(t))!Kd.call(e,o)&&o!==r&&go(e,o,{get:()=>t[o],enumerable:!(n=Qd(t,o))||n.enumerable});return e},xo=(e,t,r)=>(po(e,t,"default"),r&&po(r,t,"default")),xr=(e,t,r)=>(r=e!=null?zd(jd(e)):{},po(t||!e||!e.__esModule?go(r,"default",{value:e,enumerable:!0}):r,e)),Xd=e=>po(go({},"__esModule",{value:!0}),e);var gn=ct((G_,Yc)=>{Yc.exports=globalThis.loaders});var xe=ct(gt=>{"use strict";var G2=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function P2(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)P2(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 U2={arraySet:function(e,t,r,n,o){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),o);return}for(var s=0;s<n;s++)e[o+s]=t[r+s]},flattenChunks:function(e){var t,r,n,o,s,i;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(i=new Uint8Array(n),o=0,t=0,r=e.length;t<r;t++)s=e[t],i.set(s,o),o+=s.length;return i}},H2={arraySet:function(e,t,r,n,o){for(var s=0;s<n;s++)e[o+s]=t[r+s]},flattenChunks:function(e){return[].concat.apply([],e)}};gt.setTyped=function(e){e?(gt.Buf8=Uint8Array,gt.Buf16=Uint16Array,gt.Buf32=Int32Array,gt.assign(gt,U2)):(gt.Buf8=Array,gt.Buf16=Array,gt.Buf32=Array,gt.assign(gt,H2))};gt.setTyped(G2)});var A0=ct(an=>{"use strict";var k2=xe(),J2=4,ju=0,Ku=1,z2=2;function sn(e){for(var t=e.length;--t>=0;)e[t]=0}var Q2=0,$u=1,V2=2,j2=3,K2=258,dc=29,to=256,Zn=to+1+dc,on=30,Ac=19,t0=2*Zn+1,ir=15,ac=16,X2=7,mc=256,e0=16,r0=17,n0=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],ws=[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],Y2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],o0=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],Z2=512,Be=new Array((Zn+2)*2);sn(Be);var Yn=new Array(on*2);sn(Yn);var qn=new Array(Z2);sn(qn);var Wn=new Array(K2-j2+1);sn(Wn);var pc=new Array(dc);sn(pc);var Is=new Array(on);sn(Is);function cc(e,t,r,n,o){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=e&&e.length}var s0,i0,a0;function fc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function c0(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 oe(e,t,r){Mt(e,r[t*2],r[t*2+1])}function f0(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function q2(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 W2(e,t){var r=t.dyn_tree,n=t.max_code,o=t.stat_desc.static_tree,s=t.stat_desc.has_stree,i=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,c=t.stat_desc.max_length,f,h,u,l,d,A,m=0;for(l=0;l<=ir;l++)e.bl_count[l]=0;for(r[e.heap[e.heap_max]*2+1]=0,f=e.heap_max+1;f<t0;f++)h=e.heap[f],l=r[r[h*2+1]*2+1]+1,l>c&&(l=c,m++),r[h*2+1]=l,!(h>n)&&(e.bl_count[l]++,d=0,h>=a&&(d=i[h-a]),A=r[h*2],e.opt_len+=A*(l+d),s&&(e.static_len+=A*(o[h*2+1]+d)));if(m!==0){do{for(l=c-1;e.bl_count[l]===0;)l--;e.bl_count[l]--,e.bl_count[l+1]+=2,e.bl_count[c]--,m-=2}while(m>0);for(l=c;l!==0;l--)for(h=e.bl_count[l];h!==0;)u=e.heap[--f],!(u>n)&&(r[u*2+1]!==l&&(e.opt_len+=(l-r[u*2+1])*r[u*2],r[u*2+1]=l),h--)}}function h0(e,t,r){var n=new Array(ir+1),o=0,s,i;for(s=1;s<=ir;s++)n[s]=o=o+r[s-1]<<1;for(i=0;i<=t;i++){var a=e[i*2+1];a!==0&&(e[i*2]=f0(n[a]++,a))}}function $2(){var e,t,r,n,o,s=new Array(ir+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,o=0,n=0;n<16;n++)for(Is[n]=o,e=0;e<1<<ws[n];e++)qn[o++]=n;for(o>>=7;n<on;n++)for(Is[n]=o<<7,e=0;e<1<<ws[n]-7;e++)qn[256+o++]=n;for(t=0;t<=ir;t++)s[t]=0;for(e=0;e<=143;)Be[e*2+1]=8,e++,s[8]++;for(;e<=255;)Be[e*2+1]=9,e++,s[9]++;for(;e<=279;)Be[e*2+1]=7,e++,s[7]++;for(;e<=287;)Be[e*2+1]=8,e++,s[8]++;for(h0(Be,Zn+1,s),e=0;e<on;e++)Yn[e*2+1]=5,Yn[e*2]=f0(e,5);s0=new cc(Be,lc,to+1,Zn,ir),i0=new cc(Yn,ws,0,on,ir),a0=new cc(new Array(0),Y2,0,Ac,X2)}function l0(e){var t;for(t=0;t<Zn;t++)e.dyn_ltree[t*2]=0;for(t=0;t<on;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 u0(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 tE(e,t,r,n){u0(e),n&&($n(e,r),$n(e,~r)),k2.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function Xu(e,t,r,n){var o=t*2,s=r*2;return e[o]<e[s]||e[o]===e[s]&&n[t]<=n[r]}function hc(e,t,r){for(var n=e.heap[r],o=r<<1;o<=e.heap_len&&(o<e.heap_len&&Xu(t,e.heap[o+1],e.heap[o],e.depth)&&o++,!Xu(t,n,e.heap[o],e.depth));)e.heap[r]=e.heap[o],r=o,o<<=1;e.heap[r]=n}function Yu(e,t,r){var n,o,s=0,i,a;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+s*2]<<8|e.pending_buf[e.d_buf+s*2+1],o=e.pending_buf[e.l_buf+s],s++,n===0?oe(e,o,t):(i=Wn[o],oe(e,i+to+1,t),a=lc[i],a!==0&&(o-=pc[i],Mt(e,o,a)),n--,i=c0(n),oe(e,i,r),a=ws[i],a!==0&&(n-=Is[i],Mt(e,n,a)));while(s<e.last_lit);oe(e,mc,t)}function uc(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,o=t.stat_desc.has_stree,s=t.stat_desc.elems,i,a,c=-1,f;for(e.heap_len=0,e.heap_max=t0,i=0;i<s;i++)r[i*2]!==0?(e.heap[++e.heap_len]=c=i,e.depth[i]=0):r[i*2+1]=0;for(;e.heap_len<2;)f=e.heap[++e.heap_len]=c<2?++c:0,r[f*2]=1,e.depth[f]=0,e.opt_len--,o&&(e.static_len-=n[f*2+1]);for(t.max_code=c,i=e.heap_len>>1;i>=1;i--)hc(e,r,i);f=s;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[f*2]=r[i*2]+r[a*2],e.depth[f]=(e.depth[i]>=e.depth[a]?e.depth[i]:e.depth[a])+1,r[i*2+1]=r[a*2+1]=f,e.heap[1]=f++,hc(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],W2(e,t),h0(r,c,e.bl_count)}function Zu(e,t,r){var n,o=-1,s,i=t[0*2+1],a=0,c=7,f=4;for(i===0&&(c=138,f=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)s=i,i=t[(n+1)*2+1],!(++a<c&&s===i)&&(a<f?e.bl_tree[s*2]+=a:s!==0?(s!==o&&e.bl_tree[s*2]++,e.bl_tree[e0*2]++):a<=10?e.bl_tree[r0*2]++:e.bl_tree[n0*2]++,a=0,o=s,i===0?(c=138,f=3):s===i?(c=6,f=3):(c=7,f=4))}function qu(e,t,r){var n,o=-1,s,i=t[0*2+1],a=0,c=7,f=4;for(i===0&&(c=138,f=3),n=0;n<=r;n++)if(s=i,i=t[(n+1)*2+1],!(++a<c&&s===i)){if(a<f)do oe(e,s,e.bl_tree);while(--a!==0);else s!==0?(s!==o&&(oe(e,s,e.bl_tree),a--),oe(e,e0,e.bl_tree),Mt(e,a-3,2)):a<=10?(oe(e,r0,e.bl_tree),Mt(e,a-3,3)):(oe(e,n0,e.bl_tree),Mt(e,a-11,7));a=0,o=s,i===0?(c=138,f=3):s===i?(c=6,f=3):(c=7,f=4)}}function eE(e){var t;for(Zu(e,e.dyn_ltree,e.l_desc.max_code),Zu(e,e.dyn_dtree,e.d_desc.max_code),uc(e,e.bl_desc),t=Ac-1;t>=3&&e.bl_tree[o0[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function rE(e,t,r,n){var o;for(Mt(e,t-257,5),Mt(e,r-1,5),Mt(e,n-4,4),o=0;o<n;o++)Mt(e,e.bl_tree[o0[o]*2+1],3);qu(e,e.dyn_ltree,t-1),qu(e,e.dyn_dtree,r-1)}function nE(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return ju;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Ku;for(r=32;r<to;r++)if(e.dyn_ltree[r*2]!==0)return Ku;return ju}var Wu=!1;function oE(e){Wu||($2(),Wu=!0),e.l_desc=new fc(e.dyn_ltree,s0),e.d_desc=new fc(e.dyn_dtree,i0),e.bl_desc=new fc(e.bl_tree,a0),e.bi_buf=0,e.bi_valid=0,l0(e)}function d0(e,t,r,n){Mt(e,(Q2<<1)+(n?1:0),3),tE(e,t,r,!0)}function sE(e){Mt(e,$u<<1,3),oe(e,mc,Be),q2(e)}function iE(e,t,r,n){var o,s,i=0;e.level>0?(e.strm.data_type===z2&&(e.strm.data_type=nE(e)),uc(e,e.l_desc),uc(e,e.d_desc),i=eE(e),o=e.opt_len+3+7>>>3,s=e.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&t!==-1?d0(e,t,r,n):e.strategy===J2||s===o?(Mt(e,($u<<1)+(n?1:0),3),Yu(e,Be,Yn)):(Mt(e,(V2<<1)+(n?1:0),3),rE(e,e.l_desc.max_code+1,e.d_desc.max_code+1,i+1),Yu(e,e.dyn_ltree,e.dyn_dtree)),l0(e),n&&u0(e)}function aE(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]+to+1)*2]++,e.dyn_dtree[c0(t)*2]++),e.last_lit===e.lit_bufsize-1}an._tr_init=oE;an._tr_stored_block=d0;an._tr_flush_block=iE;an._tr_tally=aE;an._tr_align=sE});var gc=ct((oO,m0)=>{"use strict";function cE(e,t,r,n){for(var o=e&65535|0,s=e>>>16&65535|0,i=0;r!==0;){i=r>2e3?2e3:r,r-=i;do o=o+t[n++]|0,s=s+o|0;while(--i);o%=65521,s%=65521}return o|s<<16|0}m0.exports=cE});var xc=ct((sO,p0)=>{"use strict";function fE(){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 hE=fE();function lE(e,t,r,n){var o=hE,s=n+r;e^=-1;for(var i=n;i<s;i++)e=e>>>8^o[(e^t[i])&255];return e^-1}p0.exports=lE});var Ss=ct((iO,g0)=>{"use strict";g0.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 b0=ct(ae=>{"use strict";var xt=xe(),Nt=A0(),_0=gc(),Oe=xc(),uE=Ss(),hr=0,dE=1,AE=3,Pe=4,x0=5,ie=0,B0=1,Gt=-2,mE=-3,Bc=-5,pE=-1,gE=1,Rs=2,xE=3,BE=4,EE=0,_E=2,Ls=8,yE=9,TE=15,CE=8,ME=29,bE=256,_c=bE+1+ME,wE=30,IE=19,SE=2*_c+1,RE=15,k=3,Ne=258,jt=Ne+k+1,FE=32,vs=42,yc=69,Fs=73,Ds=91,Os=103,ar=113,ro=666,it=1,no=2,cr=3,hn=4,DE=3;function Ge(e,t){return e.msg=uE[t],t}function E0(e){return(e<<1)-(e>4?9:0)}function ve(e){for(var t=e.length;--t>=0;)e[t]=0}function Le(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,Le(e.strm)}function V(e,t){e.pending_buf[e.pending++]=t}function eo(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function OE(e,t,r,n){var o=e.avail_in;return o>n&&(o=n),o===0?0:(e.avail_in-=o,xt.arraySet(t,e.input,e.next_in,o,r),e.state.wrap===1?e.adler=_0(e.adler,t,o,r):e.state.wrap===2&&(e.adler=Oe(e.adler,t,o,r)),e.next_in+=o,e.total_in+=o,o)}function y0(e,t){var r=e.max_chain_length,n=e.strstart,o,s,i=e.prev_length,a=e.nice_match,c=e.strstart>e.w_size-jt?e.strstart-(e.w_size-jt):0,f=e.window,h=e.w_mask,u=e.prev,l=e.strstart+Ne,d=f[n+i-1],A=f[n+i];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do if(o=t,!(f[o+i]!==A||f[o+i-1]!==d||f[o]!==f[n]||f[++o]!==f[n+1])){n+=2,o++;do;while(f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&f[++n]===f[++o]&&n<l);if(s=Ne-(l-n),n=l-Ne,s>i){if(e.match_start=t,i=s,s>=a)break;d=f[n+i-1],A=f[n+i]}}while((t=u[t&h])>c&&--r!==0);return i<=e.lookahead?i:e.lookahead}function fr(e){var t=e.w_size,r,n,o,s,i;do{if(s=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 o=e.head[--r],e.head[r]=o>=t?o-t:0;while(--n);n=t,r=n;do o=e.prev[--r],e.prev[r]=o>=t?o-t:0;while(--n);s+=t}if(e.strm.avail_in===0)break;if(n=OE(e.strm,e.window,e.strstart+e.lookahead,s),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 LE(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(fr(e),e.lookahead===0&&t===hr)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===Pe?(lt(e,!0),e.strm.avail_out===0?cr:hn):(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(fr(e),e.lookahead<jt&&t===hr)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=y0(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===Pe?(lt(e,!0),e.strm.avail_out===0?cr:hn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:no}function cn(e,t){for(var r,n,o;;){if(e.lookahead<jt){if(fr(e),e.lookahead<jt&&t===hr)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=y0(e,r),e.match_length<=5&&(e.strategy===gE||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){o=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<=o&&(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&<(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===Pe?(lt(e,!0),e.strm.avail_out===0?cr:hn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:no}function vE(e,t){for(var r,n,o,s,i=e.window;;){if(e.lookahead<=Ne){if(fr(e),e.lookahead<=Ne&&t===hr)return it;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=k&&e.strstart>0&&(o=e.strstart-1,n=i[o],n===i[++o]&&n===i[++o]&&n===i[++o])){s=e.strstart+Ne;do;while(n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&o<s);e.match_length=Ne-(s-o),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===Pe?(lt(e,!0),e.strm.avail_out===0?cr:hn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:no}function NE(e,t){for(var r;;){if(e.lookahead===0&&(fr(e),e.lookahead===0)){if(t===hr)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===Pe?(lt(e,!0),e.strm.avail_out===0?cr:hn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:no}function se(e,t,r,n,o){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=o}var fn;fn=[new se(0,0,0,0,LE),new se(4,4,8,4,Ec),new se(4,5,16,8,Ec),new se(4,6,32,32,Ec),new se(4,4,16,16,cn),new se(8,16,32,32,cn),new se(8,16,128,128,cn),new se(8,32,128,256,cn),new se(32,128,258,1024,cn),new se(32,258,258,4096,cn)];function GE(e){e.window_size=2*e.w_size,ve(e.head),e.max_lazy_match=fn[e.level].max_lazy,e.good_match=fn[e.level].good_length,e.nice_match=fn[e.level].nice_length,e.max_chain_length=fn[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 PE(){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=Ls,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(SE*2),this.dyn_dtree=new xt.Buf16((2*wE+1)*2),this.bl_tree=new xt.Buf16((2*IE+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(RE+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 T0(e){var t;return!e||!e.state?Ge(e,Gt):(e.total_in=e.total_out=0,e.data_type=_E,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?vs:ar,e.adler=t.wrap===2?0:1,t.last_flush=hr,Nt._tr_init(t),ie)}function C0(e){var t=T0(e);return t===ie&&GE(e.state),t}function UE(e,t){return!e||!e.state||e.state.wrap!==2?Gt:(e.state.gzhead=t,ie)}function M0(e,t,r,n,o,s){if(!e)return Gt;var i=1;if(t===pE&&(t=6),n<0?(i=0,n=-n):n>15&&(i=2,n-=16),o<1||o>yE||r!==Ls||n<8||n>15||t<0||t>9||s<0||s>BE)return Ge(e,Gt);n===8&&(n=9);var a=new PE;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=o+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+k-1)/k),a.window=new 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<<o+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=s,a.method=r,C0(e)}function HE(e,t){return M0(e,t,Ls,TE,CE,EE)}function kE(e,t){var r,n,o,s;if(!e||!e.state||t>x0||t<0)return e?Ge(e,Gt):Gt;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===ro&&t!==Pe)return Ge(e,e.avail_out===0?Bc:Gt);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===vs)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>=Rs||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=Oe(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>=Rs||n.level<2?4:0),V(n,DE),n.status=ar);else{var i=Ls+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=Rs||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=FE),i+=31-i%31,n.status=ar,eo(n,i),n.strstart!==0&&(eo(n,e.adler>>>16),eo(n,e.adler&65535)),e.adler=1}if(n.status===yc)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=Oe(e.adler,n.pending_buf,n.pending-o,o)),Le(e),o=n.pending,n.pending===n.pending_buf_size));)V(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(e.adler=Oe(e.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Fs)}else n.status=Fs;if(n.status===Fs)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=Oe(e.adler,n.pending_buf,n.pending-o,o)),Le(e),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,V(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(e.adler=Oe(e.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.gzindex=0,n.status=Ds)}else n.status=Ds;if(n.status===Ds)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(e.adler=Oe(e.adler,n.pending_buf,n.pending-o,o)),Le(e),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,V(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(e.adler=Oe(e.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.status=Os)}else n.status=Os;if(n.status===Os&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Le(e),n.pending+2<=n.pending_buf_size&&(V(n,e.adler&255),V(n,e.adler>>8&255),e.adler=0,n.status=ar)):n.status=ar),n.pending!==0){if(Le(e),e.avail_out===0)return n.last_flush=-1,ie}else if(e.avail_in===0&&E0(t)<=E0(r)&&t!==Pe)return Ge(e,Bc);if(n.status===ro&&e.avail_in!==0)return Ge(e,Bc);if(e.avail_in!==0||n.lookahead!==0||t!==hr&&n.status!==ro){var c=n.strategy===Rs?NE(n,t):n.strategy===xE?vE(n,t):fn[n.level].func(n,t);if((c===cr||c===hn)&&(n.status=ro),c===it||c===cr)return e.avail_out===0&&(n.last_flush=-1),ie;if(c===no&&(t===dE?Nt._tr_align(n):t!==x0&&(Nt._tr_stored_block(n,0,0,!1),t===AE&&(ve(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Le(e),e.avail_out===0))return n.last_flush=-1,ie}return t!==Pe?ie:n.wrap<=0?B0:(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)):(eo(n,e.adler>>>16),eo(n,e.adler&65535)),Le(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?ie:B0)}function JE(e){var t;return!e||!e.state?Gt:(t=e.state.status,t!==vs&&t!==yc&&t!==Fs&&t!==Ds&&t!==Os&&t!==ar&&t!==ro?Ge(e,Gt):(e.state=null,t===ar?Ge(e,mE):ie))}function zE(e,t){var r=t.length,n,o,s,i,a,c,f,h;if(!e||!e.state||(n=e.state,i=n.wrap,i===2||i===1&&n.status!==vs||n.lookahead))return Gt;for(i===1&&(e.adler=_0(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,c=e.next_in,f=e.input,e.avail_in=r,e.next_in=0,e.input=t,fr(n);n.lookahead>=k;){o=n.strstart,s=n.lookahead-(k-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[o+k-1])&n.hash_mask,n.prev[o&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=o,o++;while(--s);n.strstart=o,n.lookahead=k-1,fr(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=c,e.input=f,e.avail_in=a,n.wrap=i,ie}ae.deflateInit=HE;ae.deflateInit2=M0;ae.deflateReset=C0;ae.deflateResetKeep=T0;ae.deflateSetHeader=UE;ae.deflate=kE;ae.deflateEnd=JE;ae.deflateSetDictionary=zE;ae.deflateInfo="pako deflate (from Nodeca project)"});var Tc=ct(ln=>{"use strict";var Ns=xe(),w0=!0,I0=!0;try{String.fromCharCode.apply(null,[0])}catch{w0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{I0=!1}var oo=new Ns.Buf8(256);for(Ee=0;Ee<256;Ee++)oo[Ee]=Ee>=252?6:Ee>=248?5:Ee>=240?4:Ee>=224?3:Ee>=192?2:1;var Ee;oo[254]=oo[254]=1;ln.string2buf=function(e){var t,r,n,o,s,i=e.length,a=0;for(o=0;o<i;o++)r=e.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=e.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Ns.Buf8(a),s=0,o=0;s<a;o++)r=e.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=e.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?t[s++]=r:r<2048?(t[s++]=192|r>>>6,t[s++]=128|r&63):r<65536?(t[s++]=224|r>>>12,t[s++]=128|r>>>6&63,t[s++]=128|r&63):(t[s++]=240|r>>>18,t[s++]=128|r>>>12&63,t[s++]=128|r>>>6&63,t[s++]=128|r&63);return t};function S0(e,t){if(t<65534&&(e.subarray&&I0||!e.subarray&&w0))return String.fromCharCode.apply(null,Ns.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}ln.buf2binstring=function(e){return S0(e,e.length)};ln.binstring2buf=function(e){for(var t=new Ns.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};ln.buf2string=function(e,t){var r,n,o,s,i=t||e.length,a=new Array(i*2);for(n=0,r=0;r<i;){if(o=e[r++],o<128){a[n++]=o;continue}if(s=oo[o],s>4){a[n++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<i;)o=o<<6|e[r++]&63,s--;if(s>1){a[n++]=65533;continue}o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|o&1023)}return S0(a,n)};ln.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+oo[e[r]]>t?r:t}});var Cc=ct((fO,R0)=>{"use strict";function QE(){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}R0.exports=QE});var L0=ct(ao=>{"use strict";var so=b0(),io=xe(),bc=Tc(),wc=Ss(),VE=Cc(),O0=Object.prototype.toString,jE=0,Mc=4,un=0,F0=1,D0=2,KE=-1,XE=0,YE=8;function lr(e){if(!(this instanceof lr))return new lr(e);this.options=io.assign({level:KE,method:YE,chunkSize:16384,windowBits:15,memLevel:8,strategy:XE,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 VE,this.strm.avail_out=0;var r=so.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==un)throw new Error(wc[r]);if(t.header&&so.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=bc.string2buf(t.dictionary):O0.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=so.deflateSetDictionary(this.strm,n),r!==un)throw new Error(wc[r]);this._dict_set=!0}}lr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,o,s;if(this.ended)return!1;s=t===~~t?t:t===!0?Mc:jE,typeof e=="string"?r.input=bc.string2buf(e):O0.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 io.Buf8(n),r.next_out=0,r.avail_out=n),o=so.deflate(r,s),o!==F0&&o!==un)return this.onEnd(o),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(s===Mc||s===D0))&&(this.options.to==="string"?this.onData(bc.buf2binstring(io.shrinkBuf(r.output,r.next_out))):this.onData(io.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&o!==F0);return s===Mc?(o=so.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===un):(s===D0&&(this.onEnd(un),r.avail_out=0),!0)};lr.prototype.onData=function(e){this.chunks.push(e)};lr.prototype.onEnd=function(e){e===un&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=io.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ic(e,t){var r=new lr(t);if(r.push(e,!0),r.err)throw r.msg||wc[r.err];return r.result}function ZE(e,t){return t=t||{},t.raw=!0,Ic(e,t)}function qE(e,t){return t=t||{},t.gzip=!0,Ic(e,t)}ao.Deflate=lr;ao.deflate=Ic;ao.deflateRaw=ZE;ao.gzip=qE});var N0=ct((lO,v0)=>{"use strict";var Gs=30,WE=12;v0.exports=function(t,r){var n,o,s,i,a,c,f,h,u,l,d,A,m,p,E,y,C,M,T,I,w,O,x,g,B;n=t.state,o=t.next_in,g=t.input,s=o+(t.avail_in-5),i=t.next_out,B=t.output,a=i-(r-t.avail_out),c=i+(t.avail_out-257),f=n.dmax,h=n.wsize,u=n.whave,l=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[o++]<<m,m+=8,A+=g[o++]<<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[o++]<<m,m+=8),I+=A&(1<<T)-1,A>>>=T,m-=T),m<15&&(A+=g[o++]<<m,m+=8,A+=g[o++]<<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[o++]<<m,m+=8,m<T&&(A+=g[o++]<<m,m+=8)),w+=A&(1<<T)-1,w>f){t.msg="invalid distance too far back",n.mode=Gs;break t}if(A>>>=T,m-=T,T=i-a,w>T){if(T=w-T,T>u&&n.sane){t.msg="invalid distance too far back",n.mode=Gs;break t}if(O=0,x=d,l===0){if(O+=h-T,T<I){I-=T;do B[i++]=d[O++];while(--T);O=i-w,x=B}}else if(l<T){if(O+=h+l-T,T-=l,T<I){I-=T;do B[i++]=d[O++];while(--T);if(O=0,l<I){T=l,I-=T;do B[i++]=d[O++];while(--T);O=i-w,x=B}}}else if(O+=l-T,T<I){I-=T;do B[i++]=d[O++];while(--T);O=i-w,x=B}for(;I>2;)B[i++]=x[O++],B[i++]=x[O++],B[i++]=x[O++],I-=3;I&&(B[i++]=x[O++],I>1&&(B[i++]=x[O++]))}else{O=i-w;do B[i++]=B[O++],B[i++]=B[O++],B[i++]=B[O++],I-=3;while(I>2);I&&(B[i++]=B[O++],I>1&&(B[i++]=B[O++]))}}else if(T&64){t.msg="invalid distance code",n.mode=Gs;break t}else{M=E[(M&65535)+(A&(1<<T)-1)];continue r}break}}else if(T&64)if(T&32){n.mode=WE;break t}else{t.msg="invalid literal/length code",n.mode=Gs;break t}else{M=p[(M&65535)+(A&(1<<T)-1)];continue e}break}}while(o<s&&i<c);I=m>>3,o-=I,m-=I<<3,A&=(1<<m)-1,t.next_in=o,t.next_out=i,t.avail_in=o<s?5+(s-o):5-(o-s),t.avail_out=i<c?257+(c-i):257-(i-c),n.hold=A,n.bits=m}});var z0=ct((uO,J0)=>{"use strict";var G0=xe(),dn=15,P0=852,U0=592,H0=0,Sc=1,k0=2,$E=[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],t_=[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],e_=[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],r_=[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];J0.exports=function(t,r,n,o,s,i,a,c){var f=c.bits,h=0,u=0,l=0,d=0,A=0,m=0,p=0,E=0,y=0,C=0,M,T,I,w,O,x=null,g=0,B,_=new G0.Buf16(dn+1),P=new G0.Buf16(dn+1),G=null,U=0,v,at,mt;for(h=0;h<=dn;h++)_[h]=0;for(u=0;u<o;u++)_[r[n+u]]++;for(A=f,d=dn;d>=1&&_[d]===0;d--);if(A>d&&(A=d),d===0)return s[i++]=1<<24|64<<16|0,s[i++]=1<<24|64<<16|0,c.bits=1,0;for(l=1;l<d&&_[l]===0;l++);for(A<l&&(A=l),E=1,h=1;h<=dn;h++)if(E<<=1,E-=_[h],E<0)return-1;if(E>0&&(t===H0||d!==1))return-1;for(P[1]=0,h=1;h<dn;h++)P[h+1]=P[h]+_[h];for(u=0;u<o;u++)r[n+u]!==0&&(a[P[r[n+u]]++]=u);if(t===H0?(x=G=a,B=19):t===Sc?(x=$E,g-=257,G=t_,U-=257,B=256):(x=e_,G=r_,B=-1),C=0,u=0,h=l,O=i,m=A,p=0,I=-1,y=1<<A,w=y-1,t===Sc&&y>P0||t===k0&&y>U0)return 1;for(;;){v=h-p,a[u]<B?(at=0,mt=a[u]):a[u]>B?(at=G[U+a[u]],mt=x[g+a[u]]):(at=32+64,mt=0),M=1<<h-p,T=1<<m,l=T;do T-=M,s[O+(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,u++,--_[h]===0){if(h===d)break;h=r[n+a[u]]}if(h>A&&(C&w)!==I){for(p===0&&(p=A),O+=l,m=h-p,E=1<<m;m+p<d&&(E-=_[m+p],!(E<=0));)m++,E<<=1;if(y+=1<<m,t===Sc&&y>P0||t===k0&&y>U0)return 1;I=C&w,s[I]=A<<24|m<<16|O-i|0}}return C!==0&&(s[O+C]=h-p<<24|64<<16|0),c.bits=A,0}});var Cd=ct(Kt=>{"use strict";var St=xe(),vc=gc(),ce=xc(),n_=N0(),co=z0(),o_=0,md=1,pd=2,Q0=4,s_=5,Ps=6,ur=0,i_=1,a_=2,Pt=-2,gd=-3,Nc=-4,c_=-5,V0=8,xd=1,j0=2,K0=3,X0=4,Y0=5,Z0=6,q0=7,W0=8,$0=9,td=10,ks=11,_e=12,Rc=13,ed=14,Fc=15,rd=16,nd=17,od=18,sd=19,Us=20,Hs=21,id=22,ad=23,cd=24,fd=25,hd=26,Dc=27,ld=28,ud=29,$=30,Gc=31,f_=32,h_=852,l_=592,u_=15,d_=u_;function dd(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function A_(){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 Bd(e){var t;return!e||!e.state?Pt:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=xd,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(h_),t.distcode=t.distdyn=new St.Buf32(l_),t.sane=1,t.back=-1,ur)}function Ed(e){var t;return!e||!e.state?Pt:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,Bd(e))}function _d(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))?Pt:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Ed(e))}function yd(e,t){var r,n;return e?(n=new A_,e.state=n,n.window=null,r=_d(e,t),r!==ur&&(e.state=null),r):Pt}function m_(e){return yd(e,d_)}var Ad=!0,Oc,Lc;function p_(e){if(Ad){var t;for(Oc=new St.Buf32(512),Lc=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(co(md,e.lens,0,288,Oc,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;co(pd,e.lens,0,32,Lc,0,e.work,{bits:5}),Ad=!1}e.lencode=Oc,e.lenbits=9,e.distcode=Lc,e.distbits=5}function Td(e,t,r,n){var o,s=e.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new St.Buf8(s.wsize)),n>=s.wsize?(St.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(o=s.wsize-s.wnext,o>n&&(o=n),St.arraySet(s.window,t,r-n,o,s.wnext),n-=o,n?(St.arraySet(s.window,t,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}function g_(e,t){var r,n,o,s,i,a,c,f,h,u,l,d,A,m,p=0,E,y,C,M,T,I,w,O,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 Pt;r=e.state,r.mode===_e&&(r.mode=Rc),i=e.next_out,o=e.output,c=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,f=r.hold,h=r.bits,u=a,l=c,O=ur;t:for(;;)switch(r.mode){case xd:if(r.wrap===0){r.mode=Rc;break}for(;h<16;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(r.wrap&2&&f===35615){r.check=0,x[0]=f&255,x[1]=f>>>8&255,r.check=ce(r.check,x,2,0),f=0,h=0,r.mode=j0;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((f&255)<<8)+(f>>8))%31){e.msg="incorrect header check",r.mode=$;break}if((f&15)!==V0){e.msg="unknown compression method",r.mode=$;break}if(f>>>=4,h-=4,w=(f&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=f&512?td:_e,f=0,h=0;break;case j0:for(;h<16;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(r.flags=f,(r.flags&255)!==V0){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=f>>8&1),r.flags&512&&(x[0]=f&255,x[1]=f>>>8&255,r.check=ce(r.check,x,2,0)),f=0,h=0,r.mode=K0;case K0:for(;h<32;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}r.head&&(r.head.time=f),r.flags&512&&(x[0]=f&255,x[1]=f>>>8&255,x[2]=f>>>16&255,x[3]=f>>>24&255,r.check=ce(r.check,x,4,0)),f=0,h=0,r.mode=X0;case X0:for(;h<16;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}r.head&&(r.head.xflags=f&255,r.head.os=f>>8),r.flags&512&&(x[0]=f&255,x[1]=f>>>8&255,r.check=ce(r.check,x,2,0)),f=0,h=0,r.mode=Y0;case Y0:if(r.flags&1024){for(;h<16;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}r.length=f,r.head&&(r.head.extra_len=f),r.flags&512&&(x[0]=f&255,x[1]=f>>>8&255,r.check=ce(r.check,x,2,0)),f=0,h=0}else r.head&&(r.head.extra=null);r.mode=Z0;case Z0: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,s,d,w)),r.flags&512&&(r.check=ce(r.check,n,d,s)),a-=d,s+=d,r.length-=d),r.length))break t;r.length=0,r.mode=q0;case q0:if(r.flags&2048){if(a===0)break t;d=0;do w=n[s+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,s)),a-=d,s+=d,w)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=W0;case W0:if(r.flags&4096){if(a===0)break t;d=0;do w=n[s+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,s)),a-=d,s+=d,w)break t}else r.head&&(r.head.comment=null);r.mode=$0;case $0:if(r.flags&512){for(;h<16;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(f!==(r.check&65535)){e.msg="header crc mismatch",r.mode=$;break}f=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 td:for(;h<32;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}e.adler=r.check=dd(f),f=0,h=0,r.mode=ks;case ks:if(r.havedict===0)return e.next_out=i,e.avail_out=c,e.next_in=s,e.avail_in=a,r.hold=f,r.bits=h,a_;e.adler=r.check=1,r.mode=_e;case _e:if(t===s_||t===Ps)break t;case Rc:if(r.last){f>>>=h&7,h-=h&7,r.mode=Dc;break}for(;h<3;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}switch(r.last=f&1,f>>>=1,h-=1,f&3){case 0:r.mode=ed;break;case 1:if(p_(r),r.mode=Us,t===Ps){f>>>=2,h-=2;break t}break;case 2:r.mode=nd;break;case 3:e.msg="invalid block type",r.mode=$}f>>>=2,h-=2;break;case ed:for(f>>>=h&7,h-=h&7;h<32;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if((f&65535)!==(f>>>16^65535)){e.msg="invalid stored block lengths",r.mode=$;break}if(r.length=f&65535,f=0,h=0,r.mode=Fc,t===Ps)break t;case Fc:r.mode=rd;case rd:if(d=r.length,d){if(d>a&&(d=a),d>c&&(d=c),d===0)break t;St.arraySet(o,n,s,d,i),a-=d,s+=d,c-=d,i+=d,r.length-=d;break}r.mode=_e;break;case nd:for(;h<14;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(r.nlen=(f&31)+257,f>>>=5,h-=5,r.ndist=(f&31)+1,f>>>=5,h-=5,r.ncode=(f&15)+4,f>>>=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=od;case od:for(;r.have<r.ncode;){for(;h<3;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}r.lens[_[r.have++]]=f&7,f>>>=3,h-=3}for(;r.have<19;)r.lens[_[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,g={bits:r.lenbits},O=co(o_,r.lens,0,19,r.lencode,0,r.work,g),r.lenbits=g.bits,O){e.msg="invalid code lengths set",r.mode=$;break}r.have=0,r.mode=sd;case sd:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[f&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(C<16)f>>>=E,h-=E,r.lens[r.have++]=C;else{if(C===16){for(B=E+2;h<B;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(f>>>=E,h-=E,r.have===0){e.msg="invalid bit length repeat",r.mode=$;break}w=r.lens[r.have-1],d=3+(f&3),f>>>=2,h-=2}else if(C===17){for(B=E+3;h<B;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}f>>>=E,h-=E,w=0,d=3+(f&7),f>>>=3,h-=3}else{for(B=E+7;h<B;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}f>>>=E,h-=E,w=0,d=11+(f&127),f>>>=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},O=co(md,r.lens,0,r.nlen,r.lencode,0,r.work,g),r.lenbits=g.bits,O){e.msg="invalid literal/lengths set",r.mode=$;break}if(r.distbits=6,r.distcode=r.distdyn,g={bits:r.distbits},O=co(pd,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,g),r.distbits=g.bits,O){e.msg="invalid distances set",r.mode=$;break}if(r.mode=Us,t===Ps)break t;case Us:r.mode=Hs;case Hs:if(a>=6&&c>=258){e.next_out=i,e.avail_out=c,e.next_in=s,e.avail_in=a,r.hold=f,r.bits=h,n_(e,l),i=e.next_out,o=e.output,c=e.avail_out,s=e.next_in,n=e.input,a=e.avail_in,f=r.hold,h=r.bits,r.mode===_e&&(r.back=-1);break}for(r.back=0;p=r.lencode[f&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(y&&!(y&240)){for(M=E,T=y,I=C;p=r.lencode[I+((f&(1<<M+T)-1)>>M)],E=p>>>24,y=p>>>16&255,C=p&65535,!(M+E<=h);){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}f>>>=M,h-=M,r.back+=M}if(f>>>=E,h-=E,r.back+=E,r.length=C,y===0){r.mode=hd;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=id;case id:if(r.extra){for(B=r.extra;h<B;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}r.length+=f&(1<<r.extra)-1,f>>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=ad;case ad:for(;p=r.distcode[f&(1<<r.distbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(!(y&240)){for(M=E,T=y,I=C;p=r.distcode[I+((f&(1<<M+T)-1)>>M)],E=p>>>24,y=p>>>16&255,C=p&65535,!(M+E<=h);){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}f>>>=M,h-=M,r.back+=M}if(f>>>=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=cd;case cd:if(r.extra){for(B=r.extra;h<B;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}r.offset+=f&(1<<r.extra)-1,f>>>=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=fd;case fd:if(c===0)break t;if(d=l-c,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=o,A=i-r.offset,d=r.length;d>c&&(d=c),c-=d,r.length-=d;do o[i++]=m[A++];while(--d);r.length===0&&(r.mode=Hs);break;case hd:if(c===0)break t;o[i++]=r.length,c--,r.mode=Hs;break;case Dc:if(r.wrap){for(;h<32;){if(a===0)break t;a--,f|=n[s++]<<h,h+=8}if(l-=c,e.total_out+=l,r.total+=l,l&&(e.adler=r.check=r.flags?ce(r.check,o,l,i-l):vc(r.check,o,l,i-l)),l=c,(r.flags?f:dd(f))!==r.check){e.msg="incorrect data check",r.mode=$;break}f=0,h=0}r.mode=ld;case ld:if(r.wrap&&r.flags){for(;h<32;){if(a===0)break t;a--,f+=n[s++]<<h,h+=8}if(f!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=$;break}f=0,h=0}r.mode=ud;case ud:O=i_;break t;case $:O=gd;break t;case Gc:return Nc;case f_:default:return Pt}return e.next_out=i,e.avail_out=c,e.next_in=s,e.avail_in=a,r.hold=f,r.bits=h,(r.wsize||l!==e.avail_out&&r.mode<$&&(r.mode<Dc||t!==Q0))&&Td(e,e.output,e.next_out,l-e.avail_out)?(r.mode=Gc,Nc):(u-=e.avail_in,l-=e.avail_out,e.total_in+=u,e.total_out+=l,r.total+=l,r.wrap&&l&&(e.adler=r.check=r.flags?ce(r.check,o,l,e.next_out-l):vc(r.check,o,l,e.next_out-l)),e.data_type=r.bits+(r.last?64:0)+(r.mode===_e?128:0)+(r.mode===Us||r.mode===Fc?256:0),(u===0&&l===0||t===Q0)&&O===ur&&(O=c_),O)}function x_(e){if(!e||!e.state)return Pt;var t=e.state;return t.window&&(t.window=null),e.state=null,ur}function B_(e,t){var r;return!e||!e.state||(r=e.state,!(r.wrap&2))?Pt:(r.head=t,t.done=!1,ur)}function E_(e,t){var r=t.length,n,o,s;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==ks)?Pt:n.mode===ks&&(o=1,o=vc(o,t,r,0),o!==n.check)?gd:(s=Td(e,t,r,r),s?(n.mode=Gc,Nc):(n.havedict=1,ur))}Kt.inflateReset=Ed;Kt.inflateReset2=_d;Kt.inflateResetKeep=Bd;Kt.inflateInit=m_;Kt.inflateInit2=yd;Kt.inflate=g_;Kt.inflateEnd=x_;Kt.inflateGetHeader=B_;Kt.inflateSetDictionary=E_;Kt.inflateInfo="pako inflate (from Nodeca project)"});var Pc=ct((AO,Md)=>{"use strict";Md.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 wd=ct((mO,bd)=>{"use strict";function __(){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}bd.exports=__});var Sd=ct(ho=>{"use strict";var An=Cd(),fo=xe(),Js=Tc(),ot=Pc(),Uc=Ss(),y_=Cc(),T_=wd(),Id=Object.prototype.toString;function dr(e){if(!(this instanceof dr))return new dr(e);this.options=fo.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 y_,this.strm.avail_out=0;var r=An.inflateInit2(this.strm,t.windowBits);if(r!==ot.Z_OK)throw new Error(Uc[r]);if(this.header=new T_,An.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=Js.string2buf(t.dictionary):Id.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=An.inflateSetDictionary(this.strm,t.dictionary),r!==ot.Z_OK)))throw new Error(Uc[r])}dr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,o=this.options.dictionary,s,i,a,c,f,h=!1;if(this.ended)return!1;i=t===~~t?t:t===!0?ot.Z_FINISH:ot.Z_NO_FLUSH,typeof e=="string"?r.input=Js.binstring2buf(e):Id.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 fo.Buf8(n),r.next_out=0,r.avail_out=n),s=An.inflate(r,ot.Z_NO_FLUSH),s===ot.Z_NEED_DICT&&o&&(s=An.inflateSetDictionary(this.strm,o)),s===ot.Z_BUF_ERROR&&h===!0&&(s=ot.Z_OK,h=!1),s!==ot.Z_STREAM_END&&s!==ot.Z_OK)return this.onEnd(s),this.ended=!0,!1;r.next_out&&(r.avail_out===0||s===ot.Z_STREAM_END||r.avail_in===0&&(i===ot.Z_FINISH||i===ot.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=Js.utf8border(r.output,r.next_out),c=r.next_out-a,f=Js.buf2string(r.output,a),r.next_out=c,r.avail_out=n-c,c&&fo.arraySet(r.output,r.output,a,c,0),this.onData(f)):this.onData(fo.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)&&s!==ot.Z_STREAM_END);return s===ot.Z_STREAM_END&&(i=ot.Z_FINISH),i===ot.Z_FINISH?(s=An.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===ot.Z_OK):(i===ot.Z_SYNC_FLUSH&&(this.onEnd(ot.Z_OK),r.avail_out=0),!0)};dr.prototype.onData=function(e){this.chunks.push(e)};dr.prototype.onEnd=function(e){e===ot.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=fo.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Hc(e,t){var r=new dr(t);if(r.push(e,!0),r.err)throw r.msg||Uc[r.err];return r.result}function C_(e,t){return t=t||{},t.raw=!0,Hc(e,t)}ho.Inflate=dr;ho.inflate=Hc;ho.inflateRaw=C_;ho.ungzip=Hc});var Dd=ct((gO,Fd)=>{"use strict";var M_=xe().assign,b_=L0(),w_=Sd(),I_=Pc(),Rd={};M_(Rd,b_,w_,I_);Fd.exports=Rd});var Od=ct(()=>{});var lo={};ut(lo,{CesiumIonLoader:()=>rc,TILE3D_TYPE:()=>_t,Tile3DBatchTable:()=>ue,Tile3DFeatureTable:()=>kt,Tile3DSubtreeLoader:()=>Xr,Tile3DWriter:()=>kd,Tiles3DArchive:()=>mn,Tiles3DArchiveFileLoader:()=>vd,Tiles3DLoader:()=>nr,_getIonTilesetMetadata:()=>Ts});xo(lo,xr(gn(),1));async function Ut(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},Yd=Yt.self||Yt.window||Yt.global||{},Zd=Yt.window||Yt.self||Yt.global||{},qd=Yt.global||Yt.self||Yt.window||{},Wd=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),$d=Zc&&parseFloat(Zc[1])||0;function xn(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Vs(e){return globalThis.loaders?.modules?.[e]||null}function t1(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.0-alpha.5"),globalThis._loadersgl_.version}var qc=t1();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},Q_=Zt.self||Zt.window||Zt.global||{},V_=Zt.window||Zt.self||Zt.global||{},j_=Zt.global||Zt.self||Zt.window||{},K_=Zt.document||{};var Br=typeof process!="object"||String(process)!=="[object process]"||process.browser,Bo=typeof importScripts=="function",X_=typeof window<"u"&&typeof window.orientation<"u",$c=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Y_=$c&&parseFloat($c[1])||0;var js={};async function qt(e,t=null,r={},n=null){return t&&(e=tf(e,t,r,n)),js[e]=js[e]||e1(e),await js[e]}function tf(e,t,r={},n=null){if(!r.useLocalLibraries&&e.startsWith("http"))return e;n=n||e;let o=r.modules||{};return o[n]?o[n]:Br?r.CDN?(Wc(r.CDN.startsWith("http")),`${r.CDN}/${t}@${qc}/dist/libs/${n}`):Bo?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function e1(e){if(e.endsWith("wasm"))return await n1(e);if(!Br)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(e)}catch(r){return console.error(r),null}if(Bo)return importScripts(e);let t=await o1(e);return r1(t,e)}function r1(e,t){if(!Br){let{requireFromString:n}=globalThis.loaders||{};return n?.(e,t)}if(Bo)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 n1(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};return Br||!t||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await t(e)}async function o1(e){let{readFileAsText:t}=globalThis.loaders||{};return Br||!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),o="";for(let s=0;s<r;s++)o+=String.fromCharCode(n.getUint8(t+s));return o}function Ks(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),o=new Uint8Array(t);for(let s=0;s<n.length;++s)if(n[s]!==o[s])return!1;return!0}function Er(...e){return nf(e)}function nf(e){let t=e.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),r=t.reduce((s,i)=>s+i.byteLength,0),n=new Uint8Array(r),o=0;for(let s of t)n.set(s,o),o+=s.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 Xs(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let o=e.byteOffset,s=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,o,s)}return t.set(n,r),r+bt(n.byteLength,4)}function Ys(e,t){let r=e.length,o=Math.ceil(r/t)*t-r,s="";for(let i=0;i<o;++i)s+=" ";return e+s}function _r(e,t,r,n){if(e)for(let o=0;o<n;o++)e.setUint8(t+o,r.charCodeAt(o));return t+n}function Bn(e,t,r,n){if(e)for(let o=0;o<n;o++)e.setUint8(t+o,r[o]);return t+n}function of(e,t,r,n){let o=bt(r.byteLength,n),s=o-r.byteLength;if(e){let i=new Uint8Array(e.buffer,e.byteOffset+t,r.byteLength),a=new Uint8Array(r);i.set(a);for(let c=0;c<s;++c)e.setUint8(t+r.byteLength+c,32)}return t+=o,t}function Eo(e,t,r,n){let s=new TextEncoder().encode(r);return t=of(e,t,s,n),t}async function En(e){let t=[];for await(let r of e)t.push(r);return Er(...t)}function sf(e){return e&&typeof e=="object"&&e.isBuffer}function yr(e){if(sf(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 Tr(e){return t=>new Promise((r,n)=>e(t,(o,s)=>o?n(o):r(s)))}var Cr={};ut(Cr,{dirname:()=>i1,filename:()=>s1,join:()=>a1,resolve:()=>c1});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 s1(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function i1(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function a1(...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 c1(...e){let t=[];for(let s=0;s<e.length;s++)t[s]=e[s];let r="",n=!1,o;for(let s=t.length-1;s>=-1&&!n;s--){let i;s>=0?i=t[s]:(o===void 0&&(o=af()),i=o),i.length!==0&&(r=`${i}/${r}`,n=i.charCodeAt(0)===_n)}return r=f1(r,!n),n?`/${r}`:r.length>0?r:"."}var _n=47,Zs=46;function f1(e,t){let r="",n=-1,o=0,s,i=!1;for(let a=0;a<=e.length;++a){if(a<e.length)s=e.charCodeAt(a);else{if(s===_n)break;s=_n}if(s===_n){if(!(n===a-1||o===1))if(n!==a-1&&o===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==Zs||r.charCodeAt(r.length-2)!==Zs){if(r.length>2){let c=r.length-1,f=c;for(;f>=0&&r.charCodeAt(f)!==_n;--f);if(f!==c){r=f===-1?"":r.slice(0,f),n=a,o=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,o=0,i=!1;continue}}t&&(r.length>0?r+="/..":r="..",i=!0)}else{let c=e.slice(n+1,a);r.length>0?r+=`/${c}`:r=c,i=!1}n=a,o=0}else s===Zs&&o!==-1?++o:o=-1}return r}var yn=new Error("Not implemented"),_o=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 yn}async write(t,r,n){throw yn}async stat(){throw yn}async truncate(t){throw yn}async append(t){throw yn}async close(){}};var qs=e=>e?.getUint8&&e?.slice&&e?.length;var Tn=class{file;constructor(t,r=!1){this.file=new _o(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 o=Number(n);return await this.file.read(t,o)}get length(){return this.file.bigsize}};var Mr=e=>{if(e>Number.MAX_SAFE_INTEGER)throw new Error("Offset is out of bounds");return Number(e)},ze=class{file;constructor(t){this.file=t}async destroy(){}async getUint8(t){return this.file.getUint8(Mr(t))}async getUint16(t){return this.file.getUint16(Mr(t),!0)}async getUint32(t){return this.file.getUint32(Mr(t),!0)}async getBigUint64(t){return this.file.getBigUint64(Mr(t),!0)}async slice(t,r){return this.file.buffer.slice(Mr(t),Mr(r))}get length(){return BigInt(this.file.byteLength)}};var Yy=1/Math.PI*180,Zy=1/180*Math.PI,h1={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...h1}};var et=globalThis.mathgl.config;function Ws(e,{precision:t=et.precision}={}){return e=l1(e),"".concat(parseFloat(e.toPrecision(t)))}function Wt(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function $s(e,t,r){return d1(e,n=>Math.max(t,Math.min(r,n)))}function yo(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 o=0;o<e.length;++o)if(!yo(e[o],t[o]))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 l1(e){return Math.round(e/et.EPSILON)*et.EPSILON}function u1(e){return e.clone?e.clone():new Array(e.length)}function d1(e,t,r){if(Wt(e)){let n=e;r=r||u1(n);for(let o=0;o<r.length&&o<n.length;++o){let s=typeof e=="number"?e:e[o];r[o]=t(s,o,r)}return r}return t(e)}function A1(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 br=class extends A1(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?", ":"")+Ws(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(!yo(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 o=0;o<this.ELEMENTS;++o){let s=t[o],i=typeof r=="number"?r:r[o];this[o]=s+n*(i-s)}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 m1(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&&!m1(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function ti(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var wr=class extends br{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 o=this[n]-t[n];r+=o*o}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 ti(t>=0&&t<this.ELEMENTS,"index is out of range"),rt(this[t])}setComponent(t,r){return ti(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 Ir=typeof Float32Array<"u"?Float32Array:Array;var aT=Math.PI/180;function B1(){let e=new Ir(2);return Ir!=Float32Array&&(e[0]=0,e[1]=0),e}function hf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[2]*o,e[1]=r[1]*n+r[3]*o,e}function lf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[2]*o+r[4],e[1]=r[1]*n+r[3]*o+r[5],e}function To(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[3]*o+r[6],e[1]=r[1]*n+r[4]*o+r[7],e}function uf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[4]*o+r[12],e[1]=r[1]*n+r[5]*o+r[13],e}var cT=function(){let e=B1();return function(t,r,n,o,s,i){let a,c;for(r||(r=2),n||(n=0),o?c=Math.min(o*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],s(e,e,i),t[a]=e[0],t[a+1]=e[1];return t}}();function df(e,t,r){let n=t[0],o=t[1],s=r[3]*n+r[7]*o||1;return e[0]=(r[0]*n+r[4]*o)/s,e[1]=(r[1]*n+r[5]*o)/s,e}function Af(e,t,r){let n=t[0],o=t[1],s=t[2],i=r[3]*n+r[7]*o+r[11]*s||1;return e[0]=(r[0]*n+r[4]*o+r[8]*s)/i,e[1]=(r[1]*n+r[5]*o+r[9]*s)/i,e[2]=(r[2]*n+r[6]*o+r[10]*s)/i,e}function mf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[2]*o,e[1]=r[1]*n+r[3]*o,e[2]=t[2],e}function pf(e,t,r){let n=t[0],o=t[1],s=t[2];return e[0]=r[0]*n+r[3]*o+r[6]*s,e[1]=r[1]*n+r[4]*o+r[7]*s,e[2]=r[2]*n+r[5]*o+r[8]*s,e[3]=t[3],e}var Qe=class extends wr{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 To(this,this,t),this.check()}transformByMatrix2x3(t){return lf(this,this,t),this.check()}transformByMatrix2(t){return hf(this,this,t),this.check()}};function E1(){let e=new Ir(3);return Ir!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function _1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function gf(e,t,r){let n=t[0],o=t[1],s=t[2],i=r[0],a=r[1],c=r[2];return e[0]=o*c-s*a,e[1]=s*i-n*c,e[2]=n*a-o*i,e}function xf(e,t,r){let n=t[0],o=t[1],s=t[2],i=r[3]*n+r[7]*o+r[11]*s+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*o+r[8]*s+r[12])/i,e[1]=(r[1]*n+r[5]*o+r[9]*s+r[13])/i,e[2]=(r[2]*n+r[6]*o+r[10]*s+r[14])/i,e}function Co(e,t,r){let n=t[0],o=t[1],s=t[2];return e[0]=n*r[0]+o*r[3]+s*r[6],e[1]=n*r[1]+o*r[4]+s*r[7],e[2]=n*r[2]+o*r[5]+s*r[8],e}function Bf(e,t,r){let n=r[0],o=r[1],s=r[2],i=r[3],a=t[0],c=t[1],f=t[2],h=o*f-s*c,u=s*a-n*f,l=n*c-o*a,d=o*l-s*u,A=s*h-n*l,m=n*u-o*h,p=i*2;return h*=p,u*=p,l*=p,d*=2,A*=2,m*=2,e[0]=a+h+d,e[1]=c+u+A,e[2]=f+l+m,e}function Ef(e,t,r,n){let o=[],s=[];return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],s[0]=o[0],s[1]=o[1]*Math.cos(n)-o[2]*Math.sin(n),s[2]=o[1]*Math.sin(n)+o[2]*Math.cos(n),e[0]=s[0]+r[0],e[1]=s[1]+r[1],e[2]=s[2]+r[2],e}function _f(e,t,r,n){let o=[],s=[];return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],s[0]=o[2]*Math.sin(n)+o[0]*Math.cos(n),s[1]=o[1],s[2]=o[2]*Math.cos(n)-o[0]*Math.sin(n),e[0]=s[0]+r[0],e[1]=s[1]+r[1],e[2]=s[2]+r[2],e}function yf(e,t,r,n){let o=[],s=[];return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],s[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),s[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),s[2]=o[2],e[0]=s[0]+r[0],e[1]=s[1]+r[1],e[2]=s[2]+r[2],e}function Tf(e,t){let r=e[0],n=e[1],o=e[2],s=t[0],i=t[1],a=t[2],c=Math.sqrt((r*r+n*n+o*o)*(s*s+i*i+a*a)),f=c&&_1(e,t)/c;return Math.acos(Math.min(Math.max(f,-1),1))}var gT=function(){let e=E1();return function(t,r,n,o,s,i){let a,c;for(r||(r=3),n||(n=0),o?c=Math.min(o*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],s(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}();var ei=[0,0,0],Mo,fe=class extends wr{static get ZERO(){return Mo||(Mo=new fe(0,0,0),Object.freeze(Mo)),Mo}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=ei}){return Ef(this,this,r,t),this.check()}rotateY({radians:t,origin:r=ei}){return _f(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=ei}){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 Co(this,this,t),this.check()}transformByMatrix2(t){return mf(this,this,t),this.check()}transformByQuaternion(t){return Bf(this,this,t),this.check()}};var bo=class extends br{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 o=0;o<this.RANK;++o)r[o]=this[n+o];return r}setColumn(t,r){let n=t*this.RANK;for(let o=0;o<this.RANK;++o)this[n+o]=r[o];return this}};function Cf(e,t){if(e===t){let r=t[1],n=t[2],o=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=o}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],o=t[2],s=t[3],i=t[4],a=t[5],c=t[6],f=t[7],h=t[8],u=h*i-a*f,l=-h*s+a*c,d=f*s-i*c,A=r*u+n*l+o*d;return A?(A=1/A,e[0]=u*A,e[1]=(-h*n+o*f)*A,e[2]=(a*n-o*i)*A,e[3]=l*A,e[4]=(h*r-o*c)*A,e[5]=(-a*r+o*s)*A,e[6]=d*A,e[7]=(-f*r+n*c)*A,e[8]=(i*r-n*s)*A,e):null}function bf(e){let t=e[0],r=e[1],n=e[2],o=e[3],s=e[4],i=e[5],a=e[6],c=e[7],f=e[8];return t*(f*s-i*c)+r*(-f*o+i*a)+n*(c*o-s*a)}function ri(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=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]=l*n+d*i+A*f,e[1]=l*o+d*a+A*h,e[2]=l*s+d*c+A*u,e[3]=m*n+p*i+E*f,e[4]=m*o+p*a+E*h,e[5]=m*s+p*c+E*u,e[6]=y*n+C*i+M*f,e[7]=y*o+C*a+M*h,e[8]=y*s+C*c+M*u,e}function wf(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=r[0],d=r[1];return e[0]=n,e[1]=o,e[2]=s,e[3]=i,e[4]=a,e[5]=c,e[6]=l*n+d*i+f,e[7]=l*o+d*a+h,e[8]=l*s+d*c+u,e}function If(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=Math.sin(r),d=Math.cos(r);return e[0]=d*n+l*i,e[1]=d*o+l*a,e[2]=d*s+l*c,e[3]=d*i-l*n,e[4]=d*a-l*o,e[5]=d*c-l*s,e[6]=f,e[7]=h,e[8]=u,e}function ni(e,t,r){let n=r[0],o=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*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],o=t[2],s=t[3],i=r+r,a=n+n,c=o+o,f=r*i,h=n*i,u=n*a,l=o*i,d=o*a,A=o*c,m=s*i,p=s*a,E=s*c;return e[0]=1-u-A,e[3]=h-E,e[6]=l+p,e[1]=h+E,e[4]=1-f-A,e[7]=d-m,e[2]=l-p,e[5]=d+m,e[8]=1-f-u,e}var oi;(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"})(oi||(oi={}));var y1=Object.freeze([1,0,0,0,1,0,0,0,1]),he=class extends bo{static get IDENTITY(){return C1()}static get ZERO(){return T1()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return oi}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(y1)}fromObject(t){return this.check()}fromQuaternion(t){return Sf(this,t),this.check()}set(t,r,n,o,s,i,a,c,f){return this[0]=t,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=c,this[8]=f,this.check()}setRowMajor(t,r,n,o,s,i,a,c,f){return this[0]=t,this[1]=o,this[2]=a,this[3]=r,this[4]=s,this[5]=c,this[6]=n,this[7]=i,this[8]=f,this.check()}determinant(){return bf(this)}transpose(){return Cf(this,this),this.check()}invert(){return Mf(this,this),this.check()}multiplyLeft(t){return ri(this,t,this),this.check()}multiplyRight(t){return ri(this,this,t),this.check()}rotate(t){return If(this,this,t),this.check()}scale(t){return Array.isArray(t)?ni(this,this,t):ni(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=To(r||[-0,-0],t,this);break;case 3:n=Co(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)}},wo,Io=null;function T1(){return wo||(wo=new he([0,0,0,0,0,0,0,0,0]),Object.freeze(wo)),wo}function C1(){return Io||(Io=new he,Object.freeze(Io)),Io}var Sr;(function(e){e[e.ADD=1]="ADD",e[e.REPLACE=2]="REPLACE"})(Sr||(Sr={}));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 Rr="4.3.0-alpha.5";var _t={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},cC=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"),o=new Uint8Array(e,t,r);return n.decode(o)}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.3.0-alpha.5";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 Of(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 ii(e){let t=1/0,r=1/0,n=1/0,o=-1/0,s=-1/0,i=-1/0,a=e.POSITION?e.POSITION.value:[],c=a&&a.length;for(let f=0;f<c;f+=3){let h=a[f],u=a[f+1],l=a[f+2];t=h<t?h:t,r=u<r?u:r,n=l<n?l:n,o=h>o?h:o,s=u>s?u:s,i=l>i?l:i}return[[t,r,n],[o,s,i]]}function ai(e,t,r){let n=Of(t.value),o=r||Lf(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:o}}function Lf(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),o=[],s=M1(t.attributes);for(let i in e){let a=e[i],c=vf(i,a,s[i]);o.push(c)}if(r){let i=vf("indices",r);o.push(i)}return{fields:o,metadata:n}}function M1(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 ai(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 Pf={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},b1={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},w1=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 o=this.decoder.GetEncodedGeometryType(n),s=o===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let i;switch(o){case this.draco.TRIANGULAR_MESH:i=this.decoder.DecodeBufferToMesh(n,s);break;case this.draco.POINT_CLOUD:i=this.decoder.DecodeBufferToPointCloud(n,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!i.ok()||!s.ptr){let l=`DRACO decompression failed: ${i.error_msg()}`;throw new Error(l)}let a=this._getDracoLoaderData(s,o,r),c=this._getMeshData(s,a,r),f=ii(c.attributes),h=Nf(c.attributes,a,c.indices);return{loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:f},...c,schema:h}}finally{this.draco.destroy(n),s&&this.draco.destroy(s)}}_getDracoLoaderData(t,r,n){let o=this._getTopLevelMetadata(t),s=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:o,attributes:s}}_getDracoAttributes(t,r){let n={};for(let o=0;o<t.num_attributes();o++){let s=this.decoder.GetAttribute(t,o),i=this._getAttributeMetadata(t,o);n[s.unique_id()]={unique_id:s.unique_id(),attribute_type:s.attribute_type(),data_type:s.data_type(),num_components:s.num_components(),byte_offset:s.byte_offset(),byte_stride:s.byte_stride(),normalized:s.normalized(),attribute_index:o,metadata:i};let a=this._getQuantizationTransform(s,r);a&&(n[s.unique_id()].quantization_transform=a);let c=this._getOctahedronTransform(s,r);c&&(n[s.unique_id()].octahedron_transform=c)}return n}_getMeshData(t,r,n){let o=this._getMeshAttributes(r,t,n);if(!o.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:o,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:o,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:o}}_getMeshAttributes(t,r,n){let o={};for(let s of Object.values(t.attributes)){let i=this._deduceAttributeName(s,n);s.name=i;let a=this._getAttributeValues(r,s);if(a){let{value:c,size:f}=a;o[i]={value:c,size:f,byteOffset:s.byte_offset,byteStride:s.byte_stride,normalized:s.normalized}}}return o}_getTriangleListIndices(t){let n=t.num_faces()*3,o=n*w1,s=this.draco._malloc(o);try{return this.decoder.GetTrianglesUInt32Array(t,o,s),new Uint32Array(this.draco.HEAPF32.buffer,s,n).slice()}finally{this.draco._free(s)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),R1(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=b1[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let o=r.num_components,i=t.num_points()*o,a=i*n.BYTES_PER_ELEMENT,c=I1(this.draco,n),f,h=this.draco._malloc(a);try{let u=this.decoder.GetAttribute(t,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,u,c,a,h),f=new n(this.draco.HEAPF32.buffer,h,i).slice()}finally{this.draco._free(h)}return{value:f,size:o}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[i,a]of Object.entries(r.extraAttributes||{}))if(a===n)return i;let o=t.attribute_type;for(let i in Pf)if(this.draco[i]===o)return Pf[i];let s=r.attributeNameEntry||"name";return t.metadata[s]?t.metadata[s].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 o=0;o<n;o++){let s=this.metadataQuerier.GetEntryName(t,o);r[s]=this._getDracoMetadataField(t,s)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let o=S1(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:o}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,o=[...r,...n];for(let s of o)this.decoder.SkipAttributeTransform(this.draco[s])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,o=t.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){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,o=t.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){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 I1(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 S1(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function R1(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var F1="1.5.6",D1="1.4.1",ci=`https://www.gstatic.com/draco/versioned/decoders/${F1}`,yt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},fi={[yt.DECODER]:`${ci}/${yt.DECODER}`,[yt.DECODER_WASM]:`${ci}/${yt.DECODER_WASM}`,[yt.FALLBACK_DECODER]:`${ci}/${yt.FALLBACK_DECODER}`,[yt.ENCODER]:`https://raw.githubusercontent.com/google/draco/${D1}/javascript/${yt.ENCODER}`},hi;async function Uf(e){let t=e.modules||{};return t.draco3d?hi||=t.draco3d.createDecoderModule({}).then(r=>({draco:r})):hi||=O1(e),await hi}async function O1(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await qt(fi[yt.FALLBACK_DECODER],"draco",e,yt.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await qt(fi[yt.DECODER],"draco",e,yt.DECODER),await qt(fi[yt.DECODER_WASM],"draco",e,yt.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await L1(t,r)}function L1(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:o=>n({draco:o})})})}var So={...Df,parse:v1};async function v1(e,t){let{draco:r}=await Uf(t),n=new Mn(r);try{return n.parseSync(e,t?.draco)}finally{n.destroy()}}var N1={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={...N1,...nt};var li={[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},G1={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},ui="Failed to convert GL type",dt=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in li)if(li[r]===t)return r;throw new Error(ui)}static fromName(t){let r=G1[t];if(!r)throw new Error(ui);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=li[t];if(!r)throw new Error(ui);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,o){o===void 0&&(o=(r.byteLength-n)/dt.getByteSize(t));let s=dt.getArrayType(t);return new s(r,n,o)}};function Hf(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function di(e,t=[0,0,0]){let r=e>>11&31,n=e>>5&63,o=e&31;return t[0]=r<<3,t[1]=n<<2,t[2]=o<<3,t}var zC=1/256;var QC=new Qe,VC=new fe,jC=new Qe,KC=new Qe,XC=new Uint8Array(1);function kf(e,t=255){return $s(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 o=n.x;n.x=(1-Math.abs(n.y))*Jf(o),n.y=(1-Math.abs(o))*Jf(n.y)}return n.normalize()}function Ai(e,t,r){return zf(e,t,255,r)}var P1=1/Math.PI*180,U1=1/180*Math.PI,H1={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...H1}};var q=globalThis.mathgl.config;function mi(e,{precision:t=q.precision}={}){return e=k1(e),`${parseFloat(e.toPrecision(t))}`}function $t(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function pi(e){return Qf(e)}function gi(e){return Vf(e)}function Qf(e,t){return jf(e,r=>r*U1,t)}function Vf(e,t){return jf(e,r=>r*P1,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 o=0;o<e.length;++o)if(!wt(e[o],t[o]))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 k1(e){return Math.round(e/q.EPSILON)*q.EPSILON}function J1(e){return e.clone?e.clone():new Array(e.length)}function jf(e,t,r){if($t(e)){let n=e;r=r||J1(n);for(let o=0;o<r.length&&o<n.length;++o){let s=typeof e=="number"?e:e[o];r[o]=t(s,o,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?", ":"")+mi(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 o=0;o<this.ELEMENTS;++o){let s=t[o],i=typeof r=="number"?r:r[o];this[o]=s+n*(i-s)}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 z1(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&&!z1(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 Fr=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 o=this[n]-t[n];r+=o*o}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 Dr(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var CM=Math.PI/180;function Q1(){let e=new W(2);return W!=Float32Array&&(e[0]=0,e[1]=0),e}function Kf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[3]*o+r[6],e[1]=r[1]*n+r[4]*o+r[7],e}function Xf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[4]*o+r[12],e[1]=r[1]*n+r[5]*o+r[13],e}var MM=function(){let e=Q1();return function(t,r,n,o,s,i){let a,c;for(r||(r=2),n||(n=0),o?c=Math.min(o*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],s(e,e,i),t[a]=e[0],t[a+1]=e[1];return t}}();function Yf(e,t,r){let n=t[0],o=t[1],s=r[3]*n+r[7]*o||1;return e[0]=(r[0]*n+r[4]*o)/s,e[1]=(r[1]*n+r[5]*o)/s,e}function Ro(e,t,r){let n=t[0],o=t[1],s=t[2],i=r[3]*n+r[7]*o+r[11]*s||1;return e[0]=(r[0]*n+r[4]*o+r[8]*s)/i,e[1]=(r[1]*n+r[5]*o+r[9]*s)/i,e[2]=(r[2]*n+r[6]*o+r[10]*s)/i,e}function Zf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[2]*o,e[1]=r[1]*n+r[3]*o,e[2]=t[2],e}function qf(e,t,r){let n=t[0],o=t[1];return e[0]=r[0]*n+r[2]*o,e[1]=r[1]*n+r[3]*o,e[2]=t[2],e[3]=t[3],e}function Fo(e,t,r){let n=t[0],o=t[1],s=t[2];return e[0]=r[0]*n+r[3]*o+r[6]*s,e[1]=r[1]*n+r[4]*o+r[7]*s,e[2]=r[2]*n+r[5]*o+r[8]*s,e[3]=t[3],e}var Ke={};ut(Ke,{add:()=>X1,angle:()=>yi,bezier:()=>aA,ceil:()=>Y1,clone:()=>V1,copy:()=>j1,create:()=>Do,cross:()=>Ve,dist:()=>pA,distance:()=>rh,div:()=>mA,divide:()=>eh,dot:()=>wn,equals:()=>uA,exactEquals:()=>lA,floor:()=>Z1,forEach:()=>BA,fromValues:()=>Oo,hermite:()=>iA,inverse:()=>nA,len:()=>Ti,length:()=>Wf,lerp:()=>oA,max:()=>W1,min:()=>q1,mul:()=>AA,multiply:()=>th,negate:()=>rA,normalize:()=>xi,random:()=>cA,rotateX:()=>Bi,rotateY:()=>Ei,rotateZ:()=>_i,round:()=>$1,scale:()=>tA,scaleAndAdd:()=>eA,set:()=>K1,slerp:()=>sA,sqrDist:()=>gA,sqrLen:()=>xA,squaredDistance:()=>nh,squaredLength:()=>oh,str:()=>hA,sub:()=>dA,subtract:()=>$f,transformMat3:()=>In,transformMat4:()=>je,transformQuat:()=>Sn,zero:()=>fA});function Do(){let e=new W(3);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function V1(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 Oo(e,t,r){let n=new W(3);return n[0]=e,n[1]=t,n[2]=r,n}function j1(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function K1(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function X1(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 Y1(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function Z1(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function q1(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 W1(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 $1(e,t){return e[0]=Dr(t[0]),e[1]=Dr(t[1]),e[2]=Dr(t[2]),e}function tA(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function eA(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],o=t[2]-e[2];return Math.sqrt(r*r+n*n+o*o)}function nh(e,t){let r=t[0]-e[0],n=t[1]-e[1],o=t[2]-e[2];return r*r+n*n+o*o}function oh(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function rA(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function nA(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function xi(e,t){let r=t[0],n=t[1],o=t[2],s=r*r+n*n+o*o;return s>0&&(s=1/Math.sqrt(s)),e[0]=t[0]*s,e[1]=t[1]*s,e[2]=t[2]*s,e}function wn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Ve(e,t,r){let n=t[0],o=t[1],s=t[2],i=r[0],a=r[1],c=r[2];return e[0]=o*c-s*a,e[1]=s*i-n*c,e[2]=n*a-o*i,e}function oA(e,t,r,n){let o=t[0],s=t[1],i=t[2];return e[0]=o+n*(r[0]-o),e[1]=s+n*(r[1]-s),e[2]=i+n*(r[2]-i),e}function sA(e,t,r,n){let o=Math.acos(Math.min(Math.max(wn(t,r),-1),1)),s=Math.sin(o),i=Math.sin((1-n)*o)/s,a=Math.sin(n*o)/s;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 iA(e,t,r,n,o,s){let i=s*s,a=i*(2*s-3)+1,c=i*(s-2)+s,f=i*(s-1),h=i*(3-2*s);return e[0]=t[0]*a+r[0]*c+n[0]*f+o[0]*h,e[1]=t[1]*a+r[1]*c+n[1]*f+o[1]*h,e[2]=t[2]*a+r[2]*c+n[2]*f+o[2]*h,e}function aA(e,t,r,n,o,s){let i=1-s,a=i*i,c=s*s,f=a*i,h=3*s*a,u=3*c*i,l=c*s;return e[0]=t[0]*f+r[0]*h+n[0]*u+o[0]*l,e[1]=t[1]*f+r[1]*h+n[1]*u+o[1]*l,e[2]=t[2]*f+r[2]*h+n[2]*u+o[2]*l,e}function cA(e,t){t=t===void 0?1:t;let r=bn()*2*Math.PI,n=bn()*2-1,o=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*o,e[1]=Math.sin(r)*o,e[2]=n*t,e}function je(e,t,r){let n=t[0],o=t[1],s=t[2],i=r[3]*n+r[7]*o+r[11]*s+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*o+r[8]*s+r[12])/i,e[1]=(r[1]*n+r[5]*o+r[9]*s+r[13])/i,e[2]=(r[2]*n+r[6]*o+r[10]*s+r[14])/i,e}function In(e,t,r){let n=t[0],o=t[1],s=t[2];return e[0]=n*r[0]+o*r[3]+s*r[6],e[1]=n*r[1]+o*r[4]+s*r[7],e[2]=n*r[2]+o*r[5]+s*r[8],e}function Sn(e,t,r){let n=r[0],o=r[1],s=r[2],i=r[3],a=t[0],c=t[1],f=t[2],h=o*f-s*c,u=s*a-n*f,l=n*c-o*a,d=o*l-s*u,A=s*h-n*l,m=n*u-o*h,p=i*2;return h*=p,u*=p,l*=p,d*=2,A*=2,m*=2,e[0]=a+h+d,e[1]=c+u+A,e[2]=f+l+m,e}function Bi(e,t,r,n){let o=[],s=[];return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],s[0]=o[0],s[1]=o[1]*Math.cos(n)-o[2]*Math.sin(n),s[2]=o[1]*Math.sin(n)+o[2]*Math.cos(n),e[0]=s[0]+r[0],e[1]=s[1]+r[1],e[2]=s[2]+r[2],e}function Ei(e,t,r,n){let o=[],s=[];return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],s[0]=o[2]*Math.sin(n)+o[0]*Math.cos(n),s[1]=o[1],s[2]=o[2]*Math.cos(n)-o[0]*Math.sin(n),e[0]=s[0]+r[0],e[1]=s[1]+r[1],e[2]=s[2]+r[2],e}function _i(e,t,r,n){let o=[],s=[];return o[0]=t[0]-r[0],o[1]=t[1]-r[1],o[2]=t[2]-r[2],s[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),s[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),s[2]=o[2],e[0]=s[0]+r[0],e[1]=s[1]+r[1],e[2]=s[2]+r[2],e}function yi(e,t){let r=e[0],n=e[1],o=e[2],s=t[0],i=t[1],a=t[2],c=Math.sqrt((r*r+n*n+o*o)*(s*s+i*i+a*a)),f=c&&wn(e,t)/c;return Math.acos(Math.min(Math.max(f,-1),1))}function fA(e){return e[0]=0,e[1]=0,e[2]=0,e}function hA(e){return`vec3(${e[0]}, ${e[1]}, ${e[2]})`}function lA(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function uA(e,t){let r=e[0],n=e[1],o=e[2],s=t[0],i=t[1],a=t[2];return Math.abs(r-s)<=1e-6*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(o-a)<=1e-6*Math.max(1,Math.abs(o),Math.abs(a))}var dA=$f,AA=th,mA=eh,pA=rh,gA=nh,Ti=Wf,xA=oh,BA=function(){let e=Do();return function(t,r,n,o,s,i){let a,c;for(r||(r=3),n||(n=0),o?c=Math.min(o*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],s(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}();var Ci=[0,0,0],Lo,b=class extends Fr{static get ZERO(){return Lo||(Lo=new b(0,0,0),Object.freeze(Lo)),Lo}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 yi(this,t)}cross(t){return Ve(this,this,t),this.check()}rotateX({radians:t,origin:r=Ci}){return Bi(this,this,r,t),this.check()}rotateY({radians:t,origin:r=Ci}){return Ei(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=Ci}){return _i(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return je(this,this,t),this.check()}transformAsVector(t){return Ro(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 vo,Lr=class extends Fr{static get ZERO(){return vo||(vo=new Lr(0,0,0,0),Object.freeze(vo)),vo}constructor(t=0,r=0,n=0,o=0){super(-0,-0,-0,-0),$t(t)&&arguments.length===1?this.copy(t):(q.debug&&(z(t),z(r),z(n),z(o)),this[0]=t,this[1]=r,this[2]=n,this[3]=o)}set(t,r,n,o){return this[0]=t,this[1]=r,this[2]=n,this[3]=o,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 je(this,this,t),this.check()}transformByMatrix3(t){return Fo(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 vr=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 o=0;o<this.RANK;++o)r[o]=this[n+o];return r}setColumn(t,r){let n=t*this.RANK;for(let o=0;o<this.RANK;++o)this[n+o]=r[o];return this}};function sh(){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],o=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=o}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],o=t[2],s=t[3],i=t[4],a=t[5],c=t[6],f=t[7],h=t[8],u=h*i-a*f,l=-h*s+a*c,d=f*s-i*c,A=r*u+n*l+o*d;return A?(A=1/A,e[0]=u*A,e[1]=(-h*n+o*f)*A,e[2]=(a*n-o*i)*A,e[3]=l*A,e[4]=(h*r-o*c)*A,e[5]=(-a*r+o*s)*A,e[6]=d*A,e[7]=(-f*r+n*c)*A,e[8]=(i*r-n*s)*A,e):null}function ch(e){let t=e[0],r=e[1],n=e[2],o=e[3],s=e[4],i=e[5],a=e[6],c=e[7],f=e[8];return t*(f*s-i*c)+r*(-f*o+i*a)+n*(c*o-s*a)}function Mi(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=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]=l*n+d*i+A*f,e[1]=l*o+d*a+A*h,e[2]=l*s+d*c+A*u,e[3]=m*n+p*i+E*f,e[4]=m*o+p*a+E*h,e[5]=m*s+p*c+E*u,e[6]=y*n+C*i+M*f,e[7]=y*o+C*a+M*h,e[8]=y*s+C*c+M*u,e}function fh(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=r[0],d=r[1];return e[0]=n,e[1]=o,e[2]=s,e[3]=i,e[4]=a,e[5]=c,e[6]=l*n+d*i+f,e[7]=l*o+d*a+h,e[8]=l*s+d*c+u,e}function hh(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=Math.sin(r),d=Math.cos(r);return e[0]=d*n+l*i,e[1]=d*o+l*a,e[2]=d*s+l*c,e[3]=d*i-l*n,e[4]=d*a-l*o,e[5]=d*c-l*s,e[6]=f,e[7]=h,e[8]=u,e}function bi(e,t,r){let n=r[0],o=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=o*t[3],e[4]=o*t[4],e[5]=o*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],o=t[2],s=t[3],i=r+r,a=n+n,c=o+o,f=r*i,h=n*i,u=n*a,l=o*i,d=o*a,A=o*c,m=s*i,p=s*a,E=s*c;return e[0]=1-u-A,e[3]=h-E,e[6]=l+p,e[1]=h+E,e[4]=1-f-A,e[7]=d-m,e[2]=l-p,e[5]=d+m,e[8]=1-f-u,e}var wi;(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"})(wi||(wi={}));var _A=Object.freeze([1,0,0,0,1,0,0,0,1]),Z=class extends vr{static get IDENTITY(){return TA()}static get ZERO(){return yA()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return wi}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(_A)}fromObject(t){return this.check()}fromQuaternion(t){return lh(this,t),this.check()}set(t,r,n,o,s,i,a,c,f){return this[0]=t,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=c,this[8]=f,this.check()}setRowMajor(t,r,n,o,s,i,a,c,f){return this[0]=t,this[1]=o,this[2]=a,this[3]=r,this[4]=s,this[5]=c,this[6]=n,this[7]=i,this[8]=f,this.check()}determinant(){return ch(this)}transpose(){return ih(this,this),this.check()}invert(){return ah(this,this),this.check()}multiplyLeft(t){return Mi(this,t,this),this.check()}multiplyRight(t){return Mi(this,this,t),this.check()}rotate(t){return hh(this,this,t),this.check()}scale(t){return Array.isArray(t)?bi(this,this,t):bi(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=Fo(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)}},No,Go=null;function yA(){return No||(No=new Z([0,0,0,0,0,0,0,0,0]),Object.freeze(No)),No}function TA(){return Go||(Go=new Z,Object.freeze(Go)),Go}var Fn={};ut(Fn,{add:()=>XA,adjoint:()=>SA,clone:()=>MA,copy:()=>bA,create:()=>CA,decompose:()=>UA,determinant:()=>Ri,equals:()=>WA,exactEquals:()=>qA,frob:()=>KA,fromQuat:()=>Gi,fromQuat2:()=>NA,fromRotation:()=>DA,fromRotationTranslation:()=>dh,fromRotationTranslationScale:()=>HA,fromRotationTranslationScaleOrigin:()=>kA,fromScaling:()=>FA,fromTranslation:()=>RA,fromValues:()=>wA,fromXRotation:()=>OA,fromYRotation:()=>LA,fromZRotation:()=>vA,frustum:()=>Pi,getRotation:()=>PA,getScaling:()=>Ah,getTranslation:()=>GA,identity:()=>uh,invert:()=>Si,lookAt:()=>ki,mul:()=>$A,multiply:()=>Rn,multiplyScalar:()=>YA,multiplyScalarAndAdd:()=>ZA,ortho:()=>Hi,orthoNO:()=>ph,orthoZO:()=>QA,perspective:()=>Ui,perspectiveFromFieldOfView:()=>zA,perspectiveNO:()=>mh,perspectiveZO:()=>JA,rotate:()=>Oi,rotateX:()=>Li,rotateY:()=>vi,rotateZ:()=>Ni,scale:()=>Di,set:()=>IA,str:()=>jA,sub:()=>tm,subtract:()=>gh,targetTo:()=>VA,translate:()=>Fi,transpose:()=>Ii});function CA(){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 MA(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 bA(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 wA(e,t,r,n,o,s,i,a,c,f,h,u,l,d,A,m){let p=new W(16);return p[0]=e,p[1]=t,p[2]=r,p[3]=n,p[4]=o,p[5]=s,p[6]=i,p[7]=a,p[8]=c,p[9]=f,p[10]=h,p[11]=u,p[12]=l,p[13]=d,p[14]=A,p[15]=m,p}function IA(e,t,r,n,o,s,i,a,c,f,h,u,l,d,A,m,p){return e[0]=t,e[1]=r,e[2]=n,e[3]=o,e[4]=s,e[5]=i,e[6]=a,e[7]=c,e[8]=f,e[9]=h,e[10]=u,e[11]=l,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 Ii(e,t){if(e===t){let r=t[1],n=t[2],o=t[3],s=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]=s,e[11]=t[14],e[12]=o,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 Si(e,t){let r=t[0],n=t[1],o=t[2],s=t[3],i=t[4],a=t[5],c=t[6],f=t[7],h=t[8],u=t[9],l=t[10],d=t[11],A=t[12],m=t[13],p=t[14],E=t[15],y=r*a-n*i,C=r*c-o*i,M=r*f-s*i,T=n*c-o*a,I=n*f-s*a,w=o*f-s*c,O=h*m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=e[14],p=e[15],E=t*i-r*s,y=t*a-n*s,C=r*a-n*i,M=f*A-h*d,T=f*m-u*d,I=h*m-u*A,w=t*I-r*T+n*M,O=s*I-i*T+a*M,x=f*C-h*y+u*E,g=d*C-A*y+m*E;return c*w-o*O+p*x-l*g}function Rn(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=t[8],l=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*u+I*m,e[1]=C*o+M*c+T*l+I*p,e[2]=C*s+M*f+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*u+I*m,e[5]=C*o+M*c+T*l+I*p,e[6]=C*s+M*f+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*u+I*m,e[9]=C*o+M*c+T*l+I*p,e[10]=C*s+M*f+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*u+I*m,e[13]=C*o+M*c+T*l+I*p,e[14]=C*s+M*f+T*d+I*E,e[15]=C*i+M*h+T*A+I*y,e}function Fi(e,t,r){let n=r[0],o=r[1],s=r[2],i,a,c,f,h,u,l,d,A,m,p,E;return t===e?(e[12]=t[0]*n+t[4]*o+t[8]*s+t[12],e[13]=t[1]*n+t[5]*o+t[9]*s+t[13],e[14]=t[2]*n+t[6]*o+t[10]*s+t[14],e[15]=t[3]*n+t[7]*o+t[11]*s+t[15]):(i=t[0],a=t[1],c=t[2],f=t[3],h=t[4],u=t[5],l=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]=c,e[3]=f,e[4]=h,e[5]=u,e[6]=l,e[7]=d,e[8]=A,e[9]=m,e[10]=p,e[11]=E,e[12]=i*n+h*o+A*s+t[12],e[13]=a*n+u*o+m*s+t[13],e[14]=c*n+l*o+p*s+t[14],e[15]=f*n+d*o+E*s+t[15]),e}function Di(e,t,r){let n=r[0],o=r[1],s=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]*o,e[5]=t[5]*o,e[6]=t[6]*o,e[7]=t[7]*o,e[8]=t[8]*s,e[9]=t[9]*s,e[10]=t[10]*s,e[11]=t[11]*s,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Oi(e,t,r,n){let o=n[0],s=n[1],i=n[2],a=Math.sqrt(o*o+s*s+i*i),c,f,h,u,l,d,A,m,p,E,y,C,M,T,I,w,O,x,g,B,_,P,G,U;return a<1e-6?null:(a=1/a,o*=a,s*=a,i*=a,f=Math.sin(r),c=Math.cos(r),h=1-c,u=t[0],l=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=o*o*h+c,O=s*o*h+i*f,x=i*o*h-s*f,g=o*s*h-i*f,B=s*s*h+c,_=i*s*h+o*f,P=o*i*h+s*f,G=s*i*h-o*f,U=i*i*h+c,e[0]=u*w+m*O+C*x,e[1]=l*w+p*O+M*x,e[2]=d*w+E*O+T*x,e[3]=A*w+y*O+I*x,e[4]=u*g+m*B+C*_,e[5]=l*g+p*B+M*_,e[6]=d*g+E*B+T*_,e[7]=A*g+y*B+I*_,e[8]=u*P+m*G+C*U,e[9]=l*P+p*G+M*U,e[10]=d*P+E*G+T*U,e[11]=A*P+y*G+I*U,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),o=Math.cos(r),s=t[4],i=t[5],a=t[6],c=t[7],f=t[8],h=t[9],u=t[10],l=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]=s*o+f*n,e[5]=i*o+h*n,e[6]=a*o+u*n,e[7]=c*o+l*n,e[8]=f*o-s*n,e[9]=h*o-i*n,e[10]=u*o-a*n,e[11]=l*o-c*n,e}function vi(e,t,r){let n=Math.sin(r),o=Math.cos(r),s=t[0],i=t[1],a=t[2],c=t[3],f=t[8],h=t[9],u=t[10],l=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]=s*o-f*n,e[1]=i*o-h*n,e[2]=a*o-u*n,e[3]=c*o-l*n,e[8]=s*n+f*o,e[9]=i*n+h*o,e[10]=a*n+u*o,e[11]=c*n+l*o,e}function Ni(e,t,r){let n=Math.sin(r),o=Math.cos(r),s=t[0],i=t[1],a=t[2],c=t[3],f=t[4],h=t[5],u=t[6],l=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]=s*o+f*n,e[1]=i*o+h*n,e[2]=a*o+u*n,e[3]=c*o+l*n,e[4]=f*o-s*n,e[5]=h*o-i*n,e[6]=u*o-a*n,e[7]=l*o-c*n,e}function RA(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 FA(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 DA(e,t,r){let n=r[0],o=r[1],s=r[2],i=Math.sqrt(n*n+o*o+s*s),a,c,f;return i<1e-6?null:(i=1/i,n*=i,o*=i,s*=i,c=Math.sin(t),a=Math.cos(t),f=1-a,e[0]=n*n*f+a,e[1]=o*n*f+s*c,e[2]=s*n*f-o*c,e[3]=0,e[4]=n*o*f-s*c,e[5]=o*o*f+a,e[6]=s*o*f+n*c,e[7]=0,e[8]=n*s*f+o*c,e[9]=o*s*f-n*c,e[10]=s*s*f+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function OA(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 LA(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 vA(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],o=t[1],s=t[2],i=t[3],a=n+n,c=o+o,f=s+s,h=n*a,u=n*c,l=n*f,d=o*c,A=o*f,m=s*f,p=i*a,E=i*c,y=i*f;return e[0]=1-(d+m),e[1]=u+y,e[2]=l-E,e[3]=0,e[4]=u-y,e[5]=1-(h+m),e[6]=A+p,e[7]=0,e[8]=l+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 NA(e,t){let r=new W(3),n=-t[0],o=-t[1],s=-t[2],i=t[3],a=t[4],c=t[5],f=t[6],h=t[7],u=n*n+o*o+s*s+i*i;return u>0?(r[0]=(a*i+h*n+c*s-f*o)*2/u,r[1]=(c*i+h*o+f*n-a*s)*2/u,r[2]=(f*i+h*s+a*o-c*n)*2/u):(r[0]=(a*i+h*n+c*s-f*o)*2,r[1]=(c*i+h*o+f*n-a*s)*2,r[2]=(f*i+h*s+a*o-c*n)*2),dh(e,t,r),e}function GA(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],o=t[2],s=t[4],i=t[5],a=t[6],c=t[8],f=t[9],h=t[10];return e[0]=Math.sqrt(r*r+n*n+o*o),e[1]=Math.sqrt(s*s+i*i+a*a),e[2]=Math.sqrt(c*c+f*f+h*h),e}function PA(e,t){let r=new W(3);Ah(r,t);let n=1/r[0],o=1/r[1],s=1/r[2],i=t[0]*n,a=t[1]*o,c=t[2]*s,f=t[4]*n,h=t[5]*o,u=t[6]*s,l=t[8]*n,d=t[9]*o,A=t[10]*s,m=i+h+A,p=0;return m>0?(p=Math.sqrt(m+1)*2,e[3]=.25*p,e[0]=(u-d)/p,e[1]=(l-c)/p,e[2]=(a-f)/p):i>h&&i>A?(p=Math.sqrt(1+i-h-A)*2,e[3]=(u-d)/p,e[0]=.25*p,e[1]=(a+f)/p,e[2]=(l+c)/p):h>A?(p=Math.sqrt(1+h-i-A)*2,e[3]=(l-c)/p,e[0]=(a+f)/p,e[1]=.25*p,e[2]=(u+d)/p):(p=Math.sqrt(1+A-i-h)*2,e[3]=(a-f)/p,e[0]=(l+c)/p,e[1]=(u+d)/p,e[2]=.25*p),e}function UA(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let o=n[0],s=n[1],i=n[2],a=n[4],c=n[5],f=n[6],h=n[8],u=n[9],l=n[10];r[0]=Math.sqrt(o*o+s*s+i*i),r[1]=Math.sqrt(a*a+c*c+f*f),r[2]=Math.sqrt(h*h+u*u+l*l);let d=1/r[0],A=1/r[1],m=1/r[2],p=o*d,E=s*A,y=i*m,C=a*d,M=c*A,T=f*m,I=h*d,w=u*A,O=l*m,x=p+M+O,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>O?(g=Math.sqrt(1+p-M-O)*2,e[3]=(T-w)/g,e[0]=.25*g,e[1]=(E+C)/g,e[2]=(I+y)/g):M>O?(g=Math.sqrt(1+M-p-O)*2,e[3]=(I-y)/g,e[0]=(E+C)/g,e[1]=.25*g,e[2]=(T+w)/g):(g=Math.sqrt(1+O-p-M)*2,e[3]=(E-C)/g,e[0]=(I+y)/g,e[1]=(T+w)/g,e[2]=.25*g),e}function HA(e,t,r,n){let o=t[0],s=t[1],i=t[2],a=t[3],c=o+o,f=s+s,h=i+i,u=o*c,l=o*f,d=o*h,A=s*f,m=s*h,p=i*h,E=a*c,y=a*f,C=a*h,M=n[0],T=n[1],I=n[2];return e[0]=(1-(A+p))*M,e[1]=(l+C)*M,e[2]=(d-y)*M,e[3]=0,e[4]=(l-C)*T,e[5]=(1-(u+p))*T,e[6]=(m+E)*T,e[7]=0,e[8]=(d+y)*I,e[9]=(m-E)*I,e[10]=(1-(u+A))*I,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function kA(e,t,r,n,o){let s=t[0],i=t[1],a=t[2],c=t[3],f=s+s,h=i+i,u=a+a,l=s*f,d=s*h,A=s*u,m=i*h,p=i*u,E=a*u,y=c*f,C=c*h,M=c*u,T=n[0],I=n[1],w=n[2],O=o[0],x=o[1],g=o[2],B=(1-(m+E))*T,_=(d+M)*T,P=(A-C)*T,G=(d-M)*I,U=(1-(l+E))*I,v=(p+y)*I,at=(A+C)*w,mt=(p-y)*w,X=(1-(l+m))*w;return e[0]=B,e[1]=_,e[2]=P,e[3]=0,e[4]=G,e[5]=U,e[6]=v,e[7]=0,e[8]=at,e[9]=mt,e[10]=X,e[11]=0,e[12]=r[0]+O-(B*O+G*x+at*g),e[13]=r[1]+x-(_*O+U*x+mt*g),e[14]=r[2]+g-(P*O+v*x+X*g),e[15]=1,e}function Gi(e,t){let r=t[0],n=t[1],o=t[2],s=t[3],i=r+r,a=n+n,c=o+o,f=r*i,h=n*i,u=n*a,l=o*i,d=o*a,A=o*c,m=s*i,p=s*a,E=s*c;return e[0]=1-u-A,e[1]=h+E,e[2]=l-p,e[3]=0,e[4]=h-E,e[5]=1-f-A,e[6]=d+m,e[7]=0,e[8]=l+p,e[9]=d-m,e[10]=1-f-u,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Pi(e,t,r,n,o,s,i){let a=1/(r-t),c=1/(o-n),f=1/(s-i);return e[0]=s*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s*2*c,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(o+n)*c,e[10]=(i+s)*f,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*s*2*f,e[15]=0,e}function mh(e,t,r,n,o){let s=1/Math.tan(t/2);if(e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,o!=null&&o!==1/0){let i=1/(n-o);e[10]=(o+n)*i,e[14]=2*o*n*i}else e[10]=-1,e[14]=-2*n;return e}var Ui=mh;function JA(e,t,r,n,o){let s=1/Math.tan(t/2);if(e[0]=s/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=s,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,o!=null&&o!==1/0){let i=1/(n-o);e[10]=o*i,e[14]=o*n*i}else e[10]=-1,e[14]=-n;return e}function zA(e,t,r,n){let o=Math.tan(t.upDegrees*Math.PI/180),s=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),c=2/(i+a),f=2/(o+s);return e[0]=c,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=f,e[6]=0,e[7]=0,e[8]=-((i-a)*c*.5),e[9]=(o-s)*f*.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,o,s,i){let a=1/(t-r),c=1/(n-o),f=1/(s-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*f,e[11]=0,e[12]=(t+r)*a,e[13]=(o+n)*c,e[14]=(i+s)*f,e[15]=1,e}var Hi=ph;function QA(e,t,r,n,o,s,i){let a=1/(t-r),c=1/(n-o),f=1/(s-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*c,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=f,e[11]=0,e[12]=(t+r)*a,e[13]=(o+n)*c,e[14]=s*f,e[15]=1,e}function ki(e,t,r,n){let o,s,i,a,c,f,h,u,l,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):(u=A-M,l=m-T,d=p-I,o=1/Math.sqrt(u*u+l*l+d*d),u*=o,l*=o,d*=o,s=y*d-C*l,i=C*u-E*d,a=E*l-y*u,o=Math.sqrt(s*s+i*i+a*a),o?(o=1/o,s*=o,i*=o,a*=o):(s=0,i=0,a=0),c=l*a-d*i,f=d*s-u*a,h=u*i-l*s,o=Math.sqrt(c*c+f*f+h*h),o?(o=1/o,c*=o,f*=o,h*=o):(c=0,f=0,h=0),e[0]=s,e[1]=c,e[2]=u,e[3]=0,e[4]=i,e[5]=f,e[6]=l,e[7]=0,e[8]=a,e[9]=h,e[10]=d,e[11]=0,e[12]=-(s*A+i*m+a*p),e[13]=-(c*A+f*m+h*p),e[14]=-(u*A+l*m+d*p),e[15]=1,e)}function VA(e,t,r,n){let o=t[0],s=t[1],i=t[2],a=n[0],c=n[1],f=n[2],h=o-r[0],u=s-r[1],l=i-r[2],d=h*h+u*u+l*l;d>0&&(d=1/Math.sqrt(d),h*=d,u*=d,l*=d);let A=c*l-f*u,m=f*h-a*l,p=a*u-c*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]=u*p-l*m,e[5]=l*A-h*p,e[6]=h*m-u*A,e[7]=0,e[8]=h,e[9]=u,e[10]=l,e[11]=0,e[12]=o,e[13]=s,e[14]=i,e[15]=1,e}function jA(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 KA(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 XA(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 YA(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 ZA(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 qA(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 WA(e,t){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],c=e[6],f=e[7],h=e[8],u=e[9],l=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],O=t[6],x=t[7],g=t[8],B=t[9],_=t[10],P=t[11],G=t[12],U=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(o-M)<=1e-6*Math.max(1,Math.abs(o),Math.abs(M))&&Math.abs(s-T)<=1e-6*Math.max(1,Math.abs(s),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(c-O)<=1e-6*Math.max(1,Math.abs(c),Math.abs(O))&&Math.abs(f-x)<=1e-6*Math.max(1,Math.abs(f),Math.abs(x))&&Math.abs(h-g)<=1e-6*Math.max(1,Math.abs(h),Math.abs(g))&&Math.abs(u-B)<=1e-6*Math.max(1,Math.abs(u),Math.abs(B))&&Math.abs(l-_)<=1e-6*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(d-P)<=1e-6*Math.max(1,Math.abs(d),Math.abs(P))&&Math.abs(A-G)<=1e-6*Math.max(1,Math.abs(A),Math.abs(G))&&Math.abs(m-U)<=1e-6*Math.max(1,Math.abs(m),Math.abs(U))&&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 $A=Rn,tm=gh;function em(){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],o=e[3];return Math.sqrt(t*t+r*r+n*n+o*o)}function _h(e){let t=e[0],r=e[1],n=e[2],o=e[3];return t*t+r*r+n*n+o*o}function yh(e,t){let r=t[0],n=t[1],o=t[2],s=t[3],i=r*r+n*n+o*o+s*s;return i>0&&(i=1/Math.sqrt(i)),e[0]=r*i,e[1]=n*i,e[2]=o*i,e[3]=s*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 o=t[0],s=t[1],i=t[2],a=t[3];return e[0]=o+n*(r[0]-o),e[1]=s+n*(r[1]-s),e[2]=i+n*(r[2]-i),e[3]=a+n*(r[3]-a),e}function Mh(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3];return e[0]=r[0]*n+r[4]*o+r[8]*s+r[12]*i,e[1]=r[1]*n+r[5]*o+r[9]*s+r[13]*i,e[2]=r[2]*n+r[6]*o+r[10]*s+r[14]*i,e[3]=r[3]*n+r[7]*o+r[11]*s+r[15]*i,e}function bh(e,t,r){let n=t[0],o=t[1],s=t[2],i=r[0],a=r[1],c=r[2],f=r[3],h=f*n+a*s-c*o,u=f*o+c*n-i*s,l=f*s+i*o-a*n,d=-i*n-a*o-c*s;return e[0]=h*f+d*-i+u*-c-l*-a,e[1]=u*f+d*-a+l*-i-h*-c,e[2]=l*f+d*-c+h*-a-u*-i,e[3]=t[3],e}var qM=function(){let e=em();return function(t,r,n,o,s,i){let a,c;for(r||(r=4),n||(n=0),o?c=Math.min(o*r+n,t.length):c=t.length,a=n;a<c;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],s(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 Qi;(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"})(Qi||(Qi={}));var nm=45*Math.PI/180,om=1,Ji=.1,zi=500,sm=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Rt=class extends vr{static get IDENTITY(){return am()}static get ZERO(){return im()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return Qi}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,o,s,i,a,c,f,h,u,l,d,A,m,p){return this[0]=t,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=c,this[8]=f,this[9]=h,this[10]=u,this[11]=l,this[12]=d,this[13]=A,this[14]=m,this[15]=p,this.check()}setRowMajor(t,r,n,o,s,i,a,c,f,h,u,l,d,A,m,p){return this[0]=t,this[1]=s,this[2]=f,this[3]=d,this[4]=r,this[5]=i,this[6]=h,this[7]=A,this[8]=n,this[9]=a,this[10]=u,this[11]=m,this[12]=o,this[13]=c,this[14]=l,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(sm)}fromObject(t){return this.check()}fromQuaternion(t){return Gi(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:o,top:s,near:i=Ji,far:a=zi}=t;return a===1/0?cm(this,r,n,o,s,i):Pi(this,r,n,o,s,i,a),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:o=[0,1,0]}=t;return ki(this,r,n,o),this.check()}ortho(t){let{left:r,right:n,bottom:o,top:s,near:i=Ji,far:a=zi}=t;return Hi(this,r,n,o,s,i,a),this.check()}orthographic(t){let{fovy:r=nm,aspect:n=om,focalDistance:o=1,near:s=Ji,far:i=zi}=t;wh(r);let a=r/2,c=o*Math.tan(a),f=c*n;return this.ortho({left:-f,right:f,bottom:-c,top:c,near:s,far:i})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:o=.1,far:s=500}=t;return wh(r),Ui(this,r,n,o,s),this.check()}determinant(){return Ri(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),o=1/n[0],s=1/n[1],i=1/n[2];return t[0]=this[0]*o,t[1]=this[1]*s,t[2]=this[2]*i,t[3]=0,t[4]=this[4]*o,t[5]=this[5]*s,t[6]=this[6]*i,t[7]=0,t[8]=this[8]*o,t[9]=this[9]*s,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),o=1/n[0],s=1/n[1],i=1/n[2];return t[0]=this[0]*o,t[1]=this[1]*s,t[2]=this[2]*i,t[3]=this[4]*o,t[4]=this[5]*s,t[5]=this[6]*i,t[6]=this[8]*o,t[7]=this[9]*s,t[8]=this[10]*i,t}transpose(){return Ii(this,this),this.check()}invert(){return Si(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 vi(this,this,t),this.check()}rotateZ(t){return Ni(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return Oi(this,this,t,r),this.check()}scale(t){return Di(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return Fi(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,o;switch(n){case 2:o=Xf(r||[-0,-0],t,this);break;case 3:o=je(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(o,t.length),o}transformAsVector(t,r){let n;switch(t.length){case 2:n=Yf(r||[-0,-0],t,this);break;case 3:n=Ro(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])}},Po,Uo;function im(){return Po||(Po=new Rt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Po)),Po}function am(){return Uo||(Uo=new Rt,Object.freeze(Uo)),Uo}function wh(e){if(e>Math.PI*2)throw Error("expected radians")}function cm(e,t,r,n,o,s){let i=2*s/(r-t),a=2*s/(o-n),c=(r+t)/(r-t),f=(o+n)/(o-n),h=-1,u=-1,l=-2*s;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]=c,e[9]=f,e[10]=h,e[11]=u,e[12]=0,e[13]=0,e[14]=l,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 Vi(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 ji(e,t,r){let n=t[0],o=t[1],s=t[2],i=t[3],a=r[0],c=r[1],f=r[2],h=r[3];return e[0]=n*h+i*a+o*f-s*c,e[1]=o*h+i*c+s*a-n*f,e[2]=s*h+i*f+n*c-o*a,e[3]=i*h-n*a-o*c-s*f,e}function Rh(e,t,r){r*=.5;let n=t[0],o=t[1],s=t[2],i=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+i*a,e[1]=o*c+s*a,e[2]=s*c-o*a,e[3]=i*c-n*a,e}function Fh(e,t,r){r*=.5;let n=t[0],o=t[1],s=t[2],i=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c-s*a,e[1]=o*c+i*a,e[2]=s*c+n*a,e[3]=i*c-o*a,e}function Dh(e,t,r){r*=.5;let n=t[0],o=t[1],s=t[2],i=t[3],a=Math.sin(r),c=Math.cos(r);return e[0]=n*c+o*a,e[1]=o*c-n*a,e[2]=s*c+i*a,e[3]=i*c-s*a,e}function Oh(e,t){let r=t[0],n=t[1],o=t[2];return e[0]=r,e[1]=n,e[2]=o,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-o*o)),e}function Dn(e,t,r,n){let o=t[0],s=t[1],i=t[2],a=t[3],c=r[0],f=r[1],h=r[2],u=r[3],l,d,A,m,p;return l=o*c+s*f+i*h+a*u,l<0&&(l=-l,c=-c,f=-f,h=-h,u=-u),1-l>1e-6?(d=Math.acos(l),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*o+m*c,e[1]=A*s+m*f,e[2]=A*i+m*h,e[3]=A*a+m*u,e}function Lh(e,t){let r=t[0],n=t[1],o=t[2],s=t[3],i=r*r+n*n+o*o+s*s,a=i?1/i:0;return e[0]=-r*a,e[1]=-n*a,e[2]=-o*a,e[3]=s*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 Ki(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 o=0;t[4]>t[0]&&(o=1),t[8]>t[o*3+o]&&(o=2);let s=(o+1)%3,i=(o+2)%3;n=Math.sqrt(t[o*3+o]-t[s*3+s]-t[i*3+i]+1),e[o]=.5*n,n=.5/n,e[3]=(t[s*3+i]-t[i*3+s])*n,e[s]=(t[s*3+o]+t[o*3+s])*n,e[i]=(t[i*3+o]+t[o*3+i])*n}return e}var Nh=xh;var Gh=Bh,Ph=Th,Uh=Ch,Hh=Eh;var kh=_h;var Jh=yh;var zh=function(){let e=Do(),t=Oo(1,0,0),r=Oo(0,1,0);return function(n,o,s){let i=wn(o,s);return i<-.999999?(Ve(e,t,o),Ti(e)<1e-6&&Ve(e,r,o),xi(e,e),Vi(n,e,Math.PI),n):i>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Ve(e,o,s),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+i,Jh(n,n))}}(),lb=function(){let e=Ih(),t=Ih();return function(r,n,o,s,i,a){return Dn(e,n,i,a),Dn(t,o,s,a),Dn(r,e,t,2*a*(1-a)),r}}(),ub=function(){let e=sh();return function(t,r,n,o){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=o[0],e[4]=o[1],e[7]=o[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],Jh(t,Ki(t,e))}}();var fm=[0,0,0,1],Ie=class extends be{constructor(t=0,r=0,n=0,o=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,o)}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,o){return this[0]=t,this[1]=r,this[2]=n,this[3]=o,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 Ki(this,t),this.check()}fromAxisRotation(t,r){return Vi(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 Ph(this,t)}rotationTo(t,r){return zh(this,t,r),this.check()}add(t){return Nh(this,this,t),this.check()}calculateW(){return Oh(this,this),this.check()}conjugate(){return vh(this,this),this.check()}invert(){return Lh(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(Uh(this,t,r,n),this.check())}multiplyRight(t){return ji(this,this,t),this.check()}multiplyLeft(t){return ji(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 o,s,i;switch(arguments.length){case 1:({start:o=fm,target:s,ratio:i}=t);break;case 2:o=this,s=t,i=r;break;default:o=t,s=r,i=n}return Dn(this,o,s,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:()=>hm,EPSILON10:()=>Bm,EPSILON11:()=>Em,EPSILON12:()=>_m,EPSILON13:()=>ym,EPSILON14:()=>Tm,EPSILON15:()=>Cm,EPSILON16:()=>Mm,EPSILON17:()=>bm,EPSILON18:()=>wm,EPSILON19:()=>Im,EPSILON2:()=>lm,EPSILON20:()=>Sm,EPSILON3:()=>um,EPSILON4:()=>dm,EPSILON5:()=>Am,EPSILON6:()=>mm,EPSILON7:()=>pm,EPSILON8:()=>gm,EPSILON9:()=>xm,PI_OVER_FOUR:()=>Fm,PI_OVER_SIX:()=>Dm,PI_OVER_TWO:()=>Rm,TWO_PI:()=>Om});var hm=.1,lm=.01,um=.001,dm=1e-4,Am=1e-5,mm=1e-6,pm=1e-7,gm=1e-8,xm=1e-9,Bm=1e-10,Em=1e-11,_m=1e-12,ym=1e-13,Tm=1e-14,Cm=1e-15,Mm=1e-16,bm=1e-17,wm=1e-18,Im=1e-19,Sm=1e-20,Rm=Math.PI/2,Fm=Math.PI/4,Dm=Math.PI/6,Om=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 o=this.json[t];return o&&Number.isFinite(o.byteOffset)?this._getTypedArrayFromBinary(t,r,n,1,o.byteOffset):o}getPropertyArray(t,r,n){let o=this.json[t];return o&&Number.isFinite(o.byteOffset)?("componentType"in o&&(r=dt.fromName(o.componentType)),this._getTypedArrayFromBinary(t,r,n,this.featuresLength,o.byteOffset)):this._getTypedArrayFromArray(t,r,o)}getProperty(t,r,n,o,s){let i=this.json[t];if(!i)return i;let a=this.getPropertyArray(t,r,n);if(n===1)return a[o];for(let c=0;c<n;++c)s[c]=a[n*o+c];return s}_getTypedArrayFromBinary(t,r,n,o,s){let i=this._cachedTypedArrays,a=i[t];return a||(a=dt.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+s,o*n),i[t]=a),a}_getTypedArrayFromArray(t,r,n){let o=this._cachedTypedArrays,s=o[t];return s||(s=dt.createTypedArray(r,n),o[t]=s),s}};var Lm={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},vm={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]]},Nm={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:o}=e;J(e.componentType);let s=typeof o=="string"?dt.fromName(o):o,i=Lm[e.type],a=vm[e.type],c=Nm[e.type];return r+=e.byteOffset,{values:dt.createTypedArray(s,t,r,i*n),type:s,size:i,unpacker:a,packer:c}}var te=e=>e!==void 0;function Vh(e,t,r){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy"),o=t.HIERARCHY;return o&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=o,n=o),n?Gm(n,r):null}function Gm(e,t){let r,n,o,s=e.instancesLength,i=e.classes,a=e.classIds,c=e.parentCounts,f=e.parentIds,h=s;te(a.byteOffset)&&(a.componentType=defaultValue(a.componentType,GL.UNSIGNED_SHORT),a.type=AttributeType.SCALAR,o=getBinaryAccessor(a),a=o.createArrayBufferView(t.buffer,t.byteOffset+a.byteOffset,s));let u;if(te(c))for(te(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,o=getBinaryAccessor(c),c=o.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,s)),u=new Uint16Array(s),h=0,r=0;r<s;++r)u[r]=h,h+=c[r];te(f)&&te(f.byteOffset)&&(f.componentType=defaultValue(f.componentType,GL.UNSIGNED_SHORT),f.type=AttributeType.SCALAR,o=getBinaryAccessor(f),f=o.createArrayBufferView(t.buffer,t.byteOffset+f.byteOffset,h));let l=i.length;for(r=0;r<l;++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(l).fill(0),A=new Uint16Array(s);for(r=0;r<s;++r)n=a[r],A[r]=d[n],++d[n];let m={classes:i,classIds:a,classIndexes:A,parentCounts:c,parentIndexes:u,parentIds:f};return Hm(m),m}function Nr(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?Pm(e,t,r):Um(e,t,r)}function Pm(e,t,r){let n=e.classIds,o=e.parentCounts,s=e.parentIds,i=e.parentIndexes,a=n.length,c=scratchVisited;c.length=Math.max(c.length,a);let f=++marker,h=scratchStack;for(h.length=0,h.push(t);h.length>0;){if(t=h.pop(),c[t]===f)continue;c[t]=f;let u=r(e,t);if(te(u))return u;let l=o[t],d=i[t];for(let A=0;A<l;++A){let m=s[d+A];m!==t&&h.push(m)}}return null}function Um(e,t,r){let n=!0;for(;n;){let o=r(e,t);if(te(o))return o;let s=e.parentIds[t];n=s!==t,t=s}throw new Error("traverseHierarchySingleParent")}function Hm(e){let t=[],n=e.classIds.length;for(let o=0;o<n;++o)jh(e,o,stack)}function jh(e,t,r){let n=e.parentCounts,o=e.parentIds,s=e.parentIndexes,a=e.classIds.length;if(!te(o))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 c=te(n)?n[t]:1,f=te(n)?s[t]:t;for(let h=0;h<c;++h){let u=o[f+h];u!==t&&jh(e,u,r)}r.pop(t)}function Tt(e){return e!=null}var Ho=(e,t)=>e,km={HIERARCHY:!0,extensions:!0,extras:!0},ue=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(t,r,n,o={}){J(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=this.json?.extensions||{},this._properties={};for(let s in this.json)km[s]||(this._properties[s]=this.json[s]);this._binaryProperties=this._initializeBinaryProperties(),o["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=Nr(this._hierarchy,t,(o,s)=>{let i=o.classIds[s];return o.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 o=this._binaryProperties[r];if(Tt(o))return this._getBinaryProperty(o,t)}let n=this._properties[r];if(Tt(n))return Ho(n[t],!0);if(this._hierarchy){let o=this._getHierarchyProperty(t,r);if(Tt(o))return o}}setProperty(t,r,n){let o=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 s=this._properties[r];Tt(s)||(this._properties[r]=new Array(o),s=this._properties[r]),s[t]=Ho(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],o=this._initializeBinaryProperty(r,n);o&&(t=t||{},t[r]=o)}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 o=Qh(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:o.values,componentCount:o.size,unpack:o.unpacker,pack:o.packer}}return null}_hasPropertyInHierarchy(t,r){if(!this._hierarchy)return!1;let n=Nr(this._hierarchy,t,(o,s)=>{let i=o.classIds[s],a=o.classes[i].instances;return Tt(a[r])});return Tt(n)}_getPropertyNamesInHierarchy(t,r){Nr(this._hierarchy,t,(n,o)=>{let s=n.classIds[o],i=n.classes[s].instances;for(let a in i)i.hasOwnProperty(a)&&r.indexOf(a)===-1&&r.push(a)})}_getHierarchyProperty(t,r){return Nr(this._hierarchy,t,(n,o)=>{let s=n.classIds[o],i=n.classes[s],a=n.classIndexes[o],c=i.instances[r];return Tt(c)?Tt(c.typedArray)?this._getBinaryProperty(c,a):Ho(c[a],!0):null})}_setHierarchyProperty(t,r,n,o){let s=Nr(this._hierarchy,r,(i,a)=>{let c=i.classIds[a],f=i.classes[c],h=i.classIndexes[a],u=f.instances[n];return Tt(u)?(J(a===r,`Inherited property "${n}" is read-only.`),Tt(u.typedArray)?this._setBinaryProperty(u,h,o):u[h]=Ho(o,!0),!0):!1});return Tt(s)}};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 Gr=4,Kh="b3dm tile in legacy format.";function Pr(e,t,r){let n=new DataView(t),o;e.header=e.header||{};let s=n.getUint32(r,!0);r+=Gr;let i=n.getUint32(r,!0);r+=Gr;let a=n.getUint32(r,!0);r+=Gr;let c=n.getUint32(r,!0);return r+=Gr,a>=570425344?(r-=Gr*2,o=s,a=i,c=0,s=0,i=0,console.warn(Kh)):c>=570425344&&(r-=Gr,o=a,a=s,c=i,s=0,i=0,console.warn(Kh)),e.header.featureTableJsonByteLength=s,e.header.featureTableBinaryByteLength=i,e.header.batchTableJsonByteLength=a,e.header.batchTableBinaryByteLength=c,e.header.batchLength=o,r}function Ur(e,t,r,n){return r=Jm(e,t,r,n),r=zm(e,t,r,n),r}function Jm(e,t,r,n){let{featureTableJsonByteLength:o,featureTableBinaryByteLength:s,batchLength:i}=e.header||{};if(e.featureTableJson={BATCH_LENGTH:i||0},o&&o>0){let a=si(t,r,o);e.featureTableJson=JSON.parse(a)}return r+=o||0,e.featureTableBinary=new Uint8Array(t,r,s),r+=s||0,r}function zm(e,t,r,n){let{batchTableJsonByteLength:o,batchTableBinaryByteLength:s}=e.header||{};if(o&&o>0){let i=si(t,r,o);e.batchTableJson=JSON.parse(i),r+=o,s&&s>0&&(e.batchTableBinary=new Uint8Array(t,r,s),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=s)}return r}function Xi(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:n,isRGB565:o,pointCount:s=0}=e;if(n&&r){let i=new Uint8ClampedArray(s*3);for(let a=0;a<s;a++){let c=n[a],h=r.getProperty(c,"dimensions").map(u=>u*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&&o){let i=new Uint8ClampedArray(s*3);for(let a=0;a<s;a++){let c=di(t[a]);i[a*3]=c[0],i[a*3+1]=c[1],i[a*3+2]=c[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}return t&&t.length===s*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++)Ai(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,Qm(e,t)):{type:H.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function Qm(e,t){let r=new b,n=new Float32Array(e.pointCount*3);for(let o=0;o<e.pointCount;o++)r.set(t[o*3],t[o*3+1],t[o*3+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,o*3);return n}async function qh(e,t,r,n,o){r=Se(e,t,r),r=Pr(e,t,r),r=Ur(e,t,r,n),Vm(e);let{featureTable:s,batchTable:i}=jm(e);return await qm(e,s,i,n,o),Km(e,s,n),Xm(e,s,i),Ym(e,s),r}function Vm(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function jm(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=Zm(e,t);return{featureTable:t,batchTable:n}}function Km(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 Xm(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=Xi(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",H.UNSIGNED_BYTE,4))}function Ym(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 Zm(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:o,batchTableBinary:s}=e;r=new ue(o,s,n)}return r}async function qm(e,t,r,n,o){let s,i,a,c=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];c&&(a=c.properties);let f=t.getExtension("3DTILES_draco_point_compression");if(f){i=f.properties;let u=f.byteOffset,l=f.byteLength;if(!i||!Number.isFinite(u)||!l)throw new Error("Draco properties, byteOffset, and byteLength must be defined");s=(e.featureTableBinary||[]).slice(u,u+l),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(!s)return!0;let h={buffer:s,properties:{...i,...a},featureTableProperties:i,batchTableProperties:a,dequantizeInShader:!1};return await Wm(e,h,n,o)}async function Wm(e,t,r,n){if(!n)return;let o={...r,draco:{...r?.draco,extraAttributes:t.batchTableProperties||{}}};delete o["3d-tiles"];let s=await Ut(t.buffer,So,o,n),i=s.attributes.POSITION&&s.attributes.POSITION.value,a=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,c=s.attributes.NORMAL&&s.attributes.NORMAL.value,f=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,h=i&&s.attributes.POSITION.value.quantization,u=c&&s.attributes.NORMAL.value.quantization;if(h){let d=s.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}u&&(e.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let l={};if(t.batchTableProperties)for(let d of Object.keys(t.batchTableProperties))s.attributes[d]&&s.attributes[d].value&&(l[d.toLowerCase()]=s.attributes[d].value);e.attributes={positions:i,colors:Xi(e,a,void 0),normals:c,batchIds:f,...l}}var ra={};ut(ra,{decode:()=>Np,name:()=>vp});var Wh="4.3.0-alpha.5";var $m=globalThis.loaders?.parseImageNode,Yi=typeof Image<"u",Zi=typeof ImageBitmap<"u",tp=Boolean($m),qi=Et?!0:tp;function $h(e){switch(e){case"auto":return Zi||Yi||qi;case"imagebitmap":return Zi;case"image":return Yi;case"data":return qi;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function tl(){if(Zi)return"imagebitmap";if(Yi)return"image";if(qi)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function el(e){let t=ep(e);if(!t)throw new Error("Not an image");return t}function On(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 ep(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 rp=/^data:image\/svg\+xml/,np=/\.svg((\?|#).*)?$/;function ko(e){return e&&(rp.test(e)||np.test(e))}function rl(e,t){if(ko(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return Wi(e,t)}function Wi(e,t){if(ko(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function Jo(e,t,r){let n=rl(e,r),o=self.URL||self.webkitURL,s=typeof n!="string"&&o.createObjectURL(n);try{return await op(s||n,t)}finally{s&&o.revokeObjectURL(s)}}async function op(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,o)=>{try{r.onload=()=>n(r),r.onerror=s=>{let i=s instanceof Error?s.message:"error";o(new Error(i))}}catch(s){o(s)}})}var sp={},nl=!0;async function ol(e,t,r){let n;ko(r)?n=await Jo(e,t,r):n=Wi(e,r);let o=t&&t.imagebitmap;return await ip(n,o)}async function ip(e,t=null){if((ap(t)||!nl)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),nl=!1}return await createImageBitmap(e)}function ap(e){for(let t in e||sp)return!1;return!0}function sl(e){return!lp(e,"ftyp",4)||!(e[8]&96)?null:cp(e)}function cp(e){switch(fp(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function fp(e,t,r){return String.fromCharCode(...e.slice(t,r))}function hp(e){return[...e].map(t=>t.charCodeAt(0))}function lp(e,t,r=0){let n=hp(t);for(let o=0;o<n.length;++o)if(n[o]!==e[o+r])return!1;return!0}var ee=!1,Ln=!0;function Xe(e){let t=vn(e);return dp(t)||pp(t)||Ap(t)||mp(t)||up(t)}function up(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=sl(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function dp(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 Ap(e){let t=vn(e);return t.byteLength>=10&&t.getUint32(0,ee)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,Ln),height:t.getUint16(8,Ln)}:null}function mp(e){let t=vn(e);return t.byteLength>=14&&t.getUint16(0,ee)===16973&&t.getUint32(2,Ln)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,Ln),height:t.getUint32(22,Ln)}:null}function pp(e){let t=vn(e);if(!(t.byteLength>=3&&t.getUint16(0,ee)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:o}=gp(),s=2;for(;s+9<t.byteLength;){let i=t.getUint16(s,ee);if(o.has(i))return{mimeType:"image/jpeg",height:t.getUint16(s+5,ee),width:t.getUint16(s+7,ee)};if(!n.has(i))return null;s+=2,s+=t.getUint16(s,ee)}return null}function gp(){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}=Xe(e)||{},n=globalThis.loaders?.parseImageNode;return J(n),await n(e,r)}async function al(e,t,r){t=t||{};let o=(t.image||{}).type||"auto",{url:s}=r||{},i=xp(o),a;switch(i){case"imagebitmap":a=await ol(e,t,s);break;case"image":a=await Jo(e,t,s);break;case"data":a=await il(e,t);break;default:J(!1)}return o==="data"&&(a=On(a)),a}function xp(e){switch(e){case"auto":case"data":return tl();default:return $h(e),e}}var Bp=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Ep=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],_p={image:{type:"auto",decode:!0}},$i={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Wh,mimeTypes:Ep,extensions:Bp,parse:al,tests:[e=>Boolean(Xe(new DataView(e)))],options:_p};var ta={};function ea(e){if(ta[e]===void 0){let t=Et?Tp(e):yp(e);ta[e]=t}return ta[e]}function yp(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 Tp(e){switch(e){case"image/avif":case"image/webp":return Cp(e);default:return!0}}function Cp(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function st(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var zo={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Qo={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var Mp=1.33,cl=["SCALAR","VEC2","VEC3","VEC4"],bp=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],wp=new Map(bp),Ip={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Sp={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Rp={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Vo(e){return cl[e-1]||cl[0]}function Hr(e){let t=wp.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function kr(e,t){let r=Rp[e.componentType],n=Ip[e.type],o=Sp[e.componentType],s=e.count*n,i=e.count*n*o;st(i>=0&&i<=t.byteLength);let a=Qo[e.componentType],c=zo[e.type];return{ArrayType:r,length:s,byteLength:i,componentByteSize:a,numberOfComponentsInElement:c}}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 o=r.reduce((i,a)=>i+a.byteLength,0),s=t.reduce((i,a)=>{let{width:c,height:f}=a.image;return i+c*f},0);return o+Math.ceil(4*s*Mp)}function fl(e,t,r){let n=e.bufferViews[r];st(n);let o=n.buffer,s=t[o];st(s);let i=(n.byteOffset||0)+s.byteOffset;return new Uint8Array(s.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 o=e.bufferViews?.[n.bufferView||0];if(!o)throw new Error(`No gltf buffer view for accessor ${o}`);let{arrayBuffer:s,byteOffset:i}=t[o.buffer],a=(i||0)+(n.byteOffset||0)+(o.byteOffset||0),{ArrayType:c,length:f,componentByteSize:h,numberOfComponentsInElement:u}=kr(n,o),l=h*u,d=o.byteStride||l;if(typeof o.byteStride>"u"||o.byteStride===l)return new c(s,a,f);let A=new c(f);for(let m=0;m<n.count;m++){let p=new c(s,a+m*d,u);A.set(p,m*u)}return A}function Fp(){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||Fp(),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(o=>o===t),n=this.getRequiredExtensions().find(o=>o===t);return typeof r=="string"||typeof n=="string"}getExtension(t){let r=this.getUsedExtensions().find(o=>o===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];st(n);let o=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,o,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),o=this.getBuffer(r.buffer).data,s=r.byteOffset||0;return new Uint8Array(o,s,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 o=t.extensions||{};o[r]=n}removeObjectExtension(t,r){let n=t?.extensions||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let o=this.json.extensionsRemoved;o.includes(r)||o.push(r)}delete n[r]}addExtension(t,r={}){return st(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return st(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 o={mesh:r};return n&&(o.matrix=n),this.json.nodes.push(o),this.json.nodes.length-1}addMesh(t){let{attributes:r,indices:n,material:o,mode:s=4}=t,a={primitives:[{attributes:this._addAttributes(r),mode:s}]};if(n){let c=this._addIndices(n);a.primitives[0].indices=c}return Number.isFinite(o)&&(a.primitives[0].material=o),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(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=Xe(t),o=r||n?.mimeType,i={bufferView:this.addBufferView(t),mimeType:o};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 o=t.byteLength;st(Number.isFinite(o)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let s={buffer:r,byteOffset:n,byteLength:o};return this.byteLength+=bt(o,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(s),this.json.bufferViews.length-1}addAccessor(t,r){let n={bufferView:t,type:Vo(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),o={min:r.min,max:r.max};(!o.min||!o.max)&&(o=this._getAccessorMinMax(t,r.size));let s={size:r.size,componentType:Hr(t),count:Math.round(t.length/r.size),min:o.min,max:o.max};return this.addAccessor(n,Object.assign(s,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),o=0;for(let s of this.sourceBuffers||[])o=Xs(s,n,o);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 o=t.indexOf(r);o>-1?t.splice(o,1):n=!1}}_addAttributes(t={}){let r={};for(let n in t){let o=t[n],s=this._getGltfAttributeName(n),i=this.addBinaryBuffer(o.value,o);r[s]=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 o=t.subarray(0,r);for(let s of o)n.min.push(s),n.max.push(s);for(let s=r;s<t.length;s+=r)for(let i=0;i<r;i++)n.min[0+i]=Math.min(n.min[0+i],t[s+i]),n.max[0+i]=Math.max(n.max[0+i],t[s+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},Dp={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 Jr(e,t,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let o=e.getTypedArrayForBufferView(t),s=zr(o,"SCALAR",r,n+1);return s instanceof BigInt64Array||s instanceof BigUint64Array?null:s}function zr(e,t,r,n=1){let o=ul[t],s=Dp[r],i=dl[r],a=n*o,c=a*i,f=e.buffer,h=e.byteOffset;return h%i!==0&&(f=new Uint8Array(f).slice(h,h+c).buffer,h=0),new s(f,h,a)}function Qr(e,t,r){let n=`TEXCOORD_${t.texCoord||0}`,o=r.attributes[n],s=e.getTypedArrayForAccessor(o),i=e.gltf.json,a=t.index,c=i.textures?.[a]?.source;if(typeof c<"u"){let f=i.images?.[c]?.mimeType,h=e.gltf.images?.[c];if(h&&typeof h.width<"u"){let u=[];for(let l=0;l<s.length;l+=2){let d=Op(h,f,s,l,t.channels);u.push(d)}return u}}return[]}function jo(e,t,r,n,o){if(!r?.length)return;let s=[];for(let h of r){let u=n.findIndex(l=>l===h);u===-1&&(u=n.push(h)-1),s.push(u)}let i=new Uint32Array(s),a=e.gltf.buffers.push({arrayBuffer:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength})-1,c=e.addBufferView(i,a,0),f=e.addAccessor(c,{size:1,componentType:Hr(i),count:i.length});o.attributes[t]=f}function Op(e,t,r,n,o=[0]){let s={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},i=r[n],a=r[n+1],c=1;t&&(t.indexOf("image/jpeg")!==-1||t.indexOf("image/png")!==-1)&&(c=4);let f=Lp(i,a,e,c),h=0;for(let u of o){let l=typeof u=="number"?Object.values(s)[u]:s[u],d=f+l.offset,A=On(e);if(A.data.length<=d)throw new Error(`${A.data.length} <= ${d}`);let m=A.data[d];h|=m<<l.shift}return h}function Lp(e,t,r,n=1){let o=r.width,s=ll(e)*(o-1),i=Math.round(s),a=r.height,c=ll(t)*(a-1),f=Math.round(c),h=r.components?r.components:n;return(f*o+i)*h}function Ko(e,t,r,n,o){let s=[];for(let i=0;i<t;i++){let a=r[i],c=r[i+1]-r[i];if(c+a>n)break;let f=a/o,h=c/o;s.push(e.slice(f,f+h))}return s}function Xo(e,t,r){let n=[];for(let o=0;o<t;o++){let s=o*r;n.push(e.slice(s,s+r))}return n}function Yo(e,t,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let o=[],s=new TextDecoder("utf8"),i=0;for(let a=0;a<e;a++){let c=n[a+1]-n[a];if(c+i<=t.length){let f=t.subarray(i,c+i),h=s.decode(f);o.push(h),i+=c}}return o}return[]}var Al="EXT_mesh_features",vp=Al;async function Np(e,t){let r=new K(e);Gp(r,t)}function Gp(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let o of n.primitives)Pp(e,o,t)}function Pp(e,t,r){if(!r?.gltf?.loadBuffers)return;let o=t.extensions?.[Al]?.featureIds;if(o)for(let s of o){let i;if(typeof s.attribute<"u"){let a=`_FEATURE_ID_${s.attribute}`,c=t.attributes[a];i=e.getTypedArrayForAccessor(c)}else typeof s.texture<"u"&&r?.gltf?.loadImages?i=Qr(e,s.texture,t):i=[];s.data=i}}var sa={};ut(sa,{decode:()=>Hp,name:()=>Up});var na="EXT_structural_metadata",Up=na;async function Hp(e,t){let r=new K(e);kp(r,t)}function kp(e,t){if(!t.gltf?.loadBuffers)return;let r=e.getExtension(na);r&&(t.gltf?.loadImages&&Jp(e,r),zp(e,r))}function Jp(e,t){let r=t.propertyTextures,n=e.gltf.json;if(r&&n.meshes)for(let o of n.meshes)for(let s of o.primitives)Vp(e,r,s,t)}function zp(e,t){let r=t.schema;if(!r)return;let n=r.classes,o=t.propertyTables;if(n&&o)for(let s in n){let i=Qp(o,s);i&&Kp(e,r,i)}}function Qp(e,t){for(let r of e)if(r.class===t)return r;return null}function Vp(e,t,r,n){if(!t)return;let s=r.extensions?.[na]?.propertyTextures;if(s)for(let i of s){let a=t[i];jp(e,a,r,n)}}function jp(e,t,r,n){if(!t.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let o=t.class;for(let s in t.properties){let i=`${o}_${s}`,a=t.properties?.[s];if(!a)continue;a.data||(a.data=[]);let c=a.data,f=Qr(e,a,r);f!==null&&(jo(e,i,f,c,r),a.data=c,n.dataAttributeNames.push(i))}}function Kp(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 o=r.count;for(let s in n.properties){let i=n.properties[s],a=r.properties?.[s];if(a){let c=Xp(e,t,i,o,a);a.data=c}}}function Xp(e,t,r,n,o){let s=[],i=o.values,a=e.getTypedArrayForBufferView(i),c=Yp(e,r,o,n),f=Zp(e,o,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{s=qp(r,n,a,c);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{s=Yo(n,a,c,f);break}case"ENUM":{s=Wp(t,r,n,a,c);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return s}function Yp(e,t,r,n){return t.array&&typeof t.count>"u"&&typeof r.arrayOffsets<"u"?Jr(e,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function Zp(e,t,r){return typeof t.stringOffsets<"u"?Jr(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function qp(e,t,r,n){let o=e.array,s=e.count,i=Gn(e.type,e.componentType),a=r.byteLength/i,c;return e.componentType?c=zr(r,e.type,e.componentType,a):c=r,o?n?Ko(c,t,n,r.length,i):s?Xo(c,t,s):[]:c}function Wp(e,t,r,n,o){let s=t.enumType;if(!s)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let i=e.enums?.[s];if(!i)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${s}`);let a=i.valueType||"UINT16",c=Gn(t.type,a),f=n.byteLength/c,h=zr(n,t.type,a,f);if(h||(h=n),t.array){if(o)return $p({valuesData:h,numberOfElements:r,arrayOffsets:o,valuesDataBytesLength:n.length,elementSize:c,enumEntry:i});let u=t.count;return u?tg(h,r,u,i):[]}return oa(h,0,r,i)}function $p(e){let{valuesData:t,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:o,elementSize:s,enumEntry:i}=e,a=[];for(let c=0;c<r;c++){let f=n[c],h=n[c+1]-n[c];if(h+f>o)break;let u=f/s,l=h/s,d=oa(t,u,l,i);a.push(d)}return a}function tg(e,t,r,n){let o=[];for(let s=0;s<t;s++){let i=r*s,a=oa(e,i,r,n);o.push(a)}return o}function oa(e,t,r,n){let o=[];for(let s=0;s<r;s++)if(e instanceof BigInt64Array||e instanceof BigUint64Array)o.push("");else{let i=e[t+s],a=eg(n,i);a?o.push(a.name):o.push("")}return o}function eg(e,t){for(let r of e.values)if(r.value===t)return r;return null}var ia={};ut(ia,{decode:()=>ng,name:()=>rg});var ml="EXT_feature_metadata",rg=ml;async function ng(e,t){let r=new K(e);og(r,t)}function og(e,t){if(!t.gltf?.loadBuffers)return;let r=e.getExtension(ml);r&&(t.gltf?.loadImages&&sg(e,r),ig(e,r))}function sg(e,t){let r=t.schema;if(!r)return;let n=r.classes,{featureTextures:o}=t;if(n&&o)for(let s in n){let i=n[s],a=cg(o,s);a&&hg(e,a,i)}}function ig(e,t){let r=t.schema;if(!r)return;let n=r.classes,o=t.featureTables;if(n&&o)for(let s in n){let i=ag(o,s);i&&fg(e,r,i)}}function ag(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function cg(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function fg(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 o=r.count;for(let s in n.properties){let i=n.properties[s],a=r.properties?.[s];if(a){let c=lg(e,t,i,o,a);a.data=c}}}function hg(e,t,r){let n=t.class;for(let o in r.properties){let s=t?.properties?.[o];if(s){let i=pg(e,s,n);s.data=i}}}function lg(e,t,r,n,o){let s=[],i=o.bufferView,a=e.getTypedArrayForBufferView(i),c=ug(e,r,o,n),f=dg(e,r,o,n);return r.type==="STRING"||r.componentType==="STRING"?s=Yo(n,a,c,f):Ag(r)&&(s=mg(r,n,a,c)),s}function ug(e,t,r,n){return t.type==="ARRAY"&&typeof t.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?Jr(e,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function dg(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?Jr(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function Ag(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 mg(e,t,r,n){let o=e.type==="ARRAY",s=e.componentCount,i="SCALAR",a=e.componentType||e.type,c=Gn(i,a),f=r.byteLength/c,h=zr(r,i,a,f);return o?n?Ko(h,t,n,r.length,c):s?Xo(h,t,s):[]:h}function pg(e,t,r){let n=e.gltf.json;if(!n.meshes)return[];let o=[];for(let s of n.meshes)for(let i of s.primitives)gg(e,r,t,o,i);return o}function gg(e,t,r,n,o){let s={channels:r.channels,...r.texture},i=Qr(e,s,o);i&&jo(e,t,i,n,o)}var pl="4.3.0-alpha.5";var gl="4.3.0-alpha.5";var Zo={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},xl;async function ca(e){xn(e.modules);let t=Vs("basis");return t||(xl||=xg(e),await xl)}async function xg(e){let t=null,r=null;return[t,r]=await Promise.all([await qt(Zo.TRANSCODER,"textures",e),await qt(Zo.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await Bg(t,r)}function Bg(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(o=>{let{BasisFile:s,initializeBasis:i}=o;i(),n({BasisFile:s})})})}var aa;async function fa(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(aa=aa||Eg(e),await aa)}async function Eg(e){let t=null,r=null;return[t,r]=await Promise.all([await qt(Zo.ENCODER,"textures",e),await qt(Zo.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await _g(t,r)}function _g(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(o=>{let{BasisFile:s,KTX2File:i,initializeBasis:a,BasisEncoder:c}=o;a(),n({BasisFile:s,KTX2File:i,BasisEncoder:c})})})}var Ye={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 yg=["","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"},qo=null;function El(e){if(!qo){e=e||Tg()||void 0,qo=new Set;for(let t of yg)for(let r in Bl)if(e&&e.getExtension(`${t}${r}`)){let n=Bl[r];qo.add(n)}}return qo}function Tg(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var It=[171,75,84,88,32,50,48,187,13,10,26,10];function _l(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 Cg={etc1:{basisFormat:0,compressed:!0,format:Ye.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Ye.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Ye.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:Ye.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Ye.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Ye.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 la(e,t){if(t.basis.containerFormat==="auto"){if(_l(e)){let n=await fa(t);return yl(n.KTX2File,e,t)}let{BasisFile:r}=await ca(t);return ha(r,e,t)}switch(t.basis.module){case"encoder":let r=await fa(t);switch(t.basis.containerFormat){case"ktx2":return yl(r.KTX2File,e,t);case"basis":default:return ha(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await ca(t);return ha(n,e,t)}}function ha(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let o=n.getNumImages(),s=[];for(let i=0;i<o;i++){let a=n.getNumLevels(i),c=[];for(let f=0;f<a;f++)c.push(Mg(n,i,f,r));s.push(c)}return s}finally{n.close(),n.delete()}}function Mg(e,t,r,n){let o=e.getImageWidth(t,r),s=e.getImageHeight(t,r),i=e.getHasAlpha(),{compressed:a,format:c,basisFormat:f}=Tl(n,i),h=e.getImageTranscodedSizeInBytes(t,r,f),u=new Uint8Array(h);if(!e.transcodeImage(u,t,r,f,0,0))throw new Error("failed to start Basis transcoding");return{width:o,height:s,data:u,compressed:a,format:c,hasAlpha:i}}function yl(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let o=n.getLevels(),s=[];for(let i=0;i<o;i++)s.push(bg(n,i,r));return[s]}finally{n.close(),n.delete()}}function bg(e,t,r){let{alphaFlag:n,height:o,width:s}=e.getImageLevelInfo(t,0,0),{compressed:i,format:a,basisFormat:c}=Tl(r,n),f=e.getImageTranscodedSizeInBytes(t,0,0,c),h=new Uint8Array(f);if(!e.transcodeImage(h,t,0,0,c,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:s,height:o,data:h,compressed:i,levelSize:f,hasAlpha:n,format:a}}function Tl(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=Wo()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),Cg[r]}function Wo(){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 Cl={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"}}},ua={...Cl,parse:la};var Vr=!0,Ml=1735152710,ma=12,$o=8,wg=1313821514,Ig=5130562,Sg=0,Rg=0,Fg=1;function Dg(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 bl(e,t=0,r={}){let n=new DataView(e),{magic:o=Ml}=r,s=n.getUint32(t,!1);return s===o||s===Ml}function wl(e,t,r=0,n={}){let o=new DataView(t),s=Dg(o,r+0),i=o.getUint32(r+4,Vr),a=o.getUint32(r+8,Vr);switch(Object.assign(e,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:s,version:i,json:{},binChunks:[]}),r+=ma,e.version){case 1:return Og(e,o,r);case 2:return Lg(e,o,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function Og(e,t,r){J(e.header.byteLength>ma+$o);let n=t.getUint32(r+0,Vr),o=t.getUint32(r+4,Vr);return r+=$o,J(o===Sg),da(e,t,r,n),r+=n,r+=Aa(e,t,r,e.header.byteLength),r}function Lg(e,t,r,n){return J(e.header.byteLength>ma+$o),vg(e,t,r,n),r+e.header.byteLength}function vg(e,t,r,n){for(;r+8<=e.header.byteLength;){let o=t.getUint32(r+0,Vr),s=t.getUint32(r+4,Vr);switch(r+=$o,s){case wg:da(e,t,r,o);break;case Ig:Aa(e,t,r,o);break;case Rg:n.strict||da(e,t,r,o);break;case Fg:n.strict||Aa(e,t,r,o);break;default:break}r+=bt(o,4)}return r}function da(e,t,r,n){let o=new Uint8Array(t.buffer,r,n),i=new TextDecoder("utf8").decode(o);return e.json=JSON.parse(i),bt(n,4)}function Aa(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),bt(n,4)}function pa(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 xa={};ut(xa,{decode:()=>Kg,name:()=>jg});var Ng="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFG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8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",Pg=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Ug=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Hg={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},kg={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function Il(e,t,r,n,o,s="NONE"){let i=await Jg();Vg(i,i.exports[kg[o]],e,t,r,n,i.exports[Hg[s||"NONE"]])}var ga;async function Jg(){return ga||(ga=zg()),ga}async function zg(){let e=Ng;WebAssembly.validate(Pg)&&(e=Gg,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(Qg(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function Qg(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n){let o=e.charCodeAt(n);t[n]=o>96?o-71:o>64?o-65:o>47?o+4:o>46?63:62}let r=0;for(let n=0;n<e.length;++n)t[r++]=t[n]<60?Ug[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function Vg(e,t,r,n,o,s,i){let a=e.exports.sbrk,c=n+3&-4,f=a(c*o),h=a(s.length),u=new Uint8Array(e.exports.memory.buffer);u.set(s,h);let l=t(f,n,o,h,s.length);if(l===0&&i&&i(f,c,o),r.set(u.subarray(f,f+n*o)),a(f-a(0)),l!==0)throw new Error(`Malformed buffer data: ${l}`)}var ts="EXT_meshopt_compression",jg=ts;async function Kg(e,t){let r=new K(e);if(!t?.gltf?.decompressMeshes||!t.gltf?.loadBuffers)return;let n=[];for(let o of e.json.bufferViews||[])n.push(Xg(r,o));await Promise.all(n),r.removeExtension(ts)}async function Xg(e,t){let r=e.getObjectExtension(t,ts);if(r){let{byteOffset:n=0,byteLength:o=0,byteStride:s,count:i,mode:a,filter:c="NONE",buffer:f}=r,h=e.gltf.buffers[f],u=new Uint8Array(h.arrayBuffer,h.byteOffset+n,o),l=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await Il(l,i,s,u,a,c),e.removeObjectExtension(t,ts)}}var Ba={};ut(Ba,{name:()=>Yg,preprocess:()=>Zg});var jr="EXT_texture_webp",Yg=jr;function Zg(e,t){let r=new K(e);if(!ea("image/webp")){if(r.getRequiredExtensions().includes(jr))throw new Error(`gltf: Required extension ${jr} not supported by browser`);return}let{json:n}=r;for(let o of n.textures||[]){let s=r.getObjectExtension(o,jr);s&&(o.source=s.source),r.removeObjectExtension(o,jr)}r.removeExtension(jr)}var Ea={};ut(Ea,{name:()=>qg,preprocess:()=>Wg});var es="KHR_texture_basisu",qg=es;function Wg(e,t){let r=new K(e),{json:n}=r;for(let o of n.textures||[]){let s=r.getObjectExtension(o,es);s&&(o.source=s.source,r.removeObjectExtension(o,es))}r.removeExtension(es)}var ya={};ut(ya,{decode:()=>nx,encode:()=>ox,name:()=>ex,preprocess:()=>rx});function Sl(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let o=_a(n);t[r]=o}}return t}function _a(e){let{buffer:t,size:r,count:n}=$g(e);return{value:t,size:r,byteOffset:0,count:n,type:Vo(r),componentType:Hr(t)}}function $g(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=tx(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function tx(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",ex=Re;function rx(e,t,r){let n=new K(e);for(let o of Rl(n))n.getObjectExtension(o,Re)}async function nx(e,t,r){if(!t?.gltf?.decompressMeshes)return;let n=new K(e),o=[];for(let s of Rl(n))n.getObjectExtension(s,Re)&&o.push(sx(n,s,t,r));await Promise.all(o),n.removeExtension(Re)}function ox(e,t={}){let r=new K(e);for(let n of r.json.meshes||[])ix(n,t),r.addRequiredExtension(Re)}async function sx(e,t,r,n){let o=e.getObjectExtension(t,Re);if(!o)return;let s=e.getTypedArrayForBufferView(o.bufferView),i=Je(s.buffer,s.byteOffset),a={...r};delete a["3d-tiles"];let c=await Ut(i,So,a,n),f=Sl(c.attributes);for(let[h,u]of Object.entries(f))if(h in t.attributes){let l=t.attributes[h],d=e.getAccessor(l);d?.min&&d?.max&&(u.min=d.min,u.max=d.max)}t.attributes=f,c.indices&&(t.indices=_a(c.indices)),e.removeObjectExtension(t,Re),ax(t)}function ix(e,t,r=4,n,o){if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let s=n.DracoWriter.encodeSync({attributes:e}),i=o?.parseSync?.({attributes:e}),a=n._addFauxAttributes(i.attributes),c=n.addBufferView(s);return{primitives:[{attributes:a,mode:r,extensions:{[Re]:{bufferView:c,attributes:a}}}]}}function ax(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Rl(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var Ta={};ut(Ta,{decode:()=>lx,name:()=>cx});var ns="KHR_texture_transform",cx=ns,rs=new fe,fx=new he,hx=new he;async function lx(e,t){if(!new K(e).hasExtension(ns)||!t.gltf?.loadBuffers)return;let o=e.json.materials||[];for(let s=0;s<o.length;s++)ux(s,e)}function ux(e,t){let r=t.json.materials?.[e],n=[r?.pbrMetallicRoughness?.baseColorTexture,r?.emissiveTexture,r?.normalTexture,r?.occlusionTexture,r?.pbrMetallicRoughness?.metallicRoughnessTexture],o=[];for(let s of n)s&&s?.extensions?.[ns]&&dx(t,e,s,o)}function dx(e,t,r,n){let o=Ax(r,n);if(!o)return;let s=e.json.meshes||[];for(let i of s)for(let a of i.primitives){let c=a.material;Number.isFinite(c)&&t===c&&mx(e,a,o)}}function Ax(e,t){let r=e.extensions?.[ns],{texCoord:n=0}=e,{texCoord:o=n}=r;if(!(t.findIndex(([i,a])=>i===n&&a===o)!==-1)){let i=xx(r);return n!==o&&(e.texCoord=o),t.push([n,o]),{originalTexCoord:n,texCoord:o,matrix:i}}return null}function mx(e,t,r){let{originalTexCoord:n,texCoord:o,matrix:s}=r,i=t.attributes[`TEXCOORD_${n}`];if(Number.isFinite(i)){let a=e.json.accessors?.[i];if(a&&a.bufferView){let c=e.json.bufferViews?.[a.bufferView];if(c){let{arrayBuffer:f,byteOffset:h}=e.buffers[c.buffer],u=(h||0)+(a.byteOffset||0)+(c.byteOffset||0),{ArrayType:l,length:d}=kr(a,c),A=Qo[a.componentType],m=zo[a.type],p=c.byteStride||A*m,E=new Float32Array(d);for(let y=0;y<a.count;y++){let C=new l(f,u+y*p,2);rs.set(C[0],C[1],1),rs.transformByMatrix3(s),E.set([rs[0],rs[1]],y*m)}n===o?px(a,c,e.buffers,E):gx(o,a,t,e,E)}}}}function px(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 gx(e,t,r,n,o){n.buffers.push({arrayBuffer:o.buffer,byteOffset:0,byteLength:o.buffer.byteLength});let s=n.json.bufferViews;if(!s)return;s.push({buffer:n.buffers.length-1,byteLength:o.buffer.byteLength,byteOffset:0});let i=n.json.accessors;i&&(i.push({bufferView:s?.length-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),r.attributes[`TEXCOORD_${e}`]=i.length-1)}function xx(e){let{offset:t=[0,0],rotation:r=0,scale:n=[1,1]}=e,o=new he().set(1,0,0,0,1,0,t[0],t[1],1),s=fx.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),i=hx.set(n[0],0,0,0,n[1],0,0,0,1);return o.multiplyRight(s).multiplyRight(i)}var Ca={};ut(Ca,{decode:()=>Ex,encode:()=>_x,name:()=>Bx});var Ze="KHR_lights_punctual",Bx=Ze;async function Ex(e){let t=new K(e),{json:r}=t,n=t.getExtension(Ze);n&&(t.json.lights=n.lights,t.removeExtension(Ze));for(let o of r.nodes||[]){let s=t.getObjectExtension(o,Ze);s&&(o.light=s.light),t.removeObjectExtension(o,Ze)}}async function _x(e){let t=new K(e),{json:r}=t;if(r.lights){let n=t.addExtension(Ze);st(!n.lights),n.lights=r.lights,delete r.lights}if(t.json.lights){for(let n of t.json.lights){let o=n.node;t.addObjectExtension(o,Ze,n)}delete t.json.lights}}var Ma={};ut(Ma,{decode:()=>Tx,encode:()=>Cx,name:()=>yx});var Pn="KHR_materials_unlit",yx=Pn;async function Tx(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,Pn);t.removeExtension(Pn)}function Cx(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,Pn,{}),t.addExtension(Pn))}var ba={};ut(ba,{decode:()=>bx,encode:()=>wx,name:()=>Mx});var Un="KHR_techniques_webgl",Mx=Un;async function bx(e){let t=new K(e),{json:r}=t,n=t.getExtension(Un);if(n){let o=Ix(n,t);for(let s of r.materials||[]){let i=t.getObjectExtension(s,Un);i&&(s.technique=Object.assign({},i,o[i.technique]),s.technique.values=Sx(s.technique,t)),t.removeObjectExtension(s,Un)}t.removeExtension(Un)}}async function wx(e,t){}function Ix(e,t){let{programs:r=[],shaders:n=[],techniques:o=[]}=e,s=new TextDecoder;return n.forEach(i=>{if(Number.isFinite(i.bufferView))i.code=s.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]}),o.forEach(i=>{i.program=r[i.program]}),o}function Sx(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 Fl=[sa,ra,xa,Ba,Ea,ya,Ca,Ma,ba,Ta,ia];function Dl(e,t={},r){let n=Fl.filter(o=>Ll(o.name,t));for(let o of n)o.preprocess?.(e,t,r)}async function Ol(e,t={},r){let n=Fl.filter(o=>Ll(o.name,t));for(let o of n)await o.decode?.(e,t,r)}function Ll(e,t){let r=t?.gltf?.excludeExtensions||{};return!(e in r&&!r[e])}var wa="KHR_binary_glTF";function vl(e){let t=new K(e),{json:r}=t;for(let n of r.images||[]){let o=t.getObjectExtension(n,wa);o&&Object.assign(n,o),t.removeObjectExtension(n,wa)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(wa)}var Nl={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Fx={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Ia=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),vl(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 Nl)this._convertTopLevelObjectToArray(t,r)}_convertTopLevelObjectToArray(t,r){let n=t[r];if(!(!n||Array.isArray(n))){t[r]=[];for(let o in n){let s=n[o];s.id=s.id||o;let i=t[r].length;t[r].push(s),this.idToIndexMap[r][o]=i}}}_convertObjectIdsToArrayIndices(t){for(let r in Nl)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:o,material:s}=r;for(let i in n)n[i]=this._convertIdToIndex(n[i],"accessor");o&&(r.indices=this._convertIdToIndex(o,"accessor")),s&&(r.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(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 o in n){let s=n[o],i=this._convertIdToIndex(s,o);n[o]=i}}_convertIdToIndex(t,r){let n=Fx[r];if(n in this.idToIndexMap){let o=this.idToIndexMap[n][t];if(!Number.isFinite(o))throw new Error(`gltf v1: failed to resolve ${r} with id ${t}`);return o}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,o=t.textures.findIndex(s=>s.id===n);o!==-1&&(r.pbrMetallicRoughness.baseColorTexture={index:o})}}};function Gl(e,t={}){return new Ia().normalize(e,t)}async function Pl(e,t,r=0,n,o){return Dx(e,t,r,n),Gl(e,{normalize:n?.gltf?.normalize}),Dl(e,n,o),n?.gltf?.loadBuffers&&e.json.buffers&&await Ox(e,n,o),n?.gltf?.loadImages&&await Lx(e,n,o),await Ol(e,n,o),e}function Dx(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!bl(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=Ks(t);else if(t instanceof ArrayBuffer){let i={};r=wl(i,t,r,n.glb),st(i.type==="glTF",`Invalid GLB magic string ${i.type}`),e._glb=i,e.json=i.json}else st(!1,"GLTF: must be ArrayBuffer or string");let o=e.json.buffers||[];if(e.buffers=new Array(o.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 s=e.json.images||[];e.images=new Array(s.length).fill({})}async function Ox(e,t,r){let n=e.json.buffers||[];for(let o=0;o<n.length;++o){let s=n[o];if(s.uri){let{fetch:i}=r;st(i);let a=pa(s.uri,t),f=await(await r?.fetch?.(a))?.arrayBuffer?.();e.buffers[o]={arrayBuffer:f,byteOffset:0,byteLength:f.byteLength},delete s.uri}else e.buffers[o]===null&&(e.buffers[o]={arrayBuffer:new ArrayBuffer(s.byteLength),byteOffset:0,byteLength:s.byteLength})}}async function Lx(e,t,r){let n=vx(e),o=e.json.images||[],s=[];for(let i of n)s.push(Nx(e,o[i],i,t,r));return await Promise.all(s)}function vx(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 Nx(e,t,r,n,o){let s;if(t.uri&&!t.hasOwnProperty("bufferView")){let a=pa(t.uri,n),{fetch:c}=o;s=await(await c(a)).arrayBuffer(),t.bufferView={data:s}}if(Number.isFinite(t.bufferView)){let a=fl(e.json,e.buffers,t.bufferView);s=Je(a.buffer,a.byteOffset,a.byteLength)}st(s,"glTF image has no data");let i=await Ut(s,[$i,ua],{...n,mimeType:t.mimeType,basis:n.basis||{format:Wo()}},o);i&&i[0]&&(i={compressed:!0,mipmaps:!1,width:i[0].width,height:i[0].height,data:i[0]}),e.images=e.images||[],e.images[r]=i}var qe={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:Gx,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function Gx(e,t={},r){t={...qe.options,...t},t.gltf={...qe.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await Pl({},e,n,t,r)}var Px={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Ux={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},Hx={magFilter:Ft.TEXTURE_MAG_FILTER,minFilter:Ft.TEXTURE_MIN_FILTER,wrapS:Ft.TEXTURE_WRAP_S,wrapT:Ft.TEXTURE_WRAP_T},kx={[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 Jx(){return{id:"default-sampler",parameters:kx}}function zx(e){return Ux[e]}function Qx(e){return Px[e]}var Sa=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:o=[],images:s=[]}=t,{baseUri:i=""}=t;return st(n),this.baseUri=i,this.buffers=o,this.images=s,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((o,s)=>this._resolveBufferView(o,s))),t.images&&(n.images=t.images.map((o,s)=>this._resolveImage(o,s))),t.samplers&&(n.samplers=t.samplers.map((o,s)=>this._resolveSampler(o,s))),t.textures&&(n.textures=t.textures.map((o,s)=>this._resolveTexture(o,s))),t.accessors&&(n.accessors=t.accessors.map((o,s)=>this._resolveAccessor(o,s))),t.materials&&(n.materials=t.materials.map((o,s)=>this._resolveMaterial(o,s))),t.meshes&&(n.meshes=t.meshes.map((o,s)=>this._resolveMesh(o,s))),t.nodes&&(n.nodes=t.nodes.map((o,s)=>this._resolveNode(o,s)),n.nodes=n.nodes.map((o,s)=>this._resolveNodeChildren(o))),t.skins&&(n.skins=t.skins.map((o,s)=>this._resolveSkin(o,s))),t.scenes&&(n.scenes=t.scenes.map((o,s)=>this._resolveScene(o,s))),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((o,s)=>{let i=this.getMesh(s);return o.id=i.id,o.primitives=o.primitives.concat(i.primitives),o},{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(o=>{let s={...o,attributes:{},indices:void 0,material:void 0},i=o.attributes;for(let a in i)s.attributes[a]=this.getAccessor(i[a]);return o.indices!==void 0&&(s.indices=this.getAccessor(o.indices)),o.material!==void 0&&(s.material=this.getMaterial(o.material)),s})),n}_resolveMaterial(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 o=n.pbrMetallicRoughness;o.baseColorTexture&&(o.baseColorTexture={...o.baseColorTexture},o.baseColorTexture.texture=this.getTexture(o.baseColorTexture.index)),o.metallicRoughnessTexture&&(o.metallicRoughnessTexture={...o.metallicRoughnessTexture},o.metallicRoughnessTexture.texture=this.getTexture(o.metallicRoughnessTexture.index))}return n}_resolveAccessor(t,r){let n=zx(t.componentType),o=Qx(t.type),s=n*o,i={...t,id:t.id||`accessor-${r}`,bytesPerComponent:n,components:o,bytesPerElement:s,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:c,byteLength:f}=kr(i,i.bufferView),h=(i.bufferView.byteOffset||0)+(i.byteOffset||0)+a.byteOffset,u=a.arrayBuffer.slice(h,h+f);i.bufferView.byteStride&&(u=this._getValueFromInterleavedBuffer(a,h,i.bufferView.byteStride,i.bytesPerElement,i.count)),i.value=new c(u)}return i}_getValueFromInterleavedBuffer(t,r,n,o,s){let i=new Uint8Array(s*o);for(let a=0;a<s;a++){let c=r+a*n;i.set(new Uint8Array(t.arrayBuffer.slice(c,c+o)),a*o)}return i.buffer}_resolveTexture(t,r){return{...t,id:t.id||`texture-${r}`,sampler:typeof t.sampler=="number"?this.getSampler(t.sampler):Jx(),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 o in n){let s=this._enumSamplerParameter(o);s!==void 0&&(n.parameters[s]=n[o])}return n}_enumSamplerParameter(t){return Hx[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},o=this.images[r];return o&&(n.image=o),n}_resolveBufferView(t,r){let n=t.buffer,o=this.buffers[n].arrayBuffer,s=this.buffers[n].byteOffset||0;return t.byteOffset&&(s+=t.byteOffset),{id:`bufferView-${r}`,...t,buffer:this.buffers[n],data:new Uint8Array(o,s,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 Sa().postProcess(e,t)}var os={URI:0,EMBEDDED:1};function ss(e,t,r,n){e.rotateYtoZ=!0;let o=(e.byteOffset||0)+(e.byteLength||0)-r;if(o===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,o),e.gltfByteOffset=0,e.gltfByteLength=o,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 is(e,t,r,n){let o=r?.["3d-tiles"]||{};if(Vx(e,t,r),o.loadGLTF){if(!n)return;if(e.gltfUrl){let{fetch:s}=n,i=await s(e.gltfUrl,r);e.gltfArrayBuffer=await i.arrayBuffer(),e.gltfByteOffset=0}if(e.gltfArrayBuffer){let s=await Ut(e.gltfArrayBuffer,qe,r,n);e.gltf=Hn(s),e.gpuMemoryUsageInBytes=Nn(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function Vx(e,t,r){switch(t){case os.URI:if(e.gltfArrayBuffer){let n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),s=new TextDecoder().decode(n);e.gltfUrl=s.replace(/[\s\0]+$/,"")}delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case os.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function Ul(e,t,r,n,o){r=jx(e,t,r,n,o),await is(e,os.EMBEDDED,n,o);let s=e?.gltf?.extensions;return s&&s.CESIUM_RTC&&(e.rtcCenter=s.CESIUM_RTC.center),r}function jx(e,t,r,n,o){r=Se(e,t,r),r=Pr(e,t,r),r=Ur(e,t,r,n),r=ss(e,t,r,n);let s=new kt(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=s.getGlobalProperty("RTC_CENTER",H.FLOAT,3),r}var de=6356752314245179e-9,Kx={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 as(e){return e}var j3=new b;function Xx(e,t=[],r=as){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 Hl(e,t=[]){return Xx(e,t,q._cartographicRadians?as:pi)}function Yx(e,t,r=as){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 kl(e,t){return Yx(e,t,q._cartographicRadians?as:gi)}var Jl=1e-14,Zx=new b,zl={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"}},Ra={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},qx=new b,Wx=new b,$x=new b;function Fa(e,t,r,n,o,s){let i=zl[t]&&zl[t][r];ft(i&&(!n||n===i));let a,c,f,h=Zx.copy(o);if(wt(h.x,0,Jl)&&wt(h.y,0,Jl)){let l=Math.sign(h.z);a=qx.fromArray(Ra[t]),t!=="east"&&t!=="west"&&a.scale(l),c=Wx.fromArray(Ra[r]),r!=="east"&&r!=="west"&&c.scale(l),f=$x.fromArray(Ra[n]),n!=="east"&&n!=="west"&&f.scale(l)}else{let{up:l,east:d,north:A}=kn;d.set(-h.y,h.x,0).normalize(),e.geodeticSurfaceNormal(h,l),A.copy(l).cross(d);let{down:m,west:p,south:E}=kn;m.copy(l).scale(-1),p.copy(d).scale(-1),E.copy(A).scale(-1),a=kn[t],c=kn[r],f=kn[n]}return s[0]=a.x,s[1]=a.y,s[2]=a.z,s[3]=0,s[4]=c.x,s[5]=c.y,s[6]=c.z,s[7]=0,s[8]=f.x,s[9]=f.y,s[10]=f.z,s[11]=0,s[12]=h.x,s[13]=h.y,s[14]=h.z,s[15]=1,s}var Kr=new b,tB=new b,eB=new b;function Ql(e,t,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:o,centerToleranceSquared:s}=t;Kr.from(e);let i=Kr.x,a=Kr.y,c=Kr.z,f=n.x,h=n.y,u=n.z,l=i*i*f*f,d=a*a*h*h,A=c*c*u*u,m=l+d+A,p=Math.sqrt(1/m);if(!Number.isFinite(p))return;let E=tB;if(E.copy(e).scale(p),m<s)return E.to(r);let y=o.x,C=o.y,M=o.z,T=eB;T.set(E.x*y*2,E.y*C*2,E.z*M*2);let I=(1-p)*Kr.len()/(.5*T.len()),w=0,O,x,g,B;do{I-=w,O=1/(1+I*y),x=1/(1+I*C),g=1/(1+I*M);let _=O*O,P=x*x,G=g*g,U=_*O,v=P*x,at=G*g;B=l*_+d*P+A*G-1;let X=-2*(l*U*y+d*v*C+A*at*M);w=B/X}while(Math.abs(B)>Ht.EPSILON12);return Kr.scale([O,x,g]).to(r)}var cs=new b,Vl=new b,oB=new b,Jt=new b,sB=new b,fs=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=Vl,o=oB,[,,s]=t;this.geodeticSurfaceNormalCartographic(t,n),o.copy(this.radiiSquared).scale(n);let i=Math.sqrt(n.dot(o));return o.scale(1/i),n.scale(s),o.add(n),o.to(r)}cartesianToCartographic(t,r=[0,0,0]){fs.from(t);let n=this.scaleToGeodeticSurface(fs,Jt);if(!n)return;let o=this.geodeticSurfaceNormal(n,Vl),s=sB;s.copy(fs).subtract(n);let i=Math.atan2(o.y,o.x),a=Math.asin(o.z),c=Math.sign(Ke.dot(s,fs))*Ke.length(s);return kl([i,a,c],r)}eastNorthUpToFixedFrame(t,r=new Rt){return Fa(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,o,s=new Rt){return Fa(this,t,r,n,o,s)}geocentricSurfaceNormal(t,r=[0,0,0]){return cs.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=Hl(t),o=n[0],s=n[1],i=Math.cos(s);return cs.set(i*Math.cos(o),i*Math.sin(o),Math.sin(s)).normalize(),cs.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return cs.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return Ql(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){Jt.from(t);let n=Jt.x,o=Jt.y,s=Jt.z,i=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*i.x+o*o*i.y+s*s*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 o=Jt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(o)>=this.radii.z-r))return Jt.set(0,0,o).to(n)}};Ae.WGS84=new Ae(6378137,6378137,de);async function jl(e,t,r,n,o){return r=iB(e,t,r,n,o),await is(e,e.gltfFormat||0,n,o),r}function iB(e,t,r,n,o){if(r=Se(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Pr(e,t,r);let s=new DataView(t);if(e.gltfFormat=s.getUint32(r,!0),r+=4,r=Ur(e,t,r,n),r=ss(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 c=new ue(e.batchTableJson,e.batchTableBinary,a);return aB(e,i,c,a),r}function aB(e,t,r,n){let o=new Array(n),s=new b,i=new b,a=new b,c=new b,f=new Z,h=new Ie,u=new b,l={},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,s);else if(t.hasProperty("POSITION_QUANTIZED")){C=t.getProperty("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3,y,s);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 P=0;P<3;P++)C[P]=C[P]/_*B[P]+g[P]}if(!C)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");s.copy(C),l.translation=s,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(s,d),d.getRotationMatrix3(f)):f.identity()}M&&(c.copy(i).cross(a).normalize(),f.setColumn(0,i),f.setColumn(1,a),f.setColumn(2,c)),h.fromMatrix3(f),l.rotation=h,u.set(1,1,1);let T=t.getProperty("SCALE",H.FLOAT,1,y,p);Number.isFinite(T)&&u.multiplyByScalar(T);let I=t.getProperty("SCALE_NON_UNIFORM",H.FLOAT,3,y,A);I&&u.scale(I),l.scale=u;let w=t.getProperty("BATCH_ID",H.UNSIGNED_SHORT,1,y,E);w===void 0&&(w=y);let O=new Rt().fromQuaternion(l.rotation);d.identity(),d.translate(l.translation),d.multiplyRight(O),d.scale(l.scale);let x=d.clone();o[y]={modelMatrix:x,batchId:w}}e.instances=o}async function Kl(e,t,r,n,o,s){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 s(t,r,n,o,a)}return r}async function Xl(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 o=await Ut(t,qe,r,n);e.gltf=Hn(o),e.gpuMemoryUsageInBytes=Nn(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function Da(e,t=0,r,n,o={shape:"tile3d"}){switch(o.byteOffset=t,o.type=Rf(e,t),o.type){case _t.COMPOSITE:return await Kl(o,e,t,r,n,Da);case _t.BATCHED_3D_MODEL:return await Ul(o,e,t,r,n);case _t.GLTF:return await Xl(o,e,r,n);case _t.INSTANCED_3D_MODEL:return await jl(o,e,t,r,n);case _t.POINT_CLOUD:return await qh(o,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${o.type}`)}}async function Oa(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 s=Yl(e.slice(8,16)),i=new Uint8Array(e,24,s),c=new TextDecoder("utf8").decode(i),f=JSON.parse(c),h=Yl(e.slice(16,24)),u=new ArrayBuffer(0);if(h&&(u=e.slice(24+s)),await hs(f,f.tileAvailability,u,r),Array.isArray(f.contentAvailability))for(let l of f.contentAvailability)await hs(f,l,u,r);else await hs(f,f.contentAvailability,u,r);return await hs(f,f.childSubtreeAvailability,u,r),f}async function hs(e,t,r,n){let o=Number.isFinite(t.bitstream)?t.bitstream:t.bufferView;if(typeof o!="number")return;let s=e.bufferViews[o],i=e.buffers[s.buffer];if(!n?.baseUrl)throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(i.uri){let c=`${n?.baseUrl||""}/${i.uri}`,h=await(await n.fetch(c)).arrayBuffer();t.explicitBitstream=new Uint8Array(h,s.byteOffset,s.byteLength);return}let a=e.buffers.slice(0,s.buffer).reduce((c,f)=>c+f.byteLength,0);t.explicitBitstream=new Uint8Array(r.slice(a,a+i.byteLength),s.byteOffset,s.byteLength)}function Yl(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var Xr={dataType:null,batchType:null,id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Rr,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Oa,options:{}};var Du=xr(gn(),1);var Iu=xr(gn(),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 cB=globalThis.self||globalThis.window||globalThis.global,Yr=globalThis.window||globalThis.self||globalThis.global,fB=globalThis.document||{},We=globalThis.process||{},hB=globalThis.console,GS=globalThis.navigator||{};var ls=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",HS=zt();function lB(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var us=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=lB(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 Zl(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 ql(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 ds(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let s=e.width*r,i=e.height*r,a=["font-size:1px;","padding:".concat(Math.floor(i/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(i,"px;"),"background:url(".concat(o,");"),"background-size:".concat(s,"px ").concat(i,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}var As;(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"})(As||(As={}));var uB=10;function Wl(e){return typeof e!="string"?e:(e=e.toUpperCase(),As[e]||As.WHITE)}function $l(e,t,r){if(!zt&&typeof e=="string"){if(t){let n=Wl(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=Wl(r);e="\x1B[".concat(n+uB,"m").concat(e,"\x1B[49m")}}return e}function tu(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),o=e;for(let s of n){let i=o[s];typeof i=="function"&&(t.find(a=>s===a)||(o[s]=i.bind(e)))}}function Zr(e,t){if(!e)throw new Error(t||"Assertion failed")}function $e(){let e;if(zt()&&Yr.performance){var t,r;e=Yr===null||Yr===void 0||(t=Yr.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in We){var n;let o=We===null||We===void 0||(n=We.hrtime)===null||n===void 0?void 0:n.call(We);e=o[0]*1e3+o[1]/1e6}else e=Date.now();return e}var qr={debug:zt()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},dB={enabled:!0,level:0};function Dt(){}var eu={},ru={once:!0},Jn=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=ls,this._startTs=$e(),this._deltaTs=$e(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new us("__probe-".concat(this.id,"__"),dB),this.timeStamp("".concat(this.id," started")),tu(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(($e()-this._startTs).toPrecision(10))}getDelta(){return Number(($e()-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){Zr(t,r)}warn(t){return this._getLogFunction(0,t,qr.warn,arguments,ru)}error(t){return this._getLogFunction(0,t,qr.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,qr.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,qr.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,qr.debug||qr.info,arguments,ru)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||Dt,n&&[n],{tag:gB(r)}):Dt}image(t){let{logLevel:r,priority:n,image:o,message:s="",scale:i=1}=t;return this._shouldLog(r||n)?zt()?pB({image:o,message:s,scale:i}):mB({image:o,message:s,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},o=nu({logLevel:t,message:r,opts:n}),{collapsed:s}=n;return o.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}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()>=ou(t)}_getLogFunction(t,r,n,o,s){if(this._shouldLog(t)){s=nu({logLevel:t,message:r,args:o,opts:s}),n=n||s.method,Zr(n),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=$e();let i=s.tag||s.message;if(s.once&&i)if(!eu[i])eu[i]=$e();else return Dt;return r=AB(this.id,s.message,s),n.bind(console,r,...s.args)}return Dt}};Jn.VERSION=ls;function ou(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 Zr(Number.isFinite(t)&&t>=0),t}function nu(e){let{logLevel:t,message:r}=e;e.logLevel=ou(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 o=typeof e.message;return Zr(o==="string"||o==="object"),Object.assign(e,{args:n},e.opts)}function AB(e,t,r){if(typeof t=="string"){let n=r.time?ql(Zl(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=$l(t,r.color,r.background)}return t}function mB(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),Dt}function pB(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let s=new Image;return s.onload=()=>{let i=ds(s,r,n);console.log(...i)},s.src=t,Dt}let o=t.nodeName||"";if(o.toLowerCase()==="img")return console.log(...ds(t,r,n)),Dt;if(o.toLowerCase()==="canvas"){let s=new Image;return s.onload=()=>console.log(...ds(s,r,n)),s.src=t.toDataURL(),Dt}return Dt}function gB(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var va=new Jn({id:"@probe.gl/log"});var Ot=null;try{Ot=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function 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 su(e){var t=Math.clz32(e&-e);return e?31-t:t}Y.isLong=At;var iu={},au={};function tr(e,t){var r,n,o;return t?(e>>>=0,(o=0<=e&&e<256)&&(n=au[e],n)?n:(r=Q(e,0,!0),o&&(au[e]=r),r)):(e|=0,(o=-128<=e&&e<128)&&(n=iu[e],n)?n:(r=Q(e,e<0?-1:0,!1),o&&(iu[e]=r),r))}Y.fromInt=tr;function Lt(e,t){if(isNaN(e))return t?me:Qt;if(t){if(e<0)return me;if(e>=lu)return Au}else{if(e<=-fu)return Ct;if(e+1>=fu)return du}return e<0?Lt(-e,t).neg():Q(e%$r|0,e/$r|0,t)}Y.fromNumber=Lt;function Q(e,t,r){return new Y(e,t,r)}Y.fromBits=Q;var ms=Math.pow;function Ga(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 Ga(e.substring(1),t,r).neg();for(var o=Lt(ms(r,8)),s=Qt,i=0;i<e.length;i+=8){var a=Math.min(8,e.length-i),c=parseInt(e.substring(i,i+a),r);if(a<8){var f=Lt(ms(r,a));s=s.mul(f).add(Lt(c))}else s=s.mul(o),s=s.add(Lt(c))}return s.unsigned=t,s}Y.fromString=Ga;function Vt(e,t){return typeof e=="number"?Lt(e,t):typeof e=="string"?Ga(e,t):Q(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}Y.fromValue=Vt;var cu=1<<16,xB=1<<24,$r=cu*cu,lu=$r*$r,fu=lu/2,hu=tr(xB),Qt=tr(0);Y.ZERO=Qt;var me=tr(0,!0);Y.UZERO=me;var Wr=tr(1);Y.ONE=Wr;var uu=tr(1,!0);Y.UONE=uu;var Na=tr(-1);Y.NEG_ONE=Na;var du=Q(-1,2147483647,!1);Y.MAX_VALUE=du;var Au=Q(-1,-1,!0);Y.MAX_UNSIGNED_VALUE=Au;var Ct=Q(0,-2147483648,!1);Y.MIN_VALUE=Ct;var L=Y.prototype;L.toInt=function(){return this.unsigned?this.low>>>0:this.low};L.toNumber=function(){return this.unsigned?(this.high>>>0)*$r+(this.low>>>0):this.high*$r+(this.low>>>0)};L.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=Lt(t),n=this.div(r),o=n.mul(r).sub(this);return n.toString(t)+o.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var s=Lt(ms(t,6),this.unsigned),i=this,a="";;){var c=i.div(s),f=i.sub(c.mul(s)).toInt()>>>0,h=f.toString(t);if(i=c,i.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}};L.getHighBits=function(){return this.high};L.getHighBitsUnsigned=function(){return this.high>>>0};L.getLowBits=function(){return this.low};L.getLowBitsUnsigned=function(){return this.low>>>0};L.getNumBitsAbs=function(){if(this.isNegative())return this.eq(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};L.isZero=function(){return this.high===0&&this.low===0};L.eqz=L.isZero;L.isNegative=function(){return!this.unsigned&&this.high<0};L.isPositive=function(){return this.unsigned||this.high>=0};L.isOdd=function(){return(this.low&1)===1};L.isEven=function(){return(this.low&1)===0};L.equals=function(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};L.eq=L.equals;L.notEquals=function(t){return!this.eq(t)};L.neq=L.notEquals;L.ne=L.notEquals;L.lessThan=function(t){return this.comp(t)<0};L.lt=L.lessThan;L.lessThanOrEqual=function(t){return this.comp(t)<=0};L.lte=L.lessThanOrEqual;L.le=L.lessThanOrEqual;L.greaterThan=function(t){return this.comp(t)>0};L.gt=L.greaterThan;L.greaterThanOrEqual=function(t){return this.comp(t)>=0};L.gte=L.greaterThanOrEqual;L.ge=L.greaterThanOrEqual;L.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};L.comp=L.compare;L.negate=function(){return!this.unsigned&&this.eq(Ct)?Ct:this.not().add(Wr)};L.neg=L.negate;L.add=function(t){At(t)||(t=Vt(t));var r=this.high>>>16,n=this.high&65535,o=this.low>>>16,s=this.low&65535,i=t.high>>>16,a=t.high&65535,c=t.low>>>16,f=t.low&65535,h=0,u=0,l=0,d=0;return d+=s+f,l+=d>>>16,d&=65535,l+=o+c,u+=l>>>16,l&=65535,u+=n+a,h+=u>>>16,u&=65535,h+=r+i,h&=65535,Q(l<<16|d,h<<16|u,this.unsigned)};L.subtract=function(t){return At(t)||(t=Vt(t)),this.add(t.neg())};L.sub=L.subtract;L.multiply=function(t){if(this.isZero())return this;if(At(t)||(t=Vt(t)),Ot){var r=Ot.mul(this.low,this.high,t.low,t.high);return Q(r,Ot.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(hu)&&t.lt(hu))return Lt(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,o=this.high&65535,s=this.low>>>16,i=this.low&65535,a=t.high>>>16,c=t.high&65535,f=t.low>>>16,h=t.low&65535,u=0,l=0,d=0,A=0;return A+=i*h,d+=A>>>16,A&=65535,d+=s*h,l+=d>>>16,d&=65535,d+=i*f,l+=d>>>16,d&=65535,l+=o*h,u+=l>>>16,l&=65535,l+=s*f,u+=l>>>16,l&=65535,l+=i*c,u+=l>>>16,l&=65535,u+=n*h+o*f+s*c+i*a,u&=65535,Q(d<<16|A,u<<16|l,this.unsigned)};L.mul=L.multiply;L.divide=function(t){if(At(t)||(t=Vt(t)),t.isZero())throw Error("division by zero");if(Ot){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?Ot.div_u:Ot.div_s)(this.low,this.high,t.low,t.high);return Q(r,Ot.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?me:Qt;var n,o,s;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return me;if(t.gt(this.shru(1)))return uu;s=me}else{if(this.eq(Ct)){if(t.eq(Wr)||t.eq(Na))return Ct;if(t.eq(Ct))return Wr;var i=this.shr(1);return n=i.div(t).shl(1),n.eq(Qt)?t.isNegative()?Wr:Na:(o=this.sub(t.mul(n)),s=n.add(o.div(t)),s)}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();s=Qt}for(o=this;o.gte(t);){n=Math.max(1,Math.floor(o.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),c=a<=48?1:ms(2,a-48),f=Lt(n),h=f.mul(t);h.isNegative()||h.gt(o);)n-=c,f=Lt(n,this.unsigned),h=f.mul(t);f.isZero()&&(f=Wr),s=s.add(f),o=o.sub(h)}return s};L.div=L.divide;L.modulo=function(t){if(At(t)||(t=Vt(t)),Ot){var r=(this.unsigned?Ot.rem_u:Ot.rem_s)(this.low,this.high,t.low,t.high);return Q(r,Ot.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};L.mod=L.modulo;L.rem=L.modulo;L.not=function(){return Q(~this.low,~this.high,this.unsigned)};L.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};L.clz=L.countLeadingZeros;L.countTrailingZeros=function(){return this.low?su(this.low):su(this.high)+32};L.ctz=L.countTrailingZeros;L.and=function(t){return At(t)||(t=Vt(t)),Q(this.low&t.low,this.high&t.high,this.unsigned)};L.or=function(t){return At(t)||(t=Vt(t)),Q(this.low|t.low,this.high|t.high,this.unsigned)};L.xor=function(t){return At(t)||(t=Vt(t)),Q(this.low^t.low,this.high^t.high,this.unsigned)};L.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)};L.shl=L.shiftLeft;L.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)};L.shr=L.shiftRight;L.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)};L.shru=L.shiftRightUnsigned;L.shr_u=L.shiftRightUnsigned;L.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))};L.rotl=L.rotateLeft;L.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))};L.rotr=L.rotateRight;L.toSigned=function(){return this.unsigned?Q(this.low,this.high,!1):this};L.toUnsigned=function(){return this.unsigned?this:Q(this.low,this.high,!0)};L.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};L.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]};L.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 tn=Y;var BB=16;function zn(e){e==="X"&&(e="");let t=e.padEnd(BB,"0");return tn.fromString(t,!0,16)}function Pa(e){if(e.isZero())return"X";let t=e.countTrailingZeros(),r=t%4;t=(t-r)/4;let n=t;t*=4;let s=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-n-s.length).join("0")+s}function Ua(e,t){let r=EB(e).shiftRightUnsigned(2);return e.add(tn.fromNumber(2*t+1-4).multiply(r))}function EB(e){return e.and(e.not().add(1))}var _B=3,yB=30,TB=2*yB+1,mu=180/Math.PI;function gu(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],o=n.length,s=0,i=[0,0];for(let a=o-1;a>=0;a--){s=o-a;let c=n[a],f=0,h=0;c==="1"?h=1:c==="2"?(f=1,h=1):c==="3"&&(f=1);let u=Math.pow(2,s-1);CB(u,i,f,h),i[0]+=u*f,i[1]+=u*h}if(r%2===1){let a=i[0];i[0]=i[1],i[1]=a}return{face:r,ij:i,level:s}}function xu(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<_B+TB;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),o=t.substring(3,r),s=o.length/2,i=tn.fromString(n,!0,2).toString(10),a="";if(s!==0)for(a=tn.fromString(o,!0,2).toString(4);a.length<s;)a="0"+a;return`${i}/${a}`}function Ha(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function pu(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function ka(e){return[pu(e[0]),pu(e[1])]}function Ja(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 za([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*mu,n*mu]}function CB(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let o=t[0];t[0]=t[1],t[1]=o}}function Bu(e){let t=Ha(e.ij,e.level,[.5,.5]),r=ka(t),n=Ja(e.face,r);return za(n)}var MB=100;function Qa(e){let{face:t,ij:r,level:n}=e,o=[[0,0],[0,1],[1,1],[1,0],[0,0]],s=Math.max(1,Math.ceil(MB*Math.pow(2,-n))),i=new Float64Array(4*s*2+2),a=0,c=0;for(let f=0;f<4;f++){let h=o[f].slice(0),u=o[f+1],l=(u[0]-h[0])/s,d=(u[1]-h[1])/s;for(let A=0;A<s;A++){h[0]+=l,h[1]+=d;let m=Ha(r,n,h),p=ka(m),E=Ja(t,p),y=za(E);Math.abs(y[1])>89.999&&(y[0]=c);let C=y[0]-c;y[0]+=C>180?-360:C<-180?360:0,i[a++]=y[0],i[a++]=y[1],c=y[0]}}return i[a++]=i[0],i[a++]=i[1],i}function en(e){let t=bB(e);return gu(t)}function bB(e){if(e.indexOf("/")>0)return e;let t=zn(e);return xu(t)}function Va(e){let t=en(e);return Bu(t)}function _u(e){let t;if(e.face===2||e.face===5){let r=null,n=0;for(let o=0;o<4;o++){let s=`${e.face}/${o}`,i=en(s),a=Qa(i);(typeof r>"u"||r===null)&&(r=new Float64Array(4*a.length)),r.set(a,n),n+=a.length}t=Eu(r)}else{let r=Qa(e);t=Eu(r)}return t}function Eu(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,o)=>n-o),r.sort((n,o)=>n-o),{west:t[0],east:t[t.length-1],north:r[r.length-1],south:r[0]}}function ja(e,t){let r=t?.minimumHeight||0,n=t?.maximumHeight||0,o=en(e),s=_u(o),i=s.west,a=s.south,c=s.east,f=s.north,h=[];return h.push(new b(i,f,r)),h.push(new b(c,f,r)),h.push(new b(c,a,r)),h.push(new b(i,a,r)),h.push(new b(i,f,n)),h.push(new b(c,f,n)),h.push(new b(c,a,n)),h.push(new b(i,a,n)),h}var ht={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var HR=new b,kR=new b;var Qn=new b,yu=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,o=t.center,s=t.radius,i=Qn.copy(o).subtract(r),a=i.magnitude();if(n>=a+s)return this.clone();if(s>=a+n)return t.clone();let c=(n+a+s)*.5;return yu.copy(i).scale((-n+c)/a).add(r),this.center.copy(yu),this.radius=c,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,s=t.normal.dot(r)+t.distance;return s<-n?ht.OUTSIDE:s<n?ht.INTERSECTING:ht.INSIDE}};var wB=new b,IB=new b,ps=new b,gs=new b,xs=new b,SB=new b,RB=new b,pe={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},er=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),o=new b(t).normalize(),s=new b(r).normalize(),i=new b(n).normalize();return new Ie().fromMatrix3(new Z([...o,...s,...i]))}fromCenterHalfSizeQuaternion(t,r,n){let o=new Ie(n),s=new Z().fromQuaternion(o);return s[0]=s[0]*r[0],s[1]=s[1]*r[0],s[2]=s[2]*r[0],s[3]=s[3]*r[1],s[4]=s[4]*r[1],s[5]=s[5]*r[1],s[6]=s[6]*r[2],s[7]=s[7]*r[2],s[8]=s[8]*r[2],this.center=new b().from(t),this.halfAxes=s,this}clone(){return new er(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,ps),o=r.getColumn(1,gs),s=r.getColumn(2,xs),i=wB.copy(n).add(o).add(s);return t.center.copy(this.center),t.radius=i.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,o=this.halfAxes,s=n.x,i=n.y,a=n.z,c=Math.abs(s*o[pe.COLUMN0ROW0]+i*o[pe.COLUMN0ROW1]+a*o[pe.COLUMN0ROW2])+Math.abs(s*o[pe.COLUMN1ROW0]+i*o[pe.COLUMN1ROW1]+a*o[pe.COLUMN1ROW2])+Math.abs(s*o[pe.COLUMN2ROW0]+i*o[pe.COLUMN2ROW1]+a*o[pe.COLUMN2ROW2]),f=n.dot(r)+t.distance;return f<=-c?ht.OUTSIDE:f>=c?ht.INSIDE:ht.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=IB.from(t).subtract(this.center),n=this.halfAxes,o=n.getColumn(0,ps),s=n.getColumn(1,gs),i=n.getColumn(2,xs),a=o.magnitude(),c=s.magnitude(),f=i.magnitude();o.normalize(),s.normalize(),i.normalize();let h=0,u;return u=Math.abs(r.dot(o))-a,u>0&&(h+=u*u),u=Math.abs(r.dot(s))-c,u>0&&(h+=u*u),u=Math.abs(r.dot(i))-f,u>0&&(h+=u*u),h}computePlaneDistances(t,r,n=[-0,-0]){let o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,i=this.center,a=this.halfAxes,c=a.getColumn(0,ps),f=a.getColumn(1,gs),h=a.getColumn(2,xs),u=SB.copy(c).add(f).add(h).add(i),l=RB.copy(u).subtract(t),d=r.dot(l);return o=Math.min(d,o),s=Math.max(d,s),u.copy(i).add(c).add(f).subtract(h),l.copy(u).subtract(t),d=r.dot(l),o=Math.min(d,o),s=Math.max(d,s),u.copy(i).add(c).subtract(f).add(h),l.copy(u).subtract(t),d=r.dot(l),o=Math.min(d,o),s=Math.max(d,s),u.copy(i).add(c).subtract(f).subtract(h),l.copy(u).subtract(t),d=r.dot(l),o=Math.min(d,o),s=Math.max(d,s),i.copy(u).subtract(c).add(f).add(h),l.copy(u).subtract(t),d=r.dot(l),o=Math.min(d,o),s=Math.max(d,s),i.copy(u).subtract(c).add(f).subtract(h),l.copy(u).subtract(t),d=r.dot(l),o=Math.min(d,o),s=Math.max(d,s),i.copy(u).subtract(c).subtract(f).add(h),l.copy(u).subtract(t),d=r.dot(l),o=Math.min(d,o),s=Math.max(d,s),i.copy(u).subtract(c).subtract(f).subtract(h),l.copy(u).subtract(t),d=r.dot(l),o=Math.min(d,o),s=Math.max(d,s),n[0]=o,n[1]=s,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,ps);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,gs);n.transformAsPoint(t);let o=this.halfAxes.getColumn(2,xs);return o.transformAsPoint(t),this.halfAxes=new Z([...r,...n,...o]),this}getTransform(){throw new Error("not implemented")}};var Tu=new b,Cu=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=Tu.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,o){return this.normal.set(t,r,n),ft(wt(this.normal.len(),1)),this.distance=o,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=Cu.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=Tu.from(t),o=this.getPointDistance(n),s=Cu.copy(this.normal).scale(o);return n.subtract(s).to(r)}};var Mu=[new b([1,0,0]),new b([0,1,0]),new b([0,0,1])],bu=new b,FB=new b,vt=class{constructor(t=[]){this.planes=t}fromBoundingSphere(t){this.planes.length=2*Mu.length;let r=t.center,n=t.radius,o=0;for(let s of Mu){let i=this.planes[o],a=this.planes[o+1];i||(i=this.planes[o]=new ge),a||(a=this.planes[o+1]=new ge);let c=bu.copy(s).scale(-n).add(r);i.fromPointNormal(c,s);let f=bu.copy(s).scale(n).add(r),h=FB.copy(s).negate();a.fromPointNormal(f,h),o+=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,o=this.planes;for(let s=0;s<this.planes.length;++s){let i=s<31?1<<s:0;if(s<31&&!(r&i))continue;let a=o[s],c=t.intersectPlane(a);if(c===ht.OUTSIDE)return vt.MASK_OUTSIDE;c===ht.INTERSECTING&&(n|=i)}return n}};vt.MASK_OUTSIDE=4294967295;vt.MASK_INSIDE=0;vt.MASK_INDETERMINATE=2147483647;var sF=new b,iF=new b,aF=new b,cF=new b,fF=new b;var mF=new b,pF=new b,gF=new b,xF=new b,BF=new b,EF=new b,_F=new b,yF=new b,TF=new b,CF=new b,MF=new b,bF=new b;var re=new Z,OB=new Z,LB=new Z,Bs=new Z,wu=new Z;function Ya(e,t={}){let r=Ht.EPSILON20,n=10,o=0,s=0,i=OB,a=LB;i.identity(),a.copy(e);let c=r*vB(a);for(;s<n&&NB(a)>c;)GB(a,Bs),wu.copy(Bs).transpose(),a.multiplyRight(Bs),a.multiplyLeft(wu),i.multiplyRight(Bs),++o>2&&(++s,o=0);return t.unitary=i.toTarget(t.unitary),t.diagonal=a.toTarget(t.diagonal),t}function vB(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var Ka=[1,0,0],Xa=[2,2,1];function NB(e){let t=0;for(let r=0;r<3;++r){let n=e[re.getElementIndex(Xa[r],Ka[r])];t+=2*n*n}return Math.sqrt(t)}function GB(e,t){let r=Ht.EPSILON15,n=0,o=1;for(let f=0;f<3;++f){let h=Math.abs(e[re.getElementIndex(Xa[f],Ka[f])]);h>n&&(o=f,n=h)}let s=Ka[o],i=Xa[o],a=1,c=0;if(Math.abs(e[re.getElementIndex(i,s)])>r){let f=e[re.getElementIndex(i,i)],h=e[re.getElementIndex(s,s)],u=e[re.getElementIndex(i,s)],l=(f-h)/2/u,d;l<0?d=-1/(-l+Math.sqrt(1+l*l)):d=1/(l+Math.sqrt(1+l*l)),a=1/Math.sqrt(1+d*d),c=d*a}return Z.IDENTITY.to(t),t[re.getElementIndex(s,s)]=t[re.getElementIndex(i,i)]=a,t[re.getElementIndex(i,s)]=c,t[re.getElementIndex(s,i)]=-c,t}var De=new b,UB=new b,HB=new b,kB=new b,JB=new b,zB=new Z,QB={diagonal:new Z,unitary:new Z};function Za(e,t=new er){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 o=1/r;n.multiplyByScalar(o);let s=0,i=0,a=0,c=0,f=0,h=0;for(let x of e){let g=De.copy(x).subtract(n);s+=g.x*g.x,i+=g.x*g.y,a+=g.x*g.z,c+=g.y*g.y,f+=g.y*g.z,h+=g.z*g.z}s*=o,i*=o,a*=o,c*=o,f*=o,h*=o;let u=zB;u[0]=s,u[1]=i,u[2]=a,u[3]=i,u[4]=c,u[5]=f,u[6]=a,u[7]=f,u[8]=h;let{unitary:l}=Ya(u,QB),d=t.halfAxes.copy(l),A=d.getColumn(0,HB),m=d.getColumn(1,kB),p=d.getColumn(2,JB),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=UB.set(E-M,y-T,C-I).multiplyByScalar(.5),O=new Z([w[0],0,0,0,w[1],0,0,0,w[2]]);return t.halfAxes.multiplyRight(O),t}function Es(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=ja(t,r),o=Va(t),s=o[0],i=o[1],a=Ae.WGS84.cartographicToCartesian([s,i,r.maximumHeight]),c=new b(a[0],a[1],a[2]);n.push(c);let f=Za(n);return[...f.center,...f.halfAxes]}var VB=4,jB=8,KB={QUADTREE:VB,OCTREE:jB};function XB(e,t,r){if(e?.box){let n=zn(e.s2VolumeInfo.token),o=Ua(n,t),s=Pa(o),i={...e.s2VolumeInfo};switch(i.token=s,r){case"OCTREE":let f=e.s2VolumeInfo,h=f.maximumHeight-f.minimumHeight,u=h/2,l=f.minimumHeight+h/2;f.minimumHeight=l-u,f.maximumHeight=l+u;break;default:break}return{box:Es(i),s2VolumeInfo:i}}}async function Wa(e){let{implicitOptions:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,s2VolumeBox:o,loaderOptions:s}=e,{subtree:i,level:a=0,globalData:c={level:0,mortonIndex:0,x:0,y:0,z:0}}=e,{subdivisionScheme:f,subtreeLevels:h,maximumLevel:u,contentUrlTemplate:l,subtreesUriTemplate:d,basePath:A}=t,m={children:[],lodMetricValue:0,contentUrl:""};if(!u)return va.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${l} won't be loaded...`),m;let p=a+c.level;if(p>u)return m;let E=KB[f],y=Math.log2(E),C=n&1,M=n>>1&1,T=n>>2&1,I=(E**a-1)/(E-1),w=rr(r.mortonIndex,n,y),O=I+w,x=rr(r.x,C,1),g=rr(r.y,M,1),B=rr(r.z,T,1),_=!1;a>=h&&(_=qa(i.childSubtreeAvailability,w));let P=rr(c.x,x,a),G=rr(c.y,g,a),U=rr(c.z,B,a);if(_){let ke=`${A}/${d}`,uo=_s(ke,p,P,G,U);i=await(0,Iu.load)(uo,Xr,s),c={mortonIndex:w,x,y:g,z:B,level:a},w=0,O=0,x=0,g=0,B=0,a=0}if(!qa(i.tileAvailability,O))return m;qa(i.contentAvailability,O)&&(m.contentUrl=_s(l,p,P,G,U));let mt=a+1,X={mortonIndex:w,x,y:g,z:B};for(let ke=0;ke<E;ke++){let uo=XB(o,ke,f),gr=await Wa({subtree:i,implicitOptions:t,loaderOptions:s,parentData:X,childIndex:ke,level:mt,globalData:{...c},s2VolumeBox:uo});if(gr.contentUrl||gr.children.length){let S=p+1,R=YB(gr,S,{childTileX:x,childTileY:g,childTileZ:B},t,o);m.children.push(R)}}return m}function qa(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&va.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?WB(t,r.explicitBitstream):!1}function YB(e,t,r,n,o){let{basePath:s,refine:i,getRefine:a,lodMetricType:c,getTileType:f,rootLodMetricValue:h,rootBoundingVolume:u}=n,l=e.contentUrl&&e.contentUrl.replace(`${s}/`,""),d=h/2**t,A=o?.box?{box:o.box}:u,m=ZB(t,A,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:l},id:e.contentUrl,refine:a(i),type:f(e),lodMetricType:c,lodMetricValue:d,geometricError:d,transform:e.transform,boundingVolume:m}}function ZB(e,t,r){if(t.region){let{childTileX:n,childTileY:o,childTileZ:s}=r,[i,a,c,f,h,u]=t.region,l=2**e,d=(c-i)/l,A=(f-a)/l,m=(u-h)/l,[p,E]=[i+d*n,i+d*(n+1)],[y,C]=[a+A*o,a+A*(o+1)],[M,T]=[h+m*s,h+m*(s+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 rr(e,t,r){return(e<<r)+t}function _s(e,t,r,n,o){let s=qB({level:t,x:r,y:n,z:o});return e.replace(/{level}|{x}|{y}|{z}/gi,i=>s[i])}function qB(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function WB(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function tc(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 ec(e){switch(e){case"REPLACE":case"replace":return Sr.REPLACE;case"ADD":case"add":return Sr.ADD;default:return e}}function $a(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 Cr.resolve(t,e)}function Su(e,t){if(!e)return null;let r;if(e.content){let o=e.content.uri||e.content?.url;typeof o<"u"&&(r=$a(o,t))}return{...e,id:r,contentUrl:r,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:tc(e,r),refine:ec(e.refine)}}async function Ou(e,t,r){let n=null,o=Fu(e.root);o&&e.root?n=await Ru(e.root,e,t,o,r):n=Su(e.root,t);let s=[];for(s.push(n);s.length>0;){let i=s.pop()||{},a=i.children||[],c=[];for(let f of a){let h=Fu(f),u;h?u=await Ru(f,e,t,h,r):u=Su(f,t),u&&(c.push(u),s.push(u))}i.children=c}return n}async function Ru(e,t,r,n,o){let{subdivisionScheme:s,maximumLevel:i,availableLevels:a,subtreeLevels:c,subtrees:{uri:f}}=n,h=_s(f,0,0,0,0),u=$a(h,r),l=await(0,Du.load)(u,Xr,o),d=e.content?.uri,A=d?$a(d,r):"",m=t?.root?.refine,p=e.geometricError,E=e.boundingVolume.extensions?.["3DTILES_bounding_volume_S2"];if(E){let T={box:Es(E),s2VolumeInfo:E};e.boundingVolume=T}let y=e.boundingVolume,C={contentUrlTemplate:A,subtreesUriTemplate:f,subdivisionScheme:s,subtreeLevels:c,maximumLevel:Number.isFinite(a)?a-1:i,refine:m,basePath:r,lodMetricType:le.GEOMETRIC_ERROR,rootLodMetricValue:p,rootBoundingVolume:y,getTileType:tc,getRefine:ec};return await $B(e,r,l,C,o)}async function $B(e,t,r,n,o){if(!e)return null;let{children:s,contentUrl:i}=await Wa({subtree:r,implicitOptions:n,loaderOptions:o}),a,c=null;return i&&(a=i,c={uri:i.replace(`${t}/`,"")}),{...e,id:a,contentUrl:a,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:tc(e,a),refine:ec(e.refine),content:c||e.content,children:s}}function Fu(e){return e?.extensions?.["3DTILES_implicit_tiling"]||e?.implicitTiling}var nr={dataType:null,batchType:null,id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Rr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:t2,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function t2(e,t={},r){let n=t["3d-tiles"]||{},o;return n.isTileset==="auto"?o=r?.url&&r.url.indexOf(".json")!==-1:o=n.isTileset,o?e2(e,t,r):r2(e,t,r)}async function e2(e,t,r){let n=JSON.parse(new TextDecoder().decode(e)),o=r?.url||"",s=n2(o),i=await Ou(n,s,t||{});return{...n,shape:"tileset3d",loader:nr,url:o,queryString:r?.queryString||"",basePath:s,root:i||n.root,type:Cn.TILES3D,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:n.root?.geometricError||0}}async function r2(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await Da(e,0,t,r,n.content),n.content}function n2(e){return Cr.dirname(e)}var ys=xr(gn(),1);var Lu="https://api.cesium.com/v1/assets";async function Ts(e,t){if(!t){let s=await o2(e);for(let i of s.items)i.type==="3DTILES"&&(t=i.id)}let r=await s2(e,t),{type:n,url:o}=r;return J(n==="3DTILES"&&o),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function o2(e){J(e);let t=Lu,r={Authorization:`Bearer ${e}`},n=await(0,ys.fetchFile)(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function s2(e,t){J(e,t);let r={Authorization:`Bearer ${e}`},n=`${Lu}/${t}`,o=await(0,ys.fetchFile)(`${n}`,{headers:r});if(!o.ok)throw new Error(o.statusText);let s=await o.json();if(o=await(0,ys.fetchFile)(`${n}/endpoint`,{headers:r}),!o.ok)throw new Error(o.statusText);let i=await o.json();return s={...s,...i},s}async function i2(e,t={}){t=t["cesium-ion"]||{};let{accessToken:r}=t,n=t.assetId;if(!Number.isFinite(n)){let o=e.match(/\/([0-9]+)\/tileset.json/);n=o&&o[1]}return Ts(r,n)}var rc={...nr,id:"cesium-ion",name:"Cesium Ion",preload:i2,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=rc,nr.parse(e,t,r)),options:{"cesium-ion":{...nr.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=-1,o=e.length-4n;do{let s=o;o-=BigInt(1024),o=o>=0n?o:0n;let i=new Uint8Array(await e.slice(o,s));for(let a=i.length-1;a>-1;a--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=i[a],r.every((c,f)=>c===t[f])){n=a;break}}while(n===-1&&o>0n);return o+BigInt(n)};var vu=new Uint8Array([80,75,5,6]),Nu=new Uint8Array([80,75,6,7]),Gu=new Uint8Array([80,75,6,6]),a2=8n;var c2=12n,f2=16n;var h2=8n,l2=24n;var u2=40n,d2=48n;var Pu=async e=>{let t=await Vn(e,vu),r=BigInt(await e.getUint16(t+a2)),n=BigInt(await e.getUint32(t+c2)),o=BigInt(await e.getUint32(t+f2)),s=t-20n,i=0n,a=await e.slice(s,s+4n);if(Te(a,Nu)){i=await e.getBigUint64(s+h2);let c=await e.slice(i,i+4n);if(!Te(c,Gu.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(i+l2),n=await e.getBigUint64(i+u2),o=await e.getBigUint64(i+d2)}else s=0n;return{cdRecordsNumber:r,cdStartOffset:o,cdByteSize:n,offsets:{zip64EoCDOffset:i,zip64EoCDLocatorOffset:s,zipEoCDOffset:t}}};var wD=[{offset:0,size:4,default:new DataView(vu.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 ID=[{offset:0,size:4,default:new DataView(Nu.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],SD=[{offset:0,size:4,default:new DataView(Gu.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 A2=20,m2=24,p2=28,g2=30,x2=32,B2=42,Cs=46n,Kn=new Uint8Array([80,75,1,2]),jn=async(e,t)=>{if(e>=t.length)return null;let r=new DataView(await t.slice(e,e+Cs)),n=r.buffer.slice(0,4);if(!Te(n,Kn.buffer))return null;let o=BigInt(r.getUint32(A2,!0)),s=BigInt(r.getUint32(m2,!0)),i=r.getUint16(g2,!0),a=BigInt(r.getUint16(x2,!0)),c=r.getUint16(p2,!0),f=await t.slice(e+Cs,e+Cs+BigInt(c+i)),h=f.slice(0,c),u=new TextDecoder().decode(h),l=e+Cs+BigInt(c),d=r.getUint32(B2,!0),A=BigInt(d),m=new DataView(f.slice(c,f.byteLength)),p={uncompressedSize:s,compressedSize:o,localHeaderOffset:A,startDisk:a},E=E2(p,m);return{...p,...E,extraFieldLength:i,fileNameLength:c,fileName:u,extraOffset:l}};async function*rn(e){let{cdStartOffset:t,cdByteSize:r}=await Pu(e),n=new ze(new DataView(await e.slice(t,t+r))),o=await jn(0n,n);for(;o;)yield o,o=await jn(o.extraOffset+BigInt(o.extraFieldLength),n)}var Uu=(...e)=>e[0]+e[1]*16,E2=(e,t)=>{let r=_2(e),n={};if(r.length>0){let o=r.reduce((a,c)=>a+c.length,0),s=new Uint8Array(t.buffer).findIndex((a,c,f)=>Uu(f[c],f[c+1])===1&&Uu(f[c+2],f[c+3])===o),i=0;for(let a of r){let c=i;n[a.name]=t.getBigUint64(s+4+c,!0),i=c+a.length}}return n},_2=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 OD=[{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 y2=8,T2=18,C2=22,M2=26,b2=28,Ms=30n,nc=new Uint8Array([80,75,3,4]),or=async(e,t)=>{let r=new DataView(await t.slice(e,e+Ms)),n=r.buffer.slice(0,4);if(!Te(n,nc))return null;let o=r.getUint16(M2,!0),s=r.getUint16(b2,!0),i=await t.slice(e+Ms,e+Ms+BigInt(o+s)),a=i.slice(0,o),c=new DataView(i.slice(o,i.byteLength)),f=new TextDecoder().decode(a).split("\\").join("/"),h=e+Ms+BigInt(o+s),u=r.getUint16(y2,!0),l=BigInt(r.getUint32(T2,!0)),d=BigInt(r.getUint32(C2,!0)),A=4;return d===BigInt(4294967295)&&(d=c.getBigUint64(A,!0),A+=8),l===BigInt(4294967295)&&(l=c.getBigUint64(A,!0),A+=8),h===BigInt(4294967295)&&(h=c.getBigUint64(A,!0)),{fileNameLength:o,fileName:f,extraFieldLength:s,fileDataOffset:h,compressedSize:l,compressionMethod:u}};var ND=[{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 bs=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 o=await this.concatenate(n),s=await this.hash(o,r);this.options.crypto?.onEnd?.({hash:s})}async concatenate(t){return await En(t)}};function Hu(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 o=0;o<n.length;o++)typeof n[o]>"u"?t+="=":t+=w2(n[o])}return t}function w2(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 ku(e,t){switch(t){case"hex":return e;case"base64":return I2(e);default:throw new Error(t)}}function I2(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Hu(r)||""}var zu=typeof atob=="function"?atob:typeof Buffer=="function"?v2:Vu,S2=zu("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3BCNAANBWxvb3BDAA4GbG9vcEMxAA8GbG9vcEMyABAGbG9vcEMzABEGbG9vcEM0ABIFbG9vcEQAEwZsb29wRDEAFAZsb29wRDIAFQZsb29wRDMAFgZsb29wRDQAFwRnZXRBACgEZ2V0QgApBGdldEMAKgRnZXREACsEZ2V0WAAsBHNldEEALQRzZXRCAC4Ec2V0QwAvBHNldEQAMARzZXRYADEKzA0xWwEBf0EAJAggAEEGdCEBAkADQCMIIAFGDQEjACQEIwEkBSMCJAYjAyQHEAIjBCMAaiQAIwUjAWokASMGIwJqJAIjByMDaiQDIwhBwABqJAgMAAsLIwgjGmokGgsTACMIIxpqJAkQAxAEEAkQDhATC6IBAEEAIwlqKAIAJApBBCMJaigCACQLQQgjCWooAgAkDEEMIwlqKAIAJA1BECMJaigCACQOQRQjCWooAgAkD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TIHBmxvb3BBMwgGbG9vcEE0CQVsb29wQgoGbG9vcEIxCwZsb29wQjIMBmxvb3BCMw0GbG9vcEI0DgVsb29wQw8GbG9vcEMxEAZsb29wQzIRBmxvb3BDMxIGbG9vcEM0EwVsb29wRBQGbG9vcEQxFQZsb29wRDIWBmxvb3BEMxcGbG9vcEQ0GAhvbmVGdWxsQRkIb25lRnVsbEIaCG9uZUZ1bGxDGwhvbmVGdWxsRBwIdHdvRnVsbEEdCHR3b0Z1bGxCHgh0d29GdWxsQx8IdHdvRnVsbEQgCHRyZUZ1bGxBIQh0cmVGdWxsQiIIdHJlRnVsbEMjCHRyZUZ1bGxEJAhxdWFGdWxsQSUIcXVhRnVsbEImCHF1YUZ1bGxDJwhxdWFGdWxsRCgEZ2V0QSkEZ2V0QioEZ2V0QysEZ2V0RCwEZ2V0WC0Ec2V0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),oc=WebAssembly&&zu!==Vu?L2(S2).buffer:!1,ne=N2(),sc=240*16*16,Qu=Math.floor(sc*16*1.066666667),R2=268435456-65536,Ju="Parameter must be Buffer, ArrayBuffer or Uint8Array",F2="Parameter exceeds max size of 255.9 Mbytes";oc||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,o,s,i,a,c,f,h;let u=O2(),l=D2(),d={},A=new Date().getTime();return d.then=function(y){return a=y,p(),d},d.catch=function(y){return c=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(Ju)):E(new TypeError(Ju)),i&&(s=i.length,oc&&s>Qu?s>R2?E(new Error(F2)):(t=new WebAssembly.Memory({initial:s>32e6?s>64e6?s>128e6?4096:2048:1024:512}),r=new Uint32Array(t.buffer),o={mem:t,log:console.log},n={imports:o},WebAssembly.instantiate(oc,n).then(m)):p(u(i))),d;function m(y){p(l(i,y.instance.exports,r))}function p(y){var C=Boolean(y)?y:f;Boolean(y)&&(h=new Date().getTime()),typeof a=="function"?Boolean(C)&&(a(C,h-A),a=c=null):Boolean(y)&&(f=y)}function E(y){typeof c=="function"&&c(y)}}function D2(){var e,t,r,n,o,s,i,a,c,f,h,u,l,d=function(A){var m,p,E,y,C,M,T,I,w,O,x,g,B,_,P,G,U,v,at,mt,X,ke,uo=new Date().getTime(),gr=0,S=1732584193,F=-271733879,R=-1732584194,D=271733878,tt=0,pn=A.length*8,Ao;for(Ao=Jd(A,l),l[pn>>>5]|=128<<pn%32,l[(pn+64>>>9<<4)+14]=pn,Ao=(pn+64>>>9<<4)+15,X=l;tt<Ao;)Ao>tt+Qu?(n(S),s(F),a(R),f(D),t(sc),tt=tt+sc*16,S=r(),F=o(),R=i(),D=c(),gr++):(U=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,O=X[tt+9]>>>0,x=X[tt+10]>>>0,g=X[tt+11]>>>0,B=X[tt+12]>>>0,_=X[tt+13]>>>0,P=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)+O-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)+P-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)+O+568446438)+F,D=N(9,23,D+(S&R|F&~R)+P-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)+P-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)+O-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))+P-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))+O-343485551)+R,tt=tt+16,S=S+U>>>0,F=F+v>>>0,R=R+at>>>0,D=D+mt>>>0);return ne.endian([S,F,R,D]);function N(pt,mo,Xt){return Xt<<pt|Xt>>>mo}function Jd(pt,mo){for(var Xt=-1,Qs=Math.floor((pt.length-1)/4),Bt=0,Vc,jc,Kc,Xc;Qs-8>Xt++;)Bt=Xt<<2,mo[Xt]=pt[Bt+0]|pt[Bt+1]<<8|pt[Bt+2]<<16|pt[Bt+3]<<24;for(Xt--;Qs>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],mo[Xt]=Vc|jc<<8|Kc<<16|Xc<<24;return Qs+1}};return function(A,m,p,E){var y;return t=m.loops,e=m.loop,r=m.getA,o=m.getB,i=m.getC,c=m.getD,h=m.getX,n=m.setA,s=m.setB,a=m.setC,f=m.setD,u=m.setX,l=p,y=ne.wordsToBytes(d(A)),E&&E.asBytes?y:ne.bytesconvertNumberToHex(y)}}function O2(){var e=function(t,r){var n,o,s,i,a,c,f,h,u,l,d,A,m,p,E,y,C,M,T,I,w,O=new Date().getTime(),x=1732584193,g=-271733879,B=-1732584194,_=271733878,P=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[P>>>5]|=128<<P%32,w[(P+64>>>9<<4)+14]=P;for(var U=0;U<w.length;U+=16)C=x,M=g,T=B,I=_,n=w[U+0]>>>0,o=w[U+1]>>>0,s=w[U+2]>>>0,i=w[U+3]>>>0,a=w[U+4]>>>0,c=w[U+5]>>>0,f=w[U+6]>>>0,h=w[U+7]>>>0,u=w[U+8]>>>0,l=w[U+9]>>>0,d=w[U+10]>>>0,A=w[U+11]>>>0,m=w[U+12]>>>0,p=w[U+13]>>>0,E=w[U+14]>>>0,y=w[U+15]>>>0,x=v(7,25,x+(g&B|~g&_)+n-680876936)+g,_=v(12,20,_+(x&g|~x&B)+o-389564586)+x,B=v(17,15,B+(_&x|~_&g)+s+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)+c+1200080426)+x,B=v(17,15,B+(_&x|~_&g)+f-1473231341)+_,g=v(22,10,g+(B&_|~B&x)+h-45705983)+B,x=v(7,25,x+(g&B|~g&_)+u+1770035416)+g,_=v(12,20,_+(x&g|~x&B)+l-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&~_)+o-165796510)+g,_=v(9,23,_+(x&B|g&~B)+f-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&~_)+c-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&~_)+l+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)+u+1163531501)+B,x=v(5,27,x+(g&_|B&~_)+p-1444681467)+g,_=v(9,23,_+(x&B|g&~B)+s-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^_)+c-378558)+g,_=v(11,21,_+(x^g^B)+u-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^_)+o-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)+f+76029189)+B,x=v(4,28,x+(g^B^_)+l-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)+s-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))+c-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))+o-2054922799)+B,x=v(6,26,x+(B^(g|~_))+u+1873313359)+g,_=v(10,22,_+(g^(x|~B))+y-30611744)+x,B=v(15,17,B+(x^(_|~g))+f-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))+s+718787259)+_,g=v(21,11,g+(_^(B|~x))+l-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)),o=r&&r.asBytes?n:ne.bytesconvertNumberToHex(n);return o}}function L2(e){var t,r,n,o=-1;for(t=e.length-1,r=new ArrayBuffer(e.length),n=new Uint8Array(r);t>o++;)n[o]=e.charCodeAt(o);return n}function v2(e){return Buffer.from(e,"base64").toString("binary")}function Vu(e){return e}function N2(){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,o=0;n<t.length;n++,o+=8)r[o>>>5]|=t[n]<<24-o%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 bs{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let o=await new Promise((s,i)=>ic(t).then(s).catch(i));return ku(o,r)}};var nn=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(t={}){xn(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 En(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var Xn=class extends nn{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 Ar=xr(Dd(),1),ye=xr(Od(),1);var mr=class extends nn{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 Tr(ye.default.gzip)(t):await Tr(ye.default.deflate)(t);return yr(r)}return this.compressSync(t)}async decompress(t){if(!Et&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Tr(ye.default.gunzip)(t):await Tr(ye.default.inflate)(t);return yr(r)}return this.decompressSync(t)}compressSync(t){if(!Et&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?ye.default.gzipSync(t):ye.default.deflateSync(t);return yr(s)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?Ar.default.deflateRaw:Ar.default.deflate)(n,r).buffer}decompressSync(t){if(!Et&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?ye.default.gunzipSync(t):ye.default.inflateSync(t);return yr(s)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?Ar.default.inflateRaw:Ar.default.inflate)(n,r).buffer}async*compressBatches(t){let r=this.options?.deflate||{},n=new Ar.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){let r=this.options?.deflate||{},n=new Ar.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),o=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 S_={0:async e=>e,8:async e=>await new mr({raw:!0}).decompress(e)},zs=class{fileProvider=null;fileName;archive=null;constructor(t){if(typeof t=="string")if(this.fileName=t,!Et)this.fileProvider=new Tn(t);else throw new Error("Cannot open file for random access in a WEB browser");else t instanceof pr?(this.fileProvider=t.fileProvider,this.archive=t,this.fileName=t.fileName):qs(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=rn(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 o=await this.getCDFileHeader(t),s=await or(o.localHeaderOffset,this.fileProvider);if(!s)throw new Error("Local file header has not been found in the zip archive`");let i=S_[s.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(s.fileDataOffset,s.fileDataOffset+s.compressedSize);r=await i(a)}let n=new Response(r);return Object.defineProperty(n,"url",{value: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=rn(this.fileProvider),n=null;for await(let o of r)if(o.fileName===t){n=o;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var pr=class{fileProvider;fileName;constructor(t,r,n){this.fileProvider=t,this.fileName=n}async getFileWithoutHash(t){return await(await new zs(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 o=t.getBigUint64(n+16,!0),s=R_(e,n,16);r[s]=o}return r}function R_(e,t,r){return[...new Uint8Array(e,t,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function Jc(e){let t=rn(e);return F_(t)}async function F_(e){let t=new sr,r=new TextEncoder,n={};for await(let o of e){let s=o.fileName.split("\\").join("/").toLocaleLowerCase(),i=r.encode(s).buffer,a=await t.hash(i,"hex");n[a]=o.localHeaderOffset}return n}var D_={0:e=>new Xn().decompress(e),8:e=>new mr({raw:!0}).decompress(e)},mn=class extends pr{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,o=await new sr().hash(n,"hex"),s=this.hashTable[o];if(s===void 0)return null;let i=await or(s,this.fileProvider);if(!i)return null;let a=await this.fileProvider.slice(i.fileDataOffset,i.fileDataOffset+i.compressedSize),c=D_[i.compressionMethod];if(!c)throw Error("Only Deflation compression is supported");r=await c(a)}else r=await this.getFileWithoutHash(t);return r}};var Ld=async(e,t)=>{let r=await Vn(e,Kn),n=await jn(r,e),o;if(n?.fileName!=="@3dtilesIndex1@")o=await Jc(e),t?.("3tz doesnt contain hash file, hash info has been composed according to zip archive headers");else{let s=await or(n.localHeaderOffset,e);if(!s)throw new Error("corrupted 3tz zip archive");let i=s.fileDataOffset,a=await e.slice(i,i+s.compressedSize);o=kc(a)}return new mn(e,o)};var O_="4.3.0-alpha.5",vd={dataType:null,batchType:null,name:"3tz",id:"3tz",module:"3d-tiles",version:O_,mimeTypes:["application/octet-stream","application/vnd.maxar.archive.3tz+zip"],parse:L_,extensions:["3tz"],options:{}};async function L_(e,t={}){return(await Ld(new ze(new DataView(e)))).getFile(t["3d-tiles-archive"]?.path??"")}function Ue(e,t,r){if(!t)return r+12;let{magic:o,version:s=1,byteLength:i=12}=e;return J(Array.isArray(o)&&Number.isFinite(s)&&Number.isFinite(i)),t.setUint8(r+0,o[0]),t.setUint8(r+1,o[1]),t.setUint8(r+2,o[2]),t.setUint8(r+3,o[3]),t.setUint32(r+4,s,!0),t.setUint32(r+8,i,!0),r+=12,r}function He(e,t,r){e&&e.setUint32(t+8,r,!0)}function Nd(e,t,r,n,o){e={magic:Me.COMPOSITE,tiles:[],...e};let s=r;r+=Ue(e,t,r),t&&t.setUint32(r,e.tiles.length,!0),r+=4;for(let i=0;i<e.tiles.length;++i)r+=o(e.tiles[i],t,r,n);return He(t,s,r-s),r}function Gd(e,t,r,n){let{featuresLength:o=0,batchTable:s}=e,a=JSON.stringify({BATCH_LENGTH:o}),c=s?JSON.stringify(s):"",f=bt(a.length,8),h=c?bt(c.length,8):0;e={magic:Me.BATCHED_MODEL,...e};let u=r;r=Ue(e,t,r),t&&(t.setUint32(12,f,!0),t.setUint32(16,0,!0),t.setUint32(20,h,!0),t.setUint32(24,0,!0)),r+=16,r=Eo(t,r,a,8),s&&(r=Eo(t,r,c,8));let l=e.gltfEncoded;return l&&(r=Bn(t,r,l,l.byteLength)),He(t,u,r-u),r}function Pd(e,t,r,n){let{featuresLength:o=1,gltfFormat:s=1,gltfUri:i=""}=e,a=i.length,c={INSTANCES_LENGTH:o,POSITION:new Array(o*3).fill(0)},f=JSON.stringify(c),h=f.length;e={magic:Me.INSTANCED_MODEL,...e};let u=r;return r=Ue(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,s,!0)),r+=20,r+=_r(t,r,f,h),r+=_r(t,r,i,a),He(t,u,r-u),r}var v_={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function Ud(e,t,r,n){let{featureTableJson:o=v_}=e,s=JSON.stringify(o);s=Ys(s,4);let{featureTableJsonByteLength:i=s.length}=e,a=new ArrayBuffer(12),c=a.byteLength;e={magic:Me.POINT_CLOUD,...e};let f=r;return r+=Ue(e,t,0),t&&(t.setUint32(r+0,i,!0),t.setUint32(r+4,c,!0),t.setUint32(r+8,0,!0),t.setUint32(r+12,0,!0)),r+=16,r+=_r(t,r,s,i),r+=Bn(t,r,a,c),He(t,f,r-f),r}function Qc(e,t){let r=zc(e,null,0,t),n=new ArrayBuffer(r),o=new DataView(n);return zc(e,o,0,t),n}function zc(e,t,r,n){switch(J(typeof e.type=="string"),e.type){case _t.COMPOSITE:return Nd(e,t,r,n,zc);case _t.POINT_CLOUD:return Ud(e,t,r,n);case _t.BATCHED_3D_MODEL:return Gd(e,t,r,n);case _t.INSTANCED_3D_MODEL:return Pd(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var kd={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:Rr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],binary:!0,options:{["3d-tiles"]:{}},encode:async(e,t)=>Hd(e,t),encodeSync:Hd};function Hd(e,t){return Qc(e,t)}return Xd(lo);})();
|
|
7
|
+
"use strict";var __exports__=(()=>{var n0=Object.create;var lo=Object.defineProperty;var o0=Object.getOwnPropertyDescriptor;var s0=Object.getOwnPropertyNames;var i0=Object.getPrototypeOf,a0=Object.prototype.hasOwnProperty;var it=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),lt=(t,e)=>{for(var r in e)lo(t,r,{get:e[r],enumerable:!0})},fo=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of s0(e))!a0.call(t,o)&&o!==r&&lo(t,o,{get:()=>e[o],enumerable:!(n=o0(e,o))||n.enumerable});return t},ho=(t,e,r)=>(fo(t,e,"default"),r&&fo(r,e,"default")),mr=(t,e,r)=>(r=t!=null?n0(i0(t)):{},fo(e||!t||!t.__esModule?lo(r,"default",{value:t,enumerable:!0}):r,t)),c0=t=>fo(lo({},"__esModule",{value:!0}),t);var un=it((q_,Lc)=>{Lc.exports=globalThis.loaders});var Ae=it(At=>{"use strict";var qx=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function $x(t,e){return Object.prototype.hasOwnProperty.call(t,e)}At.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)$x(r,n)&&(t[n]=r[n])}}return t};At.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var tE={arraySet:function(t,e,r,n,o){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+n),o);return}for(var s=0;s<n;s++)t[o+s]=e[r+s]},flattenChunks:function(t){var e,r,n,o,s,i;for(n=0,e=0,r=t.length;e<r;e++)n+=t[e].length;for(i=new Uint8Array(n),o=0,e=0,r=t.length;e<r;e++)s=t[e],i.set(s,o),o+=s.length;return i}},eE={arraySet:function(t,e,r,n,o){for(var s=0;s<n;s++)t[o+s]=e[r+s]},flattenChunks:function(t){return[].concat.apply([],t)}};At.setTyped=function(t){t?(At.Buf8=Uint8Array,At.Buf16=Uint16Array,At.Buf32=Int32Array,At.assign(At,tE)):(At.Buf8=Array,At.Buf16=Array,At.Buf32=Array,At.assign(At,eE))};At.setTyped(qx)});var Iu=it(tn=>{"use strict";var rE=Ae(),nE=4,iu=0,au=1,oE=2;function $r(t){for(var e=t.length;--e>=0;)t[e]=0}var sE=0,du=1,iE=2,aE=3,cE=258,qa=29,Zn=256,Vn=Zn+1+qa,qr=30,$a=19,Au=2*Vn+1,nr=15,ja=16,fE=7,tc=256,mu=16,pu=17,gu=18,Ya=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],gs=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],lE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Bu=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],hE=512,me=new Array((Vn+2)*2);$r(me);var Qn=new Array(qr*2);$r(Qn);var jn=new Array(hE);$r(jn);var Kn=new Array(cE-aE+1);$r(Kn);var ec=new Array(qa);$r(ec);var Bs=new Array(qr);$r(Bs);function Ka(t,e,r,n,o){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=n,this.max_length=o,this.has_stree=t&&t.length}var xu,Eu,_u;function Xa(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function yu(t){return t<256?jn[t]:jn[256+(t>>>7)]}function Xn(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}function Ct(t,e,r){t.bi_valid>ja-r?(t.bi_buf|=e<<t.bi_valid&65535,Xn(t,t.bi_buf),t.bi_buf=e>>ja-t.bi_valid,t.bi_valid+=r-ja):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function ee(t,e,r){Ct(t,r[e*2],r[e*2+1])}function Cu(t,e){var r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1}function uE(t){t.bi_valid===16?(Xn(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}function dE(t,e){var r=e.dyn_tree,n=e.max_code,o=e.stat_desc.static_tree,s=e.stat_desc.has_stree,i=e.stat_desc.extra_bits,a=e.stat_desc.extra_base,f=e.stat_desc.max_length,c,l,h,u,d,A,m=0;for(u=0;u<=nr;u++)t.bl_count[u]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<Au;c++)l=t.heap[c],u=r[r[l*2+1]*2+1]+1,u>f&&(u=f,m++),r[l*2+1]=u,!(l>n)&&(t.bl_count[u]++,d=0,l>=a&&(d=i[l-a]),A=r[l*2],t.opt_len+=A*(u+d),s&&(t.static_len+=A*(o[l*2+1]+d)));if(m!==0){do{for(u=f-1;t.bl_count[u]===0;)u--;t.bl_count[u]--,t.bl_count[u+1]+=2,t.bl_count[f]--,m-=2}while(m>0);for(u=f;u!==0;u--)for(l=t.bl_count[u];l!==0;)h=t.heap[--c],!(h>n)&&(r[h*2+1]!==u&&(t.opt_len+=(u-r[h*2+1])*r[h*2],r[h*2+1]=u),l--)}}function Tu(t,e,r){var n=new Array(nr+1),o=0,s,i;for(s=1;s<=nr;s++)n[s]=o=o+r[s-1]<<1;for(i=0;i<=e;i++){var a=t[i*2+1];a!==0&&(t[i*2]=Cu(n[a]++,a))}}function AE(){var t,e,r,n,o,s=new Array(nr+1);for(r=0,n=0;n<qa-1;n++)for(ec[n]=r,t=0;t<1<<Ya[n];t++)Kn[r++]=n;for(Kn[r-1]=n,o=0,n=0;n<16;n++)for(Bs[n]=o,t=0;t<1<<gs[n];t++)jn[o++]=n;for(o>>=7;n<qr;n++)for(Bs[n]=o<<7,t=0;t<1<<gs[n]-7;t++)jn[256+o++]=n;for(e=0;e<=nr;e++)s[e]=0;for(t=0;t<=143;)me[t*2+1]=8,t++,s[8]++;for(;t<=255;)me[t*2+1]=9,t++,s[9]++;for(;t<=279;)me[t*2+1]=7,t++,s[7]++;for(;t<=287;)me[t*2+1]=8,t++,s[8]++;for(Tu(me,Vn+1,s),t=0;t<qr;t++)Qn[t*2+1]=5,Qn[t*2]=Cu(t,5);xu=new Ka(me,Ya,Zn+1,Vn,nr),Eu=new Ka(Qn,gs,0,qr,nr),_u=new Ka(new Array(0),lE,0,$a,fE)}function bu(t){var e;for(e=0;e<Vn;e++)t.dyn_ltree[e*2]=0;for(e=0;e<qr;e++)t.dyn_dtree[e*2]=0;for(e=0;e<$a;e++)t.bl_tree[e*2]=0;t.dyn_ltree[tc*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function Mu(t){t.bi_valid>8?Xn(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function mE(t,e,r,n){Mu(t),n&&(Xn(t,r),Xn(t,~r)),rE.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function cu(t,e,r,n){var o=e*2,s=r*2;return t[o]<t[s]||t[o]===t[s]&&n[e]<=n[r]}function Za(t,e,r){for(var n=t.heap[r],o=r<<1;o<=t.heap_len&&(o<t.heap_len&&cu(e,t.heap[o+1],t.heap[o],t.depth)&&o++,!cu(e,n,t.heap[o],t.depth));)t.heap[r]=t.heap[o],r=o,o<<=1;t.heap[r]=n}function fu(t,e,r){var n,o,s=0,i,a;if(t.last_lit!==0)do n=t.pending_buf[t.d_buf+s*2]<<8|t.pending_buf[t.d_buf+s*2+1],o=t.pending_buf[t.l_buf+s],s++,n===0?ee(t,o,e):(i=Kn[o],ee(t,i+Zn+1,e),a=Ya[i],a!==0&&(o-=ec[i],Ct(t,o,a)),n--,i=yu(n),ee(t,i,r),a=gs[i],a!==0&&(n-=Bs[i],Ct(t,n,a)));while(s<t.last_lit);ee(t,tc,e)}function Wa(t,e){var r=e.dyn_tree,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.elems,i,a,f=-1,c;for(t.heap_len=0,t.heap_max=Au,i=0;i<s;i++)r[i*2]!==0?(t.heap[++t.heap_len]=f=i,t.depth[i]=0):r[i*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=f<2?++f:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,o&&(t.static_len-=n[c*2+1]);for(e.max_code=f,i=t.heap_len>>1;i>=1;i--)Za(t,r,i);c=s;do i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Za(t,r,1),a=t.heap[1],t.heap[--t.heap_max]=i,t.heap[--t.heap_max]=a,r[c*2]=r[i*2]+r[a*2],t.depth[c]=(t.depth[i]>=t.depth[a]?t.depth[i]:t.depth[a])+1,r[i*2+1]=r[a*2+1]=c,t.heap[1]=c++,Za(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],dE(t,e),Tu(r,f,t.bl_count)}function lu(t,e,r){var n,o=-1,s,i=e[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),e[(r+1)*2+1]=65535,n=0;n<=r;n++)s=i,i=e[(n+1)*2+1],!(++a<f&&s===i)&&(a<c?t.bl_tree[s*2]+=a:s!==0?(s!==o&&t.bl_tree[s*2]++,t.bl_tree[mu*2]++):a<=10?t.bl_tree[pu*2]++:t.bl_tree[gu*2]++,a=0,o=s,i===0?(f=138,c=3):s===i?(f=6,c=3):(f=7,c=4))}function hu(t,e,r){var n,o=-1,s,i=e[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),n=0;n<=r;n++)if(s=i,i=e[(n+1)*2+1],!(++a<f&&s===i)){if(a<c)do ee(t,s,t.bl_tree);while(--a!==0);else s!==0?(s!==o&&(ee(t,s,t.bl_tree),a--),ee(t,mu,t.bl_tree),Ct(t,a-3,2)):a<=10?(ee(t,pu,t.bl_tree),Ct(t,a-3,3)):(ee(t,gu,t.bl_tree),Ct(t,a-11,7));a=0,o=s,i===0?(f=138,c=3):s===i?(f=6,c=3):(f=7,c=4)}}function pE(t){var e;for(lu(t,t.dyn_ltree,t.l_desc.max_code),lu(t,t.dyn_dtree,t.d_desc.max_code),Wa(t,t.bl_desc),e=$a-1;e>=3&&t.bl_tree[Bu[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function gE(t,e,r,n){var o;for(Ct(t,e-257,5),Ct(t,r-1,5),Ct(t,n-4,4),o=0;o<n;o++)Ct(t,t.bl_tree[Bu[o]*2+1],3);hu(t,t.dyn_ltree,e-1),hu(t,t.dyn_dtree,r-1)}function BE(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return iu;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return au;for(r=32;r<Zn;r++)if(t.dyn_ltree[r*2]!==0)return au;return iu}var uu=!1;function xE(t){uu||(AE(),uu=!0),t.l_desc=new Xa(t.dyn_ltree,xu),t.d_desc=new Xa(t.dyn_dtree,Eu),t.bl_desc=new Xa(t.bl_tree,_u),t.bi_buf=0,t.bi_valid=0,bu(t)}function wu(t,e,r,n){Ct(t,(sE<<1)+(n?1:0),3),mE(t,e,r,!0)}function EE(t){Ct(t,du<<1,3),ee(t,tc,me),uE(t)}function _E(t,e,r,n){var o,s,i=0;t.level>0?(t.strm.data_type===oE&&(t.strm.data_type=BE(t)),Wa(t,t.l_desc),Wa(t,t.d_desc),i=pE(t),o=t.opt_len+3+7>>>3,s=t.static_len+3+7>>>3,s<=o&&(o=s)):o=s=r+5,r+4<=o&&e!==-1?wu(t,e,r,n):t.strategy===nE||s===o?(Ct(t,(du<<1)+(n?1:0),3),fu(t,me,Qn)):(Ct(t,(iE<<1)+(n?1:0),3),gE(t,t.l_desc.max_code+1,t.d_desc.max_code+1,i+1),fu(t,t.dyn_ltree,t.dyn_dtree)),bu(t),n&&Mu(t)}function yE(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Kn[r]+Zn+1)*2]++,t.dyn_dtree[yu(e)*2]++),t.last_lit===t.lit_bufsize-1}tn._tr_init=xE;tn._tr_stored_block=wu;tn._tr_flush_block=_E;tn._tr_tally=yE;tn._tr_align=EE});var rc=it((gR,Su)=>{"use strict";function CE(t,e,r,n){for(var o=t&65535|0,s=t>>>16&65535|0,i=0;r!==0;){i=r>2e3?2e3:r,r-=i;do o=o+e[n++]|0,s=s+o|0;while(--i);o%=65521,s%=65521}return o|s<<16|0}Su.exports=CE});var nc=it((BR,Fu)=>{"use strict";function TE(){for(var t,e=[],r=0;r<256;r++){t=r;for(var n=0;n<8;n++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}var bE=TE();function ME(t,e,r,n){var o=bE,s=n+r;t^=-1;for(var i=n;i<s;i++)t=t>>>8^o[(t^e[i])&255];return t^-1}Fu.exports=ME});var xs=it((xR,Ru)=>{"use strict";Ru.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var Hu=it(oe=>{"use strict";var mt=Ae(),Gt=Iu(),vu=rc(),Re=nc(),wE=xs(),ar=0,IE=1,SE=3,Ge=4,Du=5,ne=0,Ou=1,Nt=-2,FE=-3,oc=-5,RE=-1,DE=1,Es=2,OE=3,LE=4,vE=0,GE=2,Ts=8,NE=9,UE=15,PE=8,HE=29,kE=256,ic=kE+1+HE,JE=30,zE=19,QE=2*ic+1,VE=15,J=3,Le=258,Vt=Le+J+1,jE=32,bs=42,ac=69,_s=73,ys=91,Cs=103,or=113,Wn=666,st=1,qn=2,sr=3,nn=4,KE=3;function ve(t,e){return t.msg=wE[e],e}function Lu(t){return(t<<1)-(t>4?9:0)}function Oe(t){for(var e=t.length;--e>=0;)t[e]=0}function De(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(mt.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}function ft(t,e){Gt._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,De(t.strm)}function j(t,e){t.pending_buf[t.pending++]=e}function Yn(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}function XE(t,e,r,n){var o=t.avail_in;return o>n&&(o=n),o===0?0:(t.avail_in-=o,mt.arraySet(e,t.input,t.next_in,o,r),t.state.wrap===1?t.adler=vu(t.adler,e,o,r):t.state.wrap===2&&(t.adler=Re(t.adler,e,o,r)),t.next_in+=o,t.total_in+=o,o)}function Gu(t,e){var r=t.max_chain_length,n=t.strstart,o,s,i=t.prev_length,a=t.nice_match,f=t.strstart>t.w_size-Vt?t.strstart-(t.w_size-Vt):0,c=t.window,l=t.w_mask,h=t.prev,u=t.strstart+Le,d=c[n+i-1],A=c[n+i];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do if(o=e,!(c[o+i]!==A||c[o+i-1]!==d||c[o]!==c[n]||c[++o]!==c[n+1])){n+=2,o++;do;while(c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&c[++n]===c[++o]&&n<u);if(s=Le-(u-n),n=u-Le,s>i){if(t.match_start=e,i=s,s>=a)break;d=c[n+i-1],A=c[n+i]}}while((e=h[e&l])>f&&--r!==0);return i<=t.lookahead?i:t.lookahead}function ir(t){var e=t.w_size,r,n,o,s,i;do{if(s=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Vt)){mt.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,n=t.hash_size,r=n;do o=t.head[--r],t.head[r]=o>=e?o-e:0;while(--n);n=e,r=n;do o=t.prev[--r],t.prev[r]=o>=e?o-e:0;while(--n);s+=e}if(t.strm.avail_in===0)break;if(n=XE(t.strm,t.window,t.strstart+t.lookahead,s),t.lookahead+=n,t.lookahead+t.insert>=J)for(i=t.strstart-t.insert,t.ins_h=t.window[i],t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[i+J-1])&t.hash_mask,t.prev[i&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=i,i++,t.insert--,!(t.lookahead+t.insert<J)););}while(t.lookahead<Vt&&t.strm.avail_in!==0)}function ZE(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ir(t),t.lookahead===0&&e===ar)return st;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var n=t.block_start+r;if((t.strstart===0||t.strstart>=n)&&(t.lookahead=t.strstart-n,t.strstart=n,ft(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Vt&&(ft(t,!1),t.strm.avail_out===0))return st}return t.insert=0,e===Ge?(ft(t,!0),t.strm.avail_out===0?sr:nn):(t.strstart>t.block_start&&(ft(t,!1),t.strm.avail_out===0),st)}function sc(t,e){for(var r,n;;){if(t.lookahead<Vt){if(ir(t),t.lookahead<Vt&&e===ar)return st;if(t.lookahead===0)break}if(r=0,t.lookahead>=J&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+J-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Vt&&(t.match_length=Gu(t,r)),t.match_length>=J)if(n=Gt._tr_tally(t,t.strstart-t.match_start,t.match_length-J),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=J){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+J-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else n=Gt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(ft(t,!1),t.strm.avail_out===0))return st}return t.insert=t.strstart<J-1?t.strstart:J-1,e===Ge?(ft(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(ft(t,!1),t.strm.avail_out===0)?st:qn}function en(t,e){for(var r,n,o;;){if(t.lookahead<Vt){if(ir(t),t.lookahead<Vt&&e===ar)return st;if(t.lookahead===0)break}if(r=0,t.lookahead>=J&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+J-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=J-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Vt&&(t.match_length=Gu(t,r),t.match_length<=5&&(t.strategy===DE||t.match_length===J&&t.strstart-t.match_start>4096)&&(t.match_length=J-1)),t.prev_length>=J&&t.match_length<=t.prev_length){o=t.strstart+t.lookahead-J,n=Gt._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-J),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=o&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+J-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=J-1,t.strstart++,n&&(ft(t,!1),t.strm.avail_out===0))return st}else if(t.match_available){if(n=Gt._tr_tally(t,0,t.window[t.strstart-1]),n&&ft(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return st}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(n=Gt._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<J-1?t.strstart:J-1,e===Ge?(ft(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(ft(t,!1),t.strm.avail_out===0)?st:qn}function YE(t,e){for(var r,n,o,s,i=t.window;;){if(t.lookahead<=Le){if(ir(t),t.lookahead<=Le&&e===ar)return st;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=J&&t.strstart>0&&(o=t.strstart-1,n=i[o],n===i[++o]&&n===i[++o]&&n===i[++o])){s=t.strstart+Le;do;while(n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&n===i[++o]&&o<s);t.match_length=Le-(s-o),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=J?(r=Gt._tr_tally(t,1,t.match_length-J),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Gt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(ft(t,!1),t.strm.avail_out===0))return st}return t.insert=0,e===Ge?(ft(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(ft(t,!1),t.strm.avail_out===0)?st:qn}function WE(t,e){for(var r;;){if(t.lookahead===0&&(ir(t),t.lookahead===0)){if(e===ar)return st;break}if(t.match_length=0,r=Gt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(ft(t,!1),t.strm.avail_out===0))return st}return t.insert=0,e===Ge?(ft(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(ft(t,!1),t.strm.avail_out===0)?st:qn}function re(t,e,r,n,o){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=n,this.func=o}var rn;rn=[new re(0,0,0,0,ZE),new re(4,4,8,4,sc),new re(4,5,16,8,sc),new re(4,6,32,32,sc),new re(4,4,16,16,en),new re(8,16,32,32,en),new re(8,16,128,128,en),new re(8,32,128,256,en),new re(32,128,258,1024,en),new re(32,258,258,4096,en)];function qE(t){t.window_size=2*t.w_size,Oe(t.head),t.max_lazy_match=rn[t.level].max_lazy,t.good_match=rn[t.level].good_length,t.nice_match=rn[t.level].nice_length,t.max_chain_length=rn[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=J-1,t.match_available=0,t.ins_h=0}function $E(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Ts,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new mt.Buf16(QE*2),this.dyn_dtree=new mt.Buf16((2*JE+1)*2),this.bl_tree=new mt.Buf16((2*zE+1)*2),Oe(this.dyn_ltree),Oe(this.dyn_dtree),Oe(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new mt.Buf16(VE+1),this.heap=new mt.Buf16(2*ic+1),Oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new mt.Buf16(2*ic+1),Oe(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Nu(t){var e;return!t||!t.state?ve(t,Nt):(t.total_in=t.total_out=0,t.data_type=GE,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?bs:or,t.adler=e.wrap===2?0:1,e.last_flush=ar,Gt._tr_init(e),ne)}function Uu(t){var e=Nu(t);return e===ne&&qE(t.state),e}function t_(t,e){return!t||!t.state||t.state.wrap!==2?Nt:(t.state.gzhead=e,ne)}function Pu(t,e,r,n,o,s){if(!t)return Nt;var i=1;if(e===RE&&(e=6),n<0?(i=0,n=-n):n>15&&(i=2,n-=16),o<1||o>NE||r!==Ts||n<8||n>15||e<0||e>9||s<0||s>LE)return ve(t,Nt);n===8&&(n=9);var a=new $E;return t.state=a,a.strm=t,a.wrap=i,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=o+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+J-1)/J),a.window=new mt.Buf8(a.w_size*2),a.head=new mt.Buf16(a.hash_size),a.prev=new mt.Buf16(a.w_size),a.lit_bufsize=1<<o+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new mt.Buf8(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=(1+2)*a.lit_bufsize,a.level=e,a.strategy=s,a.method=r,Uu(t)}function e_(t,e){return Pu(t,e,Ts,UE,PE,vE)}function r_(t,e){var r,n,o,s;if(!t||!t.state||e>Du||e<0)return t?ve(t,Nt):Nt;if(n=t.state,!t.output||!t.input&&t.avail_in!==0||n.status===Wn&&e!==Ge)return ve(t,t.avail_out===0?oc:Nt);if(n.strm=t,r=n.last_flush,n.last_flush=e,n.status===bs)if(n.wrap===2)t.adler=0,j(n,31),j(n,139),j(n,8),n.gzhead?(j(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),j(n,n.gzhead.time&255),j(n,n.gzhead.time>>8&255),j(n,n.gzhead.time>>16&255),j(n,n.gzhead.time>>24&255),j(n,n.level===9?2:n.strategy>=Es||n.level<2?4:0),j(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(j(n,n.gzhead.extra.length&255),j(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(t.adler=Re(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=ac):(j(n,0),j(n,0),j(n,0),j(n,0),j(n,0),j(n,n.level===9?2:n.strategy>=Es||n.level<2?4:0),j(n,KE),n.status=or);else{var i=Ts+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=Es||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=jE),i+=31-i%31,n.status=or,Yn(n,i),n.strstart!==0&&(Yn(n,t.adler>>>16),Yn(n,t.adler&65535)),t.adler=1}if(n.status===ac)if(n.gzhead.extra){for(o=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),De(t),o=n.pending,n.pending===n.pending_buf_size));)j(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=_s)}else n.status=_s;if(n.status===_s)if(n.gzhead.name){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),De(t),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.name.length?s=n.gzhead.name.charCodeAt(n.gzindex++)&255:s=0,j(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.gzindex=0,n.status=ys)}else n.status=ys;if(n.status===ys)if(n.gzhead.comment){o=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),De(t),o=n.pending,n.pending===n.pending_buf_size)){s=1;break}n.gzindex<n.gzhead.comment.length?s=n.gzhead.comment.charCodeAt(n.gzindex++)&255:s=0,j(n,s)}while(s!==0);n.gzhead.hcrc&&n.pending>o&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),s===0&&(n.status=Cs)}else n.status=Cs;if(n.status===Cs&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&De(t),n.pending+2<=n.pending_buf_size&&(j(n,t.adler&255),j(n,t.adler>>8&255),t.adler=0,n.status=or)):n.status=or),n.pending!==0){if(De(t),t.avail_out===0)return n.last_flush=-1,ne}else if(t.avail_in===0&&Lu(e)<=Lu(r)&&e!==Ge)return ve(t,oc);if(n.status===Wn&&t.avail_in!==0)return ve(t,oc);if(t.avail_in!==0||n.lookahead!==0||e!==ar&&n.status!==Wn){var f=n.strategy===Es?WE(n,e):n.strategy===OE?YE(n,e):rn[n.level].func(n,e);if((f===sr||f===nn)&&(n.status=Wn),f===st||f===sr)return t.avail_out===0&&(n.last_flush=-1),ne;if(f===qn&&(e===IE?Gt._tr_align(n):e!==Du&&(Gt._tr_stored_block(n,0,0,!1),e===SE&&(Oe(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),De(t),t.avail_out===0))return n.last_flush=-1,ne}return e!==Ge?ne:n.wrap<=0?Ou:(n.wrap===2?(j(n,t.adler&255),j(n,t.adler>>8&255),j(n,t.adler>>16&255),j(n,t.adler>>24&255),j(n,t.total_in&255),j(n,t.total_in>>8&255),j(n,t.total_in>>16&255),j(n,t.total_in>>24&255)):(Yn(n,t.adler>>>16),Yn(n,t.adler&65535)),De(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?ne:Ou)}function n_(t){var e;return!t||!t.state?Nt:(e=t.state.status,e!==bs&&e!==ac&&e!==_s&&e!==ys&&e!==Cs&&e!==or&&e!==Wn?ve(t,Nt):(t.state=null,e===or?ve(t,FE):ne))}function o_(t,e){var r=e.length,n,o,s,i,a,f,c,l;if(!t||!t.state||(n=t.state,i=n.wrap,i===2||i===1&&n.status!==bs||n.lookahead))return Nt;for(i===1&&(t.adler=vu(t.adler,e,r,0)),n.wrap=0,r>=n.w_size&&(i===0&&(Oe(n.head),n.strstart=0,n.block_start=0,n.insert=0),l=new mt.Buf8(n.w_size),mt.arraySet(l,e,r-n.w_size,n.w_size,0),e=l,r=n.w_size),a=t.avail_in,f=t.next_in,c=t.input,t.avail_in=r,t.next_in=0,t.input=e,ir(n);n.lookahead>=J;){o=n.strstart,s=n.lookahead-(J-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[o+J-1])&n.hash_mask,n.prev[o&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=o,o++;while(--s);n.strstart=o,n.lookahead=J-1,ir(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=J-1,n.match_available=0,t.next_in=f,t.input=c,t.avail_in=a,n.wrap=i,ne}oe.deflateInit=e_;oe.deflateInit2=Pu;oe.deflateReset=Uu;oe.deflateResetKeep=Nu;oe.deflateSetHeader=t_;oe.deflate=r_;oe.deflateEnd=n_;oe.deflateSetDictionary=o_;oe.deflateInfo="pako deflate (from Nodeca project)"});var cc=it(on=>{"use strict";var Ms=Ae(),ku=!0,Ju=!0;try{String.fromCharCode.apply(null,[0])}catch{ku=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{Ju=!1}var $n=new Ms.Buf8(256);for(pe=0;pe<256;pe++)$n[pe]=pe>=252?6:pe>=248?5:pe>=240?4:pe>=224?3:pe>=192?2:1;var pe;$n[254]=$n[254]=1;on.string2buf=function(t){var e,r,n,o,s,i=t.length,a=0;for(o=0;o<i;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Ms.Buf8(a),s=0,o=0;s<a;o++)r=t.charCodeAt(o),(r&64512)===55296&&o+1<i&&(n=t.charCodeAt(o+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),o++)),r<128?e[s++]=r:r<2048?(e[s++]=192|r>>>6,e[s++]=128|r&63):r<65536?(e[s++]=224|r>>>12,e[s++]=128|r>>>6&63,e[s++]=128|r&63):(e[s++]=240|r>>>18,e[s++]=128|r>>>12&63,e[s++]=128|r>>>6&63,e[s++]=128|r&63);return e};function zu(t,e){if(e<65534&&(t.subarray&&Ju||!t.subarray&&ku))return String.fromCharCode.apply(null,Ms.shrinkBuf(t,e));for(var r="",n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r}on.buf2binstring=function(t){return zu(t,t.length)};on.binstring2buf=function(t){for(var e=new Ms.Buf8(t.length),r=0,n=e.length;r<n;r++)e[r]=t.charCodeAt(r);return e};on.buf2string=function(t,e){var r,n,o,s,i=e||t.length,a=new Array(i*2);for(n=0,r=0;r<i;){if(o=t[r++],o<128){a[n++]=o;continue}if(s=$n[o],s>4){a[n++]=65533,r+=s-1;continue}for(o&=s===2?31:s===3?15:7;s>1&&r<i;)o=o<<6|t[r++]&63,s--;if(s>1){a[n++]=65533;continue}o<65536?a[n++]=o:(o-=65536,a[n++]=55296|o>>10&1023,a[n++]=56320|o&1023)}return zu(a,n)};on.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+$n[t[r]]>e?r:e}});var fc=it((yR,Qu)=>{"use strict";function s_(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}Qu.exports=s_});var Xu=it(ro=>{"use strict";var to=Hu(),eo=Ae(),hc=cc(),uc=xs(),i_=fc(),Ku=Object.prototype.toString,a_=0,lc=4,sn=0,Vu=1,ju=2,c_=-1,f_=0,l_=8;function cr(t){if(!(this instanceof cr))return new cr(t);this.options=eo.assign({level:c_,method:l_,chunkSize:16384,windowBits:15,memLevel:8,strategy:f_,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new i_,this.strm.avail_out=0;var r=to.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==sn)throw new Error(uc[r]);if(e.header&&to.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(typeof e.dictionary=="string"?n=hc.string2buf(e.dictionary):Ku.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=to.deflateSetDictionary(this.strm,n),r!==sn)throw new Error(uc[r]);this._dict_set=!0}}cr.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o,s;if(this.ended)return!1;s=e===~~e?e:e===!0?lc:a_,typeof t=="string"?r.input=hc.string2buf(t):Ku.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new eo.Buf8(n),r.next_out=0,r.avail_out=n),o=to.deflate(r,s),o!==Vu&&o!==sn)return this.onEnd(o),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(s===lc||s===ju))&&(this.options.to==="string"?this.onData(hc.buf2binstring(eo.shrinkBuf(r.output,r.next_out))):this.onData(eo.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&o!==Vu);return s===lc?(o=to.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===sn):(s===ju&&(this.onEnd(sn),r.avail_out=0),!0)};cr.prototype.onData=function(t){this.chunks.push(t)};cr.prototype.onEnd=function(t){t===sn&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=eo.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function dc(t,e){var r=new cr(e);if(r.push(t,!0),r.err)throw r.msg||uc[r.err];return r.result}function h_(t,e){return e=e||{},e.raw=!0,dc(t,e)}function u_(t,e){return e=e||{},e.gzip=!0,dc(t,e)}ro.Deflate=cr;ro.deflate=dc;ro.deflateRaw=h_;ro.gzip=u_});var Yu=it((TR,Zu)=>{"use strict";var ws=30,d_=12;Zu.exports=function(e,r){var n,o,s,i,a,f,c,l,h,u,d,A,m,p,E,y,T,b,C,w,I,O,B,g,x;n=e.state,o=e.next_in,g=e.input,s=o+(e.avail_in-5),i=e.next_out,x=e.output,a=i-(r-e.avail_out),f=i+(e.avail_out-257),c=n.dmax,l=n.wsize,h=n.whave,u=n.wnext,d=n.window,A=n.hold,m=n.bits,p=n.lencode,E=n.distcode,y=(1<<n.lenbits)-1,T=(1<<n.distbits)-1;t:do{m<15&&(A+=g[o++]<<m,m+=8,A+=g[o++]<<m,m+=8),b=p[A&y];e:for(;;){if(C=b>>>24,A>>>=C,m-=C,C=b>>>16&255,C===0)x[i++]=b&65535;else if(C&16){w=b&65535,C&=15,C&&(m<C&&(A+=g[o++]<<m,m+=8),w+=A&(1<<C)-1,A>>>=C,m-=C),m<15&&(A+=g[o++]<<m,m+=8,A+=g[o++]<<m,m+=8),b=E[A&T];r:for(;;){if(C=b>>>24,A>>>=C,m-=C,C=b>>>16&255,C&16){if(I=b&65535,C&=15,m<C&&(A+=g[o++]<<m,m+=8,m<C&&(A+=g[o++]<<m,m+=8)),I+=A&(1<<C)-1,I>c){e.msg="invalid distance too far back",n.mode=ws;break t}if(A>>>=C,m-=C,C=i-a,I>C){if(C=I-C,C>h&&n.sane){e.msg="invalid distance too far back",n.mode=ws;break t}if(O=0,B=d,u===0){if(O+=l-C,C<w){w-=C;do x[i++]=d[O++];while(--C);O=i-I,B=x}}else if(u<C){if(O+=l+u-C,C-=u,C<w){w-=C;do x[i++]=d[O++];while(--C);if(O=0,u<w){C=u,w-=C;do x[i++]=d[O++];while(--C);O=i-I,B=x}}}else if(O+=u-C,C<w){w-=C;do x[i++]=d[O++];while(--C);O=i-I,B=x}for(;w>2;)x[i++]=B[O++],x[i++]=B[O++],x[i++]=B[O++],w-=3;w&&(x[i++]=B[O++],w>1&&(x[i++]=B[O++]))}else{O=i-I;do x[i++]=x[O++],x[i++]=x[O++],x[i++]=x[O++],w-=3;while(w>2);w&&(x[i++]=x[O++],w>1&&(x[i++]=x[O++]))}}else if(C&64){e.msg="invalid distance code",n.mode=ws;break t}else{b=E[(b&65535)+(A&(1<<C)-1)];continue r}break}}else if(C&64)if(C&32){n.mode=d_;break t}else{e.msg="invalid literal/length code",n.mode=ws;break t}else{b=p[(b&65535)+(A&(1<<C)-1)];continue e}break}}while(o<s&&i<f);w=m>>3,o-=w,m-=w<<3,A&=(1<<m)-1,e.next_in=o,e.next_out=i,e.avail_in=o<s?5+(s-o):5-(o-s),e.avail_out=i<f?257+(f-i):257-(i-f),n.hold=A,n.bits=m}});var nd=it((bR,rd)=>{"use strict";var Wu=Ae(),an=15,qu=852,$u=592,td=0,Ac=1,ed=2,A_=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],m_=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],p_=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],g_=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];rd.exports=function(e,r,n,o,s,i,a,f){var c=f.bits,l=0,h=0,u=0,d=0,A=0,m=0,p=0,E=0,y=0,T=0,b,C,w,I,O,B=null,g=0,x,_=new Wu.Buf16(an+1),U=new Wu.Buf16(an+1),N=null,P=0,v,tt,pt;for(l=0;l<=an;l++)_[l]=0;for(h=0;h<o;h++)_[r[n+h]]++;for(A=c,d=an;d>=1&&_[d]===0;d--);if(A>d&&(A=d),d===0)return s[i++]=1<<24|64<<16|0,s[i++]=1<<24|64<<16|0,f.bits=1,0;for(u=1;u<d&&_[u]===0;u++);for(A<u&&(A=u),E=1,l=1;l<=an;l++)if(E<<=1,E-=_[l],E<0)return-1;if(E>0&&(e===td||d!==1))return-1;for(U[1]=0,l=1;l<an;l++)U[l+1]=U[l]+_[l];for(h=0;h<o;h++)r[n+h]!==0&&(a[U[r[n+h]]++]=h);if(e===td?(B=N=a,x=19):e===Ac?(B=A_,g-=257,N=m_,P-=257,x=256):(B=p_,N=g_,x=-1),T=0,h=0,l=u,O=i,m=A,p=0,w=-1,y=1<<A,I=y-1,e===Ac&&y>qu||e===ed&&y>$u)return 1;for(;;){v=l-p,a[h]<x?(tt=0,pt=a[h]):a[h]>x?(tt=N[P+a[h]],pt=B[g+a[h]]):(tt=32+64,pt=0),b=1<<l-p,C=1<<m,u=C;do C-=b,s[O+(T>>p)+C]=v<<24|tt<<16|pt|0;while(C!==0);for(b=1<<l-1;T&b;)b>>=1;if(b!==0?(T&=b-1,T+=b):T=0,h++,--_[l]===0){if(l===d)break;l=r[n+a[h]]}if(l>A&&(T&I)!==w){for(p===0&&(p=A),O+=u,m=l-p,E=1<<m;m+p<d&&(E-=_[m+p],!(E<=0));)m++,E<<=1;if(y+=1<<m,e===Ac&&y>qu||e===ed&&y>$u)return 1;w=T&I,s[w]=A<<24|m<<16|O-i|0}}return T!==0&&(s[O+T]=l-p<<24|64<<16|0),f.bits=A,0}});var Ud=it(jt=>{"use strict";var wt=Ae(),Ec=rc(),se=nc(),B_=Yu(),no=nd(),x_=0,Sd=1,Fd=2,od=4,E_=5,Is=6,fr=0,__=1,y_=2,Ut=-2,Rd=-3,_c=-4,C_=-5,sd=8,Dd=1,id=2,ad=3,cd=4,fd=5,ld=6,hd=7,ud=8,dd=9,Ad=10,Rs=11,ge=12,mc=13,md=14,pc=15,pd=16,gd=17,Bd=18,xd=19,Ss=20,Fs=21,Ed=22,_d=23,yd=24,Cd=25,Td=26,gc=27,bd=28,Md=29,$=30,yc=31,T_=32,b_=852,M_=592,w_=15,I_=w_;function wd(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function S_(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new wt.Buf16(320),this.work=new wt.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Od(t){var e;return!t||!t.state?Ut:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=Dd,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new wt.Buf32(b_),e.distcode=e.distdyn=new wt.Buf32(M_),e.sane=1,e.back=-1,fr)}function Ld(t){var e;return!t||!t.state?Ut:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,Od(t))}function vd(t,e){var r,n;return!t||!t.state||(n=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?Ut:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,Ld(t))}function Gd(t,e){var r,n;return t?(n=new S_,t.state=n,n.window=null,r=vd(t,e),r!==fr&&(t.state=null),r):Ut}function F_(t){return Gd(t,I_)}var Id=!0,Bc,xc;function R_(t){if(Id){var e;for(Bc=new wt.Buf32(512),xc=new wt.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(no(Sd,t.lens,0,288,Bc,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;no(Fd,t.lens,0,32,xc,0,t.work,{bits:5}),Id=!1}t.lencode=Bc,t.lenbits=9,t.distcode=xc,t.distbits=5}function Nd(t,e,r,n){var o,s=t.state;return s.window===null&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new wt.Buf8(s.wsize)),n>=s.wsize?(wt.arraySet(s.window,e,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):(o=s.wsize-s.wnext,o>n&&(o=n),wt.arraySet(s.window,e,r-n,o,s.wnext),n-=o,n?(wt.arraySet(s.window,e,r-n,n,0),s.wnext=n,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=o))),0}function D_(t,e){var r,n,o,s,i,a,f,c,l,h,u,d,A,m,p=0,E,y,T,b,C,w,I,O,B=new wt.Buf8(4),g,x,_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0)return Ut;r=t.state,r.mode===ge&&(r.mode=mc),i=t.next_out,o=t.output,f=t.avail_out,s=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,h=a,u=f,O=fr;t:for(;;)switch(r.mode){case Dd:if(r.wrap===0){r.mode=mc;break}for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.wrap&2&&c===35615){r.check=0,B[0]=c&255,B[1]=c>>>8&255,r.check=se(r.check,B,2,0),c=0,l=0,r.mode=id;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=$;break}if((c&15)!==sd){t.msg="unknown compression method",r.mode=$;break}if(c>>>=4,l-=4,I=(c&15)+8,r.wbits===0)r.wbits=I;else if(I>r.wbits){t.msg="invalid window size",r.mode=$;break}r.dmax=1<<I,t.adler=r.check=1,r.mode=c&512?Ad:ge,c=0,l=0;break;case id:for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==sd){t.msg="unknown compression method",r.mode=$;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=$;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,r.check=se(r.check,B,2,0)),c=0,l=0,r.mode=ad;case ad:for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.head&&(r.head.time=c),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,B[2]=c>>>16&255,B[3]=c>>>24&255,r.check=se(r.check,B,4,0)),c=0,l=0,r.mode=cd;case cd:for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,r.check=se(r.check,B,2,0)),c=0,l=0,r.mode=fd;case fd:if(r.flags&1024){for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,r.check=se(r.check,B,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=ld;case ld:if(r.flags&1024&&(d=r.length,d>a&&(d=a),d&&(r.head&&(I=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),wt.arraySet(r.head.extra,n,s,d,I)),r.flags&512&&(r.check=se(r.check,n,d,s)),a-=d,s+=d,r.length-=d),r.length))break t;r.length=0,r.mode=hd;case hd:if(r.flags&2048){if(a===0)break t;d=0;do I=n[s+d++],r.head&&I&&r.length<65536&&(r.head.name+=String.fromCharCode(I));while(I&&d<a);if(r.flags&512&&(r.check=se(r.check,n,d,s)),a-=d,s+=d,I)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=ud;case ud:if(r.flags&4096){if(a===0)break t;d=0;do I=n[s+d++],r.head&&I&&r.length<65536&&(r.head.comment+=String.fromCharCode(I));while(I&&d<a);if(r.flags&512&&(r.check=se(r.check,n,d,s)),a-=d,s+=d,I)break t}else r.head&&(r.head.comment=null);r.mode=dd;case dd:if(r.flags&512){for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=$;break}c=0,l=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=ge;break;case Ad:for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}t.adler=r.check=wd(c),c=0,l=0,r.mode=Rs;case Rs:if(r.havedict===0)return t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,y_;t.adler=r.check=1,r.mode=ge;case ge:if(e===E_||e===Is)break t;case mc:if(r.last){c>>>=l&7,l-=l&7,r.mode=gc;break}for(;l<3;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}switch(r.last=c&1,c>>>=1,l-=1,c&3){case 0:r.mode=md;break;case 1:if(R_(r),r.mode=Ss,e===Is){c>>>=2,l-=2;break t}break;case 2:r.mode=gd;break;case 3:t.msg="invalid block type",r.mode=$}c>>>=2,l-=2;break;case md:for(c>>>=l&7,l-=l&7;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=$;break}if(r.length=c&65535,c=0,l=0,r.mode=pc,e===Is)break t;case pc:r.mode=pd;case pd:if(d=r.length,d){if(d>a&&(d=a),d>f&&(d=f),d===0)break t;wt.arraySet(o,n,s,d,i),a-=d,s+=d,f-=d,i+=d,r.length-=d;break}r.mode=ge;break;case gd:for(;l<14;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.nlen=(c&31)+257,c>>>=5,l-=5,r.ndist=(c&31)+1,c>>>=5,l-=5,r.ncode=(c&15)+4,c>>>=4,l-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=$;break}r.have=0,r.mode=Bd;case Bd:for(;r.have<r.ncode;){for(;l<3;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.lens[_[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[_[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,g={bits:r.lenbits},O=no(x_,r.lens,0,19,r.lencode,0,r.work,g),r.lenbits=g.bits,O){t.msg="invalid code lengths set",r.mode=$;break}r.have=0,r.mode=xd;case xd:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[c&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,T=p&65535,!(E<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(T<16)c>>>=E,l-=E,r.lens[r.have++]=T;else{if(T===16){for(x=E+2;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c>>>=E,l-=E,r.have===0){t.msg="invalid bit length repeat",r.mode=$;break}I=r.lens[r.have-1],d=3+(c&3),c>>>=2,l-=2}else if(T===17){for(x=E+3;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=E,l-=E,I=0,d=3+(c&7),c>>>=3,l-=3}else{for(x=E+7;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=E,l-=E,I=0,d=11+(c&127),c>>>=7,l-=7}if(r.have+d>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=$;break}for(;d--;)r.lens[r.have++]=I}}if(r.mode===$)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=$;break}if(r.lenbits=9,g={bits:r.lenbits},O=no(Sd,r.lens,0,r.nlen,r.lencode,0,r.work,g),r.lenbits=g.bits,O){t.msg="invalid literal/lengths set",r.mode=$;break}if(r.distbits=6,r.distcode=r.distdyn,g={bits:r.distbits},O=no(Fd,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,g),r.distbits=g.bits,O){t.msg="invalid distances set",r.mode=$;break}if(r.mode=Ss,e===Is)break t;case Ss:r.mode=Fs;case Fs:if(a>=6&&f>=258){t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,B_(t,u),i=t.next_out,o=t.output,f=t.avail_out,s=t.next_in,n=t.input,a=t.avail_in,c=r.hold,l=r.bits,r.mode===ge&&(r.back=-1);break}for(r.back=0;p=r.lencode[c&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,T=p&65535,!(E<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(y&&!(y&240)){for(b=E,C=y,w=T;p=r.lencode[w+((c&(1<<b+C)-1)>>b)],E=p>>>24,y=p>>>16&255,T=p&65535,!(b+E<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=E,l-=E,r.back+=E,r.length=T,y===0){r.mode=Td;break}if(y&32){r.back=-1,r.mode=ge;break}if(y&64){t.msg="invalid literal/length code",r.mode=$;break}r.extra=y&15,r.mode=Ed;case Ed:if(r.extra){for(x=r.extra;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=_d;case _d:for(;p=r.distcode[c&(1<<r.distbits)-1],E=p>>>24,y=p>>>16&255,T=p&65535,!(E<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(!(y&240)){for(b=E,C=y,w=T;p=r.distcode[w+((c&(1<<b+C)-1)>>b)],E=p>>>24,y=p>>>16&255,T=p&65535,!(b+E<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=E,l-=E,r.back+=E,y&64){t.msg="invalid distance code",r.mode=$;break}r.offset=T,r.extra=y&15,r.mode=yd;case yd:if(r.extra){for(x=r.extra;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,l-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=$;break}r.mode=Cd;case Cd:if(f===0)break t;if(d=u-f,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=$;break}d>r.wnext?(d-=r.wnext,A=r.wsize-d):A=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=o,A=i-r.offset,d=r.length;d>f&&(d=f),f-=d,r.length-=d;do o[i++]=m[A++];while(--d);r.length===0&&(r.mode=Fs);break;case Td:if(f===0)break t;o[i++]=r.length,f--,r.mode=Fs;break;case gc:if(r.wrap){for(;l<32;){if(a===0)break t;a--,c|=n[s++]<<l,l+=8}if(u-=f,t.total_out+=u,r.total+=u,u&&(t.adler=r.check=r.flags?se(r.check,o,u,i-u):Ec(r.check,o,u,i-u)),u=f,(r.flags?c:wd(c))!==r.check){t.msg="incorrect data check",r.mode=$;break}c=0,l=0}r.mode=bd;case bd:if(r.wrap&&r.flags){for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=$;break}c=0,l=0}r.mode=Md;case Md:O=__;break t;case $:O=Rd;break t;case yc:return _c;case T_:default:return Ut}return t.next_out=i,t.avail_out=f,t.next_in=s,t.avail_in=a,r.hold=c,r.bits=l,(r.wsize||u!==t.avail_out&&r.mode<$&&(r.mode<gc||e!==od))&&Nd(t,t.output,t.next_out,u-t.avail_out)?(r.mode=yc,_c):(h-=t.avail_in,u-=t.avail_out,t.total_in+=h,t.total_out+=u,r.total+=u,r.wrap&&u&&(t.adler=r.check=r.flags?se(r.check,o,u,t.next_out-u):Ec(r.check,o,u,t.next_out-u)),t.data_type=r.bits+(r.last?64:0)+(r.mode===ge?128:0)+(r.mode===Ss||r.mode===pc?256:0),(h===0&&u===0||e===od)&&O===fr&&(O=C_),O)}function O_(t){if(!t||!t.state)return Ut;var e=t.state;return e.window&&(e.window=null),t.state=null,fr}function L_(t,e){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?Ut:(r.head=e,e.done=!1,fr)}function v_(t,e){var r=e.length,n,o,s;return!t||!t.state||(n=t.state,n.wrap!==0&&n.mode!==Rs)?Ut:n.mode===Rs&&(o=1,o=Ec(o,e,r,0),o!==n.check)?Rd:(s=Nd(t,e,r,r),s?(n.mode=yc,_c):(n.havedict=1,fr))}jt.inflateReset=Ld;jt.inflateReset2=vd;jt.inflateResetKeep=Od;jt.inflateInit=F_;jt.inflateInit2=Gd;jt.inflate=D_;jt.inflateEnd=O_;jt.inflateGetHeader=L_;jt.inflateSetDictionary=v_;jt.inflateInfo="pako inflate (from Nodeca project)"});var Cc=it((wR,Pd)=>{"use strict";Pd.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var kd=it((IR,Hd)=>{"use strict";function G_(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Hd.exports=G_});var zd=it(so=>{"use strict";var cn=Ud(),oo=Ae(),Ds=cc(),nt=Cc(),Tc=xs(),N_=fc(),U_=kd(),Jd=Object.prototype.toString;function lr(t){if(!(this instanceof lr))return new lr(t);this.options=oo.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new N_,this.strm.avail_out=0;var r=cn.inflateInit2(this.strm,e.windowBits);if(r!==nt.Z_OK)throw new Error(Tc[r]);if(this.header=new U_,cn.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Ds.string2buf(e.dictionary):Jd.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=cn.inflateSetDictionary(this.strm,e.dictionary),r!==nt.Z_OK)))throw new Error(Tc[r])}lr.prototype.push=function(t,e){var r=this.strm,n=this.options.chunkSize,o=this.options.dictionary,s,i,a,f,c,l=!1;if(this.ended)return!1;i=e===~~e?e:e===!0?nt.Z_FINISH:nt.Z_NO_FLUSH,typeof t=="string"?r.input=Ds.binstring2buf(t):Jd.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new oo.Buf8(n),r.next_out=0,r.avail_out=n),s=cn.inflate(r,nt.Z_NO_FLUSH),s===nt.Z_NEED_DICT&&o&&(s=cn.inflateSetDictionary(this.strm,o)),s===nt.Z_BUF_ERROR&&l===!0&&(s=nt.Z_OK,l=!1),s!==nt.Z_STREAM_END&&s!==nt.Z_OK)return this.onEnd(s),this.ended=!0,!1;r.next_out&&(r.avail_out===0||s===nt.Z_STREAM_END||r.avail_in===0&&(i===nt.Z_FINISH||i===nt.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=Ds.utf8border(r.output,r.next_out),f=r.next_out-a,c=Ds.buf2string(r.output,a),r.next_out=f,r.avail_out=n-f,f&&oo.arraySet(r.output,r.output,a,f,0),this.onData(c)):this.onData(oo.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(l=!0)}while((r.avail_in>0||r.avail_out===0)&&s!==nt.Z_STREAM_END);return s===nt.Z_STREAM_END&&(i=nt.Z_FINISH),i===nt.Z_FINISH?(s=cn.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===nt.Z_OK):(i===nt.Z_SYNC_FLUSH&&(this.onEnd(nt.Z_OK),r.avail_out=0),!0)};lr.prototype.onData=function(t){this.chunks.push(t)};lr.prototype.onEnd=function(t){t===nt.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=oo.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function bc(t,e){var r=new lr(e);if(r.push(t,!0),r.err)throw r.msg||Tc[r.err];return r.result}function P_(t,e){return e=e||{},e.raw=!0,bc(t,e)}so.Inflate=lr;so.inflate=bc;so.inflateRaw=P_;so.ungzip=bc});var jd=it((FR,Vd)=>{"use strict";var H_=Ae().assign,k_=Xu(),J_=zd(),z_=Cc(),Qd={};H_(Qd,k_,J_,z_);Vd.exports=Qd});var Kd=it(()=>{});var io={};lt(io,{CesiumIonLoader:()=>ka,TILE3D_TYPE:()=>xt,Tile3DBatchTable:()=>ue,Tile3DFeatureTable:()=>kt,Tile3DSubtreeLoader:()=>Jr,Tile3DWriter:()=>e0,Tiles3DArchive:()=>fn,Tiles3DArchiveFileLoader:()=>Zd,Tiles3DLoader:()=>tr,_getIonTilesetMetadata:()=>ds});ho(io,mr(un(),1));async function Pt(t,e,r,n){return n._parse(t,e,r,n)}function z(t,e){if(!t)throw new Error(e||"loader assertion failed.")}var Xt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},f0=Xt.self||Xt.window||Xt.global||{},l0=Xt.window||Xt.self||Xt.global||{},h0=Xt.global||Xt.self||Xt.window||{},u0=Xt.document||{};var Bt=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var vc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),d0=vc&&parseFloat(vc[1])||0;function dn(t){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,t)}function vs(t){return globalThis.loaders?.modules?.[t]||null}function A0(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.3.0-alpha.7"),globalThis._loadersgl_.version}var Gc=A0();function Nc(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var Zt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},s2=Zt.self||Zt.window||Zt.global||{},i2=Zt.window||Zt.self||Zt.global||{},a2=Zt.global||Zt.self||Zt.window||{},c2=Zt.document||{};var pr=typeof process!="object"||String(process)!=="[object process]"||process.browser,uo=typeof importScripts=="function",f2=typeof window<"u"&&typeof window.orientation<"u",Uc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),l2=Uc&&parseFloat(Uc[1])||0;var Gs={};async function Yt(t,e=null,r={},n=null){return e&&(t=Pc(t,e,r,n)),Gs[t]=Gs[t]||m0(t),await Gs[t]}function Pc(t,e,r={},n=null){if(!r.useLocalLibraries&&t.startsWith("http"))return t;n=n||t;let o=r.modules||{};return o[n]?o[n]:pr?r.CDN?(Nc(r.CDN.startsWith("http")),`${r.CDN}/${e}@${Gc}/dist/libs/${n}`):uo?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}async function m0(t){if(t.endsWith("wasm"))return await g0(t);if(!pr)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(t)}catch(r){return console.error(r),null}if(uo)return importScripts(t);let e=await B0(t);return p0(e,t)}function p0(t,e){if(!pr){let{requireFromString:n}=globalThis.loaders||{};return n?.(t,e)}if(uo)return eval.call(globalThis,t),null;let r=document.createElement("script");r.id=e;try{r.appendChild(document.createTextNode(t))}catch{r.text=t}return document.body.appendChild(r),null}async function g0(t){let{readFileAsArrayBuffer:e}=globalThis.loaders||{};return pr||!e||t.startsWith("http")?await(await fetch(t)).arrayBuffer():await e(t)}async function B0(t){let{readFileAsText:e}=globalThis.loaders||{};return pr||!e||t.startsWith("http")?await(await fetch(t)).text():await e(t)}function kc(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?Hc(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?Hc(t,0,e):""}function Hc(t,e,r){if(t.byteLength<=e+r)return"";let n=new DataView(t),o="";for(let s=0;s<r;s++)o+=String.fromCharCode(n.getUint8(e+s));return o}function Ns(t){try{return JSON.parse(t)}catch{throw new Error(`Failed to parse JSON from data starting with "${kc(t)}"`)}}function xe(t,e,r){if(r=r||t.byteLength,t.byteLength<r||e.byteLength<r)return!1;let n=new Uint8Array(t),o=new Uint8Array(e);for(let s=0;s<n.length;++s)if(n[s]!==o[s])return!1;return!0}function gr(...t){return Jc(t)}function Jc(t){let e=t.map(s=>s instanceof ArrayBuffer?new Uint8Array(s):s),r=e.reduce((s,i)=>s+i.byteLength,0),n=new Uint8Array(r),o=0;for(let s of e)n.set(s,o),o+=s.byteLength;return n.buffer}function Pe(t,e,r){let n=r!==void 0?new Uint8Array(t).subarray(e,e+r):new Uint8Array(t).subarray(e);return new Uint8Array(n).buffer}function Tt(t,e){return z(t>=0),z(e>0),t+(e-1)&~(e-1)}function Us(t,e,r){let n;if(t instanceof ArrayBuffer)n=new Uint8Array(t);else{let o=t.byteOffset,s=t.byteLength;n=new Uint8Array(t.buffer||t.arrayBuffer,o,s)}return e.set(n,r),r+Tt(n.byteLength,4)}function Ps(t,e){let r=t.length,o=Math.ceil(r/e)*e-r,s="";for(let i=0;i<o;++i)s+=" ";return t+s}function Br(t,e,r,n){if(t)for(let o=0;o<n;o++)t.setUint8(e+o,r.charCodeAt(o));return e+n}function An(t,e,r,n){if(t)for(let o=0;o<n;o++)t.setUint8(e+o,r[o]);return e+n}function zc(t,e,r,n){let o=Tt(r.byteLength,n),s=o-r.byteLength;if(t){let i=new Uint8Array(t.buffer,t.byteOffset+e,r.byteLength),a=new Uint8Array(r);i.set(a);for(let f=0;f<s;++f)t.setUint8(e+r.byteLength+f,32)}return e+=o,e}function Ao(t,e,r,n){let s=new TextEncoder().encode(r);return e=zc(t,e,s,n),e}async function mn(t){let e=[];for await(let r of t)e.push(r);return gr(...e)}function Qc(t){return t&&typeof t=="object"&&t.isBuffer}function xr(t){if(Qc(t))return t;if(t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if(typeof t=="string"){let e=t;return new TextEncoder().encode(e).buffer}if(t&&typeof t=="object"&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function Er(t){return e=>new Promise((r,n)=>t(e,(o,s)=>o?n(o):r(s)))}var _r={};lt(_r,{dirname:()=>E0,filename:()=>x0,join:()=>_0,resolve:()=>y0});function Vc(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let t=window.location?.pathname;return t?.slice(0,t.lastIndexOf("/")+1)||""}function x0(t){let e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function E0(t){let e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}function _0(...t){let e="/";return t=t.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${e}`),"")),n!==t.length-1&&(r=r.replace(new RegExp(`${e}$`),"")),r)),t.join(e)}function y0(...t){let e=[];for(let s=0;s<t.length;s++)e[s]=t[s];let r="",n=!1,o;for(let s=e.length-1;s>=-1&&!n;s--){let i;s>=0?i=e[s]:(o===void 0&&(o=Vc()),i=o),i.length!==0&&(r=`${i}/${r}`,n=i.charCodeAt(0)===pn)}return r=C0(r,!n),n?`/${r}`:r.length>0?r:"."}var pn=47,Hs=46;function C0(t,e){let r="",n=-1,o=0,s,i=!1;for(let a=0;a<=t.length;++a){if(a<t.length)s=t.charCodeAt(a);else{if(s===pn)break;s=pn}if(s===pn){if(!(n===a-1||o===1))if(n!==a-1&&o===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==Hs||r.charCodeAt(r.length-2)!==Hs){if(r.length>2){let f=r.length-1,c=f;for(;c>=0&&r.charCodeAt(c)!==pn;--c);if(c!==f){r=c===-1?"":r.slice(0,c),n=a,o=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,o=0,i=!1;continue}}e&&(r.length>0?r+="/..":r="..",i=!0)}else{let f=t.slice(n+1,a);r.length>0?r+=`/${f}`:r=f,i=!1}n=a,o=0}else s===Hs&&o!==-1?++o:o=-1}return r}var gn=new Error("Not implemented"),mo=class{handle;size=0;bigsize=0n;url="";constructor(e,r,n){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(e,r,n);throw Bt?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(e,r){throw gn}async write(e,r,n){throw gn}async stat(){throw gn}async truncate(e){throw gn}async append(e){throw gn}async close(){}};var ks=t=>t?.getUint8&&t?.slice&&t?.length;var Bn=class{file;constructor(e,r=!1){this.file=new mo(e,r?"a+":"r")}async truncate(e){await this.file.truncate(e)}async append(e){await this.file.append(e)}async destroy(){await this.file.close()}async getUint8(e){let r=await this.file.read(e,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(e){let r=await this.file.read(e,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(e){let r=await this.file.read(e,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(e){let r=await this.file.read(e,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(e,r){let n=r-e;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let o=Number(n);return await this.file.read(e,o)}get length(){return this.file.bigsize}};var yr=t=>{if(t>Number.MAX_SAFE_INTEGER)throw new Error("Offset is out of bounds");return Number(t)},He=class{file;constructor(e){this.file=e}async destroy(){}async getUint8(e){return this.file.getUint8(yr(e))}async getUint16(e){return this.file.getUint16(yr(e),!0)}async getUint32(e){return this.file.getUint32(yr(e),!0)}async getBigUint64(e){return this.file.getBigUint64(yr(e),!0)}async slice(e,r){return this.file.buffer.slice(yr(e),yr(r))}get length(){return BigInt(this.file.byteLength)}};var T0=1/Math.PI*180,b0=1/180*Math.PI,M0={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...M0}};var Z=globalThis.mathgl.config;function Js(t,{precision:e=Z.precision}={}){return t=w0(t),`${parseFloat(t.toPrecision(e))}`}function It(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function zs(t){return jc(t)}function Qs(t){return Kc(t)}function jc(t,e){return js(t,r=>r*b0,e)}function Kc(t,e){return js(t,r=>r*T0,e)}function Vs(t,e,r){return js(t,n=>Math.max(e,Math.min(r,n)))}function bt(t,e,r){let n=Z.EPSILON;r&&(Z.EPSILON=r);try{if(t===e)return!0;if(It(t)&&It(e)){if(t.length!==e.length)return!1;for(let o=0;o<t.length;++o)if(!bt(t[o],e[o]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=Z.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{Z.EPSILON=n}}function w0(t){return Math.round(t/Z.EPSILON)*Z.EPSILON}function I0(t){return t.clone?t.clone():new Array(t.length)}function js(t,e,r){if(It(t)){let n=t;r=r||I0(n);for(let o=0;o<r.length&&o<n.length;++o){let s=typeof t=="number"?t:t[o];r[o]=e(s,o,r)}return r}return e(t)}var Ee=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(e,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=e[n+r];return this.check()}toArray(e=[],r=0){for(let n=0;n<this.ELEMENTS;++n)e[r+n]=this[n];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:It(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Z)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Js(this[n],e);return`${e.printTypes?this.constructor.name:""}[${r}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!bt(this[r],e[r]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==e[r])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,r,n){if(n===void 0)return this.lerp(this,e,r);for(let o=0;o<this.ELEMENTS;++o){let s=e[o],i=typeof r=="number"?r:r[o];this[o]=s+n*(i-s)}return this.check()}min(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(e[r],this[r]);return this.check()}max(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(e[r],this[r]);return this.check()}clamp(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e[n]),r[n]);return this.check()}add(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(e){if(typeof e=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;else for(let r=0;r<this.ELEMENTS&&r<e.length;++r)this[r]*=e[r];return this.check()}multiplyByScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}check(){if(Z.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let e=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)e=e&&Number.isFinite(this[r]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=e;return this.check()}addScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),r);return this.check()}get elements(){return this}};function S0(t,e){if(t.length!==e)return!1;for(let r=0;r<t.length;++r)if(!Number.isFinite(t[r]))return!1;return!0}function k(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function _e(t,e,r=""){if(Z.debug&&!S0(t,e))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return t}function at(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}var ye=class extends Ee{get x(){return this[0]}set x(e){this[0]=k(e)}get y(){return this[1]}set y(e){this[1]=k(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let r=0;r<this.ELEMENTS;++r)e+=this[r]*this[r];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let r=0;for(let n=0;n<this.ELEMENTS;++n){let o=this[n]-e[n];r+=o*o}return k(r)}dot(e){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*e[n];return k(r)}normalize(){let e=this.magnitude();if(e!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=e;return this.check()}multiply(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...e){for(let r of e)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return at(e>=0&&e<this.ELEMENTS,"index is out of range"),k(this[e])}setComponent(e,r){return at(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=r,this.check()}addVectors(e,r){return this.copy(e).add(r)}subVectors(e,r){return this.copy(e).subtract(r)}multiplyVectors(e,r){return this.copy(e).multiply(r)}addScaledVector(e,r){return this.add(new this.constructor(e).multiplyScalar(r))}};var q=typeof Float32Array<"u"?Float32Array:Array,xn=Math.random;function Cr(t){return t>=0?Math.round(t):t%.5===0?Math.floor(t):Math.round(t)}var Ey=Math.PI/180;function F0(){let t=new q(2);return q!=Float32Array&&(t[0]=0,t[1]=0),t}function Xc(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o,t[1]=r[1]*n+r[3]*o,t}function Zc(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o+r[4],t[1]=r[1]*n+r[3]*o+r[5],t}function po(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[3]*o+r[6],t[1]=r[1]*n+r[4]*o+r[7],t}function go(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[4]*o+r[12],t[1]=r[1]*n+r[5]*o+r[13],t}var _y=function(){let t=F0();return function(e,r,n,o,s,i){let a,f;for(r||(r=2),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],s(t,t,i),e[a]=t[0],e[a+1]=t[1];return e}}();function Bo(t,e,r){let n=e[0],o=e[1],s=r[3]*n+r[7]*o||1;return t[0]=(r[0]*n+r[4]*o)/s,t[1]=(r[1]*n+r[5]*o)/s,t}function xo(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[3]*n+r[7]*o+r[11]*s||1;return t[0]=(r[0]*n+r[4]*o+r[8]*s)/i,t[1]=(r[1]*n+r[5]*o+r[9]*s)/i,t[2]=(r[2]*n+r[6]*o+r[10]*s)/i,t}function Yc(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o,t[1]=r[1]*n+r[3]*o,t[2]=e[2],t}function Wc(t,e,r){let n=e[0],o=e[1];return t[0]=r[0]*n+r[2]*o,t[1]=r[1]*n+r[3]*o,t[2]=e[2],t[3]=e[3],t}function Eo(t,e,r){let n=e[0],o=e[1],s=e[2];return t[0]=r[0]*n+r[3]*o+r[6]*s,t[1]=r[1]*n+r[4]*o+r[7]*s,t[2]=r[2]*n+r[5]*o+r[8]*s,t[3]=e[3],t}var ke=class extends ye{constructor(e=0,r=0){super(2),It(e)&&arguments.length===1?this.copy(e):(Z.debug&&(k(e),k(r)),this[0]=e,this[1]=r)}set(e,r){return this[0]=e,this[1]=r,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this.check()}fromObject(e){return Z.debug&&(k(e.x),k(e.y)),this[0]=e.x,this[1]=e.y,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return go(this,this,e),this.check()}transformAsVector(e){return Bo(this,this,e),this.check()}transformByMatrix3(e){return po(this,this,e),this.check()}transformByMatrix2x3(e){return Zc(this,this,e),this.check()}transformByMatrix2(e){return Xc(this,this,e),this.check()}};var Qe={};lt(Qe,{add:()=>L0,angle:()=>Ws,bezier:()=>K0,ceil:()=>v0,clone:()=>R0,copy:()=>D0,create:()=>_o,cross:()=>Je,dist:()=>rA,distance:()=>rf,div:()=>eA,divide:()=>ef,dot:()=>En,equals:()=>q0,exactEquals:()=>W0,floor:()=>G0,forEach:()=>sA,fromValues:()=>yo,hermite:()=>j0,inverse:()=>z0,len:()=>qs,length:()=>qc,lerp:()=>Q0,max:()=>U0,min:()=>N0,mul:()=>tA,multiply:()=>tf,negate:()=>J0,normalize:()=>Ks,random:()=>X0,rotateX:()=>Xs,rotateY:()=>Zs,rotateZ:()=>Ys,round:()=>P0,scale:()=>H0,scaleAndAdd:()=>k0,set:()=>O0,slerp:()=>V0,sqrDist:()=>nA,sqrLen:()=>oA,squaredDistance:()=>nf,squaredLength:()=>of,str:()=>Y0,sub:()=>$0,subtract:()=>$c,transformMat3:()=>_n,transformMat4:()=>ze,transformQuat:()=>yn,zero:()=>Z0});function _o(){let t=new q(3);return q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function R0(t){let e=new q(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function qc(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function yo(t,e,r){let n=new q(3);return n[0]=t,n[1]=e,n[2]=r,n}function D0(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function O0(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function L0(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function $c(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function tf(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function ef(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function v0(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function G0(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function N0(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t}function U0(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t}function P0(t,e){return t[0]=Cr(e[0]),t[1]=Cr(e[1]),t[2]=Cr(e[2]),t}function H0(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function k0(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}function rf(t,e){let r=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2];return Math.sqrt(r*r+n*n+o*o)}function nf(t,e){let r=e[0]-t[0],n=e[1]-t[1],o=e[2]-t[2];return r*r+n*n+o*o}function of(t){let e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function J0(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function z0(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function Ks(t,e){let r=e[0],n=e[1],o=e[2],s=r*r+n*n+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function En(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function Je(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[0],a=r[1],f=r[2];return t[0]=o*f-s*a,t[1]=s*i-n*f,t[2]=n*a-o*i,t}function Q0(t,e,r,n){let o=e[0],s=e[1],i=e[2];return t[0]=o+n*(r[0]-o),t[1]=s+n*(r[1]-s),t[2]=i+n*(r[2]-i),t}function V0(t,e,r,n){let o=Math.acos(Math.min(Math.max(En(e,r),-1),1)),s=Math.sin(o),i=Math.sin((1-n)*o)/s,a=Math.sin(n*o)/s;return t[0]=i*e[0]+a*r[0],t[1]=i*e[1]+a*r[1],t[2]=i*e[2]+a*r[2],t}function j0(t,e,r,n,o,s){let i=s*s,a=i*(2*s-3)+1,f=i*(s-2)+s,c=i*(s-1),l=i*(3-2*s);return t[0]=e[0]*a+r[0]*f+n[0]*c+o[0]*l,t[1]=e[1]*a+r[1]*f+n[1]*c+o[1]*l,t[2]=e[2]*a+r[2]*f+n[2]*c+o[2]*l,t}function K0(t,e,r,n,o,s){let i=1-s,a=i*i,f=s*s,c=a*i,l=3*s*a,h=3*f*i,u=f*s;return t[0]=e[0]*c+r[0]*l+n[0]*h+o[0]*u,t[1]=e[1]*c+r[1]*l+n[1]*h+o[1]*u,t[2]=e[2]*c+r[2]*l+n[2]*h+o[2]*u,t}function X0(t,e){e=e===void 0?1:e;let r=xn()*2*Math.PI,n=xn()*2-1,o=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*o,t[1]=Math.sin(r)*o,t[2]=n*e,t}function ze(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[3]*n+r[7]*o+r[11]*s+r[15];return i=i||1,t[0]=(r[0]*n+r[4]*o+r[8]*s+r[12])/i,t[1]=(r[1]*n+r[5]*o+r[9]*s+r[13])/i,t[2]=(r[2]*n+r[6]*o+r[10]*s+r[14])/i,t}function _n(t,e,r){let n=e[0],o=e[1],s=e[2];return t[0]=n*r[0]+o*r[3]+s*r[6],t[1]=n*r[1]+o*r[4]+s*r[7],t[2]=n*r[2]+o*r[5]+s*r[8],t}function yn(t,e,r){let n=r[0],o=r[1],s=r[2],i=r[3],a=e[0],f=e[1],c=e[2],l=o*c-s*f,h=s*a-n*c,u=n*f-o*a,d=o*u-s*h,A=s*l-n*u,m=n*h-o*l,p=i*2;return l*=p,h*=p,u*=p,d*=2,A*=2,m*=2,t[0]=a+l+d,t[1]=f+h+A,t[2]=c+u+m,t}function Xs(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[0],s[1]=o[1]*Math.cos(n)-o[2]*Math.sin(n),s[2]=o[1]*Math.sin(n)+o[2]*Math.cos(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Zs(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[2]*Math.sin(n)+o[0]*Math.cos(n),s[1]=o[1],s[2]=o[2]*Math.cos(n)-o[0]*Math.sin(n),t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Ys(t,e,r,n){let o=[],s=[];return o[0]=e[0]-r[0],o[1]=e[1]-r[1],o[2]=e[2]-r[2],s[0]=o[0]*Math.cos(n)-o[1]*Math.sin(n),s[1]=o[0]*Math.sin(n)+o[1]*Math.cos(n),s[2]=o[2],t[0]=s[0]+r[0],t[1]=s[1]+r[1],t[2]=s[2]+r[2],t}function Ws(t,e){let r=t[0],n=t[1],o=t[2],s=e[0],i=e[1],a=e[2],f=Math.sqrt((r*r+n*n+o*o)*(s*s+i*i+a*a)),c=f&&En(t,e)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function Z0(t){return t[0]=0,t[1]=0,t[2]=0,t}function Y0(t){return`vec3(${t[0]}, ${t[1]}, ${t[2]})`}function W0(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function q0(t,e){let r=t[0],n=t[1],o=t[2],s=e[0],i=e[1],a=e[2];return Math.abs(r-s)<=1e-6*Math.max(1,Math.abs(r),Math.abs(s))&&Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(o-a)<=1e-6*Math.max(1,Math.abs(o),Math.abs(a))}var $0=$c,tA=tf,eA=ef,rA=rf,nA=nf,qs=qc,oA=of,sA=function(){let t=_o();return function(e,r,n,o,s,i){let a,f;for(r||(r=3),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],s(t,t,i),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}}();var $s=[0,0,0],Co,M=class extends ye{static get ZERO(){return Co||(Co=new M(0,0,0),Object.freeze(Co)),Co}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&It(e)?this.copy(e):(Z.debug&&(k(e),k(r),k(n)),this[0]=e,this[1]=r,this[2]=n)}set(e,r,n){return this[0]=e,this[1]=r,this[2]=n,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return Z.debug&&(k(e.x),k(e.y),k(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=k(e)}angle(e){return Ws(this,e)}cross(e){return Je(this,this,e),this.check()}rotateX({radians:e,origin:r=$s}){return Xs(this,this,r,e),this.check()}rotateY({radians:e,origin:r=$s}){return Zs(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=$s}){return Ys(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return ze(this,this,e),this.check()}transformAsVector(e){return xo(this,this,e),this.check()}transformByMatrix3(e){return _n(this,this,e),this.check()}transformByMatrix2(e){return Yc(this,this,e),this.check()}transformByQuaternion(e){return yn(this,this,e),this.check()}};var To,br=class extends ye{static get ZERO(){return To||(To=new br(0,0,0,0),Object.freeze(To)),To}constructor(e=0,r=0,n=0,o=0){super(-0,-0,-0,-0),It(e)&&arguments.length===1?this.copy(e):(Z.debug&&(k(e),k(r),k(n),k(o)),this[0]=e,this[1]=r,this[2]=n,this[3]=o)}set(e,r,n,o){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}fromObject(e){return Z.debug&&(k(e.x),k(e.y),k(e.z),k(e.w)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e.w=this[3],e}get ELEMENTS(){return 4}get z(){return this[2]}set z(e){this[2]=k(e)}get w(){return this[3]}set w(e){this[3]=k(e)}transform(e){return ze(this,this,e),this.check()}transformByMatrix3(e){return Eo(this,this,e),this.check()}transformByMatrix2(e){return Wc(this,this,e),this.check()}transformByQuaternion(e){return yn(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}};var Mr=class extends Ee{toString(){let e="[";if(Z.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=` ${this[n*this.RANK+r]}`}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=` ${this[r]}`}return e+="]",e}getElementIndex(e,r){return r*this.RANK+e}getElement(e,r){return this[r*this.RANK+e]}setElement(e,r,n){return this[r*this.RANK+e]=k(n),this}getColumn(e,r=new Array(this.RANK).fill(-0)){let n=e*this.RANK;for(let o=0;o<this.RANK;++o)r[o]=this[n+o];return r}setColumn(e,r){let n=e*this.RANK;for(let o=0;o<this.RANK;++o)this[n+o]=r[o];return this}};function sf(){let t=new q(9);return q!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[5]=0,t[6]=0,t[7]=0),t[0]=1,t[4]=1,t[8]=1,t}function af(t,e){if(t===e){let r=e[1],n=e[2],o=e[5];t[1]=e[3],t[2]=e[6],t[3]=r,t[5]=e[7],t[6]=n,t[7]=o}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function cf(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],f=e[6],c=e[7],l=e[8],h=l*i-a*c,u=-l*s+a*f,d=c*s-i*f,A=r*h+n*u+o*d;return A?(A=1/A,t[0]=h*A,t[1]=(-l*n+o*c)*A,t[2]=(a*n-o*i)*A,t[3]=u*A,t[4]=(l*r-o*f)*A,t[5]=(-a*r+o*s)*A,t[6]=d*A,t[7]=(-c*r+n*f)*A,t[8]=(i*r-n*s)*A,t):null}function ff(t){let e=t[0],r=t[1],n=t[2],o=t[3],s=t[4],i=t[5],a=t[6],f=t[7],c=t[8];return e*(c*s-i*f)+r*(-c*o+i*a)+n*(f*o-s*a)}function ti(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=r[0],d=r[1],A=r[2],m=r[3],p=r[4],E=r[5],y=r[6],T=r[7],b=r[8];return t[0]=u*n+d*i+A*c,t[1]=u*o+d*a+A*l,t[2]=u*s+d*f+A*h,t[3]=m*n+p*i+E*c,t[4]=m*o+p*a+E*l,t[5]=m*s+p*f+E*h,t[6]=y*n+T*i+b*c,t[7]=y*o+T*a+b*l,t[8]=y*s+T*f+b*h,t}function lf(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=r[0],d=r[1];return t[0]=n,t[1]=o,t[2]=s,t[3]=i,t[4]=a,t[5]=f,t[6]=u*n+d*i+c,t[7]=u*o+d*a+l,t[8]=u*s+d*f+h,t}function hf(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=Math.sin(r),d=Math.cos(r);return t[0]=d*n+u*i,t[1]=d*o+u*a,t[2]=d*s+u*f,t[3]=d*i-u*n,t[4]=d*a-u*o,t[5]=d*f-u*s,t[6]=c,t[7]=l,t[8]=h,t}function ei(t,e,r){let n=r[0],o=r[1];return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=o*e[3],t[4]=o*e[4],t[5]=o*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function uf(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r+r,a=n+n,f=o+o,c=r*i,l=n*i,h=n*a,u=o*i,d=o*a,A=o*f,m=s*i,p=s*a,E=s*f;return t[0]=1-h-A,t[3]=l-E,t[6]=u+p,t[1]=l+E,t[4]=1-c-A,t[7]=d-m,t[2]=u-p,t[5]=d+m,t[8]=1-c-h,t}var ri;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"})(ri||(ri={}));var aA=Object.freeze([1,0,0,0,1,0,0,0,1]),X=class extends Mr{static get IDENTITY(){return fA()}static get ZERO(){return cA()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return ri}constructor(e,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):r.length>0?this.copy([e,...r]):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this.check()}identity(){return this.copy(aA)}fromObject(e){return this.check()}fromQuaternion(e){return uf(this,e),this.check()}set(e,r,n,o,s,i,a,f,c){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(e,r,n,o,s,i,a,f,c){return this[0]=e,this[1]=o,this[2]=a,this[3]=r,this[4]=s,this[5]=f,this[6]=n,this[7]=i,this[8]=c,this.check()}determinant(){return ff(this)}transpose(){return af(this,this),this.check()}invert(){return cf(this,this),this.check()}multiplyLeft(e){return ti(this,e,this),this.check()}multiplyRight(e){return ti(this,this,e),this.check()}rotate(e){return hf(this,this,e),this.check()}scale(e){return Array.isArray(e)?ei(this,this,e):ei(this,this,[e,e]),this.check()}translate(e){return lf(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=po(r||[-0,-0],e,this);break;case 3:n=_n(r||[-0,-0,-0],e,this);break;case 4:n=Eo(r||[-0,-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return _e(n,e.length),n}transformVector(e,r){return this.transform(e,r)}transformVector2(e,r){return this.transform(e,r)}transformVector3(e,r){return this.transform(e,r)}},bo,Mo=null;function cA(){return bo||(bo=new X([0,0,0,0,0,0,0,0,0]),Object.freeze(bo)),bo}function fA(){return Mo||(Mo=new X,Object.freeze(Mo)),Mo}var Tn={};lt(Tn,{add:()=>LA,adjoint:()=>mA,clone:()=>hA,copy:()=>uA,create:()=>lA,decompose:()=>bA,determinant:()=>si,equals:()=>UA,exactEquals:()=>NA,frob:()=>OA,fromQuat:()=>ui,fromQuat2:()=>yA,fromRotation:()=>BA,fromRotationTranslation:()=>Af,fromRotationTranslationScale:()=>MA,fromRotationTranslationScaleOrigin:()=>wA,fromScaling:()=>gA,fromTranslation:()=>pA,fromValues:()=>dA,fromXRotation:()=>xA,fromYRotation:()=>EA,fromZRotation:()=>_A,frustum:()=>di,getRotation:()=>TA,getScaling:()=>mf,getTranslation:()=>CA,identity:()=>df,invert:()=>oi,lookAt:()=>pi,mul:()=>PA,multiply:()=>Cn,multiplyScalar:()=>vA,multiplyScalarAndAdd:()=>GA,ortho:()=>mi,orthoNO:()=>gf,orthoZO:()=>FA,perspective:()=>Ai,perspectiveFromFieldOfView:()=>SA,perspectiveNO:()=>pf,perspectiveZO:()=>IA,rotate:()=>ci,rotateX:()=>fi,rotateY:()=>li,rotateZ:()=>hi,scale:()=>ai,set:()=>AA,str:()=>DA,sub:()=>HA,subtract:()=>Bf,targetTo:()=>RA,translate:()=>ii,transpose:()=>ni});function lA(){let t=new q(16);return q!=Float32Array&&(t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0),t[0]=1,t[5]=1,t[10]=1,t[15]=1,t}function hA(t){let e=new q(16);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function uA(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function dA(t,e,r,n,o,s,i,a,f,c,l,h,u,d,A,m){let p=new q(16);return p[0]=t,p[1]=e,p[2]=r,p[3]=n,p[4]=o,p[5]=s,p[6]=i,p[7]=a,p[8]=f,p[9]=c,p[10]=l,p[11]=h,p[12]=u,p[13]=d,p[14]=A,p[15]=m,p}function AA(t,e,r,n,o,s,i,a,f,c,l,h,u,d,A,m,p){return t[0]=e,t[1]=r,t[2]=n,t[3]=o,t[4]=s,t[5]=i,t[6]=a,t[7]=f,t[8]=c,t[9]=l,t[10]=h,t[11]=u,t[12]=d,t[13]=A,t[14]=m,t[15]=p,t}function df(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function ni(t,e){if(t===e){let r=e[1],n=e[2],o=e[3],s=e[6],i=e[7],a=e[11];t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=r,t[6]=e[9],t[7]=e[13],t[8]=n,t[9]=s,t[11]=e[14],t[12]=o,t[13]=i,t[14]=a}else t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=e[1],t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=e[2],t[9]=e[6],t[10]=e[10],t[11]=e[14],t[12]=e[3],t[13]=e[7],t[14]=e[11],t[15]=e[15];return t}function oi(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=e[4],a=e[5],f=e[6],c=e[7],l=e[8],h=e[9],u=e[10],d=e[11],A=e[12],m=e[13],p=e[14],E=e[15],y=r*a-n*i,T=r*f-o*i,b=r*c-s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=t[8],l=t[9],h=t[10],u=t[11],d=t[12],A=t[13],m=t[14],p=t[15],E=e*i-r*s,y=e*a-n*s,T=r*a-n*i,b=c*A-l*d,C=c*m-h*d,w=l*m-h*A,I=e*w-r*C+n*b,O=s*w-i*C+a*b,B=c*T-l*y+h*E,g=d*T-A*y+m*E;return f*I-o*O+p*B-u*g}function Cn(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=e[9],d=e[10],A=e[11],m=e[12],p=e[13],E=e[14],y=e[15],T=r[0],b=r[1],C=r[2],w=r[3];return t[0]=T*n+b*a+C*h+w*m,t[1]=T*o+b*f+C*u+w*p,t[2]=T*s+b*c+C*d+w*E,t[3]=T*i+b*l+C*A+w*y,T=r[4],b=r[5],C=r[6],w=r[7],t[4]=T*n+b*a+C*h+w*m,t[5]=T*o+b*f+C*u+w*p,t[6]=T*s+b*c+C*d+w*E,t[7]=T*i+b*l+C*A+w*y,T=r[8],b=r[9],C=r[10],w=r[11],t[8]=T*n+b*a+C*h+w*m,t[9]=T*o+b*f+C*u+w*p,t[10]=T*s+b*c+C*d+w*E,t[11]=T*i+b*l+C*A+w*y,T=r[12],b=r[13],C=r[14],w=r[15],t[12]=T*n+b*a+C*h+w*m,t[13]=T*o+b*f+C*u+w*p,t[14]=T*s+b*c+C*d+w*E,t[15]=T*i+b*l+C*A+w*y,t}function ii(t,e,r){let n=r[0],o=r[1],s=r[2],i,a,f,c,l,h,u,d,A,m,p,E;return e===t?(t[12]=e[0]*n+e[4]*o+e[8]*s+e[12],t[13]=e[1]*n+e[5]*o+e[9]*s+e[13],t[14]=e[2]*n+e[6]*o+e[10]*s+e[14],t[15]=e[3]*n+e[7]*o+e[11]*s+e[15]):(i=e[0],a=e[1],f=e[2],c=e[3],l=e[4],h=e[5],u=e[6],d=e[7],A=e[8],m=e[9],p=e[10],E=e[11],t[0]=i,t[1]=a,t[2]=f,t[3]=c,t[4]=l,t[5]=h,t[6]=u,t[7]=d,t[8]=A,t[9]=m,t[10]=p,t[11]=E,t[12]=i*n+l*o+A*s+e[12],t[13]=a*n+h*o+m*s+e[13],t[14]=f*n+u*o+p*s+e[14],t[15]=c*n+d*o+E*s+e[15]),t}function ai(t,e,r){let n=r[0],o=r[1],s=r[2];return t[0]=e[0]*n,t[1]=e[1]*n,t[2]=e[2]*n,t[3]=e[3]*n,t[4]=e[4]*o,t[5]=e[5]*o,t[6]=e[6]*o,t[7]=e[7]*o,t[8]=e[8]*s,t[9]=e[9]*s,t[10]=e[10]*s,t[11]=e[11]*s,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function ci(t,e,r,n){let o=n[0],s=n[1],i=n[2],a=Math.sqrt(o*o+s*s+i*i),f,c,l,h,u,d,A,m,p,E,y,T,b,C,w,I,O,B,g,x,_,U,N,P;return a<1e-6?null:(a=1/a,o*=a,s*=a,i*=a,c=Math.sin(r),f=Math.cos(r),l=1-f,h=e[0],u=e[1],d=e[2],A=e[3],m=e[4],p=e[5],E=e[6],y=e[7],T=e[8],b=e[9],C=e[10],w=e[11],I=o*o*l+f,O=s*o*l+i*c,B=i*o*l-s*c,g=o*s*l-i*c,x=s*s*l+f,_=i*s*l+o*c,U=o*i*l+s*c,N=s*i*l-o*c,P=i*i*l+f,t[0]=h*I+m*O+T*B,t[1]=u*I+p*O+b*B,t[2]=d*I+E*O+C*B,t[3]=A*I+y*O+w*B,t[4]=h*g+m*x+T*_,t[5]=u*g+p*x+b*_,t[6]=d*g+E*x+C*_,t[7]=A*g+y*x+w*_,t[8]=h*U+m*N+T*P,t[9]=u*U+p*N+b*P,t[10]=d*U+E*N+C*P,t[11]=A*U+y*N+w*P,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function fi(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[4],i=e[5],a=e[6],f=e[7],c=e[8],l=e[9],h=e[10],u=e[11];return e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=s*o+c*n,t[5]=i*o+l*n,t[6]=a*o+h*n,t[7]=f*o+u*n,t[8]=c*o-s*n,t[9]=l*o-i*n,t[10]=h*o-a*n,t[11]=u*o-f*n,t}function li(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[0],i=e[1],a=e[2],f=e[3],c=e[8],l=e[9],h=e[10],u=e[11];return e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*o-c*n,t[1]=i*o-l*n,t[2]=a*o-h*n,t[3]=f*o-u*n,t[8]=s*n+c*o,t[9]=i*n+l*o,t[10]=a*n+h*o,t[11]=f*n+u*o,t}function hi(t,e,r){let n=Math.sin(r),o=Math.cos(r),s=e[0],i=e[1],a=e[2],f=e[3],c=e[4],l=e[5],h=e[6],u=e[7];return e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=s*o+c*n,t[1]=i*o+l*n,t[2]=a*o+h*n,t[3]=f*o+u*n,t[4]=c*o-s*n,t[5]=l*o-i*n,t[6]=h*o-a*n,t[7]=u*o-f*n,t}function pA(t,e){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e[0],t[13]=e[1],t[14]=e[2],t[15]=1,t}function gA(t,e){return t[0]=e[0],t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e[1],t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e[2],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function BA(t,e,r){let n=r[0],o=r[1],s=r[2],i=Math.sqrt(n*n+o*o+s*s),a,f,c;return i<1e-6?null:(i=1/i,n*=i,o*=i,s*=i,f=Math.sin(e),a=Math.cos(e),c=1-a,t[0]=n*n*c+a,t[1]=o*n*c+s*f,t[2]=s*n*c-o*f,t[3]=0,t[4]=n*o*c-s*f,t[5]=o*o*c+a,t[6]=s*o*c+n*f,t[7]=0,t[8]=n*s*c+o*f,t[9]=o*s*c-n*f,t[10]=s*s*c+a,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t)}function xA(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=n,t[6]=r,t[7]=0,t[8]=0,t[9]=-r,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function EA(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=0,t[2]=-r,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=r,t[9]=0,t[10]=n,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function _A(t,e){let r=Math.sin(e),n=Math.cos(e);return t[0]=n,t[1]=r,t[2]=0,t[3]=0,t[4]=-r,t[5]=n,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Af(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=n+n,f=o+o,c=s+s,l=n*a,h=n*f,u=n*c,d=o*f,A=o*c,m=s*c,p=i*a,E=i*f,y=i*c;return t[0]=1-(d+m),t[1]=h+y,t[2]=u-E,t[3]=0,t[4]=h-y,t[5]=1-(l+m),t[6]=A+p,t[7]=0,t[8]=u+E,t[9]=A-p,t[10]=1-(l+d),t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function yA(t,e){let r=new q(3),n=-e[0],o=-e[1],s=-e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=n*n+o*o+s*s+i*i;return h>0?(r[0]=(a*i+l*n+f*s-c*o)*2/h,r[1]=(f*i+l*o+c*n-a*s)*2/h,r[2]=(c*i+l*s+a*o-f*n)*2/h):(r[0]=(a*i+l*n+f*s-c*o)*2,r[1]=(f*i+l*o+c*n-a*s)*2,r[2]=(c*i+l*s+a*o-f*n)*2),Af(t,e,r),t}function CA(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function mf(t,e){let r=e[0],n=e[1],o=e[2],s=e[4],i=e[5],a=e[6],f=e[8],c=e[9],l=e[10];return t[0]=Math.sqrt(r*r+n*n+o*o),t[1]=Math.sqrt(s*s+i*i+a*a),t[2]=Math.sqrt(f*f+c*c+l*l),t}function TA(t,e){let r=new q(3);mf(r,e);let n=1/r[0],o=1/r[1],s=1/r[2],i=e[0]*n,a=e[1]*o,f=e[2]*s,c=e[4]*n,l=e[5]*o,h=e[6]*s,u=e[8]*n,d=e[9]*o,A=e[10]*s,m=i+l+A,p=0;return m>0?(p=Math.sqrt(m+1)*2,t[3]=.25*p,t[0]=(h-d)/p,t[1]=(u-f)/p,t[2]=(a-c)/p):i>l&&i>A?(p=Math.sqrt(1+i-l-A)*2,t[3]=(h-d)/p,t[0]=.25*p,t[1]=(a+c)/p,t[2]=(u+f)/p):l>A?(p=Math.sqrt(1+l-i-A)*2,t[3]=(u-f)/p,t[0]=(a+c)/p,t[1]=.25*p,t[2]=(h+d)/p):(p=Math.sqrt(1+A-i-l)*2,t[3]=(a-c)/p,t[0]=(u+f)/p,t[1]=(h+d)/p,t[2]=.25*p),t}function bA(t,e,r,n){e[0]=n[12],e[1]=n[13],e[2]=n[14];let o=n[0],s=n[1],i=n[2],a=n[4],f=n[5],c=n[6],l=n[8],h=n[9],u=n[10];r[0]=Math.sqrt(o*o+s*s+i*i),r[1]=Math.sqrt(a*a+f*f+c*c),r[2]=Math.sqrt(l*l+h*h+u*u);let d=1/r[0],A=1/r[1],m=1/r[2],p=o*d,E=s*A,y=i*m,T=a*d,b=f*A,C=c*m,w=l*d,I=h*A,O=u*m,B=p+b+O,g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Y*g),t[15]=1,t}function ui(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r+r,a=n+n,f=o+o,c=r*i,l=n*i,h=n*a,u=o*i,d=o*a,A=o*f,m=s*i,p=s*a,E=s*f;return t[0]=1-h-A,t[1]=l+E,t[2]=u-p,t[3]=0,t[4]=l-E,t[5]=1-c-A,t[6]=d+m,t[7]=0,t[8]=u+p,t[9]=d-m,t[10]=1-c-h,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function di(t,e,r,n,o,s,i){let a=1/(r-e),f=1/(o-n),c=1/(s-i);return t[0]=s*2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s*2*f,t[6]=0,t[7]=0,t[8]=(r+e)*a,t[9]=(o+n)*f,t[10]=(i+s)*c,t[11]=-1,t[12]=0,t[13]=0,t[14]=i*s*2*c,t[15]=0,t}function pf(t,e,r,n,o){let s=1/Math.tan(e/2);if(t[0]=s/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,o!=null&&o!==1/0){let i=1/(n-o);t[10]=(o+n)*i,t[14]=2*o*n*i}else t[10]=-1,t[14]=-2*n;return t}var Ai=pf;function IA(t,e,r,n,o){let s=1/Math.tan(e/2);if(t[0]=s/r,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=s,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[11]=-1,t[12]=0,t[13]=0,t[15]=0,o!=null&&o!==1/0){let i=1/(n-o);t[10]=o*i,t[14]=o*n*i}else t[10]=-1,t[14]=-n;return t}function SA(t,e,r,n){let o=Math.tan(e.upDegrees*Math.PI/180),s=Math.tan(e.downDegrees*Math.PI/180),i=Math.tan(e.leftDegrees*Math.PI/180),a=Math.tan(e.rightDegrees*Math.PI/180),f=2/(i+a),c=2/(o+s);return t[0]=f,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=c,t[6]=0,t[7]=0,t[8]=-((i-a)*f*.5),t[9]=(o-s)*c*.5,t[10]=n/(r-n),t[11]=-1,t[12]=0,t[13]=0,t[14]=n*r/(r-n),t[15]=0,t}function gf(t,e,r,n,o,s,i){let a=1/(e-r),f=1/(n-o),c=1/(s-i);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=2*c,t[11]=0,t[12]=(e+r)*a,t[13]=(o+n)*f,t[14]=(i+s)*c,t[15]=1,t}var mi=gf;function FA(t,e,r,n,o,s,i){let a=1/(e-r),f=1/(n-o),c=1/(s-i);return t[0]=-2*a,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=-2*f,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=c,t[11]=0,t[12]=(e+r)*a,t[13]=(o+n)*f,t[14]=s*c,t[15]=1,t}function pi(t,e,r,n){let o,s,i,a,f,c,l,h,u,d,A=e[0],m=e[1],p=e[2],E=n[0],y=n[1],T=n[2],b=r[0],C=r[1],w=r[2];return Math.abs(A-b)<1e-6&&Math.abs(m-C)<1e-6&&Math.abs(p-w)<1e-6?df(t):(h=A-b,u=m-C,d=p-w,o=1/Math.sqrt(h*h+u*u+d*d),h*=o,u*=o,d*=o,s=y*d-T*u,i=T*h-E*d,a=E*u-y*h,o=Math.sqrt(s*s+i*i+a*a),o?(o=1/o,s*=o,i*=o,a*=o):(s=0,i=0,a=0),f=u*a-d*i,c=d*s-h*a,l=h*i-u*s,o=Math.sqrt(f*f+c*c+l*l),o?(o=1/o,f*=o,c*=o,l*=o):(f=0,c=0,l=0),t[0]=s,t[1]=f,t[2]=h,t[3]=0,t[4]=i,t[5]=c,t[6]=u,t[7]=0,t[8]=a,t[9]=l,t[10]=d,t[11]=0,t[12]=-(s*A+i*m+a*p),t[13]=-(f*A+c*m+l*p),t[14]=-(h*A+u*m+d*p),t[15]=1,t)}function RA(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=n[0],f=n[1],c=n[2],l=o-r[0],h=s-r[1],u=i-r[2],d=l*l+h*h+u*u;d>0&&(d=1/Math.sqrt(d),l*=d,h*=d,u*=d);let A=f*u-c*h,m=c*l-a*u,p=a*h-f*l;return d=A*A+m*m+p*p,d>0&&(d=1/Math.sqrt(d),A*=d,m*=d,p*=d),t[0]=A,t[1]=m,t[2]=p,t[3]=0,t[4]=h*p-u*m,t[5]=u*A-l*p,t[6]=l*m-h*A,t[7]=0,t[8]=l,t[9]=h,t[10]=u,t[11]=0,t[12]=o,t[13]=s,t[14]=i,t[15]=1,t}function DA(t){return`mat4(${t[0]}, ${t[1]}, ${t[2]}, ${t[3]}, ${t[4]}, ${t[5]}, ${t[6]}, ${t[7]}, ${t[8]}, ${t[9]}, ${t[10]}, ${t[11]}, ${t[12]}, ${t[13]}, ${t[14]}, ${t[15]})`}function OA(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]+t[3]*t[3]+t[4]*t[4]+t[5]*t[5]+t[6]*t[6]+t[7]*t[7]+t[8]*t[8]+t[9]*t[9]+t[10]*t[10]+t[11]*t[11]+t[12]*t[12]+t[13]*t[13]+t[14]*t[14]+t[15]*t[15])}function LA(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t[4]=e[4]+r[4],t[5]=e[5]+r[5],t[6]=e[6]+r[6],t[7]=e[7]+r[7],t[8]=e[8]+r[8],t[9]=e[9]+r[9],t[10]=e[10]+r[10],t[11]=e[11]+r[11],t[12]=e[12]+r[12],t[13]=e[13]+r[13],t[14]=e[14]+r[14],t[15]=e[15]+r[15],t}function Bf(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t[4]=e[4]-r[4],t[5]=e[5]-r[5],t[6]=e[6]-r[6],t[7]=e[7]-r[7],t[8]=e[8]-r[8],t[9]=e[9]-r[9],t[10]=e[10]-r[10],t[11]=e[11]-r[11],t[12]=e[12]-r[12],t[13]=e[13]-r[13],t[14]=e[14]-r[14],t[15]=e[15]-r[15],t}function vA(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t[4]=e[4]*r,t[5]=e[5]*r,t[6]=e[6]*r,t[7]=e[7]*r,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12]*r,t[13]=e[13]*r,t[14]=e[14]*r,t[15]=e[15]*r,t}function GA(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t[4]=e[4]+r[4]*n,t[5]=e[5]+r[5]*n,t[6]=e[6]+r[6]*n,t[7]=e[7]+r[7]*n,t[8]=e[8]+r[8]*n,t[9]=e[9]+r[9]*n,t[10]=e[10]+r[10]*n,t[11]=e[11]+r[11]*n,t[12]=e[12]+r[12]*n,t[13]=e[13]+r[13]*n,t[14]=e[14]+r[14]*n,t[15]=e[15]+r[15]*n,t}function NA(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]&&t[3]===e[3]&&t[4]===e[4]&&t[5]===e[5]&&t[6]===e[6]&&t[7]===e[7]&&t[8]===e[8]&&t[9]===e[9]&&t[10]===e[10]&&t[11]===e[11]&&t[12]===e[12]&&t[13]===e[13]&&t[14]===e[14]&&t[15]===e[15]}function UA(t,e){let r=t[0],n=t[1],o=t[2],s=t[3],i=t[4],a=t[5],f=t[6],c=t[7],l=t[8],h=t[9],u=t[10],d=t[11],A=t[12],m=t[13],p=t[14],E=t[15],y=e[0],T=e[1],b=e[2],C=e[3],w=e[4],I=e[5],O=e[6],B=e[7],g=e[8],x=e[9],_=e[10],U=e[11],N=e[12],P=e[13],v=e[14],tt=e[15];return Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-T)<=1e-6*Math.max(1,Math.abs(n),Math.abs(T))&&Math.abs(o-b)<=1e-6*Math.max(1,Math.abs(o),Math.abs(b))&&Math.abs(s-C)<=1e-6*Math.max(1,Math.abs(s),Math.abs(C))&&Math.abs(i-w)<=1e-6*Math.max(1,Math.abs(i),Math.abs(w))&&Math.abs(a-I)<=1e-6*Math.max(1,Math.abs(a),Math.abs(I))&&Math.abs(f-O)<=1e-6*Math.max(1,Math.abs(f),Math.abs(O))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(l-g)<=1e-6*Math.max(1,Math.abs(l),Math.abs(g))&&Math.abs(h-x)<=1e-6*Math.max(1,Math.abs(h),Math.abs(x))&&Math.abs(u-_)<=1e-6*Math.max(1,Math.abs(u),Math.abs(_))&&Math.abs(d-U)<=1e-6*Math.max(1,Math.abs(d),Math.abs(U))&&Math.abs(A-N)<=1e-6*Math.max(1,Math.abs(A),Math.abs(N))&&Math.abs(m-P)<=1e-6*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(p-v)<=1e-6*Math.max(1,Math.abs(p),Math.abs(v))&&Math.abs(E-tt)<=1e-6*Math.max(1,Math.abs(E),Math.abs(tt))}var PA=Cn,HA=Bf;function kA(){let t=new q(4);return q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function xf(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}function Ef(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}function _f(t){let e=t[0],r=t[1],n=t[2],o=t[3];return Math.sqrt(e*e+r*r+n*n+o*o)}function yf(t){let e=t[0],r=t[1],n=t[2],o=t[3];return e*e+r*r+n*n+o*o}function Cf(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r*r+n*n+o*o+s*s;return i>0&&(i=1/Math.sqrt(i)),t[0]=r*i,t[1]=n*i,t[2]=o*i,t[3]=s*i,t}function Tf(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function bf(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3];return t[0]=o+n*(r[0]-o),t[1]=s+n*(r[1]-s),t[2]=i+n*(r[2]-i),t[3]=a+n*(r[3]-a),t}function Mf(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3];return t[0]=r[0]*n+r[4]*o+r[8]*s+r[12]*i,t[1]=r[1]*n+r[5]*o+r[9]*s+r[13]*i,t[2]=r[2]*n+r[6]*o+r[10]*s+r[14]*i,t[3]=r[3]*n+r[7]*o+r[11]*s+r[15]*i,t}function wf(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[0],a=r[1],f=r[2],c=r[3],l=c*n+a*s-f*o,h=c*o+f*n-i*s,u=c*s+i*o-a*n,d=-i*n-a*o-f*s;return t[0]=l*c+d*-i+h*-f-u*-a,t[1]=h*c+d*-a+u*-i-l*-f,t[2]=u*c+d*-f+l*-a-h*-i,t[3]=e[3],t}var $y=function(){let t=kA();return function(e,r,n,o,s,i){let a,f;for(r||(r=4),n||(n=0),o?f=Math.min(o*r+n,e.length):f=e.length,a=n;a<f;a+=r)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],t[3]=e[a+3],s(t,t,i),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2],e[a+3]=t[3];return e}}();var xi;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL0ROW3=3]="COL0ROW3",t[t.COL1ROW0=4]="COL1ROW0",t[t.COL1ROW1=5]="COL1ROW1",t[t.COL1ROW2=6]="COL1ROW2",t[t.COL1ROW3=7]="COL1ROW3",t[t.COL2ROW0=8]="COL2ROW0",t[t.COL2ROW1=9]="COL2ROW1",t[t.COL2ROW2=10]="COL2ROW2",t[t.COL2ROW3=11]="COL2ROW3",t[t.COL3ROW0=12]="COL3ROW0",t[t.COL3ROW1=13]="COL3ROW1",t[t.COL3ROW2=14]="COL3ROW2",t[t.COL3ROW3=15]="COL3ROW3"})(xi||(xi={}));var zA=45*Math.PI/180,QA=1,gi=.1,Bi=500,VA=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),St=class extends Mr{static get IDENTITY(){return KA()}static get ZERO(){return jA()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return xi}constructor(e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(e)?this.copy(e):this.identity()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this[4]=e[4],this[5]=e[5],this[6]=e[6],this[7]=e[7],this[8]=e[8],this[9]=e[9],this[10]=e[10],this[11]=e[11],this[12]=e[12],this[13]=e[13],this[14]=e[14],this[15]=e[15],this.check()}set(e,r,n,o,s,i,a,f,c,l,h,u,d,A,m,p){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this[4]=s,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this[9]=l,this[10]=h,this[11]=u,this[12]=d,this[13]=A,this[14]=m,this[15]=p,this.check()}setRowMajor(e,r,n,o,s,i,a,f,c,l,h,u,d,A,m,p){return this[0]=e,this[1]=s,this[2]=c,this[3]=d,this[4]=r,this[5]=i,this[6]=l,this[7]=A,this[8]=n,this[9]=a,this[10]=h,this[11]=m,this[12]=o,this[13]=f,this[14]=u,this[15]=p,this.check()}toRowMajor(e){return e[0]=this[0],e[1]=this[4],e[2]=this[8],e[3]=this[12],e[4]=this[1],e[5]=this[5],e[6]=this[9],e[7]=this[13],e[8]=this[2],e[9]=this[6],e[10]=this[10],e[11]=this[14],e[12]=this[3],e[13]=this[7],e[14]=this[11],e[15]=this[15],e}identity(){return this.copy(VA)}fromObject(e){return this.check()}fromQuaternion(e){return ui(this,e),this.check()}frustum(e){let{left:r,right:n,bottom:o,top:s,near:i=gi,far:a=Bi}=e;return a===1/0?XA(this,r,n,o,s,i):di(this,r,n,o,s,i,a),this.check()}lookAt(e){let{eye:r,center:n=[0,0,0],up:o=[0,1,0]}=e;return pi(this,r,n,o),this.check()}ortho(e){let{left:r,right:n,bottom:o,top:s,near:i=gi,far:a=Bi}=e;return mi(this,r,n,o,s,i,a),this.check()}orthographic(e){let{fovy:r=zA,aspect:n=QA,focalDistance:o=1,near:s=gi,far:i=Bi}=e;If(r);let a=r/2,f=o*Math.tan(a),c=f*n;return this.ortho({left:-c,right:c,bottom:-f,top:f,near:s,far:i})}perspective(e){let{fovy:r=45*Math.PI/180,aspect:n=1,near:o=.1,far:s=500}=e;return If(r),Ai(this,r,n,o,s),this.check()}determinant(){return si(this)}getScale(e=[-0,-0,-0]){return e[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),e[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),e[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),e}getTranslation(e=[-0,-0,-0]){return e[0]=this[12],e[1]=this[13],e[2]=this[14],e}getRotation(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),o=1/n[0],s=1/n[1],i=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*s,e[2]=this[2]*i,e[3]=0,e[4]=this[4]*o,e[5]=this[5]*s,e[6]=this[6]*i,e[7]=0,e[8]=this[8]*o,e[9]=this[9]*s,e[10]=this[10]*i,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}getRotationMatrix3(e,r){e=e||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),o=1/n[0],s=1/n[1],i=1/n[2];return e[0]=this[0]*o,e[1]=this[1]*s,e[2]=this[2]*i,e[3]=this[4]*o,e[4]=this[5]*s,e[5]=this[6]*i,e[6]=this[8]*o,e[7]=this[9]*s,e[8]=this[10]*i,e}transpose(){return ni(this,this),this.check()}invert(){return oi(this,this),this.check()}multiplyLeft(e){return Cn(this,e,this),this.check()}multiplyRight(e){return Cn(this,this,e),this.check()}rotateX(e){return fi(this,this,e),this.check()}rotateY(e){return li(this,this,e),this.check()}rotateZ(e){return hi(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return ci(this,this,e,r),this.check()}scale(e){return ai(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return ii(this,this,e),this.check()}transform(e,r){return e.length===4?(r=Mf(r||[-0,-0,-0,-0],e,this),_e(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,o;switch(n){case 2:o=go(r||[-0,-0],e,this);break;case 3:o=ze(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return _e(o,e.length),o}transformAsVector(e,r){let n;switch(e.length){case 2:n=Bo(r||[-0,-0],e,this);break;case 3:n=xo(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return _e(n,e.length),n}transformPoint(e,r){return this.transformAsPoint(e,r)}transformVector(e,r){return this.transformAsPoint(e,r)}transformDirection(e,r){return this.transformAsVector(e,r)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,r,n){return this.identity().translate([e,r,n])}},wo,Io;function jA(){return wo||(wo=new St([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(wo)),wo}function KA(){return Io||(Io=new St,Object.freeze(Io)),Io}function If(t){if(t>Math.PI*2)throw Error("expected radians")}function XA(t,e,r,n,o,s){let i=2*s/(r-e),a=2*s/(o-n),f=(r+e)/(r-e),c=(o+n)/(o-n),l=-1,h=-1,u=-2*s;return t[0]=i,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=a,t[6]=0,t[7]=0,t[8]=f,t[9]=c,t[10]=l,t[11]=h,t[12]=0,t[13]=0,t[14]=u,t[15]=0,t}function Sf(){let t=new q(4);return q!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Ff(t){return t[0]=0,t[1]=0,t[2]=0,t[3]=1,t}function Ei(t,e,r){r=r*.5;let n=Math.sin(r);return t[0]=n*e[0],t[1]=n*e[1],t[2]=n*e[2],t[3]=Math.cos(r),t}function _i(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=r[0],f=r[1],c=r[2],l=r[3];return t[0]=n*l+i*a+o*c-s*f,t[1]=o*l+i*f+s*a-n*c,t[2]=s*l+i*c+n*f-o*a,t[3]=i*l-n*a-o*f-s*c,t}function Rf(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+i*a,t[1]=o*f+s*a,t[2]=s*f-o*a,t[3]=i*f-n*a,t}function Df(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f-s*a,t[1]=o*f+i*a,t[2]=s*f+n*a,t[3]=i*f-o*a,t}function Of(t,e,r){r*=.5;let n=e[0],o=e[1],s=e[2],i=e[3],a=Math.sin(r),f=Math.cos(r);return t[0]=n*f+o*a,t[1]=o*f-n*a,t[2]=s*f+i*a,t[3]=i*f-s*a,t}function Lf(t,e){let r=e[0],n=e[1],o=e[2];return t[0]=r,t[1]=n,t[2]=o,t[3]=Math.sqrt(Math.abs(1-r*r-n*n-o*o)),t}function bn(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3],f=r[0],c=r[1],l=r[2],h=r[3],u,d,A,m,p;return u=o*f+s*c+i*l+a*h,u<0&&(u=-u,f=-f,c=-c,l=-l,h=-h),1-u>1e-6?(d=Math.acos(u),p=Math.sin(d),A=Math.sin((1-n)*d)/p,m=Math.sin(n*d)/p):(A=1-n,m=n),t[0]=A*o+m*f,t[1]=A*s+m*c,t[2]=A*i+m*l,t[3]=A*a+m*h,t}function vf(t,e){let r=e[0],n=e[1],o=e[2],s=e[3],i=r*r+n*n+o*o+s*s,a=i?1/i:0;return t[0]=-r*a,t[1]=-n*a,t[2]=-o*a,t[3]=s*a,t}function Gf(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function yi(t,e){let r=e[0]+e[4]+e[8],n;if(r>0)n=Math.sqrt(r+1),t[3]=.5*n,n=.5/n,t[0]=(e[5]-e[7])*n,t[1]=(e[6]-e[2])*n,t[2]=(e[1]-e[3])*n;else{let o=0;e[4]>e[0]&&(o=1),e[8]>e[o*3+o]&&(o=2);let s=(o+1)%3,i=(o+2)%3;n=Math.sqrt(e[o*3+o]-e[s*3+s]-e[i*3+i]+1),t[o]=.5*n,n=.5/n,t[3]=(e[s*3+i]-e[i*3+s])*n,t[s]=(e[s*3+o]+e[o*3+s])*n,t[i]=(e[i*3+o]+e[o*3+i])*n}return t}var Nf=xf;var Uf=Ef,Pf=Tf,Hf=bf,kf=_f;var Jf=yf;var zf=Cf;var Qf=function(){let t=_o(),e=yo(1,0,0),r=yo(0,1,0);return function(n,o,s){let i=En(o,s);return i<-.999999?(Je(t,e,o),qs(t)<1e-6&&Je(t,r,o),Ks(t,t),Ei(n,t,Math.PI),n):i>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Je(t,o,s),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+i,zf(n,n))}}(),dC=function(){let t=Sf(),e=Sf();return function(r,n,o,s,i,a){return bn(t,n,i,a),bn(e,o,s,a),bn(r,t,e,2*a*(1-a)),r}}(),AC=function(){let t=sf();return function(e,r,n,o){return t[0]=n[0],t[3]=n[1],t[6]=n[2],t[1]=o[0],t[4]=o[1],t[7]=o[2],t[2]=-r[0],t[5]=-r[1],t[8]=-r[2],zf(e,yi(e,t))}}();var ZA=[0,0,0,1],Ce=class extends Ee{constructor(e=0,r=0,n=0,o=1){super(-0,-0,-0,-0),Array.isArray(e)&&arguments.length===1?this.copy(e):this.set(e,r,n,o)}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this[3]=e[3],this.check()}set(e,r,n,o){return this[0]=e,this[1]=r,this[2]=n,this[3]=o,this.check()}fromObject(e){return this[0]=e.x,this[1]=e.y,this[2]=e.z,this[3]=e.w,this.check()}fromMatrix3(e){return yi(this,e),this.check()}fromAxisRotation(e,r){return Ei(this,e,r),this.check()}identity(){return Ff(this),this.check()}setAxisAngle(e,r){return this.fromAxisRotation(e,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(e){this[0]=k(e)}get y(){return this[1]}set y(e){this[1]=k(e)}get z(){return this[2]}set z(e){this[2]=k(e)}get w(){return this[3]}set w(e){this[3]=k(e)}len(){return kf(this)}lengthSquared(){return Jf(this)}dot(e){return Pf(this,e)}rotationTo(e,r){return Qf(this,e,r),this.check()}add(e){return Nf(this,this,e),this.check()}calculateW(){return Lf(this,this),this.check()}conjugate(){return Gf(this,this),this.check()}invert(){return vf(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(Hf(this,e,r,n),this.check())}multiplyRight(e){return _i(this,this,e),this.check()}multiplyLeft(e){return _i(this,e,this),this.check()}normalize(){let e=this.len(),r=e>0?1/e:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,e===0&&(this[3]=1),this.check()}rotateX(e){return Rf(this,this,e),this.check()}rotateY(e){return Df(this,this,e),this.check()}rotateZ(e){return Of(this,this,e),this.check()}scale(e){return Uf(this,this,e),this.check()}slerp(e,r,n){let o,s,i;switch(arguments.length){case 1:({start:o=ZA,target:s,ratio:i}=e);break;case 2:o=this,s=e,i=r;break;default:o=e,s=r,i=n}return bn(this,o,s,i),this.check()}transformVector4(e,r=new br){return wf(r,e,this),_e(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(e,r){return this.setAxisAngle(e,r)}premultiply(e){return this.multiplyLeft(e)}multiply(e){return this.multiplyRight(e)}};var Ft={};lt(Ft,{EPSILON1:()=>YA,EPSILON10:()=>sm,EPSILON11:()=>im,EPSILON12:()=>am,EPSILON13:()=>cm,EPSILON14:()=>fm,EPSILON15:()=>lm,EPSILON16:()=>hm,EPSILON17:()=>um,EPSILON18:()=>dm,EPSILON19:()=>Am,EPSILON2:()=>WA,EPSILON20:()=>mm,EPSILON3:()=>qA,EPSILON4:()=>$A,EPSILON5:()=>tm,EPSILON6:()=>em,EPSILON7:()=>rm,EPSILON8:()=>nm,EPSILON9:()=>om,PI_OVER_FOUR:()=>gm,PI_OVER_SIX:()=>Bm,PI_OVER_TWO:()=>pm,TWO_PI:()=>xm});var YA=.1,WA=.01,qA=.001,$A=1e-4,tm=1e-5,em=1e-6,rm=1e-7,nm=1e-8,om=1e-9,sm=1e-10,im=1e-11,am=1e-12,cm=1e-13,fm=1e-14,lm=1e-15,hm=1e-16,um=1e-17,dm=1e-18,Am=1e-19,mm=1e-20,pm=Math.PI/2,gm=Math.PI/4,Bm=Math.PI/6,xm=Math.PI*2;var ae=6356752314245179e-9,Em={radii:[6378137,6378137,ae],radiiSquared:[6378137*6378137,6378137*6378137,ae*ae],oneOverRadii:[1/6378137,1/6378137,1/ae],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(ae*ae)],maximumRadius:Math.max(6378137,6378137,ae),centerToleranceSquared:.1};function So(t){return t}var QC=new M;function _m(t,e=[],r=So){return"longitude"in t?(e[0]=r(t.longitude),e[1]=r(t.latitude),e[2]=t.height):"x"in t?(e[0]=r(t.x),e[1]=r(t.y),e[2]=t.z):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function Vf(t,e=[]){return _m(t,e,Z._cartographicRadians?So:zs)}function ym(t,e,r=So){return"longitude"in e?(e.longitude=r(t[0]),e.latitude=r(t[1]),e.height=t[2]):"x"in e?(e.x=r(t[0]),e.y=r(t[1]),e.z=t[2]):(e[0]=r(t[0]),e[1]=r(t[1]),e[2]=t[2]),e}function jf(t,e){return ym(t,e,Z._cartographicRadians?So:Qs)}var Kf=1e-14,Cm=new M,Xf={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Ci={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Mn={east:new M,north:new M,up:new M,west:new M,south:new M,down:new M},Tm=new M,bm=new M,Mm=new M;function Ti(t,e,r,n,o,s){let i=Xf[e]&&Xf[e][r];at(i&&(!n||n===i));let a,f,c,l=Cm.copy(o);if(bt(l.x,0,Kf)&&bt(l.y,0,Kf)){let u=Math.sign(l.z);a=Tm.fromArray(Ci[e]),e!=="east"&&e!=="west"&&a.scale(u),f=bm.fromArray(Ci[r]),r!=="east"&&r!=="west"&&f.scale(u),c=Mm.fromArray(Ci[n]),n!=="east"&&n!=="west"&&c.scale(u)}else{let{up:u,east:d,north:A}=Mn;d.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,u),A.copy(u).cross(d);let{down:m,west:p,south:E}=Mn;m.copy(u).scale(-1),p.copy(d).scale(-1),E.copy(A).scale(-1),a=Mn[e],f=Mn[r],c=Mn[n]}return s[0]=a.x,s[1]=a.y,s[2]=a.z,s[3]=0,s[4]=f.x,s[5]=f.y,s[6]=f.z,s[7]=0,s[8]=c.x,s[9]=c.y,s[10]=c.z,s[11]=0,s[12]=l.x,s[13]=l.y,s[14]=l.z,s[15]=1,s}var wr=new M,wm=new M,Im=new M;function Zf(t,e,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:o,centerToleranceSquared:s}=e;wr.from(t);let i=wr.x,a=wr.y,f=wr.z,c=n.x,l=n.y,h=n.z,u=i*i*c*c,d=a*a*l*l,A=f*f*h*h,m=u+d+A,p=Math.sqrt(1/m);if(!Number.isFinite(p))return;let E=wm;if(E.copy(t).scale(p),m<s)return E.to(r);let y=o.x,T=o.y,b=o.z,C=Im;C.set(E.x*y*2,E.y*T*2,E.z*b*2);let w=(1-p)*wr.len()/(.5*C.len()),I=0,O,B,g,x;do{w-=I,O=1/(1+w*y),B=1/(1+w*T),g=1/(1+w*b);let _=O*O,U=B*B,N=g*g,P=_*O,v=U*B,tt=N*g;x=u*_+d*U+A*N-1;let Y=-2*(u*P*y+d*v*T+A*tt*b);I=x/Y}while(Math.abs(x)>Ft.EPSILON12);return wr.scale([O,B,g]).to(r)}var Fo=new M,Yf=new M,Rm=new M,Ht=new M,Dm=new M,Ro=new M,ce=class{constructor(e=0,r=0,n=0){this.centerToleranceSquared=Ft.EPSILON1,at(e>=0),at(r>=0),at(n>=0),this.radii=new M(e,r,n),this.radiiSquared=new M(e*e,r*r,n*n),this.radiiToTheFourth=new M(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new M(e===0?0:1/e,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new M(e===0?0:1/(e*e),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(e,r,n),this.maximumRadius=Math.max(e,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(e){return this===e||Boolean(e&&this.radii.equals(e.radii))}toString(){return this.radii.toString()}cartographicToCartesian(e,r=[0,0,0]){let n=Yf,o=Rm,[,,s]=e;this.geodeticSurfaceNormalCartographic(e,n),o.copy(this.radiiSquared).scale(n);let i=Math.sqrt(n.dot(o));return o.scale(1/i),n.scale(s),o.add(n),o.to(r)}cartesianToCartographic(e,r=[0,0,0]){Ro.from(e);let n=this.scaleToGeodeticSurface(Ro,Ht);if(!n)return;let o=this.geodeticSurfaceNormal(n,Yf),s=Dm;s.copy(Ro).subtract(n);let i=Math.atan2(o.y,o.x),a=Math.asin(o.z),f=Math.sign(Qe.dot(s,Ro))*Qe.length(s);return jf([i,a,f],r)}eastNorthUpToFixedFrame(e,r=new St){return Ti(this,"east","north","up",e,r)}localFrameToFixedFrame(e,r,n,o,s=new St){return Ti(this,e,r,n,o,s)}geocentricSurfaceNormal(e,r=[0,0,0]){return Fo.from(e).normalize().to(r)}geodeticSurfaceNormalCartographic(e,r=[0,0,0]){let n=Vf(e),o=n[0],s=n[1],i=Math.cos(s);return Fo.set(i*Math.cos(o),i*Math.sin(o),Math.sin(s)).normalize(),Fo.to(r)}geodeticSurfaceNormal(e,r=[0,0,0]){return Fo.from(e).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(e,r){return Zf(e,this,r)}scaleToGeocentricSurface(e,r=[0,0,0]){Ht.from(e);let n=Ht.x,o=Ht.y,s=Ht.z,i=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*i.x+o*o*i.y+s*s*i.z);return Ht.multiplyScalar(a).to(r)}transformPositionToScaledSpace(e,r=[0,0,0]){return Ht.from(e).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(e,r=[0,0,0]){return Ht.from(e).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(e,r=0,n=[0,0,0]){at(bt(this.radii.x,this.radii.y,Ft.EPSILON15)),at(this.radii.z>0),Ht.from(e);let o=Ht.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(o)>=this.radii.z-r))return Ht.set(0,0,o).to(n)}};ce.WGS84=new ce(6378137,6378137,ae);var ct={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var fT=new M,lT=new M;var wn=new M,Wf=new M,Te=class{constructor(e=[0,0,0],r=0){this.radius=-0,this.center=new M,this.fromCenterRadius(e,r)}fromCenterRadius(e,r){return this.center.from(e),this.radius=r,this}fromCornerPoints(e,r){return r=wn.from(r),this.center=new M().from(e).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.radius===e.radius}clone(){return new Te(this.center,this.radius)}union(e){let r=this.center,n=this.radius,o=e.center,s=e.radius,i=wn.copy(o).subtract(r),a=i.magnitude();if(n>=a+s)return this.clone();if(s>=a+n)return e.clone();let f=(n+a+s)*.5;return Wf.copy(i).scale((-n+f)/a).add(r),this.center.copy(Wf),this.radius=f,this}expand(e){let n=wn.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);let r=Tn.getScaling(wn,e);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(e){let r=this.distanceTo(e);return r*r}distanceTo(e){let n=wn.from(e).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(e){let r=this.center,n=this.radius,s=e.normal.dot(r)+e.distance;return s<-n?ct.OUTSIDE:s<n?ct.INTERSECTING:ct.INSIDE}};var Om=new M,Lm=new M,Do=new M,Oo=new M,Lo=new M,vm=new M,Gm=new M,fe={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},Ve=class{constructor(e=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new M().from(e),this.halfAxes=new X(r)}get halfSize(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new M(e).len(),new M(r).len(),new M(n).len()]}get quaternion(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),o=new M(e).normalize(),s=new M(r).normalize(),i=new M(n).normalize();return new Ce().fromMatrix3(new X([...o,...s,...i]))}fromCenterHalfSizeQuaternion(e,r,n){let o=new Ce(n),s=new X().fromQuaternion(o);return s[0]=s[0]*r[0],s[1]=s[1]*r[0],s[2]=s[2]*r[0],s[3]=s[3]*r[1],s[4]=s[4]*r[1],s[5]=s[5]*r[1],s[6]=s[6]*r[2],s[7]=s[7]*r[2],s[8]=s[8]*r[2],this.center=new M().from(e),this.halfAxes=s,this}clone(){return new Ve(this.center,this.halfAxes)}equals(e){return this===e||Boolean(e)&&this.center.equals(e.center)&&this.halfAxes.equals(e.halfAxes)}getBoundingSphere(e=new Te){let r=this.halfAxes,n=r.getColumn(0,Do),o=r.getColumn(1,Oo),s=r.getColumn(2,Lo),i=Om.copy(n).add(o).add(s);return e.center.copy(this.center),e.radius=i.magnitude(),e}intersectPlane(e){let r=this.center,n=e.normal,o=this.halfAxes,s=n.x,i=n.y,a=n.z,f=Math.abs(s*o[fe.COLUMN0ROW0]+i*o[fe.COLUMN0ROW1]+a*o[fe.COLUMN0ROW2])+Math.abs(s*o[fe.COLUMN1ROW0]+i*o[fe.COLUMN1ROW1]+a*o[fe.COLUMN1ROW2])+Math.abs(s*o[fe.COLUMN2ROW0]+i*o[fe.COLUMN2ROW1]+a*o[fe.COLUMN2ROW2]),c=n.dot(r)+e.distance;return c<=-f?ct.OUTSIDE:c>=f?ct.INSIDE:ct.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=Lm.from(e).subtract(this.center),n=this.halfAxes,o=n.getColumn(0,Do),s=n.getColumn(1,Oo),i=n.getColumn(2,Lo),a=o.magnitude(),f=s.magnitude(),c=i.magnitude();o.normalize(),s.normalize(),i.normalize();let l=0,h;return h=Math.abs(r.dot(o))-a,h>0&&(l+=h*h),h=Math.abs(r.dot(s))-f,h>0&&(l+=h*h),h=Math.abs(r.dot(i))-c,h>0&&(l+=h*h),l}computePlaneDistances(e,r,n=[-0,-0]){let o=Number.POSITIVE_INFINITY,s=Number.NEGATIVE_INFINITY,i=this.center,a=this.halfAxes,f=a.getColumn(0,Do),c=a.getColumn(1,Oo),l=a.getColumn(2,Lo),h=vm.copy(f).add(c).add(l).add(i),u=Gm.copy(h).subtract(e),d=r.dot(u);return o=Math.min(d,o),s=Math.max(d,s),h.copy(i).add(f).add(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),h.copy(i).add(f).subtract(c).add(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),h.copy(i).add(f).subtract(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).add(c).add(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).add(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).subtract(c).add(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),i.copy(h).subtract(f).subtract(c).subtract(l),u.copy(h).subtract(e),d=r.dot(u),o=Math.min(d,o),s=Math.max(d,s),n[0]=o,n[1]=s,n}transform(e){this.center.transformAsPoint(e);let r=this.halfAxes.getColumn(0,Do);r.transformAsPoint(e);let n=this.halfAxes.getColumn(1,Oo);n.transformAsPoint(e);let o=this.halfAxes.getColumn(2,Lo);return o.transformAsPoint(e),this.halfAxes=new X([...r,...n,...o]),this}getTransform(){throw new Error("not implemented")}};var qf=new M,$f=new M,le=class{constructor(e=[0,0,1],r=0){this.normal=new M,this.distance=-0,this.fromNormalDistance(e,r)}fromNormalDistance(e,r){return at(Number.isFinite(r)),this.normal.from(e).normalize(),this.distance=r,this}fromPointNormal(e,r){e=qf.from(e),this.normal.from(r).normalize();let n=-this.normal.dot(e);return this.distance=n,this}fromCoefficients(e,r,n,o){return this.normal.set(e,r,n),at(bt(this.normal.len(),1)),this.distance=o,this}clone(){return new le(this.normal,this.distance)}equals(e){return bt(this.distance,e.distance)&&bt(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){let r=$f.copy(this.normal).transformAsVector(e).normalize(),n=this.normal.scale(-this.distance).transform(e);return this.fromPointNormal(n,r)}projectPointOntoPlane(e,r=[0,0,0]){let n=qf.from(e),o=this.getPointDistance(n),s=$f.copy(this.normal).scale(o);return n.subtract(s).to(r)}};var tl=[new M([1,0,0]),new M([0,1,0]),new M([0,0,1])],el=new M,Nm=new M,Rt=class{constructor(e=[]){this.planes=e}fromBoundingSphere(e){this.planes.length=2*tl.length;let r=e.center,n=e.radius,o=0;for(let s of tl){let i=this.planes[o],a=this.planes[o+1];i||(i=this.planes[o]=new le),a||(a=this.planes[o+1]=new le);let f=el.copy(s).scale(-n).add(r);i.fromPointNormal(f,s);let c=el.copy(s).scale(n).add(r),l=Nm.copy(s).negate();a.fromPointNormal(c,l),o+=2}return this}computeVisibility(e){let r=ct.INSIDE;for(let n of this.planes)switch(e.intersectPlane(n)){case ct.OUTSIDE:return ct.OUTSIDE;case ct.INTERSECTING:r=ct.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(e,r){if(at(Number.isFinite(r),"parentPlaneMask is required."),r===Rt.MASK_OUTSIDE||r===Rt.MASK_INSIDE)return r;let n=Rt.MASK_INSIDE,o=this.planes;for(let s=0;s<this.planes.length;++s){let i=s<31?1<<s:0;if(s<31&&!(r&i))continue;let a=o[s],f=e.intersectPlane(a);if(f===ct.OUTSIDE)return Rt.MASK_OUTSIDE;f===ct.INTERSECTING&&(n|=i)}return n}};Rt.MASK_OUTSIDE=4294967295;Rt.MASK_INSIDE=0;Rt.MASK_INDETERMINATE=2147483647;var IT=new M,ST=new M,FT=new M,RT=new M,DT=new M;var UT=new M,PT=new M,HT=new M,kT=new M,JT=new M,zT=new M,QT=new M,VT=new M,jT=new M,KT=new M,XT=new M,ZT=new M;var Wt=new X,Pm=new X,Hm=new X,vo=new X,rl=new X;function wi(t,e={}){let r=Ft.EPSILON20,n=10,o=0,s=0,i=Pm,a=Hm;i.identity(),a.copy(t);let f=r*km(a);for(;s<n&&Jm(a)>f;)zm(a,vo),rl.copy(vo).transpose(),a.multiplyRight(vo),a.multiplyLeft(rl),i.multiplyRight(vo),++o>2&&(++s,o=0);return e.unitary=i.toTarget(e.unitary),e.diagonal=a.toTarget(e.diagonal),e}function km(t){let e=0;for(let r=0;r<9;++r){let n=t[r];e+=n*n}return Math.sqrt(e)}var bi=[1,0,0],Mi=[2,2,1];function Jm(t){let e=0;for(let r=0;r<3;++r){let n=t[Wt.getElementIndex(Mi[r],bi[r])];e+=2*n*n}return Math.sqrt(e)}function zm(t,e){let r=Ft.EPSILON15,n=0,o=1;for(let c=0;c<3;++c){let l=Math.abs(t[Wt.getElementIndex(Mi[c],bi[c])]);l>n&&(o=c,n=l)}let s=bi[o],i=Mi[o],a=1,f=0;if(Math.abs(t[Wt.getElementIndex(i,s)])>r){let c=t[Wt.getElementIndex(i,i)],l=t[Wt.getElementIndex(s,s)],h=t[Wt.getElementIndex(i,s)],u=(c-l)/2/h,d;u<0?d=-1/(-u+Math.sqrt(1+u*u)):d=1/(u+Math.sqrt(1+u*u)),a=1/Math.sqrt(1+d*d),f=d*a}return X.IDENTITY.to(e),e[Wt.getElementIndex(s,s)]=e[Wt.getElementIndex(i,i)]=a,e[Wt.getElementIndex(i,s)]=f,e[Wt.getElementIndex(s,i)]=-f,e}var be=new M,Vm=new M,jm=new M,Km=new M,Xm=new M,Zm=new X,Ym={diagonal:new X,unitary:new X};function Ii(t,e=new Ve){if(!t||t.length===0)return e.halfAxes=new X([0,0,0,0,0,0,0,0,0]),e.center=new M,e;let r=t.length,n=new M(0,0,0);for(let B of t)n.add(B);let o=1/r;n.multiplyByScalar(o);let s=0,i=0,a=0,f=0,c=0,l=0;for(let B of t){let g=be.copy(B).subtract(n);s+=g.x*g.x,i+=g.x*g.y,a+=g.x*g.z,f+=g.y*g.y,c+=g.y*g.z,l+=g.z*g.z}s*=o,i*=o,a*=o,f*=o,c*=o,l*=o;let h=Zm;h[0]=s,h[1]=i,h[2]=a,h[3]=i,h[4]=f,h[5]=c,h[6]=a,h[7]=c,h[8]=l;let{unitary:u}=wi(h,Ym),d=e.halfAxes.copy(u),A=d.getColumn(0,jm),m=d.getColumn(1,Km),p=d.getColumn(2,Xm),E=-Number.MAX_VALUE,y=-Number.MAX_VALUE,T=-Number.MAX_VALUE,b=Number.MAX_VALUE,C=Number.MAX_VALUE,w=Number.MAX_VALUE;for(let B of t)be.copy(B),E=Math.max(be.dot(A),E),y=Math.max(be.dot(m),y),T=Math.max(be.dot(p),T),b=Math.min(be.dot(A),b),C=Math.min(be.dot(m),C),w=Math.min(be.dot(p),w);A=A.multiplyByScalar(.5*(b+E)),m=m.multiplyByScalar(.5*(C+y)),p=p.multiplyByScalar(.5*(w+T)),e.center.copy(A).add(m).add(p);let I=Vm.set(E-b,y-C,T-w).multiplyByScalar(.5),O=new X([I[0],0,0,0,I[1],0,0,0,I[2]]);return e.halfAxes.multiplyRight(O),e}var Ir;(function(t){t[t.ADD=1]="ADD",t[t.REPLACE=2]="REPLACE"})(Ir||(Ir={}));var Me;(function(t){t.EMPTY="empty",t.SCENEGRAPH="scenegraph",t.POINTCLOUD="pointcloud",t.MESH="mesh"})(Me||(Me={}));var In;(function(t){t.I3S="I3S",t.TILES3D="TILES3D"})(In||(In={}));var he;(function(t){t.GEOMETRIC_ERROR="geometricError",t.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(he||(he={}));var Sr="4.3.0-alpha.7";var xt={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Tb=Object.keys(xt),we={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function Si(t,e,r){z(t instanceof ArrayBuffer);let n=new TextDecoder("utf8"),o=new Uint8Array(t,e,r);return n.decode(o)}function nl(t,e=0){let r=new DataView(t);return`${String.fromCharCode(r.getUint8(e+0))}${String.fromCharCode(r.getUint8(e+1))}${String.fromCharCode(r.getUint8(e+2))}${String.fromCharCode(r.getUint8(e+3))}`}var ol="4.3.0-alpha.7";var sl={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:ol,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function il(t){switch(t.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function Fi(t){let e=1/0,r=1/0,n=1/0,o=-1/0,s=-1/0,i=-1/0,a=t.POSITION?t.POSITION.value:[],f=a&&a.length;for(let c=0;c<f;c+=3){let l=a[c],h=a[c+1],u=a[c+2];e=l<e?l:e,r=h<r?h:r,n=u<n?u:n,o=l>o?l:o,s=h>s?h:s,i=u>i?u:i}return[[e,r,n],[o,s,i]]}function Ri(t,e,r){let n=il(e.value),o=r||al(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]},nullable:!1,metadata:o}}function al(t){let e={};return"byteOffset"in t&&(e.byteOffset=t.byteOffset.toString(10)),"byteStride"in t&&(e.byteStride=t.byteStride.toString(10)),"normalized"in t&&(e.normalized=t.normalized.toString()),e}function fl(t,e,r){let n=ll(e.metadata),o=[],s=Wm(e.attributes);for(let i in t){let a=t[i],f=cl(i,a,s[i]);o.push(f)}if(r){let i=cl("indices",r);o.push(i)}return{fields:o,metadata:n}}function Wm(t){let e={};for(let r in t){let n=t[r];e[n.name||"undefined"]=n}return e}function cl(t,e,r){let n=r?ll(r.metadata):void 0;return Ri(t,e,n)}function ll(t){Object.entries(t);let e={};for(let r in t)e[`${r}.string`]=JSON.stringify(t[r]);return e}var hl={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},qm={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},$m=4,Sn=class{draco;decoder;metadataQuerier;constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(r);let o=this.decoder.GetEncodedGeometryType(n),s=o===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let i;switch(o){case this.draco.TRIANGULAR_MESH:i=this.decoder.DecodeBufferToMesh(n,s);break;case this.draco.POINT_CLOUD:i=this.decoder.DecodeBufferToPointCloud(n,s);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!i.ok()||!s.ptr){let u=`DRACO decompression failed: ${i.error_msg()}`;throw new Error(u)}let a=this._getDracoLoaderData(s,o,r),f=this._getMeshData(s,a,r),c=Fi(f.attributes),l=fl(f.attributes,a,f.indices);return{loader:"draco",loaderData:a,header:{vertexCount:s.num_points(),boundingBox:c},...f,schema:l}}finally{this.draco.destroy(n),s&&this.draco.destroy(s)}}_getDracoLoaderData(e,r,n){let o=this._getTopLevelMetadata(e),s=this._getDracoAttributes(e,n);return{geometry_type:r,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:o,attributes:s}}_getDracoAttributes(e,r){let n={};for(let o=0;o<e.num_attributes();o++){let s=this.decoder.GetAttribute(e,o),i=this._getAttributeMetadata(e,o);n[s.unique_id()]={unique_id:s.unique_id(),attribute_type:s.attribute_type(),data_type:s.data_type(),num_components:s.num_components(),byte_offset:s.byte_offset(),byte_stride:s.byte_stride(),normalized:s.normalized(),attribute_index:o,metadata:i};let a=this._getQuantizationTransform(s,r);a&&(n[s.unique_id()].quantization_transform=a);let f=this._getOctahedronTransform(s,r);f&&(n[s.unique_id()].octahedron_transform=f)}return n}_getMeshData(e,r,n){let o=this._getMeshAttributes(r,e,n);if(!o.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:o,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:o,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:o}}_getMeshAttributes(e,r,n){let o={};for(let s of Object.values(e.attributes)){let i=this._deduceAttributeName(s,n);s.name=i;let a=this._getAttributeValues(r,s);if(a){let{value:f,size:c}=a;o[i]={value:f,size:c,byteOffset:s.byte_offset,byteStride:s.byte_stride,normalized:s.normalized}}}return o}_getTriangleListIndices(e){let n=e.num_faces()*3,o=n*$m,s=this.draco._malloc(o);try{return this.decoder.GetTrianglesUInt32Array(e,o,s),new Uint32Array(this.draco.HEAPF32.buffer,s,n).slice()}finally{this.draco._free(s)}}_getTriangleStripIndices(e){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,r),rp(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let n=qm[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let o=r.num_components,i=e.num_points()*o,a=i*n.BYTES_PER_ELEMENT,f=tp(this.draco,n),c,l=this.draco._malloc(a);try{let h=this.decoder.GetAttribute(e,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,h,f,a,l),c=new n(this.draco.HEAPF32.buffer,l,i).slice()}finally{this.draco._free(l)}return{value:c,size:o}}_deduceAttributeName(e,r){let n=e.unique_id;for(let[i,a]of Object.entries(r.extraAttributes||{}))if(a===n)return i;let o=e.attribute_type;for(let i in hl)if(this.draco[i]===o)return hl[i];let s=r.attributeNameEntry||"name";return e.metadata[s]?e.metadata[s].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(e){let r=this.decoder.GetMetadata(e);return this._getDracoMetadata(r)}_getAttributeMetadata(e,r){let n=this.decoder.GetAttributeMetadata(e,r);return this._getDracoMetadata(n)}_getDracoMetadata(e){if(!e||!e.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(e);for(let o=0;o<n;o++){let s=this.metadataQuerier.GetEntryName(e,o);r[s]=this._getDracoMetadataField(e,s)}return r}_getDracoMetadataField(e,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,r,n);let o=ep(n);return{int:this.metadataQuerier.GetIntEntry(e,r),string:this.metadataQuerier.GetStringEntry(e,r),double:this.metadataQuerier.GetDoubleEntry(e,r),intArray:o}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(e){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=e,o=[...r,...n];for(let s of o)this.decoder.SkipAttributeTransform(this.draco[s])}_getQuantizationTransform(e,r){let{quantizedAttributes:n=[]}=r,o=e.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits(),range:i.range(),min_values:new Float32Array([1,2,3]).map(a=>i.min_value(a))}}finally{this.draco.destroy(i)}}return null}_getOctahedronTransform(e,r){let{octahedronAttributes:n=[]}=r,o=e.attribute_type();if(n.map(i=>this.decoder[i]).includes(o)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(e))return{quantization_bits:i.quantization_bits()}}finally{this.draco.destroy(i)}}return null}};function tp(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}function ep(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function rp(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}var np="1.5.6",op="1.4.1",Di=`https://www.gstatic.com/draco/versioned/decoders/${np}`,Et={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Oi={[Et.DECODER]:`${Di}/${Et.DECODER}`,[Et.DECODER_WASM]:`${Di}/${Et.DECODER_WASM}`,[Et.FALLBACK_DECODER]:`${Di}/${Et.FALLBACK_DECODER}`,[Et.ENCODER]:`https://raw.githubusercontent.com/google/draco/${op}/javascript/${Et.ENCODER}`},Li;async function ul(t){let e=t.modules||{};return e.draco3d?Li||=e.draco3d.createDecoderModule({}).then(r=>({draco:r})):Li||=sp(t),await Li}async function sp(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await Yt(Oi[Et.FALLBACK_DECODER],"draco",t,Et.FALLBACK_DECODER);break;case"wasm":default:[e,r]=await Promise.all([await Yt(Oi[Et.DECODER],"draco",t,Et.DECODER),await Yt(Oi[Et.DECODER_WASM],"draco",t,Et.DECODER_WASM)])}return e=e||globalThis.DracoDecoderModule,await ip(e,r)}function ip(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t({...r,onModuleLoaded:o=>n({draco:o})})})}var Go={...sl,parse:ap};async function ap(t,e){let{draco:r}=await ul(e),n=new Sn(r);try{return n.parseSync(t,e?.draco)}finally{n.destroy()}}var cp={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},rt={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},H={...cp,...rt};var vi={[rt.DOUBLE]:Float64Array,[rt.FLOAT]:Float32Array,[rt.UNSIGNED_SHORT]:Uint16Array,[rt.UNSIGNED_INT]:Uint32Array,[rt.UNSIGNED_BYTE]:Uint8Array,[rt.BYTE]:Int8Array,[rt.SHORT]:Int16Array,[rt.INT]:Int32Array},fp={DOUBLE:rt.DOUBLE,FLOAT:rt.FLOAT,UNSIGNED_SHORT:rt.UNSIGNED_SHORT,UNSIGNED_INT:rt.UNSIGNED_INT,UNSIGNED_BYTE:rt.UNSIGNED_BYTE,BYTE:rt.BYTE,SHORT:rt.SHORT,INT:rt.INT},Gi="Failed to convert GL type",ht=class{static fromTypedArray(e){e=ArrayBuffer.isView(e)?e.constructor:e;for(let r in vi)if(vi[r]===e)return r;throw new Error(Gi)}static fromName(e){let r=fp[e];if(!r)throw new Error(Gi);return r}static getArrayType(e){switch(e){case rt.UNSIGNED_SHORT_5_6_5:case rt.UNSIGNED_SHORT_4_4_4_4:case rt.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=vi[e];if(!r)throw new Error(Gi);return r}}static getByteSize(e){return ht.getArrayType(e).BYTES_PER_ELEMENT}static validate(e){return Boolean(ht.getArrayType(e))}static createTypedArray(e,r,n=0,o){o===void 0&&(o=(r.byteLength-n)/ht.getByteSize(e));let s=ht.getArrayType(e);return new s(r,n,o)}};function dl(t,e){if(!t)throw new Error(`math.gl assertion failed. ${e}`)}function Ni(t,e=[0,0,0]){let r=t>>11&31,n=t>>5&63,o=t&31;return e[0]=r<<3,e[1]=n<<2,e[2]=o<<3,e}var oM=1/256;var sM=new ke,iM=new M,aM=new ke,cM=new ke,fM=new Uint8Array(1);function Al(t,e=255){return Vs(t,0,e)/e*2-1}function ml(t){return t<0?-1:1}function pl(t,e,r,n){if(dl(n),t<0||t>r||e<0||e>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=Al(t,r),n.y=Al(e,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let o=n.x;n.x=(1-Math.abs(n.y))*ml(o),n.y=(1-Math.abs(o))*ml(n.y)}return n.normalize()}function Ui(t,e,r){return pl(t,e,255,r)}var kt=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(e,r){this.json=e,this.buffer=r}getExtension(e){return this.json.extensions&&this.json.extensions[e]}hasProperty(e){return Boolean(this.json[e])}getGlobalProperty(e,r=H.UNSIGNED_INT,n=1){let o=this.json[e];return o&&Number.isFinite(o.byteOffset)?this._getTypedArrayFromBinary(e,r,n,1,o.byteOffset):o}getPropertyArray(e,r,n){let o=this.json[e];return o&&Number.isFinite(o.byteOffset)?("componentType"in o&&(r=ht.fromName(o.componentType)),this._getTypedArrayFromBinary(e,r,n,this.featuresLength,o.byteOffset)):this._getTypedArrayFromArray(e,r,o)}getProperty(e,r,n,o,s){let i=this.json[e];if(!i)return i;let a=this.getPropertyArray(e,r,n);if(n===1)return a[o];for(let f=0;f<n;++f)s[f]=a[n*o+f];return s}_getTypedArrayFromBinary(e,r,n,o,s){let i=this._cachedTypedArrays,a=i[e];return a||(a=ht.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+s,o*n),i[e]=a),a}_getTypedArrayFromArray(e,r,n){let o=this._cachedTypedArrays,s=o[e];return s||(s=ht.createTypedArray(r,n),o[e]=s),s}};var lp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},hp={SCALAR:(t,e)=>t[e],VEC2:(t,e)=>[t[2*e+0],t[2*e+1]],VEC3:(t,e)=>[t[3*e+0],t[3*e+1],t[3*e+2]],VEC4:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT2:(t,e)=>[t[4*e+0],t[4*e+1],t[4*e+2],t[4*e+3]],MAT3:(t,e)=>[t[9*e+0],t[9*e+1],t[9*e+2],t[9*e+3],t[9*e+4],t[9*e+5],t[9*e+6],t[9*e+7],t[9*e+8]],MAT4:(t,e)=>[t[16*e+0],t[16*e+1],t[16*e+2],t[16*e+3],t[16*e+4],t[16*e+5],t[16*e+6],t[16*e+7],t[16*e+8],t[16*e+9],t[16*e+10],t[16*e+11],t[16*e+12],t[16*e+13],t[16*e+14],t[16*e+15]]},up={SCALAR:(t,e,r)=>{e[r]=t},VEC2:(t,e,r)=>{e[2*r+0]=t[0],e[2*r+1]=t[1]},VEC3:(t,e,r)=>{e[3*r+0]=t[0],e[3*r+1]=t[1],e[3*r+2]=t[2]},VEC4:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT2:(t,e,r)=>{e[4*r+0]=t[0],e[4*r+1]=t[1],e[4*r+2]=t[2],e[4*r+3]=t[3]},MAT3:(t,e,r)=>{e[9*r+0]=t[0],e[9*r+1]=t[1],e[9*r+2]=t[2],e[9*r+3]=t[3],e[9*r+4]=t[4],e[9*r+5]=t[5],e[9*r+6]=t[6],e[9*r+7]=t[7],e[9*r+8]=t[8],e[9*r+9]=t[9]},MAT4:(t,e,r)=>{e[16*r+0]=t[0],e[16*r+1]=t[1],e[16*r+2]=t[2],e[16*r+3]=t[3],e[16*r+4]=t[4],e[16*r+5]=t[5],e[16*r+6]=t[6],e[16*r+7]=t[7],e[16*r+8]=t[8],e[16*r+9]=t[9],e[16*r+10]=t[10],e[16*r+11]=t[11],e[16*r+12]=t[12],e[16*r+13]=t[13],e[16*r+14]=t[14],e[16*r+15]=t[15]}};function gl(t,e,r,n){let{componentType:o}=t;z(t.componentType);let s=typeof o=="string"?ht.fromName(o):o,i=lp[t.type],a=hp[t.type],f=up[t.type];return r+=t.byteOffset,{values:ht.createTypedArray(s,e,r,i*n),type:s,size:i,unpacker:a,packer:f}}var qt=t=>t!==void 0;function Bl(t,e,r){if(!e)return null;let n=t.getExtension("3DTILES_batch_table_hierarchy"),o=e.HIERARCHY;return o&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),e.extensions=e.extensions||{},e.extensions["3DTILES_batch_table_hierarchy"]=o,n=o),n?dp(n,r):null}function dp(t,e){let r,n,o,s=t.instancesLength,i=t.classes,a=t.classIds,f=t.parentCounts,c=t.parentIds,l=s;qt(a.byteOffset)&&(a.componentType=defaultValue(a.componentType,GL.UNSIGNED_SHORT),a.type=AttributeType.SCALAR,o=getBinaryAccessor(a),a=o.createArrayBufferView(e.buffer,e.byteOffset+a.byteOffset,s));let h;if(qt(f))for(qt(f.byteOffset)&&(f.componentType=defaultValue(f.componentType,GL.UNSIGNED_SHORT),f.type=AttributeType.SCALAR,o=getBinaryAccessor(f),f=o.createArrayBufferView(e.buffer,e.byteOffset+f.byteOffset,s)),h=new Uint16Array(s),l=0,r=0;r<s;++r)h[r]=l,l+=f[r];qt(c)&&qt(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,o=getBinaryAccessor(c),c=o.createArrayBufferView(e.buffer,e.byteOffset+c.byteOffset,l));let u=i.length;for(r=0;r<u;++r){let p=i[r].length,E=i[r].instances,y=getBinaryProperties(p,E,e);i[r].instances=combine(y,E)}let d=new Array(u).fill(0),A=new Uint16Array(s);for(r=0;r<s;++r)n=a[r],A[r]=d[n],++d[n];let m={classes:i,classIds:a,classIndexes:A,parentCounts:f,parentIndexes:h,parentIds:c};return pp(m),m}function Fr(t,e,r){if(!t)return;let n=t.parentCounts;return t.parentIds?r(t,e):n>0?Ap(t,e,r):mp(t,e,r)}function Ap(t,e,r){let n=t.classIds,o=t.parentCounts,s=t.parentIds,i=t.parentIndexes,a=n.length,f=scratchVisited;f.length=Math.max(f.length,a);let c=++marker,l=scratchStack;for(l.length=0,l.push(e);l.length>0;){if(e=l.pop(),f[e]===c)continue;f[e]=c;let h=r(t,e);if(qt(h))return h;let u=o[e],d=i[e];for(let A=0;A<u;++A){let m=s[d+A];m!==e&&l.push(m)}}return null}function mp(t,e,r){let n=!0;for(;n;){let o=r(t,e);if(qt(o))return o;let s=t.parentIds[e];n=s!==e,e=s}throw new Error("traverseHierarchySingleParent")}function pp(t){let e=[],n=t.classIds.length;for(let o=0;o<n;++o)xl(t,o,stack)}function xl(t,e,r){let n=t.parentCounts,o=t.parentIds,s=t.parentIndexes,a=t.classIds.length;if(!qt(o))return;assert(e<a,`Parent index ${e} exceeds the total number of instances: ${a}`),assert(r.indexOf(e)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(e);let f=qt(n)?n[e]:1,c=qt(n)?s[e]:e;for(let l=0;l<f;++l){let h=o[c+l];h!==e&&xl(t,h,r)}r.pop(e)}function _t(t){return t!=null}var No=(t,e)=>t,gp={HIERARCHY:!0,extensions:!0,extras:!0},ue=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(e,r,n,o={}){z(n>=0),this.json=e||{},this.binary=r,this.featureCount=n,this._extensions=this.json?.extensions||{},this._properties={};for(let s in this.json)gp[s]||(this._properties[s]=this.json[s]);this._binaryProperties=this._initializeBinaryProperties(),o["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Bl(this,this.json,this.binary))}getExtension(e){return this.json&&this.json.extensions&&this.json.extensions[e]}memorySizeInBytes(){return 0}isClass(e,r){if(this._checkBatchId(e),z(typeof r=="string",r),this._hierarchy){let n=Fr(this._hierarchy,e,(o,s)=>{let i=o.classIds[s];return o.classes[i].name===r});return _t(n)}return!1}isExactClass(e,r){return z(typeof r=="string",r),this.getExactClassName(e)===r}getExactClassName(e){if(this._checkBatchId(e),this._hierarchy){let r=this._hierarchy.classIds[e];return this._hierarchy.classes[r].name}}hasProperty(e,r){return this._checkBatchId(e),z(typeof r=="string",r),_t(this._properties[r])||this._hasPropertyInHierarchy(e,r)}getPropertyNames(e,r){this._checkBatchId(e),r=_t(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(e,r),r}getProperty(e,r){if(this._checkBatchId(e),z(typeof r=="string",r),this._binaryProperties){let o=this._binaryProperties[r];if(_t(o))return this._getBinaryProperty(o,e)}let n=this._properties[r];if(_t(n))return No(n[e],!0);if(this._hierarchy){let o=this._getHierarchyProperty(e,r);if(_t(o))return o}}setProperty(e,r,n){let o=this.featureCount;if(this._checkBatchId(e),z(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(i){this._setBinaryProperty(i,e,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,e,r,n))return;let s=this._properties[r];_t(s)||(this._properties[r]=new Array(o),s=this._properties[r]),s[e]=No(n,!0)}_checkBatchId(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(e,r){return e.unpack(e.typedArray,r)}_setBinaryProperty(e,r,n){e.pack(n,e.typedArray,r)}_initializeBinaryProperties(){let e=null;for(let r in this._properties){let n=this._properties[r],o=this._initializeBinaryProperty(r,n);o&&(e=e||{},e[r]=o)}return e}_initializeBinaryProperty(e,r){if("byteOffset"in r){let n=r;z(this.binary,`Property ${e} requires a batch table binary.`),z(n.type,`Property ${e} requires a type.`);let o=gl(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:o.values,componentCount:o.size,unpack:o.unpacker,pack:o.packer}}return null}_hasPropertyInHierarchy(e,r){if(!this._hierarchy)return!1;let n=Fr(this._hierarchy,e,(o,s)=>{let i=o.classIds[s],a=o.classes[i].instances;return _t(a[r])});return _t(n)}_getPropertyNamesInHierarchy(e,r){Fr(this._hierarchy,e,(n,o)=>{let s=n.classIds[o],i=n.classes[s].instances;for(let a in i)i.hasOwnProperty(a)&&r.indexOf(a)===-1&&r.push(a)})}_getHierarchyProperty(e,r){return Fr(this._hierarchy,e,(n,o)=>{let s=n.classIds[o],i=n.classes[s],a=n.classIndexes[o],f=i.instances[r];return _t(f)?_t(f.typedArray)?this._getBinaryProperty(f,a):No(f[a],!0):null})}_setHierarchyProperty(e,r,n,o){let s=Fr(this._hierarchy,r,(i,a)=>{let f=i.classIds[a],c=i.classes[f],l=i.classIndexes[a],h=c.instances[n];return _t(h)?(z(a===r,`Inherited property "${n}" is read-only.`),_t(h.typedArray)?this._setBinaryProperty(h,l,o):h[l]=No(o,!0),!0):!1});return _t(s)}};function Ie(t,e,r=0){let n=new DataView(e);if(t.magic=n.getUint32(r,!0),r+=4,t.version=n.getUint32(r,!0),r+=4,t.byteLength=n.getUint32(r,!0),r+=4,t.version!==1)throw new Error(`3D Tile Version ${t.version} not supported`);return r}var Rr=4,El="b3dm tile in legacy format.";function Dr(t,e,r){let n=new DataView(e),o;t.header=t.header||{};let s=n.getUint32(r,!0);r+=Rr;let i=n.getUint32(r,!0);r+=Rr;let a=n.getUint32(r,!0);r+=Rr;let f=n.getUint32(r,!0);return r+=Rr,a>=570425344?(r-=Rr*2,o=s,a=i,f=0,s=0,i=0,console.warn(El)):f>=570425344&&(r-=Rr,o=a,a=s,f=i,s=0,i=0,console.warn(El)),t.header.featureTableJsonByteLength=s,t.header.featureTableBinaryByteLength=i,t.header.batchTableJsonByteLength=a,t.header.batchTableBinaryByteLength=f,t.header.batchLength=o,r}function Or(t,e,r,n){return r=Bp(t,e,r,n),r=xp(t,e,r,n),r}function Bp(t,e,r,n){let{featureTableJsonByteLength:o,featureTableBinaryByteLength:s,batchLength:i}=t.header||{};if(t.featureTableJson={BATCH_LENGTH:i||0},o&&o>0){let a=Si(e,r,o);t.featureTableJson=JSON.parse(a)}return r+=o||0,t.featureTableBinary=new Uint8Array(e,r,s),r+=s||0,r}function xp(t,e,r,n){let{batchTableJsonByteLength:o,batchTableBinaryByteLength:s}=t.header||{};if(o&&o>0){let i=Si(e,r,o);t.batchTableJson=JSON.parse(i),r+=o,s&&s>0&&(t.batchTableBinary=new Uint8Array(e,r,s),t.batchTableBinary=new Uint8Array(t.batchTableBinary),r+=s)}return r}function Pi(t,e,r){if(!e&&(!t||!t.batchIds||!r))return null;let{batchIds:n,isRGB565:o,pointCount:s=0}=t;if(n&&r){let i=new Uint8ClampedArray(s*3);for(let a=0;a<s;a++){let f=n[a],l=r.getProperty(f,"dimensions").map(h=>h*255);i[a*3]=l[0],i[a*3+1]=l[1],i[a*3+2]=l[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}if(e&&o){let i=new Uint8ClampedArray(s*3);for(let a=0;a<s;a++){let f=Ni(e[a]);i[a*3]=f[0],i[a*3+1]=f[1],i[a*3+2]=f[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}return e&&e.length===s*3?{type:H.UNSIGNED_BYTE,value:e,size:3,normalized:!0}:{type:H.UNSIGNED_BYTE,value:e||new Uint8ClampedArray,size:4,normalized:!0}}var _l=new M;function yl(t,e){if(!e)return null;if(t.isOctEncoded16P){let r=new Float32Array((t.pointsLength||0)*3);for(let n=0;n<(t.pointsLength||0);n++)Ui(e[n*2],e[n*2+1],_l),_l.toArray(r,n*3);return{type:H.FLOAT,size:2,value:r}}return{type:H.FLOAT,size:2,value:e}}function Cl(t,e,r){return t.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,Ep(t,e)):{type:H.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}function Ep(t,e){let r=new M,n=new Float32Array(t.pointCount*3);for(let o=0;o<t.pointCount;o++)r.set(e[o*3],e[o*3+1],e[o*3+2]).scale(1/t.quantizedRange).multiply(t.quantizedVolumeScale).add(t.quantizedVolumeOffset).toArray(n,o*3);return n}async function Tl(t,e,r,n,o){r=Ie(t,e,r),r=Dr(t,e,r),r=Or(t,e,r,n),_p(t);let{featureTable:s,batchTable:i}=yp(t);return await wp(t,s,i,n,o),Cp(t,s,n),Tp(t,s,i),bp(t,s),r}function _p(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}function yp(t){let e=new kt(t.featureTableJson,t.featureTableBinary),r=e.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");e.featuresLength=r,t.featuresLength=r,t.pointsLength=r,t.pointCount=r,t.rtcCenter=e.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let n=Mp(t,e);return{featureTable:e,batchTable:n}}function Cp(t,e,r){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.positions){if(e.hasProperty("POSITION"))t.attributes.positions=e.getPropertyArray("POSITION",H.FLOAT,3);else if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3);if(t.isQuantized=!0,t.quantizedRange=(1<<16)-1,t.quantizedVolumeScale=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3),!t.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(t.quantizedVolumeOffset=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3),!t.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");t.attributes.positions=Cl(t,n,r)}}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function Tp(t,e,r){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.colors){let n=null;e.hasProperty("RGBA")?(n=e.getPropertyArray("RGBA",H.UNSIGNED_BYTE,4),t.isTranslucent=!0):e.hasProperty("RGB")?n=e.getPropertyArray("RGB",H.UNSIGNED_BYTE,3):e.hasProperty("RGB565")&&(n=e.getPropertyArray("RGB565",H.UNSIGNED_SHORT,1),t.isRGB565=!0),t.attributes.colors=Pi(t,n,r)}e.hasProperty("CONSTANT_RGBA")&&(t.constantRGBA=e.getGlobalProperty("CONSTANT_RGBA",H.UNSIGNED_BYTE,4))}function bp(t,e){if(t.attributes=t.attributes||{positions:null,colors:null,normals:null,batchIds:null},!t.attributes.normals){let r=null;e.hasProperty("NORMAL")?r=e.getPropertyArray("NORMAL",H.FLOAT,3):e.hasProperty("NORMAL_OCT16P")&&(r=e.getPropertyArray("NORMAL_OCT16P",H.UNSIGNED_BYTE,2),t.isOctEncoded16P=!0),t.attributes.normals=yl(t,r)}}function Mp(t,e){let r=null;if(!t.batchIds&&e.hasProperty("BATCH_ID")&&(t.batchIds=e.getPropertyArray("BATCH_ID",H.UNSIGNED_SHORT,1),t.batchIds)){let n=e.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:o,batchTableBinary:s}=t;r=new ue(o,s,n)}return r}async function wp(t,e,r,n,o){let s,i,a,f=t.batchTableJson&&t.batchTableJson.extensions&&t.batchTableJson.extensions["3DTILES_draco_point_compression"];f&&(a=f.properties);let c=e.getExtension("3DTILES_draco_point_compression");if(c){i=c.properties;let h=c.byteOffset,u=c.byteLength;if(!i||!Number.isFinite(h)||!u)throw new Error("Draco properties, byteOffset, and byteLength must be defined");s=(t.featureTableBinary||[]).slice(h,h+u),t.hasPositions=Number.isFinite(i.POSITION),t.hasColors=Number.isFinite(i.RGB)||Number.isFinite(i.RGBA),t.hasNormals=Number.isFinite(i.NORMAL),t.hasBatchIds=Number.isFinite(i.BATCH_ID),t.isTranslucent=Number.isFinite(i.RGBA)}if(!s)return!0;let l={buffer:s,properties:{...i,...a},featureTableProperties:i,batchTableProperties:a,dequantizeInShader:!1};return await Ip(t,l,n,o)}async function Ip(t,e,r,n){if(!n)return;let o={...r,draco:{...r?.draco,extraAttributes:e.batchTableProperties||{}}};delete o["3d-tiles"];let s=await Pt(e.buffer,Go,o,n),i=s.attributes.POSITION&&s.attributes.POSITION.value,a=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,f=s.attributes.NORMAL&&s.attributes.NORMAL.value,c=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,l=i&&s.attributes.POSITION.value.quantization,h=f&&s.attributes.NORMAL.value.quantization;if(l){let d=s.POSITION.data.quantization,A=d.range;t.quantizedVolumeScale=new M(A,A,A),t.quantizedVolumeOffset=new M(d.minValues),t.quantizedRange=(1<<d.quantizationBits)-1,t.isQuantizedDraco=!0}h&&(t.octEncodedRange=(1<<s.NORMAL.data.quantization.quantizationBits)-1,t.isOctEncodedDraco=!0);let u={};if(e.batchTableProperties)for(let d of Object.keys(e.batchTableProperties))s.attributes[d]&&s.attributes[d].value&&(u[d.toLowerCase()]=s.attributes[d].value);t.attributes={positions:i,colors:Pi(t,a,void 0),normals:f,batchIds:c,...u}}var Ki={};lt(Ki,{createExtMeshFeatures:()=>g1,decode:()=>u1,encode:()=>d1,name:()=>h1});var bl="4.3.0-alpha.7";var Sp=globalThis.loaders?.parseImageNode,Hi=typeof Image<"u",ki=typeof ImageBitmap<"u",Fp=Boolean(Sp),Ji=Bt?!0:Fp;function Ml(t){switch(t){case"auto":return ki||Hi||Ji;case"imagebitmap":return ki;case"image":return Hi;case"data":return Ji;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function wl(){if(ki)return"imagebitmap";if(Hi)return"image";if(Ji)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function Il(t){let e=Rp(t);if(!e)throw new Error("Not an image");return e}function Fn(t){switch(Il(t)){case"data":return t;case"image":case"imagebitmap":let e=document.createElement("canvas"),r=e.getContext("2d");if(!r)throw new Error("getImageData");return e.width=t.width,e.height=t.height,r.drawImage(t,0,0),r.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function Rp(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}var Dp=/^data:image\/svg\+xml/,Op=/\.svg((\?|#).*)?$/;function Uo(t){return t&&(Dp.test(t)||Op.test(t))}function Sl(t,e){if(Uo(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return zi(t,e)}function zi(t,e){if(Uo(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function Po(t,e,r){let n=Sl(t,r),o=self.URL||self.webkitURL,s=typeof n!="string"&&o.createObjectURL(n);try{return await Lp(s||n,e)}finally{s&&o.revokeObjectURL(s)}}async function Lp(t,e){let r=new Image;return r.src=t,e.image&&e.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,o)=>{try{r.onload=()=>n(r),r.onerror=s=>{let i=s instanceof Error?s.message:"error";o(new Error(i))}}catch(s){o(s)}})}var vp={},Fl=!0;async function Rl(t,e,r){let n;Uo(r)?n=await Po(t,e,r):n=zi(t,r);let o=e&&e.imagebitmap;return await Gp(n,o)}async function Gp(t,e=null){if((Np(e)||!Fl)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),Fl=!1}return await createImageBitmap(t)}function Np(t){for(let e in t||vp)return!1;return!0}function Dl(t){return!kp(t,"ftyp",4)||!(t[8]&96)?null:Up(t)}function Up(t){switch(Pp(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function Pp(t,e,r){return String.fromCharCode(...t.slice(e,r))}function Hp(t){return[...t].map(e=>e.charCodeAt(0))}function kp(t,e,r=0){let n=Hp(e);for(let o=0;o<n.length;++o)if(n[o]!==t[o+r])return!1;return!0}var $t=!1,Rn=!0;function je(t){let e=Dn(t);return zp(e)||jp(e)||Qp(e)||Vp(e)||Jp(e)}function Jp(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=Dl(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function zp(t){let e=Dn(t);return e.byteLength>=24&&e.getUint32(0,$t)===2303741511?{mimeType:"image/png",width:e.getUint32(16,$t),height:e.getUint32(20,$t)}:null}function Qp(t){let e=Dn(t);return e.byteLength>=10&&e.getUint32(0,$t)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Rn),height:e.getUint16(8,Rn)}:null}function Vp(t){let e=Dn(t);return e.byteLength>=14&&e.getUint16(0,$t)===16973&&e.getUint32(2,Rn)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Rn),height:e.getUint32(22,Rn)}:null}function jp(t){let e=Dn(t);if(!(e.byteLength>=3&&e.getUint16(0,$t)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:o}=Kp(),s=2;for(;s+9<e.byteLength;){let i=e.getUint16(s,$t);if(o.has(i))return{mimeType:"image/jpeg",height:e.getUint16(s+5,$t),width:e.getUint16(s+7,$t)};if(!n.has(i))return null;s+=2,s+=e.getUint16(s,$t)}return null}function Kp(){let t=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)t.add(r);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function Dn(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function Ol(t,e){let{mimeType:r}=je(t)||{},n=globalThis.loaders?.parseImageNode;return z(n),await n(t,r)}async function Ll(t,e,r){e=e||{};let o=(e.image||{}).type||"auto",{url:s}=r||{},i=Xp(o),a;switch(i){case"imagebitmap":a=await Rl(t,e,s);break;case"image":a=await Po(t,e,s);break;case"data":a=await Ol(t,e);break;default:z(!1)}return o==="data"&&(a=Fn(a)),a}function Xp(t){switch(t){case"auto":case"data":return wl();default:return Ml(t),t}}var Zp=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Yp=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Wp={image:{type:"auto",decode:!0}},Qi={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:bl,mimeTypes:Yp,extensions:Zp,parse:Ll,tests:[t=>Boolean(je(new DataView(t)))],options:Wp};var Vi={};function ji(t){if(Vi[t]===void 0){let e=Bt?$p(t):qp(t);Vi[t]=e}return Vi[t]}function qp(t){let e=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||e,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(t)}function $p(t){switch(t){case"image/avif":case"image/webp":return t1(t);default:return!0}}function t1(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}function ot(t,e){if(!t)throw new Error(e||"assert failed: gltf")}var Ho={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},ko={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var e1=1.33,vl=["SCALAR","VEC2","VEC3","VEC4"],r1=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],n1=new Map(r1),o1={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},s1={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},i1={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Jo(t){return vl[t-1]||vl[0]}function Se(t){let e=n1.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function Lr(t,e){let r=i1[t.componentType],n=o1[t.type],o=s1[t.componentType],s=t.count*n,i=t.count*n*o;ot(i>=0&&i<=e.byteLength);let a=ko[t.componentType],f=Ho[t.type];return{ArrayType:r,length:s,byteLength:i,componentByteSize:a,numberOfComponentsInElement:f}}function On(t){let{images:e,bufferViews:r}=t;e=e||[],r=r||[];let n=e.map(i=>i.bufferView);r=r.filter(i=>!n.includes(i));let o=r.reduce((i,a)=>i+a.byteLength,0),s=e.reduce((i,a)=>{let{width:f,height:c}=a.image;return i+f*c},0);return o+Math.ceil(4*s*e1)}function Gl(t,e,r){let n=t.bufferViews[r];ot(n);let o=n.buffer,s=e[o];ot(s);let i=(n.byteOffset||0)+s.byteOffset;return new Uint8Array(s.arrayBuffer,i,n.byteLength)}function Nl(t,e,r){let n=typeof r=="number"?t.accessors?.[r]:r;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(r)}`);let o=t.bufferViews?.[n.bufferView||0];if(!o)throw new Error(`No gltf buffer view for accessor ${o}`);let{arrayBuffer:s,byteOffset:i}=e[o.buffer],a=(i||0)+(n.byteOffset||0)+(o.byteOffset||0),{ArrayType:f,length:c,componentByteSize:l,numberOfComponentsInElement:h}=Lr(n,o),u=l*h,d=o.byteStride||u;if(typeof o.byteStride>"u"||o.byteStride===u)return new f(s,a,c);let A=new f(c);for(let m=0;m<n.count;m++){let p=new f(s,a+m*d,h);A.set(p,m*h)}return A}function a1(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var Q=class{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||a1(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){let r=this.getUsedExtensions().find(o=>o===e),n=this.getRequiredExtensions().find(o=>o===e);return typeof r=="string"||typeof n=="string"}getExtension(e){let r=this.getUsedExtensions().find(o=>o===e),n=this.json.extensions||{};return r?n[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(n=>n===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,r){return(e.extensions||{})[r]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,r){if(typeof r=="object")return r;let n=this.json[e]&&this.json[e][r];if(!n)throw new Error(`glTF file error: Could not find ${e}[${r}]`);return n}getTypedArrayForBufferView(e){e=this.getBufferView(e);let r=e.buffer,n=this.gltf.buffers[r];ot(n);let o=(e.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,o,e.byteLength)}getTypedArrayForAccessor(e){let r=this.getAccessor(e);return Nl(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(e){e=this.getAccessor(e);let r=this.getBufferView(e.bufferView),o=this.getBuffer(r.buffer).data,s=r.byteOffset||0;return new Uint8Array(o,s,r.byteLength)}addApplicationData(e,r){return this.json[e]=r,this}addExtraData(e,r){return this.json.extras=this.json.extras||{},this.json.extras[e]=r,this}addObjectExtension(e,r,n){return e.extensions=e.extensions||{},e.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(e,r,n){let o=e.extensions||{};o[r]=n}removeObjectExtension(e,r){let n=e?.extensions||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let o=this.json.extensionsRemoved;o.includes(r)||o.push(r)}delete n[r]}addExtension(e,r={}){return ot(r),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=r,this.registerUsedExtension(e),r}addRequiredExtension(e,r={}){return ot(r),this.addExtension(e,r),this.registerRequiredExtension(e),r}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let r=this.json.extensionsRemoved;r.includes(e)||r.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){let{nodeIndices:r}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(e){let{meshIndex:r,matrix:n}=e;this.json.nodes=this.json.nodes||[];let o={mesh:r};return n&&(o.matrix=n),this.json.nodes.push(o),this.json.nodes.length-1}addMesh(e){let{attributes:r,indices:n,material:o,mode:s=4}=e,a={primitives:[{attributes:this._addAttributes(r),mode:s}]};if(n){let f=this._addIndices(n);a.primitives[0].indices=f}return Number.isFinite(o)&&(a.primitives[0].material=o),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(e){let n={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(e,r){let n=je(e),o=r||n?.mimeType,i={bufferView:this.addBufferView(e),mimeType:o};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}addBufferView(e,r=0,n=this.byteLength){let o=e.byteLength;ot(Number.isFinite(o)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);let s={buffer:r,byteOffset:n,byteLength:o};return this.byteLength+=Tt(o,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(s),this.json.bufferViews.length-1}addAccessor(e,r){let n={bufferView:e,type:Jo(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(e,r={size:3}){let n=this.addBufferView(e),o={min:r.min,max:r.max};(!o.min||!o.max)&&(o=this._getAccessorMinMax(e,r.size));let s={size:r.size,componentType:Se(e),count:Math.round(e.length/r.size),min:o.min,max:o.max};return this.addAccessor(n,Object.assign(s,r))}addTexture(e){let{imageIndex:r}=e,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){let e=this.byteLength,r=new ArrayBuffer(e),n=new Uint8Array(r),o=0;for(let s of this.sourceBuffers||[])o=Us(s,n,o);this.json?.buffers?.[0]?this.json.buffers[0].byteLength=e:this.json.buffers=[{byteLength:e}],this.gltf.binary=r,this.sourceBuffers=[r],this.gltf.buffers=[{arrayBuffer:r,byteOffset:0,byteLength:r.byteLength}]}_removeStringFromArray(e,r){let n=!0;for(;n;){let o=e.indexOf(r);o>-1?e.splice(o,1):n=!1}}_addAttributes(e={}){let r={};for(let n in e){let o=e[n],s=this._getGltfAttributeName(n),i=this.addBinaryBuffer(o.value,o);r[s]=i}return r}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,r){let n={min:null,max:null};if(e.length<r)return n;n.min=[],n.max=[];let o=e.subarray(0,r);for(let s of o)n.min.push(s),n.max.push(s);for(let s=r;s<e.length;s+=r)for(let i=0;i<r;i++)n.min[0+i]=Math.min(n.min[0+i],e[s+i]),n.max[0+i]=Math.max(n.max[0+i],e[s+i]);return n}};function Ul(t){return(t%1+1)%1}var Pl={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},c1={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},Hl={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function Ln(t,e){return Hl[e]*Pl[t]}function vr(t,e,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let o=t.getTypedArrayForBufferView(e),s=Gr(o,"SCALAR",r,n+1);return s instanceof BigInt64Array||s instanceof BigUint64Array?null:s}function Gr(t,e,r,n=1){let o=Pl[e],s=c1[r],i=Hl[r],a=n*o,f=a*i,c=t.buffer,l=t.byteOffset;return l%i!==0&&(c=new Uint8Array(c).slice(l,l+f).buffer,l=0),new s(c,l,a)}function Nr(t,e,r){let n=`TEXCOORD_${e.texCoord||0}`,o=r.attributes[n],s=t.getTypedArrayForAccessor(o),i=t.gltf.json,a=e.index,f=i.textures?.[a]?.source;if(typeof f<"u"){let c=i.images?.[f]?.mimeType,l=t.gltf.images?.[f];if(l&&typeof l.width<"u"){let h=[];for(let u=0;u<s.length;u+=2){let d=f1(l,c,s,u,e.channels);h.push(d)}return h}}return[]}function zo(t,e,r,n,o){if(!r?.length)return;let s=[];for(let l of r){let h=n.findIndex(u=>u===l);h===-1&&(h=n.push(l)-1),s.push(h)}let i=new Uint32Array(s),a=t.gltf.buffers.push({arrayBuffer:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength})-1,f=t.addBufferView(i,a,0),c=t.addAccessor(f,{size:1,componentType:Se(i),count:i.length});o.attributes[e]=c}function f1(t,e,r,n,o=[0]){let s={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},i=r[n],a=r[n+1],f=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(f=4);let c=l1(i,a,t,f),l=0;for(let h of o){let u=typeof h=="number"?Object.values(s)[h]:s[h],d=c+u.offset,A=Fn(t);if(A.data.length<=d)throw new Error(`${A.data.length} <= ${d}`);let m=A.data[d];l|=m<<u.shift}return l}function l1(t,e,r,n=1){let o=r.width,s=Ul(t)*(o-1),i=Math.round(s),a=r.height,f=Ul(e)*(a-1),c=Math.round(f),l=r.components?r.components:n;return(c*o+i)*l}function Qo(t,e,r,n,o){let s=[];for(let i=0;i<e;i++){let a=r[i],f=r[i+1]-r[i];if(f+a>n)break;let c=a/o,l=f/o;s.push(t.slice(c,c+l))}return s}function Vo(t,e,r){let n=[];for(let o=0;o<e;o++){let s=o*r;n.push(t.slice(s,s+r))}return n}function jo(t,e,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let o=[],s=new TextDecoder("utf8"),i=0;for(let a=0;a<t;a++){let f=n[a+1]-n[a];if(f+i<=e.length){let c=e.subarray(i,f+i),l=s.decode(c);o.push(l),i+=f}}return o}return[]}var Ur="EXT_mesh_features",h1=Ur;async function u1(t,e){let r=new Q(t);A1(r,e)}function d1(t,e){let r=new Q(t);return p1(r,e),r.createBinaryChunk(),r.gltf}function A1(t,e){let r=t.gltf.json;if(r.meshes)for(let n of r.meshes)for(let o of n.primitives)m1(t,o,e)}function m1(t,e,r){if(!r?.gltf?.loadBuffers)return;let o=e.extensions?.[Ur]?.featureIds;if(o)for(let s of o){let i;if(typeof s.attribute<"u"){let a=`_FEATURE_ID_${s.attribute}`,f=e.attributes[a];i=t.getTypedArrayForAccessor(f)}else typeof s.texture<"u"&&r?.gltf?.loadImages?i=Nr(t,s.texture,e):i=[];s.data=i}}function p1(t,e){let r=t.gltf.json.meshes;if(r)for(let n of r)for(let o of n.primitives)B1(t,o)}function g1(t,e,r,n){e.extensions||(e.extensions={});let o=e.extensions[Ur];o||(o={featureIds:[]},e.extensions[Ur]=o);let{featureIds:s}=o,i={featureCount:r.length,propertyTable:n,data:r};s.push(i),t.addObjectExtension(e,Ur,o)}function B1(t,e){let r=e.extensions?.[Ur];if(!r)return;let n=r.featureIds;n.forEach((o,s)=>{if(o.data){let{accessorKey:i,index:a}=x1(e.attributes),f=new Uint32Array(o.data);n[s]={featureCount:f.length,propertyTable:o.propertyTable,attribute:a},t.gltf.buffers.push({arrayBuffer:f.buffer,byteOffset:f.byteOffset,byteLength:f.byteLength});let c=t.addBufferView(f),l=t.addAccessor(c,{size:1,componentType:Se(f),count:f.length});e.attributes[i]=l}})}function x1(t){let e="_FEATURE_ID_",r=Object.keys(t).filter(s=>s.indexOf(e)===0),n=-1;for(let s of r){let i=Number(s.substring(e.length));i>n&&(n=i)}return n++,{accessorKey:`${e}${n}`,index:n}}var Yi={};lt(Yi,{createExtStructuralMetadata:()=>k1,decode:()=>_1,encode:()=>y1,name:()=>E1});var Pr="EXT_structural_metadata",E1=Pr;async function _1(t,e){let r=new Q(t);C1(r,e)}function y1(t,e){let r=new Q(t);return P1(r,e),r.createBinaryChunk(),r.gltf}function C1(t,e){if(!e.gltf?.loadBuffers)return;let r=t.getExtension(Pr);r&&(e.gltf?.loadImages&&T1(t,r),b1(t,r))}function T1(t,e){let r=e.propertyTextures,n=t.gltf.json;if(r&&n.meshes)for(let o of n.meshes)for(let s of o.primitives)w1(t,r,s,e)}function b1(t,e){let r=e.schema;if(!r)return;let n=r.classes,o=e.propertyTables;if(n&&o)for(let s in n){let i=M1(o,s);i&&S1(t,r,i)}}function M1(t,e){for(let r of t)if(r.class===e)return r;return null}function w1(t,e,r,n){if(!e)return;let s=r.extensions?.[Pr]?.propertyTextures;if(s)for(let i of s){let a=e[i];I1(t,a,r,n)}}function I1(t,e,r,n){if(!e.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let o=e.class;for(let s in e.properties){let i=`${o}_${s}`,a=e.properties?.[s];if(!a)continue;a.data||(a.data=[]);let f=a.data,c=Nr(t,a,r);c!==null&&(zo(t,i,c,f,r),a.data=f,n.dataAttributeNames.push(i))}}function S1(t,e,r){let n=e.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let o=r.count;for(let s in n.properties){let i=n.properties[s],a=r.properties?.[s];if(a){let f=F1(t,e,i,o,a);a.data=f}}}function F1(t,e,r,n,o){let s=[],i=o.values,a=t.getTypedArrayForBufferView(i),f=R1(t,r,o,n),c=D1(t,o,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{s=O1(r,n,a,f);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{s=jo(n,a,f,c);break}case"ENUM":{s=L1(e,r,n,a,f);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return s}function R1(t,e,r,n){return e.array&&typeof e.count>"u"&&typeof r.arrayOffsets<"u"?vr(t,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function D1(t,e,r){return typeof e.stringOffsets<"u"?vr(t,e.stringOffsets,e.stringOffsetType||"UINT32",r):null}function O1(t,e,r,n){let o=t.array,s=t.count,i=Ln(t.type,t.componentType),a=r.byteLength/i,f;return t.componentType?f=Gr(r,t.type,t.componentType,a):f=r,o?n?Qo(f,e,n,r.length,i):s?Vo(f,e,s):[]:f}function L1(t,e,r,n,o){let s=e.enumType;if(!s)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let i=t.enums?.[s];if(!i)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${s}`);let a=i.valueType||"UINT16",f=Ln(e.type,a),c=n.byteLength/f,l=Gr(n,e.type,a,c);if(l||(l=n),e.array){if(o)return v1({valuesData:l,numberOfElements:r,arrayOffsets:o,valuesDataBytesLength:n.length,elementSize:f,enumEntry:i});let h=e.count;return h?G1(l,r,h,i):[]}return Zi(l,0,r,i)}function v1(t){let{valuesData:e,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:o,elementSize:s,enumEntry:i}=t,a=[];for(let f=0;f<r;f++){let c=n[f],l=n[f+1]-n[f];if(l+c>o)break;let h=c/s,u=l/s,d=Zi(e,h,u,i);a.push(d)}return a}function G1(t,e,r,n){let o=[];for(let s=0;s<e;s++){let i=r*s,a=Zi(t,i,r,n);o.push(a)}return o}function Zi(t,e,r,n){let o=[];for(let s=0;s<r;s++)if(t instanceof BigInt64Array||t instanceof BigUint64Array)o.push("");else{let i=t[e+s],a=N1(n,i);a?o.push(a.name):o.push("")}return o}function N1(t,e){for(let r of t.values)if(r.value===e)return r;return null}var U1="schemaClassId";function P1(t,e){let r=t.getExtension(Pr);if(r&&r.propertyTables)for(let n of r.propertyTables){let o=n.class,s=r.schema?.classes?.[o];n.properties&&s&&H1(n,s,t)}}function H1(t,e,r){for(let n in t.properties){let o=t.properties[n].data;if(o){let s=e.properties[n];if(s){let i=Q1(o,s,r);t.properties[n]=i}}}}function k1(t,e,r=U1){let n=t.getExtension(Pr);n||(n=t.addExtension(Pr)),n.schema=J1(e,r,n.schema);let o=z1(e,r,n.schema);return n.propertyTables||(n.propertyTables=[]),n.propertyTables.push(o)-1}function J1(t,e,r){let n=r??{id:"schema_id"},o={properties:{}};for(let s of t){let i={type:s.elementType,componentType:s.componentType};o.properties[s.name]=i}return n.classes={},n.classes[e]=o,n}function z1(t,e,r){let n={class:e,count:0},o=0,s=r.classes?.[e];for(let i of t){if(o===0&&(o=i.values.length),o!==i.values.length&&i.values.length)throw new Error("Illegal values in attributes");s?.properties[i.name]&&(n.properties||(n.properties={}),n.properties[i.name]={values:0,data:i.values})}return n.count=o,n}function Q1(t,e,r){let n={values:0};if(e.type==="STRING"){let{stringData:o,stringOffsets:s}=K1(t);n.stringOffsets=Xi(s,r),n.values=Xi(o,r)}else if(e.type==="SCALAR"&&e.componentType){let o=j1(t,e.componentType);n.values=Xi(o,r)}return n}var V1={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array};function j1(t,e){let r=[];for(let o of t)r.push(Number(o));let n=V1[e];if(!n)throw new Error("Illegal component type");return new n(r)}function K1(t){let e=new TextEncoder,r=[],n=0;for(let f of t){let c=e.encode(f);n+=c.length,r.push(c)}let o=new Uint8Array(n),s=[],i=0;for(let f of r)o.set(f,i),s.push(i),i+=f.length;s.push(i);let a=new Uint32Array(s);return{stringData:o,stringOffsets:a}}function Xi(t,e){return e.gltf.buffers.push({arrayBuffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}),e.addBufferView(t)}var Wi={};lt(Wi,{decode:()=>Z1,name:()=>X1});var kl="EXT_feature_metadata",X1=kl;async function Z1(t,e){let r=new Q(t);Y1(r,e)}function Y1(t,e){if(!e.gltf?.loadBuffers)return;let r=t.getExtension(kl);r&&(e.gltf?.loadImages&&W1(t,r),q1(t,r))}function W1(t,e){let r=e.schema;if(!r)return;let n=r.classes,{featureTextures:o}=e;if(n&&o)for(let s in n){let i=n[s],a=tg(o,s);a&&rg(t,a,i)}}function q1(t,e){let r=e.schema;if(!r)return;let n=r.classes,o=e.featureTables;if(n&&o)for(let s in n){let i=$1(o,s);i&&eg(t,r,i)}}function $1(t,e){for(let r in t){let n=t[r];if(n.class===e)return n}return null}function tg(t,e){for(let r in t){let n=t[r];if(n.class===e)return n}return null}function eg(t,e,r){if(!r.class)return;let n=e.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let o=r.count;for(let s in n.properties){let i=n.properties[s],a=r.properties?.[s];if(a){let f=ng(t,e,i,o,a);a.data=f}}}function rg(t,e,r){let n=e.class;for(let o in r.properties){let s=e?.properties?.[o];if(s){let i=cg(t,s,n);s.data=i}}}function ng(t,e,r,n,o){let s=[],i=o.bufferView,a=t.getTypedArrayForBufferView(i),f=og(t,r,o,n),c=sg(t,r,o,n);return r.type==="STRING"||r.componentType==="STRING"?s=jo(n,a,f,c):ig(r)&&(s=ag(r,n,a,f)),s}function og(t,e,r,n){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?vr(t,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function sg(t,e,r,n){return typeof r.stringOffsetBufferView<"u"?vr(t,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function ig(t){let e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(t.type)||typeof t.componentType<"u"&&e.includes(t.componentType)}function ag(t,e,r,n){let o=t.type==="ARRAY",s=t.componentCount,i="SCALAR",a=t.componentType||t.type,f=Ln(i,a),c=r.byteLength/f,l=Gr(r,i,a,c);return o?n?Qo(l,e,n,r.length,f):s?Vo(l,e,s):[]:l}function cg(t,e,r){let n=t.gltf.json;if(!n.meshes)return[];let o=[];for(let s of n.meshes)for(let i of s.primitives)fg(t,r,e,o,i);return o}function fg(t,e,r,n,o){let s={channels:r.channels,...r.texture},i=Nr(t,s,o);i&&zo(t,e,i,n,o)}var Jl="4.3.0-alpha.7";var zl="4.3.0-alpha.7";var Ko={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},Ql;async function $i(t){dn(t.modules);let e=vs("basis");return e||(Ql||=lg(t),await Ql)}async function lg(t){let e=null,r=null;return[e,r]=await Promise.all([await Yt(Ko.TRANSCODER,"textures",t),await Yt(Ko.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await hg(e,r)}function hg(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:s,initializeBasis:i}=o;i(),n({BasisFile:s})})})}var qi;async function ta(t){let e=t.modules||{};return e.basisEncoder?e.basisEncoder:(qi=qi||ug(t),await qi)}async function ug(t){let e=null,r=null;return[e,r]=await Promise.all([await Yt(Ko.ENCODER,"textures",t),await Yt(Ko.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await dg(e,r)}function dg(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t(r).then(o=>{let{BasisFile:s,KTX2File:i,initializeBasis:a,BasisEncoder:f}=o;a(),n({BasisFile:s,KTX2File:i,BasisEncoder:f})})})}var Ke={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var Ag=["","WEBKIT_","MOZ_"],Vl={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},Xo=null;function jl(t){if(!Xo){t=t||mg()||void 0,Xo=new Set;for(let e of Ag)for(let r in Vl)if(t&&t.getExtension(`${e}${r}`)){let n=Vl[r];Xo.add(n)}}return Xo}function mg(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var Mt=[171,75,84,88,32,50,48,187,13,10,26,10];function Kl(t){let e=new Uint8Array(t);return!(e.byteLength<Mt.length||e[0]!==Mt[0]||e[1]!==Mt[1]||e[2]!==Mt[2]||e[3]!==Mt[3]||e[4]!==Mt[4]||e[5]!==Mt[5]||e[6]!==Mt[6]||e[7]!==Mt[7]||e[8]!==Mt[8]||e[9]!==Mt[9]||e[10]!==Mt[10]||e[11]!==Mt[11])}var pg={etc1:{basisFormat:0,compressed:!0,format:Ke.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Ke.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Ke.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:Ke.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Ke.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Ke.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function ra(t,e){if(e.basis.containerFormat==="auto"){if(Kl(t)){let n=await ta(e);return Xl(n.KTX2File,t,e)}let{BasisFile:r}=await $i(e);return ea(r,t,e)}switch(e.basis.module){case"encoder":let r=await ta(e);switch(e.basis.containerFormat){case"ktx2":return Xl(r.KTX2File,t,e);case"basis":default:return ea(r.BasisFile,t,e)}case"transcoder":default:let{BasisFile:n}=await $i(e);return ea(n,t,e)}}function ea(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let o=n.getNumImages(),s=[];for(let i=0;i<o;i++){let a=n.getNumLevels(i),f=[];for(let c=0;c<a;c++)f.push(gg(n,i,c,r));s.push(f)}return s}finally{n.close(),n.delete()}}function gg(t,e,r,n){let o=t.getImageWidth(e,r),s=t.getImageHeight(e,r),i=t.getHasAlpha(),{compressed:a,format:f,basisFormat:c}=Zl(n,i),l=t.getImageTranscodedSizeInBytes(e,r,c),h=new Uint8Array(l);if(!t.transcodeImage(h,e,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:o,height:s,data:h,compressed:a,format:f,hasAlpha:i}}function Xl(t,e,r){let n=new t(new Uint8Array(e));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let o=n.getLevels(),s=[];for(let i=0;i<o;i++)s.push(Bg(n,i,r));return[s]}finally{n.close(),n.delete()}}function Bg(t,e,r){let{alphaFlag:n,height:o,width:s}=t.getImageLevelInfo(e,0,0),{compressed:i,format:a,basisFormat:f}=Zl(r,n),c=t.getImageTranscodedSizeInBytes(e,0,0,f),l=new Uint8Array(c);if(!t.transcodeImage(l,e,0,0,f,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:s,height:o,data:l,compressed:i,levelSize:c,hasAlpha:n,format:a}}function Zl(t,e){let r=t&&t.basis&&t.basis.format;return r==="auto"&&(r=Zo()),typeof r=="object"&&(r=e?r.alpha:r.noAlpha),r=r.toLowerCase(),pg[r]}function Zo(){let t=jl();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}var Yl={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:zl,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},na={...Yl,parse:ra};var Hr=!0,Wl=1735152710,ia=12,Yo=8,xg=1313821514,Eg=5130562,_g=0,yg=0,Cg=1;function Tg(t,e=0){return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}function ql(t,e=0,r={}){let n=new DataView(t),{magic:o=Wl}=r,s=n.getUint32(e,!1);return s===o||s===Wl}function $l(t,e,r=0,n={}){let o=new DataView(e),s=Tg(o,r+0),i=o.getUint32(r+4,Hr),a=o.getUint32(r+8,Hr);switch(Object.assign(t,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:s,version:i,json:{},binChunks:[]}),r+=ia,t.version){case 1:return bg(t,o,r);case 2:return Mg(t,o,r,n={});default:throw new Error(`Invalid GLB version ${t.version}. Only supports version 1 and 2.`)}}function bg(t,e,r){z(t.header.byteLength>ia+Yo);let n=e.getUint32(r+0,Hr),o=e.getUint32(r+4,Hr);return r+=Yo,z(o===_g),oa(t,e,r,n),r+=n,r+=sa(t,e,r,t.header.byteLength),r}function Mg(t,e,r,n){return z(t.header.byteLength>ia+Yo),wg(t,e,r,n),r+t.header.byteLength}function wg(t,e,r,n){for(;r+8<=t.header.byteLength;){let o=e.getUint32(r+0,Hr),s=e.getUint32(r+4,Hr);switch(r+=Yo,s){case xg:oa(t,e,r,o);break;case Eg:sa(t,e,r,o);break;case yg:n.strict||oa(t,e,r,o);break;case Cg:n.strict||sa(t,e,r,o);break;default:break}r+=Tt(o,4)}return r}function oa(t,e,r,n){let o=new Uint8Array(e.buffer,r,n),i=new TextDecoder("utf8").decode(o);return t.json=JSON.parse(i),Tt(n,4)}function sa(t,e,r,n){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:e.buffer}),Tt(n,4)}function aa(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;let n=e.baseUri||e.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${t}`);return n.substr(0,n.lastIndexOf("/")+1)+t}var fa={};lt(fa,{decode:()=>Pg,name:()=>Ug});var Ig="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy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,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Rg=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Dg={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Og={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function th(t,e,r,n,o,s="NONE"){let i=await Lg();Ng(i,i.exports[Og[o]],t,e,r,n,i.exports[Dg[s||"NONE"]])}var ca;async function Lg(){return ca||(ca=vg()),ca}async function vg(){let t=Ig;WebAssembly.validate(Fg)&&(t=Sg,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let e=await WebAssembly.instantiate(Gg(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}function Gg(t){let e=new Uint8Array(t.length);for(let n=0;n<t.length;++n){let o=t.charCodeAt(n);e[n]=o>96?o-71:o>64?o-65:o>47?o+4:o>46?63:62}let r=0;for(let n=0;n<t.length;++n)e[r++]=e[n]<60?Rg[e[n]]:(e[n]-60)*64+e[++n];return e.buffer.slice(0,r)}function Ng(t,e,r,n,o,s,i){let a=t.exports.sbrk,f=n+3&-4,c=a(f*o),l=a(s.length),h=new Uint8Array(t.exports.memory.buffer);h.set(s,l);let u=e(c,n,o,l,s.length);if(u===0&&i&&i(c,f,o),r.set(h.subarray(c,c+n*o)),a(c-a(0)),u!==0)throw new Error(`Malformed buffer data: ${u}`)}var Wo="EXT_meshopt_compression",Ug=Wo;async function Pg(t,e){let r=new Q(t);if(!e?.gltf?.decompressMeshes||!e.gltf?.loadBuffers)return;let n=[];for(let o of t.json.bufferViews||[])n.push(Hg(r,o));await Promise.all(n),r.removeExtension(Wo)}async function Hg(t,e){let r=t.getObjectExtension(e,Wo);if(r){let{byteOffset:n=0,byteLength:o=0,byteStride:s,count:i,mode:a,filter:f="NONE",buffer:c}=r,l=t.gltf.buffers[c],h=new Uint8Array(l.arrayBuffer,l.byteOffset+n,o),u=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);await th(u,i,s,h,a,f),t.removeObjectExtension(e,Wo)}}var la={};lt(la,{name:()=>kg,preprocess:()=>Jg});var kr="EXT_texture_webp",kg=kr;function Jg(t,e){let r=new Q(t);if(!ji("image/webp")){if(r.getRequiredExtensions().includes(kr))throw new Error(`gltf: Required extension ${kr} not supported by browser`);return}let{json:n}=r;for(let o of n.textures||[]){let s=r.getObjectExtension(o,kr);s&&(o.source=s.source),r.removeObjectExtension(o,kr)}r.removeExtension(kr)}var ha={};lt(ha,{name:()=>zg,preprocess:()=>Qg});var qo="KHR_texture_basisu",zg=qo;function Qg(t,e){let r=new Q(t),{json:n}=r;for(let o of n.textures||[]){let s=r.getObjectExtension(o,qo);s&&(o.source=s.source,r.removeObjectExtension(o,qo))}r.removeExtension(qo)}var da={};lt(da,{decode:()=>Zg,encode:()=>Yg,name:()=>Kg,preprocess:()=>Xg});function eh(t){let e={};for(let r in t){let n=t[r];if(r!=="indices"){let o=ua(n);e[r]=o}}return e}function ua(t){let{buffer:e,size:r,count:n}=Vg(t);return{value:e,size:r,byteOffset:0,count:n,type:Jo(r),componentType:Se(e)}}function Vg(t){let e=t,r=1,n=0;return t&&t.value&&(e=t.value,r=t.size||1),e&&(ArrayBuffer.isView(e)||(e=jg(e,Float32Array)),n=e.length/r),{buffer:e,size:r,count:n}}function jg(t,e,r=!1){return t?Array.isArray(t)?new e(t):r&&!(t instanceof e)?new e(t):t:null}var Fe="KHR_draco_mesh_compression",Kg=Fe;function Xg(t,e,r){let n=new Q(t);for(let o of rh(n))n.getObjectExtension(o,Fe)}async function Zg(t,e,r){if(!e?.gltf?.decompressMeshes)return;let n=new Q(t),o=[];for(let s of rh(n))n.getObjectExtension(s,Fe)&&o.push(Wg(n,s,e,r));await Promise.all(o),n.removeExtension(Fe)}function Yg(t,e={}){let r=new Q(t);for(let n of r.json.meshes||[])qg(n,e),r.addRequiredExtension(Fe)}async function Wg(t,e,r,n){let o=t.getObjectExtension(e,Fe);if(!o)return;let s=t.getTypedArrayForBufferView(o.bufferView),i=Pe(s.buffer,s.byteOffset),a={...r};delete a["3d-tiles"];let f=await Pt(i,Go,a,n),c=eh(f.attributes);for(let[l,h]of Object.entries(c))if(l in e.attributes){let u=e.attributes[l],d=t.getAccessor(u);d?.min&&d?.max&&(h.min=d.min,h.max=d.max)}e.attributes=c,f.indices&&(e.indices=ua(f.indices)),t.removeObjectExtension(e,Fe),$g(e)}function qg(t,e,r=4,n,o){if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let s=n.DracoWriter.encodeSync({attributes:t}),i=o?.parseSync?.({attributes:t}),a=n._addFauxAttributes(i.attributes),f=n.addBufferView(s);return{primitives:[{attributes:a,mode:r,extensions:{[Fe]:{bufferView:f,attributes:a}}}]}}function $g(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*rh(t){for(let e of t.json.meshes||[])for(let r of e.primitives)yield r}var Aa={};lt(Aa,{decode:()=>nB,name:()=>tB});var ts="KHR_texture_transform",tB=ts,$o=new M,eB=new X,rB=new X;async function nB(t,e){if(!new Q(t).hasExtension(ts)||!e.gltf?.loadBuffers)return;let o=t.json.materials||[];for(let s=0;s<o.length;s++)oB(s,t)}function oB(t,e){let r=e.json.materials?.[t],n=[r?.pbrMetallicRoughness?.baseColorTexture,r?.emissiveTexture,r?.normalTexture,r?.occlusionTexture,r?.pbrMetallicRoughness?.metallicRoughnessTexture],o=[];for(let s of n)s&&s?.extensions?.[ts]&&sB(e,t,s,o)}function sB(t,e,r,n){let o=iB(r,n);if(!o)return;let s=t.json.meshes||[];for(let i of s)for(let a of i.primitives){let f=a.material;Number.isFinite(f)&&e===f&&aB(t,a,o)}}function iB(t,e){let r=t.extensions?.[ts],{texCoord:n=0}=t,{texCoord:o=n}=r;if(!(e.findIndex(([i,a])=>i===n&&a===o)!==-1)){let i=lB(r);return n!==o&&(t.texCoord=o),e.push([n,o]),{originalTexCoord:n,texCoord:o,matrix:i}}return null}function aB(t,e,r){let{originalTexCoord:n,texCoord:o,matrix:s}=r,i=e.attributes[`TEXCOORD_${n}`];if(Number.isFinite(i)){let a=t.json.accessors?.[i];if(a&&a.bufferView){let f=t.json.bufferViews?.[a.bufferView];if(f){let{arrayBuffer:c,byteOffset:l}=t.buffers[f.buffer],h=(l||0)+(a.byteOffset||0)+(f.byteOffset||0),{ArrayType:u,length:d}=Lr(a,f),A=ko[a.componentType],m=Ho[a.type],p=f.byteStride||A*m,E=new Float32Array(d);for(let y=0;y<a.count;y++){let T=new u(c,h+y*p,2);$o.set(T[0],T[1],1),$o.transformByMatrix3(s),E.set([$o[0],$o[1]],y*m)}n===o?cB(a,f,t.buffers,E):fB(o,a,e,t,E)}}}}function cB(t,e,r,n){t.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),e.buffer=r.length-1,e.byteLength=n.buffer.byteLength,e.byteOffset=0,delete e.byteStride}function fB(t,e,r,n,o){n.buffers.push({arrayBuffer:o.buffer,byteOffset:0,byteLength:o.buffer.byteLength});let s=n.json.bufferViews;if(!s)return;s.push({buffer:n.buffers.length-1,byteLength:o.buffer.byteLength,byteOffset:0});let i=n.json.accessors;i&&(i.push({bufferView:s?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),r.attributes[`TEXCOORD_${t}`]=i.length-1)}function lB(t){let{offset:e=[0,0],rotation:r=0,scale:n=[1,1]}=t,o=new X().set(1,0,0,0,1,0,e[0],e[1],1),s=eB.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),i=rB.set(n[0],0,0,0,n[1],0,0,0,1);return o.multiplyRight(s).multiplyRight(i)}var ma={};lt(ma,{decode:()=>uB,encode:()=>dB,name:()=>hB});var Xe="KHR_lights_punctual",hB=Xe;async function uB(t){let e=new Q(t),{json:r}=e,n=e.getExtension(Xe);n&&(e.json.lights=n.lights,e.removeExtension(Xe));for(let o of r.nodes||[]){let s=e.getObjectExtension(o,Xe);s&&(o.light=s.light),e.removeObjectExtension(o,Xe)}}async function dB(t){let e=new Q(t),{json:r}=e;if(r.lights){let n=e.addExtension(Xe);ot(!n.lights),n.lights=r.lights,delete r.lights}if(e.json.lights){for(let n of e.json.lights){let o=n.node;e.addObjectExtension(o,Xe,n)}delete e.json.lights}}var pa={};lt(pa,{decode:()=>mB,encode:()=>pB,name:()=>AB});var vn="KHR_materials_unlit",AB=vn;async function mB(t){let e=new Q(t),{json:r}=e;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),e.removeObjectExtension(n,vn);e.removeExtension(vn)}function pB(t){let e=new Q(t),{json:r}=e;if(e.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,e.addObjectExtension(n,vn,{}),e.addExtension(vn))}var ga={};lt(ga,{decode:()=>BB,encode:()=>xB,name:()=>gB});var Gn="KHR_techniques_webgl",gB=Gn;async function BB(t){let e=new Q(t),{json:r}=e,n=e.getExtension(Gn);if(n){let o=EB(n,e);for(let s of r.materials||[]){let i=e.getObjectExtension(s,Gn);i&&(s.technique=Object.assign({},i,o[i.technique]),s.technique.values=_B(s.technique,e)),e.removeObjectExtension(s,Gn)}e.removeExtension(Gn)}}async function xB(t,e){}function EB(t,e){let{programs:r=[],shaders:n=[],techniques:o=[]}=t,s=new TextDecoder;return n.forEach(i=>{if(Number.isFinite(i.bufferView))i.code=s.decode(e.getTypedArrayForBufferView(i.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),r.forEach(i=>{i.fragmentShader=n[i.fragmentShader],i.vertexShader=n[i.vertexShader]}),o.forEach(i=>{i.program=r[i.program]}),o}function _B(t,e){let r=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(n=>{t.uniforms[n].value&&!(n in r)&&(r[n]=t.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=e.getTexture(r[n].index))}),r}var nh=[Yi,Ki,fa,la,ha,da,ma,pa,ga,Aa,Wi];function oh(t,e={},r){let n=nh.filter(o=>ih(o.name,e));for(let o of n)o.preprocess?.(t,e,r)}async function sh(t,e={},r){let n=nh.filter(o=>ih(o.name,e));for(let o of n)await o.decode?.(t,e,r)}function ih(t,e){let r=e?.gltf?.excludeExtensions||{};return!(t in r&&!r[t])}var Ba="KHR_binary_glTF";function ah(t){let e=new Q(t),{json:r}=e;for(let n of r.images||[]){let o=e.getObjectExtension(n,Ba);o&&Object.assign(n,o),e.removeObjectExtension(n,Ba)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,e.removeExtension(Ba)}var ch={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},CB={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},xa=class{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(e,r){this.json=e.json;let n=e.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!r.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),ah(e),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(let r in ch)this._convertTopLevelObjectToArray(e,r)}_convertTopLevelObjectToArray(e,r){let n=e[r];if(!(!n||Array.isArray(n))){e[r]=[];for(let o in n){let s=n[o];s.id=s.id||o;let i=e[r].length;e[r].push(s),this.idToIndexMap[r][o]=i}}}_convertObjectIdsToArrayIndices(e){for(let r in ch)this._convertIdsToIndices(e,r);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(let r of e.textures)this._convertTextureIds(r);for(let r of e.meshes)this._convertMeshIds(r);for(let r of e.nodes)this._convertNodeIds(r);for(let r of e.scenes)this._convertSceneIds(r)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(let r of e.primitives){let{attributes:n,indices:o,material:s}=r;for(let i in n)n[i]=this._convertIdToIndex(n[i],"accessor");o&&(r.indices=this._convertIdToIndex(o,"accessor")),s&&(r.material=this._convertIdToIndex(s,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(r=>this._convertIdToIndex(r,"node"))),e.meshes&&(e.meshes=e.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(e,r){e[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),e[r]=[]);for(let n of e[r])for(let o in n){let s=n[o],i=this._convertIdToIndex(s,o);n[o]=i}}_convertIdToIndex(e,r){let n=CB[r];if(n in this.idToIndexMap){let o=this.idToIndexMap[n][e];if(!Number.isFinite(o))throw new Error(`gltf v1: failed to resolve ${r} with id ${e}`);return o}return e}_updateObjects(e){for(let r of this.json.buffers)delete r.type}_updateMaterial(e){for(let r of e.materials){r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let n=r.values?.tex||r.values?.texture2d_0||r.values?.diffuseTex,o=e.textures.findIndex(s=>s.id===n);o!==-1&&(r.pbrMetallicRoughness.baseColorTexture={index:o})}}};function fh(t,e={}){return new xa().normalize(t,e)}async function lh(t,e,r=0,n,o){return TB(t,e,r,n),fh(t,{normalize:n?.gltf?.normalize}),oh(t,n,o),n?.gltf?.loadBuffers&&t.json.buffers&&await bB(t,n,o),n?.gltf?.loadImages&&await MB(t,n,o),await sh(t,n,o),t}function TB(t,e,r,n){if(n.uri&&(t.baseUri=n.uri),e instanceof ArrayBuffer&&!ql(e,r,n)&&(e=new TextDecoder().decode(e)),typeof e=="string")t.json=Ns(e);else if(e instanceof ArrayBuffer){let i={};r=$l(i,e,r,n.glb),ot(i.type==="glTF",`Invalid GLB magic string ${i.type}`),t._glb=i,t.json=i.json}else ot(!1,"GLTF: must be ArrayBuffer or string");let o=t.json.buffers||[];if(t.buffers=new Array(o.length).fill(null),t._glb&&t._glb.header.hasBinChunk){let{binChunks:i}=t._glb;t.buffers[0]={arrayBuffer:i[0].arrayBuffer,byteOffset:i[0].byteOffset,byteLength:i[0].byteLength}}let s=t.json.images||[];t.images=new Array(s.length).fill({})}async function bB(t,e,r){let n=t.json.buffers||[];for(let o=0;o<n.length;++o){let s=n[o];if(s.uri){let{fetch:i}=r;ot(i);let a=aa(s.uri,e),c=await(await r?.fetch?.(a))?.arrayBuffer?.();t.buffers[o]={arrayBuffer:c,byteOffset:0,byteLength:c.byteLength},delete s.uri}else t.buffers[o]===null&&(t.buffers[o]={arrayBuffer:new ArrayBuffer(s.byteLength),byteOffset:0,byteLength:s.byteLength})}}async function MB(t,e,r){let n=wB(t),o=t.json.images||[],s=[];for(let i of n)s.push(IB(t,o[i],i,e,r));return await Promise.all(s)}function wB(t){let e=new Set,r=t.json.textures||[];for(let n of r)n.source!==void 0&&e.add(n.source);return Array.from(e).sort()}async function IB(t,e,r,n,o){let s;if(e.uri&&!e.hasOwnProperty("bufferView")){let a=aa(e.uri,n),{fetch:f}=o;s=await(await f(a)).arrayBuffer(),e.bufferView={data:s}}if(Number.isFinite(e.bufferView)){let a=Gl(t.json,t.buffers,e.bufferView);s=Pe(a.buffer,a.byteOffset,a.byteLength)}ot(s,"glTF image has no data");let i=await Pt(s,[Qi,na],{...n,mimeType:e.mimeType,basis:n.basis||{format:Zo()}},o);i&&i[0]&&(i={compressed:!0,mipmaps:!1,width:i[0].width,height:i[0].height,data:i[0]}),t.images=t.images||[],t.images[r]=i}var Ze={dataType:null,batchType:null,name:"glTF",id:"gltf",module:"gltf",version:Jl,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:SB,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function SB(t,e={},r){e={...Ze.options,...e},e.gltf={...Ze.options.gltf,...e.gltf};let{byteOffset:n=0}=e;return await lh({},t,n,e,r)}var FB={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},RB={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Dt={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},DB={magFilter:Dt.TEXTURE_MAG_FILTER,minFilter:Dt.TEXTURE_MIN_FILTER,wrapS:Dt.TEXTURE_WRAP_S,wrapT:Dt.TEXTURE_WRAP_T},OB={[Dt.TEXTURE_MAG_FILTER]:Dt.LINEAR,[Dt.TEXTURE_MIN_FILTER]:Dt.NEAREST_MIPMAP_LINEAR,[Dt.TEXTURE_WRAP_S]:Dt.REPEAT,[Dt.TEXTURE_WRAP_T]:Dt.REPEAT};function LB(){return{id:"default-sampler",parameters:OB}}function vB(t){return RB[t]}function GB(t){return FB[t]}var Ea=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(e,r={}){let{json:n,buffers:o=[],images:s=[]}=e,{baseUri:i=""}=e;return ot(n),this.baseUri=i,this.buffers=o,this.images=s,this.jsonUnprocessed=n,this.json=this._resolveTree(e.json,r),this.json}_resolveTree(e,r={}){let n={...e};return this.json=n,e.bufferViews&&(n.bufferViews=e.bufferViews.map((o,s)=>this._resolveBufferView(o,s))),e.images&&(n.images=e.images.map((o,s)=>this._resolveImage(o,s))),e.samplers&&(n.samplers=e.samplers.map((o,s)=>this._resolveSampler(o,s))),e.textures&&(n.textures=e.textures.map((o,s)=>this._resolveTexture(o,s))),e.accessors&&(n.accessors=e.accessors.map((o,s)=>this._resolveAccessor(o,s))),e.materials&&(n.materials=e.materials.map((o,s)=>this._resolveMaterial(o,s))),e.meshes&&(n.meshes=e.meshes.map((o,s)=>this._resolveMesh(o,s))),e.nodes&&(n.nodes=e.nodes.map((o,s)=>this._resolveNode(o,s)),n.nodes=n.nodes.map((o,s)=>this._resolveNodeChildren(o))),e.skins&&(n.skins=e.skins.map((o,s)=>this._resolveSkin(o,s))),e.scenes&&(n.scenes=e.scenes.map((o,s)=>this._resolveScene(o,s))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(e){return this._get(this.json.scenes,e)}getNode(e){return this._get(this.json.nodes,e)}getSkin(e){return this._get(this.json.skins,e)}getMesh(e){return this._get(this.json.meshes,e)}getMaterial(e){return this._get(this.json.materials,e)}getAccessor(e){return this._get(this.json.accessors,e)}getCamera(e){return this._get(this.json.cameras,e)}getTexture(e){return this._get(this.json.textures,e)}getSampler(e){return this._get(this.json.samplers,e)}getImage(e){return this._get(this.json.images,e)}getBufferView(e){return this._get(this.json.bufferViews,e)}getBuffer(e){return this._get(this.json.buffers,e)}_get(e,r){if(typeof r=="object")return r;let n=e&&e[r];return n||console.warn(`glTF file error: Could not find ${e}[${r}]`),n}_resolveScene(e,r){return{...e,id:e.id||`scene-${r}`,nodes:(e.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(e,r){let n={...e,id:e?.id||`node-${r}`};return e.mesh!==void 0&&(n.mesh=this.getMesh(e.mesh)),e.camera!==void 0&&(n.camera=this.getCamera(e.camera)),e.skin!==void 0&&(n.skin=this.getSkin(e.skin)),e.meshes!==void 0&&e.meshes.length&&(n.mesh=e.meshes.reduce((o,s)=>{let i=this.getMesh(s);return o.id=i.id,o.primitives=o.primitives.concat(i.primitives),o},{primitives:[]})),n}_resolveNodeChildren(e){return e.children&&(e.children=e.children.map(r=>this.getNode(r))),e}_resolveSkin(e,r){let n=typeof e.inverseBindMatrices=="number"?this.getAccessor(e.inverseBindMatrices):void 0;return{...e,id:e.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(e,r){let n={...e,id:e.id||`mesh-${r}`,primitives:[]};return e.primitives&&(n.primitives=e.primitives.map(o=>{let s={...o,attributes:{},indices:void 0,material:void 0},i=o.attributes;for(let a in i)s.attributes[a]=this.getAccessor(i[a]);return o.indices!==void 0&&(s.indices=this.getAccessor(o.indices)),o.material!==void 0&&(s.material=this.getMaterial(o.material)),s})),n}_resolveMaterial(e,r){let n={...e,id:e.id||`material-${r}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};let o=n.pbrMetallicRoughness;o.baseColorTexture&&(o.baseColorTexture={...o.baseColorTexture},o.baseColorTexture.texture=this.getTexture(o.baseColorTexture.index)),o.metallicRoughnessTexture&&(o.metallicRoughnessTexture={...o.metallicRoughnessTexture},o.metallicRoughnessTexture.texture=this.getTexture(o.metallicRoughnessTexture.index))}return n}_resolveAccessor(e,r){let n=vB(e.componentType),o=GB(e.type),s=n*o,i={...e,id:e.id||`accessor-${r}`,bytesPerComponent:n,components:o,bytesPerElement:s,value:void 0,bufferView:void 0,sparse:void 0};if(e.bufferView!==void 0&&(i.bufferView=this.getBufferView(e.bufferView)),i.bufferView){let a=i.bufferView.buffer,{ArrayType:f,byteLength:c}=Lr(i,i.bufferView),l=(i.bufferView.byteOffset||0)+(i.byteOffset||0)+a.byteOffset,h=a.arrayBuffer.slice(l,l+c);i.bufferView.byteStride&&(h=this._getValueFromInterleavedBuffer(a,l,i.bufferView.byteStride,i.bytesPerElement,i.count)),i.value=new f(h)}return i}_getValueFromInterleavedBuffer(e,r,n,o,s){let i=new Uint8Array(s*o);for(let a=0;a<s;a++){let f=r+a*n;i.set(new Uint8Array(e.arrayBuffer.slice(f,f+o)),a*o)}return i.buffer}_resolveTexture(e,r){return{...e,id:e.id||`texture-${r}`,sampler:typeof e.sampler=="number"?this.getSampler(e.sampler):LB(),source:typeof e.source=="number"?this.getImage(e.source):void 0}}_resolveSampler(e,r){let n={id:e.id||`sampler-${r}`,...e,parameters:{}};for(let o in n){let s=this._enumSamplerParameter(o);s!==void 0&&(n.parameters[s]=n[o])}return n}_enumSamplerParameter(e){return DB[e]}_resolveImage(e,r){let n={...e,id:e.id||`image-${r}`,image:null,bufferView:e.bufferView!==void 0?this.getBufferView(e.bufferView):void 0},o=this.images[r];return o&&(n.image=o),n}_resolveBufferView(e,r){let n=e.buffer,o=this.buffers[n].arrayBuffer,s=this.buffers[n].byteOffset||0;return e.byteOffset&&(s+=e.byteOffset),{id:`bufferView-${r}`,...e,buffer:this.buffers[n],data:new Uint8Array(o,s,e.byteLength)}}_resolveCamera(e,r){let n={...e,id:e.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function Nn(t,e){return new Ea().postProcess(t,e)}var es={URI:0,EMBEDDED:1};function rs(t,e,r,n){t.rotateYtoZ=!0;let o=(t.byteOffset||0)+(t.byteLength||0)-r;if(o===0)throw new Error("glTF byte length must be greater than 0.");return t.gltfUpAxis=n?.["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",t.gltfArrayBuffer=Pe(e,r,o),t.gltfByteOffset=0,t.gltfByteLength=o,r%4===0||console.warn(`${t.type}: embedded glb is not aligned to a 4-byte boundary.`),(t.byteOffset||0)+(t.byteLength||0)}async function ns(t,e,r,n){let o=r?.["3d-tiles"]||{};if(NB(t,e,r),o.loadGLTF){if(!n)return;if(t.gltfUrl){let{fetch:s}=n,i=await s(t.gltfUrl,r);t.gltfArrayBuffer=await i.arrayBuffer(),t.gltfByteOffset=0}if(t.gltfArrayBuffer){let s=await Pt(t.gltfArrayBuffer,Ze,r,n);t.gltf=Nn(s),t.gpuMemoryUsageInBytes=On(t.gltf),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength}}}function NB(t,e,r){switch(e){case es.URI:if(t.gltfArrayBuffer){let n=new Uint8Array(t.gltfArrayBuffer,t.gltfByteOffset),s=new TextDecoder().decode(n);t.gltfUrl=s.replace(/[\s\0]+$/,"")}delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength;break;case es.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function hh(t,e,r,n,o){r=UB(t,e,r,n,o),await ns(t,es.EMBEDDED,n,o);let s=t?.gltf?.extensions;return s&&s.CESIUM_RTC&&(t.rtcCenter=s.CESIUM_RTC.center),r}function UB(t,e,r,n,o){r=Ie(t,e,r),r=Dr(t,e,r),r=Or(t,e,r,n),r=rs(t,e,r,n);let s=new kt(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=s.getGlobalProperty("RTC_CENTER",H.FLOAT,3),r}async function uh(t,e,r,n,o){return r=PB(t,e,r,n,o),await ns(t,t.gltfFormat||0,n,o),r}function PB(t,e,r,n,o){if(r=Ie(t,e,r),t.version!==1)throw new Error(`Instanced 3D Model version ${t.version} is not supported`);r=Dr(t,e,r);let s=new DataView(e);if(t.gltfFormat=s.getUint32(r,!0),r+=4,r=Or(t,e,r,n),r=rs(t,e,r,n),!t?.header?.featureTableJsonByteLength||t.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let i=new kt(t.featureTableJson,t.featureTableBinary),a=i.getGlobalProperty("INSTANCES_LENGTH");if(i.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");t.eastNorthUp=i.getGlobalProperty("EAST_NORTH_UP"),t.rtcCenter=i.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let f=new ue(t.batchTableJson,t.batchTableBinary,a);return HB(t,i,f,a),r}function HB(t,e,r,n){let o=new Array(n),s=new M,i=new M,a=new M,f=new M,c=new X,l=new Ce,h=new M,u={},d=new St,A=[],m=[],p=[],E=[];for(let y=0;y<n;y++){let T;if(e.hasProperty("POSITION"))T=e.getProperty("POSITION",H.FLOAT,3,y,s);else if(e.hasProperty("POSITION_QUANTIZED")){T=e.getProperty("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3,y,s);let g=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3);if(!g)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let x=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3);if(!x)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let _=65535;for(let U=0;U<3;U++)T[U]=T[U]/_*x[U]+g[U]}if(!T)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");s.copy(T),u.translation=s,t.normalUp=e.getProperty("NORMAL_UP",H.FLOAT,3,y,A),t.normalRight=e.getProperty("NORMAL_RIGHT",H.FLOAT,3,y,m);let b=!1;if(t.normalUp){if(!t.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");t.hasCustomOrientation=!0}else{if(t.octNormalUp=e.getProperty("NORMAL_UP_OCT32P",H.UNSIGNED_SHORT,2,y,A),t.octNormalRight=e.getProperty("NORMAL_RIGHT_OCT32P",H.UNSIGNED_SHORT,2,y,m),t.octNormalUp)throw t.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");t.eastNorthUp?(ce.WGS84.eastNorthUpToFixedFrame(s,d),d.getRotationMatrix3(c)):c.identity()}b&&(f.copy(i).cross(a).normalize(),c.setColumn(0,i),c.setColumn(1,a),c.setColumn(2,f)),l.fromMatrix3(c),u.rotation=l,h.set(1,1,1);let C=e.getProperty("SCALE",H.FLOAT,1,y,p);Number.isFinite(C)&&h.multiplyByScalar(C);let w=e.getProperty("SCALE_NON_UNIFORM",H.FLOAT,3,y,A);w&&h.scale(w),u.scale=h;let I=e.getProperty("BATCH_ID",H.UNSIGNED_SHORT,1,y,E);I===void 0&&(I=y);let O=new St().fromQuaternion(u.rotation);d.identity(),d.translate(u.translation),d.multiplyRight(O),d.scale(u.scale);let B=d.clone();o[y]={modelMatrix:B,batchId:I}}t.instances=o}async function dh(t,e,r,n,o,s){r=Ie(t,e,r);let i=new DataView(e);for(t.tilesLength=i.getUint32(r,!0),r+=4,t.tiles=[];t.tiles.length<t.tilesLength&&(t.byteLength||0)-r>12;){let a={shape:"tile3d"};t.tiles.push(a),r=await s(e,r,n,o,a)}return r}async function Ah(t,e,r,n){if(t.rotateYtoZ=!0,t.gltfUpAxis=r?.["3d-tiles"]?.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",r?.["3d-tiles"]?.loadGLTF){if(!n)return e.byteLength;let o=await Pt(e,Ze,r,n);t.gltf=Nn(o),t.gpuMemoryUsageInBytes=On(t.gltf)}else t.gltfArrayBuffer=e;return e.byteLength}async function _a(t,e=0,r,n,o={shape:"tile3d"}){switch(o.byteOffset=e,o.type=nl(t,e),o.type){case xt.COMPOSITE:return await dh(o,t,e,r,n,_a);case xt.BATCHED_3D_MODEL:return await hh(o,t,e,r,n);case xt.GLTF:return await Ah(o,t,r,n);case xt.INSTANCED_3D_MODEL:return await uh(o,t,e,r,n);case xt.POINT_CLOUD:return await Tl(o,t,e,r,n);default:throw new Error(`3DTileLoader: unknown type ${o.type}`)}}async function ya(t,e,r){if(new Uint32Array(t.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(t.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let s=mh(t.slice(8,16)),i=new Uint8Array(t,24,s),f=new TextDecoder("utf8").decode(i),c=JSON.parse(f),l=mh(t.slice(16,24)),h=new ArrayBuffer(0);if(l&&(h=t.slice(24+s)),await os(c,c.tileAvailability,h,r),Array.isArray(c.contentAvailability))for(let u of c.contentAvailability)await os(c,u,h,r);else await os(c,c.contentAvailability,h,r);return await os(c,c.childSubtreeAvailability,h,r),c}async function os(t,e,r,n){let o=Number.isFinite(e.bitstream)?e.bitstream:e.bufferView;if(typeof o!="number")return;let s=t.bufferViews[o],i=t.buffers[s.buffer];if(!n?.baseUrl)throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(i.uri){let f=`${n?.baseUrl||""}/${i.uri}`,l=await(await n.fetch(f)).arrayBuffer();e.explicitBitstream=new Uint8Array(l,s.byteOffset,s.byteLength);return}let a=t.buffers.slice(0,s.buffer).reduce((f,c)=>f+c.byteLength,0);e.explicitBitstream=new Uint8Array(r.slice(a,a+i.byteLength),s.byteOffset,s.byteLength)}function mh(t){let e=new DataView(t),r=e.getUint32(0,!0),n=e.getUint32(4,!0);return r+2**32*n}var Jr={dataType:null,batchType:null,id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Sr,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:ya,options:{}};var jh=mr(un(),1);var Jh=mr(un(),1);function Ca(t){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let e=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=t||e;return!!(r&&r.indexOf("Electron")>=0)}function Jt(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||Ca()}var kB=globalThis.self||globalThis.window||globalThis.global,zr=globalThis.window||globalThis.self||globalThis.global,JB=globalThis.document||{},Ye=globalThis.process||{},zB=globalThis.console,fS=globalThis.navigator||{};var ss=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",uS=Jt();function QB(t){try{let e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch{return null}}var is=class{constructor(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=QB(n),this.id=e,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(e){if(Object.assign(this.config,e),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let e={};if(this.storage){let r=this.storage.getItem(this.id);e=r?JSON.parse(r):{}}return Object.assign(this.config,e),this}};function ph(t){let e;return t<10?e="".concat(t.toFixed(2),"ms"):t<100?e="".concat(t.toFixed(1),"ms"):t<1e3?e="".concat(t.toFixed(0),"ms"):e="".concat((t/1e3).toFixed(2),"s"),e}function gh(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(e-t.length,0);return"".concat(" ".repeat(r)).concat(t)}function as(t,e,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,o=t.src.replace(/\(/g,"%28").replace(/\)/g,"%29");t.width>n&&(r=Math.min(r,n/t.width));let s=t.width*r,i=t.height*r,a=["font-size:1px;","padding:".concat(Math.floor(i/2),"px ").concat(Math.floor(s/2),"px;"),"line-height:".concat(i,"px;"),"background:url(".concat(o,");"),"background-size:".concat(s,"px ").concat(i,"px;"),"color:transparent;"].join("");return["".concat(e," %c+"),a]}var cs;(function(t){t[t.BLACK=30]="BLACK",t[t.RED=31]="RED",t[t.GREEN=32]="GREEN",t[t.YELLOW=33]="YELLOW",t[t.BLUE=34]="BLUE",t[t.MAGENTA=35]="MAGENTA",t[t.CYAN=36]="CYAN",t[t.WHITE=37]="WHITE",t[t.BRIGHT_BLACK=90]="BRIGHT_BLACK",t[t.BRIGHT_RED=91]="BRIGHT_RED",t[t.BRIGHT_GREEN=92]="BRIGHT_GREEN",t[t.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",t[t.BRIGHT_BLUE=94]="BRIGHT_BLUE",t[t.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",t[t.BRIGHT_CYAN=96]="BRIGHT_CYAN",t[t.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(cs||(cs={}));var VB=10;function Bh(t){return typeof t!="string"?t:(t=t.toUpperCase(),cs[t]||cs.WHITE)}function xh(t,e,r){if(!Jt&&typeof t=="string"){if(e){let n=Bh(e);t="\x1B[".concat(n,"m").concat(t,"\x1B[39m")}if(r){let n=Bh(r);t="\x1B[".concat(n+VB,"m").concat(t,"\x1B[49m")}}return t}function Eh(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(t),n=Object.getOwnPropertyNames(r),o=t;for(let s of n){let i=o[s];typeof i=="function"&&(e.find(a=>s===a)||(o[s]=i.bind(t)))}}function Qr(t,e){if(!t)throw new Error(e||"Assertion failed")}function We(){let t;if(Jt()&&zr.performance){var e,r;t=zr===null||zr===void 0||(e=zr.performance)===null||e===void 0||(r=e.now)===null||r===void 0?void 0:r.call(e)}else if("hrtime"in Ye){var n;let o=Ye===null||Ye===void 0||(n=Ye.hrtime)===null||n===void 0?void 0:n.call(Ye);t=o[0]*1e3+o[1]/1e6}else t=Date.now();return t}var Vr={debug:Jt()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},jB={enabled:!0,level:0};function Ot(){}var _h={},yh={once:!0},Un=class{constructor(){let{id:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=ss,this._startTs=We(),this._deltaTs=We(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=e,this.userData={},this._storage=new is("__probe-".concat(this.id,"__"),jB),this.timeStamp("".concat(this.id," started")),Eh(this),Object.seal(this)}set level(e){this.setLevel(e)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((We()-this._startTs).toPrecision(10))}getDelta(){return Number((We()-this._deltaTs).toPrecision(10))}set priority(e){this.level=e}get priority(){return this.level}getPriority(){return this.level}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:e}),this}setLevel(e){return this._storage.setConfiguration({level:e}),this}get(e){return this._storage.config[e]}set(e,r){this._storage.setConfiguration({[e]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(e,r){Qr(e,r)}warn(e){return this._getLogFunction(0,e,Vr.warn,arguments,yh)}error(e){return this._getLogFunction(0,e,Vr.error,arguments)}deprecated(e,r){return this.warn("`".concat(e,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(e,r){return this.error("`".concat(e,"` has been removed. Use `").concat(r,"` instead"))}probe(e,r){return this._getLogFunction(e,r,Vr.log,arguments,{time:!0,once:!0})}log(e,r){return this._getLogFunction(e,r,Vr.debug,arguments)}info(e,r){return this._getLogFunction(e,r,console.info,arguments)}once(e,r){return this._getLogFunction(e,r,Vr.debug||Vr.info,arguments,yh)}table(e,r,n){return r?this._getLogFunction(e,r,console.table||Ot,n&&[n],{tag:YB(r)}):Ot}image(e){let{logLevel:r,priority:n,image:o,message:s="",scale:i=1}=e;return this._shouldLog(r||n)?Jt()?ZB({image:o,message:s,scale:i}):XB({image:o,message:s,scale:i}):Ot}time(e,r){return this._getLogFunction(e,r,console.time?console.time:console.info)}timeEnd(e,r){return this._getLogFunction(e,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(e,r){return this._getLogFunction(e,r,console.timeStamp||Ot)}group(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},o=Ch({logLevel:e,message:r,opts:n}),{collapsed:s}=n;return o.method=(s?console.groupCollapsed:console.group)||console.info,this._getLogFunction(o)}groupCollapsed(e,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(e,r,Object.assign({},n,{collapsed:!0}))}groupEnd(e){return this._getLogFunction(e,"",console.groupEnd||Ot)}withGroup(e,r,n){this.group(e,r)();try{n()}finally{this.groupEnd(e)()}}trace(){console.trace&&console.trace()}_shouldLog(e){return this.isEnabled()&&this.getLevel()>=Th(e)}_getLogFunction(e,r,n,o,s){if(this._shouldLog(e)){s=Ch({logLevel:e,message:r,args:o,opts:s}),n=n||s.method,Qr(n),s.total=this.getTotal(),s.delta=this.getDelta(),this._deltaTs=We();let i=s.tag||s.message;if(s.once&&i)if(!_h[i])_h[i]=We();else return Ot;return r=KB(this.id,s.message,s),n.bind(console,r,...s.args)}return Ot}};Un.VERSION=ss;function Th(t){if(!t)return 0;let e;switch(typeof t){case"number":e=t;break;case"object":e=t.logLevel||t.priority||0;break;default:return 0}return Qr(Number.isFinite(e)&&e>=0),e}function Ch(t){let{logLevel:e,message:r}=t;t.logLevel=Th(e);let n=t.args?Array.from(t.args):[];for(;n.length&&n.shift()!==r;);switch(typeof e){case"string":case"function":r!==void 0&&n.unshift(r),t.message=e;break;case"object":Object.assign(t,e);break;default:}typeof t.message=="function"&&(t.message=t.message());let o=typeof t.message;return Qr(o==="string"||o==="object"),Object.assign(t,{args:n},t.opts)}function KB(t,e,r){if(typeof e=="string"){let n=r.time?gh(ph(r.total)):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),e=xh(e,r.color,r.background)}return e}function XB(t){let{image:e,message:r="",scale:n=1}=t;return console.warn("removed"),Ot}function ZB(t){let{image:e,message:r="",scale:n=1}=t;if(typeof e=="string"){let s=new Image;return s.onload=()=>{let i=as(s,r,n);console.log(...i)},s.src=e,Ot}let o=e.nodeName||"";if(o.toLowerCase()==="img")return console.log(...as(e,r,n)),Ot;if(o.toLowerCase()==="canvas"){let s=new Image;return s.onload=()=>console.log(...as(s,r,n)),s.src=e.toDataURL(),Ot}return Ot}function YB(t){for(let e in t)for(let r in t[e])return r||"untitled";return"empty"}var Ta=new Un({id:"@probe.gl/log"});var Lt=null;try{Lt=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function W(t,e,r){this.low=t|0,this.high=e|0,this.unsigned=!!r}W.prototype.__isLong__;Object.defineProperty(W.prototype,"__isLong__",{value:!0});function ut(t){return(t&&t.__isLong__)===!0}function bh(t){var e=Math.clz32(t&-t);return t?31-e:e}W.isLong=ut;var Mh={},wh={};function qe(t,e){var r,n,o;return e?(t>>>=0,(o=0<=t&&t<256)&&(n=wh[t],n)?n:(r=V(t,0,!0),o&&(wh[t]=r),r)):(t|=0,(o=-128<=t&&t<128)&&(n=Mh[t],n)?n:(r=V(t,t<0?-1:0,!1),o&&(Mh[t]=r),r))}W.fromInt=qe;function vt(t,e){if(isNaN(t))return e?de:zt;if(e){if(t<0)return de;if(t>=Rh)return Lh}else{if(t<=-Sh)return yt;if(t+1>=Sh)return Oh}return t<0?vt(-t,e).neg():V(t%Kr|0,t/Kr|0,e)}W.fromNumber=vt;function V(t,e,r){return new W(t,e,r)}W.fromBits=V;var fs=Math.pow;function Ma(t,e,r){if(t.length===0)throw Error("empty string");if(typeof e=="number"?(r=e,e=!1):e=!!e,t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return e?de:zt;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=t.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return Ma(t.substring(1),e,r).neg();for(var o=vt(fs(r,8)),s=zt,i=0;i<t.length;i+=8){var a=Math.min(8,t.length-i),f=parseInt(t.substring(i,i+a),r);if(a<8){var c=vt(fs(r,a));s=s.mul(c).add(vt(f))}else s=s.mul(o),s=s.add(vt(f))}return s.unsigned=e,s}W.fromString=Ma;function Qt(t,e){return typeof t=="number"?vt(t,e):typeof t=="string"?Ma(t,e):V(t.low,t.high,typeof e=="boolean"?e:t.unsigned)}W.fromValue=Qt;var Ih=1<<16,WB=1<<24,Kr=Ih*Ih,Rh=Kr*Kr,Sh=Rh/2,Fh=qe(WB),zt=qe(0);W.ZERO=zt;var de=qe(0,!0);W.UZERO=de;var jr=qe(1);W.ONE=jr;var Dh=qe(1,!0);W.UONE=Dh;var ba=qe(-1);W.NEG_ONE=ba;var Oh=V(-1,2147483647,!1);W.MAX_VALUE=Oh;var Lh=V(-1,-1,!0);W.MAX_UNSIGNED_VALUE=Lh;var yt=V(0,-2147483648,!1);W.MIN_VALUE=yt;var L=W.prototype;L.toInt=function(){return this.unsigned?this.low>>>0:this.low};L.toNumber=function(){return this.unsigned?(this.high>>>0)*Kr+(this.low>>>0):this.high*Kr+(this.low>>>0)};L.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(yt)){var r=vt(e),n=this.div(r),o=n.mul(r).sub(this);return n.toString(e)+o.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=vt(fs(e,6),this.unsigned),i=this,a="";;){var f=i.div(s),c=i.sub(f.mul(s)).toInt()>>>0,l=c.toString(e);if(i=f,i.isZero())return l+a;for(;l.length<6;)l="0"+l;a=""+l+a}};L.getHighBits=function(){return this.high};L.getHighBitsUnsigned=function(){return this.high>>>0};L.getLowBits=function(){return this.low};L.getLowBitsUnsigned=function(){return this.low>>>0};L.getNumBitsAbs=function(){if(this.isNegative())return this.eq(yt)?64:this.neg().getNumBitsAbs();for(var e=this.high!=0?this.high:this.low,r=31;r>0&&!(e&1<<r);r--);return this.high!=0?r+33:r+1};L.isZero=function(){return this.high===0&&this.low===0};L.eqz=L.isZero;L.isNegative=function(){return!this.unsigned&&this.high<0};L.isPositive=function(){return this.unsigned||this.high>=0};L.isOdd=function(){return(this.low&1)===1};L.isEven=function(){return(this.low&1)===0};L.equals=function(e){return ut(e)||(e=Qt(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};L.eq=L.equals;L.notEquals=function(e){return!this.eq(e)};L.neq=L.notEquals;L.ne=L.notEquals;L.lessThan=function(e){return this.comp(e)<0};L.lt=L.lessThan;L.lessThanOrEqual=function(e){return this.comp(e)<=0};L.lte=L.lessThanOrEqual;L.le=L.lessThanOrEqual;L.greaterThan=function(e){return this.comp(e)>0};L.gt=L.greaterThan;L.greaterThanOrEqual=function(e){return this.comp(e)>=0};L.gte=L.greaterThanOrEqual;L.ge=L.greaterThanOrEqual;L.compare=function(e){if(ut(e)||(e=Qt(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};L.comp=L.compare;L.negate=function(){return!this.unsigned&&this.eq(yt)?yt:this.not().add(jr)};L.neg=L.negate;L.add=function(e){ut(e)||(e=Qt(e));var r=this.high>>>16,n=this.high&65535,o=this.low>>>16,s=this.low&65535,i=e.high>>>16,a=e.high&65535,f=e.low>>>16,c=e.low&65535,l=0,h=0,u=0,d=0;return d+=s+c,u+=d>>>16,d&=65535,u+=o+f,h+=u>>>16,u&=65535,h+=n+a,l+=h>>>16,h&=65535,l+=r+i,l&=65535,V(u<<16|d,l<<16|h,this.unsigned)};L.subtract=function(e){return ut(e)||(e=Qt(e)),this.add(e.neg())};L.sub=L.subtract;L.multiply=function(e){if(this.isZero())return this;if(ut(e)||(e=Qt(e)),Lt){var r=Lt.mul(this.low,this.high,e.low,e.high);return V(r,Lt.get_high(),this.unsigned)}if(e.isZero())return this.unsigned?de:zt;if(this.eq(yt))return e.isOdd()?yt:zt;if(e.eq(yt))return this.isOdd()?yt:zt;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(Fh)&&e.lt(Fh))return vt(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=this.high&65535,s=this.low>>>16,i=this.low&65535,a=e.high>>>16,f=e.high&65535,c=e.low>>>16,l=e.low&65535,h=0,u=0,d=0,A=0;return A+=i*l,d+=A>>>16,A&=65535,d+=s*l,u+=d>>>16,d&=65535,d+=i*c,u+=d>>>16,d&=65535,u+=o*l,h+=u>>>16,u&=65535,u+=s*c,h+=u>>>16,u&=65535,u+=i*f,h+=u>>>16,u&=65535,h+=n*l+o*c+s*f+i*a,h&=65535,V(d<<16|A,h<<16|u,this.unsigned)};L.mul=L.multiply;L.divide=function(e){if(ut(e)||(e=Qt(e)),e.isZero())throw Error("division by zero");if(Lt){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var r=(this.unsigned?Lt.div_u:Lt.div_s)(this.low,this.high,e.low,e.high);return V(r,Lt.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?de:zt;var n,o,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return de;if(e.gt(this.shru(1)))return Dh;s=de}else{if(this.eq(yt)){if(e.eq(jr)||e.eq(ba))return yt;if(e.eq(yt))return jr;var i=this.shr(1);return n=i.div(e).shl(1),n.eq(zt)?e.isNegative()?jr:ba:(o=this.sub(e.mul(n)),s=n.add(o.div(e)),s)}else if(e.eq(yt))return this.unsigned?de:zt;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=zt}for(o=this;o.gte(e);){n=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),f=a<=48?1:fs(2,a-48),c=vt(n),l=c.mul(e);l.isNegative()||l.gt(o);)n-=f,c=vt(n,this.unsigned),l=c.mul(e);c.isZero()&&(c=jr),s=s.add(c),o=o.sub(l)}return s};L.div=L.divide;L.modulo=function(e){if(ut(e)||(e=Qt(e)),Lt){var r=(this.unsigned?Lt.rem_u:Lt.rem_s)(this.low,this.high,e.low,e.high);return V(r,Lt.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};L.mod=L.modulo;L.rem=L.modulo;L.not=function(){return V(~this.low,~this.high,this.unsigned)};L.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};L.clz=L.countLeadingZeros;L.countTrailingZeros=function(){return this.low?bh(this.low):bh(this.high)+32};L.ctz=L.countTrailingZeros;L.and=function(e){return ut(e)||(e=Qt(e)),V(this.low&e.low,this.high&e.high,this.unsigned)};L.or=function(e){return ut(e)||(e=Qt(e)),V(this.low|e.low,this.high|e.high,this.unsigned)};L.xor=function(e){return ut(e)||(e=Qt(e)),V(this.low^e.low,this.high^e.high,this.unsigned)};L.shiftLeft=function(e){return ut(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?V(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):V(0,this.low<<e-32,this.unsigned)};L.shl=L.shiftLeft;L.shiftRight=function(e){return ut(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?V(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):V(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};L.shr=L.shiftRight;L.shiftRightUnsigned=function(e){return ut(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?V(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):e===32?V(this.high,0,this.unsigned):V(this.high>>>e-32,0,this.unsigned)};L.shru=L.shiftRightUnsigned;L.shr_u=L.shiftRightUnsigned;L.rotateLeft=function(e){var r;return ut(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?V(this.high,this.low,this.unsigned):e<32?(r=32-e,V(this.low<<e|this.high>>>r,this.high<<e|this.low>>>r,this.unsigned)):(e-=32,r=32-e,V(this.high<<e|this.low>>>r,this.low<<e|this.high>>>r,this.unsigned))};L.rotl=L.rotateLeft;L.rotateRight=function(e){var r;return ut(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?V(this.high,this.low,this.unsigned):e<32?(r=32-e,V(this.high<<r|this.low>>>e,this.low<<r|this.high>>>e,this.unsigned)):(e-=32,r=32-e,V(this.low<<r|this.high>>>e,this.high<<r|this.low>>>e,this.unsigned))};L.rotr=L.rotateRight;L.toSigned=function(){return this.unsigned?V(this.low,this.high,!1):this};L.toUnsigned=function(){return this.unsigned?this:V(this.low,this.high,!0)};L.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};L.toBytesLE=function(){var e=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]};L.toBytesBE=function(){var e=this.high,r=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};W.fromBytes=function(e,r,n){return n?W.fromBytesLE(e,r):W.fromBytesBE(e,r)};W.fromBytesLE=function(e,r){return new W(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)};W.fromBytesBE=function(e,r){return new W(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],r)};var Xr=W;var qB=16;function Pn(t){t==="X"&&(t="");let e=t.padEnd(qB,"0");return Xr.fromString(e,!0,16)}function wa(t){if(t.isZero())return"X";let e=t.countTrailingZeros(),r=e%4;e=(e-r)/4;let n=e;e*=4;let s=t.shiftRightUnsigned(e).toString(16).replace(/0+$/,"");return Array(17-n-s.length).join("0")+s}function Ia(t,e){let r=$B(t).shiftRightUnsigned(2);return t.add(Xr.fromNumber(2*e+1-4).multiply(r))}function $B(t){return t.and(t.not().add(1))}var tx=3,ex=30,rx=2*ex+1,vh=180/Math.PI;function Nh(t){if(t.length===0)throw new Error(`Invalid Hilbert quad key ${t}`);let e=t.split("/"),r=parseInt(e[0],10),n=e[1],o=n.length,s=0,i=[0,0];for(let a=o-1;a>=0;a--){s=o-a;let f=n[a],c=0,l=0;f==="1"?l=1:f==="2"?(c=1,l=1):f==="3"&&(c=1);let h=Math.pow(2,s-1);nx(h,i,c,l),i[0]+=h*c,i[1]+=h*l}if(r%2===1){let a=i[0];i[0]=i[1],i[1]=a}return{face:r,ij:i,level:s}}function Uh(t){if(t.isZero())return"";let e=t.toString(2);for(;e.length<tx+rx;)e="0"+e;let r=e.lastIndexOf("1"),n=e.substring(0,3),o=e.substring(3,r),s=o.length/2,i=Xr.fromString(n,!0,2).toString(10),a="";if(s!==0)for(a=Xr.fromString(o,!0,2).toString(4);a.length<s;)a="0"+a;return`${i}/${a}`}function Sa(t,e,r){let n=1<<e;return[(t[0]+r[0])/n,(t[1]+r[1])/n]}function Gh(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function Fa(t){return[Gh(t[0]),Gh(t[1])]}function Ra(t,[e,r]){switch(t){case 0:return[1,e,r];case 1:return[-e,1,r];case 2:return[-e,-r,1];case 3:return[-1,-r,-e];case 4:return[r,-1,-e];case 5:return[r,e,-1];default:throw new Error("Invalid face")}}function Da([t,e,r]){let n=Math.atan2(r,Math.sqrt(t*t+e*e));return[Math.atan2(e,t)*vh,n*vh]}function nx(t,e,r,n){if(n===0){r===1&&(e[0]=t-1-e[0],e[1]=t-1-e[1]);let o=e[0];e[0]=e[1],e[1]=o}}function Ph(t){let e=Sa(t.ij,t.level,[.5,.5]),r=Fa(e),n=Ra(t.face,r);return Da(n)}var ox=100;function Oa(t){let{face:e,ij:r,level:n}=t,o=[[0,0],[0,1],[1,1],[1,0],[0,0]],s=Math.max(1,Math.ceil(ox*Math.pow(2,-n))),i=new Float64Array(4*s*2+2),a=0,f=0;for(let c=0;c<4;c++){let l=o[c].slice(0),h=o[c+1],u=(h[0]-l[0])/s,d=(h[1]-l[1])/s;for(let A=0;A<s;A++){l[0]+=u,l[1]+=d;let m=Sa(r,n,l),p=Fa(m),E=Ra(e,p),y=Da(E);Math.abs(y[1])>89.999&&(y[0]=f);let T=y[0]-f;y[0]+=T>180?-360:T<-180?360:0,i[a++]=y[0],i[a++]=y[1],f=y[0]}}return i[a++]=i[0],i[a++]=i[1],i}function Zr(t){let e=sx(t);return Nh(e)}function sx(t){if(t.indexOf("/")>0)return t;let e=Pn(t);return Uh(e)}function La(t){let e=Zr(t);return Ph(e)}function kh(t){let e;if(t.face===2||t.face===5){let r=null,n=0;for(let o=0;o<4;o++){let s=`${t.face}/${o}`,i=Zr(s),a=Oa(i);(typeof r>"u"||r===null)&&(r=new Float64Array(4*a.length)),r.set(a,n),n+=a.length}e=Hh(r)}else{let r=Oa(t);e=Hh(r)}return e}function Hh(t){if(t.length%2!==0)throw new Error("Invalid corners");let e=[],r=[];for(let n=0;n<t.length;n+=2)e.push(t[n]),r.push(t[n+1]);return e.sort((n,o)=>n-o),r.sort((n,o)=>n-o),{west:e[0],east:e[e.length-1],north:r[r.length-1],south:r[0]}}function va(t,e){let r=e?.minimumHeight||0,n=e?.maximumHeight||0,o=Zr(t),s=kh(o),i=s.west,a=s.south,f=s.east,c=s.north,l=[];return l.push(new M(i,c,r)),l.push(new M(f,c,r)),l.push(new M(f,a,r)),l.push(new M(i,a,r)),l.push(new M(i,c,n)),l.push(new M(f,c,n)),l.push(new M(f,a,n)),l.push(new M(i,a,n)),l}function ls(t){let e=t.token,r={minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight},n=va(e,r),o=La(e),s=o[0],i=o[1],a=ce.WGS84.cartographicToCartesian([s,i,r.maximumHeight]),f=new M(a[0],a[1],a[2]);n.push(f);let c=Ii(n);return[...c.center,...c.halfAxes]}var ix=4,ax=8,cx={QUADTREE:ix,OCTREE:ax};function fx(t,e,r){if(t?.box){let n=Pn(t.s2VolumeInfo.token),o=Ia(n,e),s=wa(o),i={...t.s2VolumeInfo};switch(i.token=s,r){case"OCTREE":let c=t.s2VolumeInfo,l=c.maximumHeight-c.minimumHeight,h=l/2,u=c.minimumHeight+l/2;c.minimumHeight=u-h,c.maximumHeight=u+h;break;default:break}return{box:ls(i),s2VolumeInfo:i}}}async function Na(t){let{subtree:e,subtreeData:r={level:0,x:0,y:0,z:0},parentData:n={mortonIndex:0,localLevel:-1,localX:0,localY:0,localZ:0},childIndex:o=0,implicitOptions:s,loaderOptions:i,s2VolumeBox:a}=t,{subdivisionScheme:f,subtreeLevels:c,maximumLevel:l,contentUrlTemplate:h,subtreesUriTemplate:u,basePath:d}=s,A={children:[],lodMetricValue:0,contentUrl:""};if(!l)return Ta.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${h} won't be loaded...`),A;let m=n.localLevel+1,p=r.level+m;if(p>l)return A;let E=cx[f],y=Math.log2(E),T=o&1,b=o>>1&1,C=o>>2&1,w=$e(n.localX,T,1),I=$e(n.localY,b,1),O=$e(n.localZ,C,1),B=$e(r.x,w,m),g=$e(r.y,I,m),x=$e(r.z,O,m),_=$e(n.mortonIndex,o,y),U=m===c&&Ga(e.childSubtreeAvailability,_),N,P,v,tt;if(U){let ie=`${d}/${u}`,ln=hs(ie,p,B,g,x);N=await(0,Jh.load)(ln,Jr,i),tt=0,P={level:p,x:B,y:g,z:x},v={mortonIndex:0,localLevel:0,localX:0,localY:0,localZ:0}}else N=e,tt=(E**m-1)/(E-1)+_,P=r,v={mortonIndex:_,localLevel:m,localX:w,localY:I,localZ:O};if(!Ga(N.tileAvailability,tt))return A;Ga(N.contentAvailability,tt)&&(A.contentUrl=hs(h,p,B,g,x));for(let ie=0;ie<E;ie++){let ln=fx(a,ie,f),Ar=await Na({subtree:N,subtreeData:P,parentData:v,childIndex:ie,implicitOptions:s,loaderOptions:i,s2VolumeBox:ln});(Ar.contentUrl||Ar.children.length)&&A.children.push(Ar)}return A.contentUrl||A.children.length?lx(A,{level:p,x:B,y:g,z:x},s,a):A}function Ga(t,e){let r;return Array.isArray(t)?(r=t[0],t.length>1&&Ta.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=t,"constant"in r?Boolean(r.constant):r.explicitBitstream?dx(e,r.explicitBitstream):!1}function lx(t,e,r,n){let{basePath:o,refine:s,getRefine:i,lodMetricType:a,getTileType:f,rootLodMetricValue:c,rootBoundingVolume:l}=r,h=t.contentUrl&&t.contentUrl.replace(`${o}/`,""),u=c/2**e.level,d=n?.box?{box:n.box}:l,A=hx(d,e,r.subdivisionScheme);return{children:t.children,contentUrl:t.contentUrl,content:{uri:h},id:t.contentUrl,refine:i(s),type:f(t),lodMetricType:a,lodMetricValue:u,geometricError:u,transform:t.transform,boundingVolume:A}}function hx(t,e,r){if(t.region){let{level:n,x:o,y:s,z:i}=e,[a,f,c,l,h,u]=t.region,d=2**n,A=(c-a)/d,[m,p]=[a+A*o,a+A*(o+1)],E=(l-f)/d,[y,T]=[f+E*s,f+E*(s+1)],b,C;if(r==="OCTREE"){let w=(u-h)/d;[b,C]=[h+w*i,h+w*(i+1)]}else[b,C]=[h,u];return{region:[m,y,p,T,b,C]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${JSON.stringify(t)}`)}function $e(t,e,r){return(t<<r)+e}function hs(t,e,r,n,o){let s=ux({level:e,x:r,y:n,z:o});return t.replace(/{level}|{x}|{y}|{z}/gi,i=>s[i])}function ux(t){let e={};for(let r in t)e[`{${r}}`]=t[r];return e}function dx(t,e){let r=Math.floor(t/8),n=t%8;return(e[r]>>n&1)===1}function Pa(t,e=""){if(!e)return Me.EMPTY;let n=e.split("?")[0].split(".").pop();switch(n){case"pnts":return Me.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Me.SCENEGRAPH;default:return n||Me.EMPTY}}function Ha(t){switch(t){case"REPLACE":case"replace":return Ir.REPLACE;case"ADD":case"add":return Ir.ADD;default:return t}}function Ua(t,e){if(/^[a-z][0-9a-z+.-]*:/i.test(e)){let n=new URL(t,`${e}/`);return decodeURI(n.toString())}else if(t.startsWith("/"))return t;return _r.resolve(e,t)}function zh(t,e){if(!t)return null;let r;if(t.content){let o=t.content.uri||t.content?.url;typeof o<"u"&&(r=Ua(o,e))}return{...t,id:r,contentUrl:r,lodMetricType:he.GEOMETRIC_ERROR,lodMetricValue:t.geometricError,transformMatrix:t.transform,type:Pa(t,r),refine:Ha(t.refine)}}async function Kh(t,e,r){let n=null,o=Vh(t.root);o&&t.root?n=await Qh(t.root,t,e,o,r):n=zh(t.root,e);let s=[];for(s.push(n);s.length>0;){let i=s.pop()||{},a=i.children||[],f=[];for(let c of a){let l=Vh(c),h;l?h=await Qh(c,t,e,l,r):h=zh(c,e),h&&(f.push(h),s.push(h))}i.children=f}return n}async function Qh(t,e,r,n,o){let{subdivisionScheme:s,maximumLevel:i,availableLevels:a,subtreeLevels:f,subtrees:{uri:c}}=n,l=hs(c,0,0,0,0),h=Ua(l,r),u=await(0,jh.load)(h,Jr,o),d=t.content?.uri,A=d?Ua(d,r):"",m=e?.root?.refine,p=t.geometricError,E=t.boundingVolume.extensions?.["3DTILES_bounding_volume_S2"];if(E){let C={box:ls(E),s2VolumeInfo:E};t.boundingVolume=C}let y=t.boundingVolume,T={contentUrlTemplate:A,subtreesUriTemplate:c,subdivisionScheme:s,subtreeLevels:f,maximumLevel:Number.isFinite(a)?a-1:i,refine:m,basePath:r,lodMetricType:he.GEOMETRIC_ERROR,rootLodMetricValue:p,rootBoundingVolume:y,getTileType:Pa,getRefine:Ha};return await Ax(t,r,u,T,o)}async function Ax(t,e,r,n,o){if(!t)return null;let{children:s,contentUrl:i}=await Na({subtree:r,implicitOptions:n,loaderOptions:o}),a,f=null;return i&&(a=i,f={uri:i.replace(`${e}/`,"")}),{...t,id:a,contentUrl:a,lodMetricType:he.GEOMETRIC_ERROR,lodMetricValue:t.geometricError,transformMatrix:t.transform,type:Pa(t,a),refine:Ha(t.refine),content:f||t.content,children:s}}function Vh(t){return t?.extensions?.["3DTILES_implicit_tiling"]||t?.implicitTiling}var tr={dataType:null,batchType:null,id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Sr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:mx,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function mx(t,e={},r){let n=e["3d-tiles"]||{},o;return n.isTileset==="auto"?o=r?.url&&r.url.indexOf(".json")!==-1:o=n.isTileset,o?px(t,e,r):gx(t,e,r)}async function px(t,e,r){let n=JSON.parse(new TextDecoder().decode(t)),o=r?.url||"",s=Bx(o),i=await Kh(n,s,e||{});return{...n,shape:"tileset3d",loader:tr,url:o,queryString:r?.queryString||"",basePath:s,root:i||n.root,type:In.TILES3D,lodMetricType:he.GEOMETRIC_ERROR,lodMetricValue:n.root?.geometricError||0}}async function gx(t,e,r){let n={content:{shape:"tile3d",featureIds:null}};return await _a(t,0,e,r,n.content),n.content}function Bx(t){return _r.dirname(t)}var us=mr(un(),1);var Xh="https://api.cesium.com/v1/assets";async function ds(t,e){if(!e){let s=await xx(t);for(let i of s.items)i.type==="3DTILES"&&(e=i.id)}let r=await Ex(t,e),{type:n,url:o}=r;return z(n==="3DTILES"&&o),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function xx(t){z(t);let e=Xh,r={Authorization:`Bearer ${t}`},n=await(0,us.fetchFile)(e,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function Ex(t,e){z(t,e);let r={Authorization:`Bearer ${t}`},n=`${Xh}/${e}`,o=await(0,us.fetchFile)(`${n}`,{headers:r});if(!o.ok)throw new Error(o.statusText);let s=await o.json();if(o=await(0,us.fetchFile)(`${n}/endpoint`,{headers:r}),!o.ok)throw new Error(o.statusText);let i=await o.json();return s={...s,...i},s}async function _x(t,e={}){e=e["cesium-ion"]||{};let{accessToken:r}=e,n=e.assetId;if(!Number.isFinite(n)){let o=t.match(/\/([0-9]+)\/tileset.json/);n=o&&o[1]}return ds(r,n)}var ka={...tr,id:"cesium-ion",name:"Cesium Ion",preload:_x,parse:async(t,e,r)=>(e={...e},e["3d-tiles"]=e["cesium-ion"],e.loader=ka,tr.parse(t,e,r)),options:{"cesium-ion":{...tr.options["3d-tiles"],accessToken:null}}};var Hn=async(t,e)=>{let r=[await t.getUint8(t.length-1n),await t.getUint8(t.length-2n),await t.getUint8(t.length-3n),void 0],n=-1,o=t.length-4n;do{let s=o;o-=BigInt(1024),o=o>=0n?o:0n;let i=new Uint8Array(await t.slice(o,s));for(let a=i.length-1;a>-1;a--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=i[a],r.every((f,c)=>f===e[c])){n=a;break}}while(n===-1&&o>0n);return o+BigInt(n)};var Zh=new Uint8Array([80,75,5,6]),Yh=new Uint8Array([80,75,6,7]),Wh=new Uint8Array([80,75,6,6]),yx=8n;var Cx=12n,Tx=16n;var bx=8n,Mx=24n;var wx=40n,Ix=48n;var qh=async t=>{let e=await Hn(t,Zh),r=BigInt(await t.getUint16(e+yx)),n=BigInt(await t.getUint32(e+Cx)),o=BigInt(await t.getUint32(e+Tx)),s=e-20n,i=0n,a=await t.slice(s,s+4n);if(xe(a,Yh)){i=await t.getBigUint64(s+bx);let f=await t.slice(i,i+4n);if(!xe(f,Wh.buffer))throw new Error("zip64 EoCD not found");r=await t.getBigUint64(i+Mx),n=await t.getBigUint64(i+wx),o=await t.getBigUint64(i+Ix)}else s=0n;return{cdRecordsNumber:r,cdStartOffset:o,cdByteSize:n,offsets:{zip64EoCDOffset:i,zip64EoCDLocatorOffset:s,zipEoCDOffset:e}}};var HF=[{offset:0,size:4,default:new DataView(Zh.buffer).getUint32(0,!0)},{offset:4,size:2,default:0},{offset:6,size:2,default:0},{offset:8,size:2,name:"recordsNumber"},{offset:10,size:2,name:"recordsNumber"},{offset:12,size:4,name:"cdSize"},{offset:16,size:4,name:"cdOffset"},{offset:20,size:2,default:0}];var kF=[{offset:0,size:4,default:new DataView(Yh.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],JF=[{offset:0,size:4,default:new DataView(Wh.buffer).getUint32(0,!0)},{offset:4,size:8,default:44},{offset:12,size:2,default:45},{offset:14,size:2,default:45},{offset:16,size:4,default:0},{offset:20,size:4,default:0},{offset:24,size:8,name:"recordsNumber"},{offset:32,size:8,name:"recordsNumber"},{offset:40,size:8,name:"cdSize"},{offset:48,size:8,name:"cdOffset"}];var Sx=20,Fx=24,Rx=28,Dx=30,Ox=32,Lx=42,As=46n,Jn=new Uint8Array([80,75,1,2]),kn=async(t,e)=>{if(t>=e.length)return null;let r=new DataView(await e.slice(t,t+As)),n=r.buffer.slice(0,4);if(!xe(n,Jn.buffer))return null;let o=BigInt(r.getUint32(Sx,!0)),s=BigInt(r.getUint32(Fx,!0)),i=r.getUint16(Dx,!0),a=BigInt(r.getUint16(Ox,!0)),f=r.getUint16(Rx,!0),c=await e.slice(t+As,t+As+BigInt(f+i)),l=c.slice(0,f),h=new TextDecoder().decode(l),u=t+As+BigInt(f),d=r.getUint32(Lx,!0),A=BigInt(d),m=new DataView(c.slice(f,c.byteLength)),p={uncompressedSize:s,compressedSize:o,localHeaderOffset:A,startDisk:a},E=vx(p,m);return{...p,...E,extraFieldLength:i,fileNameLength:f,fileName:h,extraOffset:u}};async function*Yr(t){let{cdStartOffset:e,cdByteSize:r}=await qh(t),n=new He(new DataView(await t.slice(e,e+r))),o=await kn(0n,n);for(;o;)yield o,o=await kn(o.extraOffset+BigInt(o.extraFieldLength),n)}var $h=(...t)=>t[0]+t[1]*16,vx=(t,e)=>{let r=Gx(t),n={};if(r.length>0){let o=r.reduce((a,f)=>a+f.length,0),s=new Uint8Array(e.buffer).findIndex((a,f,c)=>$h(c[f],c[f+1])===1&&$h(c[f+2],c[f+3])===o),i=0;for(let a of r){let f=i;n[a.name]=e.getBigUint64(s+4+f,!0),i=f+a.length}}return n},Gx=t=>{let e=[];return t.uncompressedSize===BigInt(4294967295)&&e.push({name:"uncompressedSize",length:8}),t.compressedSize===BigInt(4294967295)&&e.push({name:"compressedSize",length:8}),t.localHeaderOffset===BigInt(4294967295)&&e.push({name:"localHeaderOffset",length:8}),t.startDisk===BigInt(4294967295)&&e.push({name:"startDisk",length:4}),e};var jF=[{offset:0,size:4,default:new DataView(Jn.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:45},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:2,default:0},{offset:16,size:4,name:"crc32"},{offset:20,size:4,name:"length"},{offset:24,size:4,name:"length"},{offset:28,size:2,name:"fnlength"},{offset:30,size:2,default:0,name:"extraLength"},{offset:32,size:2,default:0},{offset:34,size:2,default:0},{offset:36,size:2,default:0},{offset:38,size:4,default:0},{offset:42,size:4,name:"offset"}];var Nx=8,Ux=18,Px=22,Hx=26,kx=28,ms=30n,Ja=new Uint8Array([80,75,3,4]),er=async(t,e)=>{let r=new DataView(await e.slice(t,t+ms)),n=r.buffer.slice(0,4);if(!xe(n,Ja))return null;let o=r.getUint16(Hx,!0),s=r.getUint16(kx,!0),i=await e.slice(t+ms,t+ms+BigInt(o+s)),a=i.slice(0,o),f=new DataView(i.slice(o,i.byteLength)),c=new TextDecoder().decode(a).split("\\").join("/"),l=t+ms+BigInt(o+s),h=r.getUint16(Nx,!0),u=BigInt(r.getUint32(Ux,!0)),d=BigInt(r.getUint32(Px,!0)),A=4;return d===BigInt(4294967295)&&(d=f.getBigUint64(A,!0),A+=8),u===BigInt(4294967295)&&(u=f.getBigUint64(A,!0),A+=8),l===BigInt(4294967295)&&(l=f.getBigUint64(A,!0)),{fileNameLength:o,fileName:c,extraFieldLength:s,fileDataOffset:l,compressedSize:u,compressionMethod:h}};var ZF=[{offset:0,size:4,default:new DataView(Ja.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:0},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:4,name:"crc32"},{offset:18,size:4,name:"length"},{offset:22,size:4,name:"length"},{offset:26,size:2,name:"fnlength"},{offset:28,size:2,default:0,name:"extraLength"}];var ps=class{constructor(e={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(e,r="base64"){let n=[];for await(let i of e)n.push(i),yield i;let o=await this.concatenate(n),s=await this.hash(o,r);this.options.crypto?.onEnd?.({hash:s})}async concatenate(e){return await mn(e)}};function tu(t){t=`${t}`;for(let r=0;r<t.length;r++)if(t.charCodeAt(r)>255)return null;let e="";for(let r=0;r<t.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=t.charCodeAt(r)>>2,n[1]=(t.charCodeAt(r)&3)<<4,t.length>r+1&&(n[1]|=t.charCodeAt(r+1)>>4,n[2]=(t.charCodeAt(r+1)&15)<<2),t.length>r+2&&(n[2]|=t.charCodeAt(r+2)>>6,n[3]=t.charCodeAt(r+2)&63);for(let o=0;o<n.length;o++)typeof n[o]>"u"?e+="=":e+=Jx(n[o])}return e}function Jx(t){if(t<26)return String.fromCharCode(t+"A".charCodeAt(0));if(t<52)return String.fromCharCode(t-26+"a".charCodeAt(0));if(t<62)return String.fromCharCode(t-52+"0".charCodeAt(0));if(t===62)return"+";if(t===63)return"/"}function eu(t,e){switch(e){case"hex":return t;case"base64":return zx(t);default:throw new Error(e)}}function zx(t){t.length%2!==0&&(t=`0${t}`);let r=(t.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return tu(r)||""}var nu=typeof atob=="function"?atob:typeof Buffer=="function"?Yx:su,Qx=nu("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3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IAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),za=WebAssembly&&nu!==su?Zx(Qx).buffer:!1,te=Wx(),Qa=240*16*16,ou=Math.floor(Qa*16*1.066666667),Vx=268435456-65536,ru="Parameter must be Buffer, ArrayBuffer or Uint8Array",jx="Parameter exceeds max size of 255.9 Mbytes";za||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function Va(t){var e,r,n,o,s,i,a,f,c,l;let h=Xx(),u=Kx(),d={},A=new Date().getTime();return d.then=function(y){return a=y,p(),d},d.catch=function(y){return f=y,d},t&&typeof t=="object"?typeof Buffer=="function"&&t.constructor===Buffer?i=t:t.constructor===Uint8Array||t.constructor===ArrayBuffer?i=t.constructor===ArrayBuffer?new Uint8Array(t):t:E(new TypeError(ru)):E(new TypeError(ru)),i&&(s=i.length,za&&s>ou?s>Vx?E(new Error(jx)):(e=new WebAssembly.Memory({initial:s>32e6?s>64e6?s>128e6?4096:2048:1024:512}),r=new Uint32Array(e.buffer),o={mem:e,log:console.log},n={imports:o},WebAssembly.instantiate(za,n).then(m)):p(h(i))),d;function m(y){p(u(i,y.instance.exports,r))}function p(y){var T=Boolean(y)?y:c;Boolean(y)&&(l=new Date().getTime()),typeof a=="function"?Boolean(T)&&(a(T,l-A),a=f=null):Boolean(y)&&(c=y)}function E(y){typeof f=="function"&&f(y)}}function Kx(){var t,e,r,n,o,s,i,a,f,c,l,h,u,d=function(A){var m,p,E,y,T,b,C,w,I,O,B,g,x,_,U,N,P,v,tt,pt,Y,ie,ln=new Date().getTime(),Ar=0,S=1732584193,F=-271733879,R=-1732584194,D=271733878,et=0,hn=A.length*8,ao;for(ao=r0(A,u),u[hn>>>5]|=128<<hn%32,u[(hn+64>>>9<<4)+14]=hn,ao=(hn+64>>>9<<4)+15,Y=u;et<ao;)ao>et+ou?(n(S),s(F),a(R),c(D),e(Qa),et=et+Qa*16,S=r(),F=o(),R=i(),D=f(),Ar++):(P=S,v=F,tt=R,pt=D,m=Y[et+0]>>>0,p=Y[et+1]>>>0,E=Y[et+2]>>>0,y=Y[et+3]>>>0,T=Y[et+4]>>>0,b=Y[et+5]>>>0,C=Y[et+6]>>>0,w=Y[et+7]>>>0,I=Y[et+8]>>>0,O=Y[et+9]>>>0,B=Y[et+10]>>>0,g=Y[et+11]>>>0,x=Y[et+12]>>>0,_=Y[et+13]>>>0,U=Y[et+14]>>>0,N=Y[et+15]>>>0,S=G(7,25,S+(F&R|~F&D)+m-680876936)+F,D=G(12,20,D+(S&F|~S&R)+p-389564586)+S,R=G(17,15,R+(D&S|~D&F)+E+606105819)+D,F=G(22,10,F+(R&D|~R&S)+y-1044525330)+R,S=G(7,25,S+(F&R|~F&D)+T-176418897)+F,D=G(12,20,D+(S&F|~S&R)+b+1200080426)+S,R=G(17,15,R+(D&S|~D&F)+C-1473231341)+D,F=G(22,10,F+(R&D|~R&S)+w-45705983)+R,S=G(7,25,S+(F&R|~F&D)+I+1770035416)+F,D=G(12,20,D+(S&F|~S&R)+O-1958414417)+S,R=G(17,15,R+(D&S|~D&F)+B-42063)+D,F=G(22,10,F+(R&D|~R&S)+g-1990404162)+R,S=G(7,25,S+(F&R|~F&D)+x+1804603682)+F,D=G(12,20,D+(S&F|~S&R)+_-40341101)+S,R=G(17,15,R+(D&S|~D&F)+U-1502002290)+D,F=G(22,10,F+(R&D|~R&S)+N+1236535329)+R,S=G(5,27,S+(F&D|R&~D)+p-165796510)+F,D=G(9,23,D+(S&R|F&~R)+C-1069501632)+S,R=G(14,18,R+(D&F|S&~F)+g+643717713)+D,F=G(20,12,F+(R&S|D&~S)+m-373897302)+R,S=G(5,27,S+(F&D|R&~D)+b-701558691)+F,D=G(9,23,D+(S&R|F&~R)+B+38016083)+S,R=G(14,18,R+(D&F|S&~F)+N-660478335)+D,F=G(20,12,F+(R&S|D&~S)+T-405537848)+R,S=G(5,27,S+(F&D|R&~D)+O+568446438)+F,D=G(9,23,D+(S&R|F&~R)+U-1019803690)+S,R=G(14,18,R+(D&F|S&~F)+y-187363961)+D,F=G(20,12,F+(R&S|D&~S)+I+1163531501)+R,S=G(5,27,S+(F&D|R&~D)+_-1444681467)+F,D=G(9,23,D+(S&R|F&~R)+E-51403784)+S,R=G(14,18,R+(D&F|S&~F)+w+1735328473)+D,F=G(20,12,F+(R&S|D&~S)+x-1926607734)+R,S=G(4,28,S+(F^R^D)+b-378558)+F,D=G(11,21,D+(S^F^R)+I-2022574463)+S,R=G(16,16,R+(D^S^F)+g+1839030562)+D,F=G(23,9,F+(R^D^S)+U-35309556)+R,S=G(4,28,S+(F^R^D)+p-1530992060)+F,D=G(11,21,D+(S^F^R)+T+1272893353)+S,R=G(16,16,R+(D^S^F)+w-155497632)+D,F=G(23,9,F+(R^D^S)+B-1094730640)+R,S=G(4,28,S+(F^R^D)+_+681279174)+F,D=G(11,21,D+(S^F^R)+m-358537222)+S,R=G(16,16,R+(D^S^F)+y-722521979)+D,F=G(23,9,F+(R^D^S)+C+76029189)+R,S=G(4,28,S+(F^R^D)+O-640364487)+F,D=G(11,21,D+(S^F^R)+x-421815835)+S,R=G(16,16,R+(D^S^F)+N+530742520)+D,F=G(23,9,F+(R^D^S)+E-995338651)+R,S=G(6,26,S+(R^(F|~D))+m-198630844)+F,D=G(10,22,D+(F^(S|~R))+w+1126891415)+S,R=G(15,17,R+(S^(D|~F))+U-1416354905)+D,F=G(21,11,F+(D^(R|~S))+b-57434055)+R,S=G(6,26,S+(R^(F|~D))+x+1700485571)+F,D=G(10,22,D+(F^(S|~R))+y-1894986606)+S,R=G(15,17,R+(S^(D|~F))+B-1051523)+D,F=G(21,11,F+(D^(R|~S))+p-2054922799)+R,S=G(6,26,S+(R^(F|~D))+I+1873313359)+F,D=G(10,22,D+(F^(S|~R))+N-30611744)+S,R=G(15,17,R+(S^(D|~F))+C-1560198380)+D,F=G(21,11,F+(D^(R|~S))+_+1309151649)+R,S=G(6,26,S+(R^(F|~D))+T-145523070)+F,D=G(10,22,D+(F^(S|~R))+g-1120210379)+S,R=G(15,17,R+(S^(D|~F))+E+718787259)+D,F=G(21,11,F+(D^(R|~S))+O-343485551)+R,et=et+16,S=S+P>>>0,F=F+v>>>0,R=R+tt>>>0,D=D+pt>>>0);return te.endian([S,F,R,D]);function G(dt,co,Kt){return Kt<<dt|Kt>>>co}function r0(dt,co){for(var Kt=-1,Ls=Math.floor((dt.length-1)/4),gt=0,Fc,Rc,Dc,Oc;Ls-8>Kt++;)gt=Kt<<2,co[Kt]=dt[gt+0]|dt[gt+1]<<8|dt[gt+2]<<16|dt[gt+3]<<24;for(Kt--;Ls>Kt++;)gt=Kt<<2,Fc=typeof dt[gt+0]>"u"?0:dt[gt+0],Rc=typeof dt[gt+1]>"u"?0:dt[gt+1],Dc=typeof dt[gt+2]>"u"?0:dt[gt+2],Oc=typeof dt[gt+3]>"u"?0:dt[gt+3],co[Kt]=Fc|Rc<<8|Dc<<16|Oc<<24;return Ls+1}};return function(A,m,p,E){var y;return e=m.loops,t=m.loop,r=m.getA,o=m.getB,i=m.getC,f=m.getD,l=m.getX,n=m.setA,s=m.setB,a=m.setC,c=m.setD,h=m.setX,u=p,y=te.wordsToBytes(d(A)),E&&E.asBytes?y:te.bytesconvertNumberToHex(y)}}function Xx(){var t=function(e,r){var n,o,s,i,a,f,c,l,h,u,d,A,m,p,E,y,T,b,C,w,I,O=new Date().getTime(),B=1732584193,g=-271733879,x=-1732584194,_=271733878,U=e.length*8;I=te.bytesToWords(e);for(var N=0;N<I.length;N++)I[N]=(I[N]<<8|I[N]>>>24)&16711935|(I[N]<<24|I[N]>>>8)&4278255360;I[U>>>5]|=128<<U%32,I[(U+64>>>9<<4)+14]=U;for(var P=0;P<I.length;P+=16)T=B,b=g,C=x,w=_,n=I[P+0]>>>0,o=I[P+1]>>>0,s=I[P+2]>>>0,i=I[P+3]>>>0,a=I[P+4]>>>0,f=I[P+5]>>>0,c=I[P+6]>>>0,l=I[P+7]>>>0,h=I[P+8]>>>0,u=I[P+9]>>>0,d=I[P+10]>>>0,A=I[P+11]>>>0,m=I[P+12]>>>0,p=I[P+13]>>>0,E=I[P+14]>>>0,y=I[P+15]>>>0,B=v(7,25,B+(g&x|~g&_)+n-680876936)+g,_=v(12,20,_+(B&g|~B&x)+o-389564586)+B,x=v(17,15,x+(_&B|~_&g)+s+606105819)+_,g=v(22,10,g+(x&_|~x&B)+i-1044525330)+x,B=v(7,25,B+(g&x|~g&_)+a-176418897)+g,_=v(12,20,_+(B&g|~B&x)+f+1200080426)+B,x=v(17,15,x+(_&B|~_&g)+c-1473231341)+_,g=v(22,10,g+(x&_|~x&B)+l-45705983)+x,B=v(7,25,B+(g&x|~g&_)+h+1770035416)+g,_=v(12,20,_+(B&g|~B&x)+u-1958414417)+B,x=v(17,15,x+(_&B|~_&g)+d-42063)+_,g=v(22,10,g+(x&_|~x&B)+A-1990404162)+x,B=v(7,25,B+(g&x|~g&_)+m+1804603682)+g,_=v(12,20,_+(B&g|~B&x)+p-40341101)+B,x=v(17,15,x+(_&B|~_&g)+E-1502002290)+_,g=v(22,10,g+(x&_|~x&B)+y+1236535329)+x,B=v(5,27,B+(g&_|x&~_)+o-165796510)+g,_=v(9,23,_+(B&x|g&~x)+c-1069501632)+B,x=v(14,18,x+(_&g|B&~g)+A+643717713)+_,g=v(20,12,g+(x&B|_&~B)+n-373897302)+x,B=v(5,27,B+(g&_|x&~_)+f-701558691)+g,_=v(9,23,_+(B&x|g&~x)+d+38016083)+B,x=v(14,18,x+(_&g|B&~g)+y-660478335)+_,g=v(20,12,g+(x&B|_&~B)+a-405537848)+x,B=v(5,27,B+(g&_|x&~_)+u+568446438)+g,_=v(9,23,_+(B&x|g&~x)+E-1019803690)+B,x=v(14,18,x+(_&g|B&~g)+i-187363961)+_,g=v(20,12,g+(x&B|_&~B)+h+1163531501)+x,B=v(5,27,B+(g&_|x&~_)+p-1444681467)+g,_=v(9,23,_+(B&x|g&~x)+s-51403784)+B,x=v(14,18,x+(_&g|B&~g)+l+1735328473)+_,g=v(20,12,g+(x&B|_&~B)+m-1926607734)+x,B=v(4,28,B+(g^x^_)+f-378558)+g,_=v(11,21,_+(B^g^x)+h-2022574463)+B,x=v(16,16,x+(_^B^g)+A+1839030562)+_,g=v(23,9,g+(x^_^B)+E-35309556)+x,B=v(4,28,B+(g^x^_)+o-1530992060)+g,_=v(11,21,_+(B^g^x)+a+1272893353)+B,x=v(16,16,x+(_^B^g)+l-155497632)+_,g=v(23,9,g+(x^_^B)+d-1094730640)+x,B=v(4,28,B+(g^x^_)+p+681279174)+g,_=v(11,21,_+(B^g^x)+n-358537222)+B,x=v(16,16,x+(_^B^g)+i-722521979)+_,g=v(23,9,g+(x^_^B)+c+76029189)+x,B=v(4,28,B+(g^x^_)+u-640364487)+g,_=v(11,21,_+(B^g^x)+m-421815835)+B,x=v(16,16,x+(_^B^g)+y+530742520)+_,g=v(23,9,g+(x^_^B)+s-995338651)+x,B=v(6,26,B+(x^(g|~_))+n-198630844)+g,_=v(10,22,_+(g^(B|~x))+l+1126891415)+B,x=v(15,17,x+(B^(_|~g))+E-1416354905)+_,g=v(21,11,g+(_^(x|~B))+f-57434055)+x,B=v(6,26,B+(x^(g|~_))+m+1700485571)+g,_=v(10,22,_+(g^(B|~x))+i-1894986606)+B,x=v(15,17,x+(B^(_|~g))+d-1051523)+_,g=v(21,11,g+(_^(x|~B))+o-2054922799)+x,B=v(6,26,B+(x^(g|~_))+h+1873313359)+g,_=v(10,22,_+(g^(B|~x))+y-30611744)+B,x=v(15,17,x+(B^(_|~g))+c-1560198380)+_,g=v(21,11,g+(_^(x|~B))+p+1309151649)+x,B=v(6,26,B+(x^(g|~_))+a-145523070)+g,_=v(10,22,_+(g^(B|~x))+A-1120210379)+B,x=v(15,17,x+(B^(_|~g))+s+718787259)+_,g=v(21,11,g+(_^(x|~B))+u-343485551)+x,B=B+T>>>0,g=g+b>>>0,x=x+C>>>0,_=_+w>>>0;return te.endian([B,g,x,_]);function v(tt,pt,Y){return Y<<tt|Y>>>pt}};return function(e,r){var n=te.wordsToBytes(t(e,r)),o=r&&r.asBytes?n:te.bytesconvertNumberToHex(n);return o}}function Zx(t){var e,r,n,o=-1;for(e=t.length-1,r=new ArrayBuffer(t.length),n=new Uint8Array(r);e>o++;)n[o]=t.charCodeAt(o);return n}function Yx(t){return Buffer.from(t,"base64").toString("binary")}function su(t){return t}function Wx(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(e,r){return e<<r|e>>>32-r},endian:function(e){if(e.constructor==Number)return te.rotl(e,8)&16711935|te.rotl(e,24)&4278255360;for(var r=0;r<e.length;r++)e[r]=te.endian(e[r]);return e},bytesToWords:function(e){for(var r=[],n=0,o=0;n<e.length;n++,o+=8)r[o>>>5]|=e[n]<<24-o%32;return r},wordsToBytes:function(e){for(var r=[],n=0;n<e.length*32;n+=8)r.push(e[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(e){for(var r=[],n=0;n<e.length;n++)r.push((e[n]>>>4).toString(16)),r.push((e[n]&15).toString(16));return r.join("")}}}var rr=class extends ps{name="md5";options;constructor(e={}){super(),this.options=e}async hash(e,r){let o=await new Promise((s,i)=>Va(e).then(s).catch(i));return eu(o,r)}};var Wr=class{constructor(e){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(e={}){dn(e)}async compress(e){return await this.preload(),this.compressSync(e)}async decompress(e,r){return await this.preload(),this.decompressSync(e,r)}compressSync(e){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(e,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(e){let r=await this.concatenate(e);yield this.compress(r)}async*decompressBatches(e){let r=await this.concatenate(e);yield this.decompress(r)}concatenate(e){return mn(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}};var zn=class extends Wr{name="uncompressed";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(e){super(e),this.options=e||{}}compressSync(e){return e}decompressSync(e){return e}async*compressBatches(e){return yield*e}async*decompressBatches(e){return yield*e}};var hr=mr(jd(),1),Be=mr(Kd(),1);var ur=class extends Wr{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(e={}){super(e),this.options=e}async compress(e){if(!Bt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Er(Be.default.gzip)(e):await Er(Be.default.deflate)(e);return xr(r)}return this.compressSync(e)}async decompress(e){if(!Bt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await Er(Be.default.gunzip)(e):await Er(Be.default.inflate)(e);return xr(r)}return this.decompressSync(e)}compressSync(e){if(!Bt&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?Be.default.gzipSync(e):Be.default.deflateSync(e);return xr(s)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?hr.default.deflateRaw:hr.default.deflate)(n,r).buffer}decompressSync(e){if(!Bt&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?Be.default.gunzipSync(e):Be.default.inflateSync(e);return xr(s)}let r=this.options?.deflate||{},n=new Uint8Array(e);return(this.options?.raw?hr.default.inflateRaw:hr.default.inflate)(n,r).buffer}async*compressBatches(e){let r=this.options?.deflate||{},n=new hr.default.Deflate(r);yield*this.transformBatches(n,e)}async*decompressBatches(e){let r=this.options?.deflate||{},n=new hr.default.Inflate(r);yield*this.transformBatches(n,e)}async*transformBatches(e,r){e.onData=this._onData.bind(this),e.onEnd=this._onEnd.bind(this);for await(let i of r){let a=new Uint8Array(i);if(!e.push(a,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),o=e.push(n,!0);yield*this._getChunks()}_onData(e){this._chunks.push(e)}_onEnd(e){if(e!==0)throw new Error(this._getError(e)+this._chunks.length)}_getChunks(){let e=this._chunks;return this._chunks=[],e}_getError(e=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[e]}`}};var Q_={0:async t=>t,8:async t=>await new ur({raw:!0}).decompress(t)},Os=class{fileProvider=null;fileName;archive=null;constructor(e){if(typeof e=="string")if(this.fileName=e,!Bt)this.fileProvider=new Bn(e);else throw new Error("Cannot open file for random access in a WEB browser");else e instanceof dr?(this.fileProvider=e.fileProvider,this.archive=e,this.fileName=e.fileName):ks(e)&&(this.fileProvider=e)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let e=[],r=Yr(this.fileProvider);for await(let n of r)e.push(n.fileName);return e}async stat(e){let r=await this.getCDFileHeader(e);return{...r,size:Number(r.uncompressedSize)}}async fetch(e){this.fileName&&e.indexOf(this.fileName)===0&&(e=e.substring(this.fileName.length+1));let r;if(this.archive)r=await this.archive.getFile(e,"http");else{if(!this.fileProvider)throw new Error("No data detected in the zip archive");let o=await this.getCDFileHeader(e),s=await er(o.localHeaderOffset,this.fileProvider);if(!s)throw new Error("Local file header has not been found in the zip archive`");let i=Q_[s.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(s.fileDataOffset,s.fileDataOffset+s.compressedSize);r=await i(a)}let n=new Response(r);return Object.defineProperty(n,"url",{value:e?`${this.fileName||""}/${e}`:this.fileName||""}),n}async getCDFileHeader(e){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=Yr(this.fileProvider),n=null;for await(let o of r)if(o.fileName===e){n=o;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var dr=class{fileProvider;fileName;constructor(e,r,n){this.fileProvider=e,this.fileName=n}async getFileWithoutHash(e){return await(await new Os(this.fileProvider).fetch(e)).arrayBuffer()}};function Mc(t){let e=new DataView(t),r={};for(let n=0;n<t.byteLength;n=n+24){let o=e.getBigUint64(n+16,!0),s=V_(t,n,16);r[s]=o}return r}function V_(t,e,r){return[...new Uint8Array(t,e,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function wc(t){let e=Yr(t);return j_(e)}async function j_(t){let e=new rr,r=new TextEncoder,n={};for await(let o of t){let s=o.fileName.split("\\").join("/").toLocaleLowerCase(),i=r.encode(s).buffer,a=await e.hash(i,"hex");n[a]=o.localHeaderOffset}return n}var K_={0:t=>new zn().decompress(t),8:t=>new ur({raw:!0}).decompress(t)},fn=class extends dr{hashTable;constructor(e,r,n){super(e,r,n),this.hashTable=r}async getFile(e){let r=await this.getFileBytes(e.toLocaleLowerCase());if(r||(r=await this.getFileBytes(e)),!r)throw new Error(`No such file in the archive: ${e}`);return r}async getFileBytes(e){let r;if(this.hashTable){let n=new TextEncoder().encode(e).buffer,o=await new rr().hash(n,"hex"),s=this.hashTable[o];if(s===void 0)return null;let i=await er(s,this.fileProvider);if(!i)return null;let a=await this.fileProvider.slice(i.fileDataOffset,i.fileDataOffset+i.compressedSize),f=K_[i.compressionMethod];if(!f)throw Error("Only Deflation compression is supported");r=await f(a)}else r=await this.getFileWithoutHash(e);return r}};var Xd=async(t,e)=>{let r=await Hn(t,Jn),n=await kn(r,t),o;if(n?.fileName!=="@3dtilesIndex1@")o=await wc(t),e?.("3tz doesnt contain hash file, hash info has been composed according to zip archive headers");else{let s=await er(n.localHeaderOffset,t);if(!s)throw new Error("corrupted 3tz zip archive");let i=s.fileDataOffset,a=await t.slice(i,i+s.compressedSize);o=Mc(a)}return new fn(t,o)};var X_="4.3.0-alpha.7",Zd={dataType:null,batchType:null,name:"3tz",id:"3tz",module:"3d-tiles",version:X_,mimeTypes:["application/octet-stream","application/vnd.maxar.archive.3tz+zip"],parse:Z_,extensions:["3tz"],options:{}};async function Z_(t,e={}){return(await Xd(new He(new DataView(t)))).getFile(e["3d-tiles-archive"]?.path??"")}function Ne(t,e,r){if(!e)return r+12;let{magic:o,version:s=1,byteLength:i=12}=t;return z(Array.isArray(o)&&Number.isFinite(s)&&Number.isFinite(i)),e.setUint8(r+0,o[0]),e.setUint8(r+1,o[1]),e.setUint8(r+2,o[2]),e.setUint8(r+3,o[3]),e.setUint32(r+4,s,!0),e.setUint32(r+8,i,!0),r+=12,r}function Ue(t,e,r){t&&t.setUint32(e+8,r,!0)}function Yd(t,e,r,n,o){t={magic:we.COMPOSITE,tiles:[],...t};let s=r;r+=Ne(t,e,r),e&&e.setUint32(r,t.tiles.length,!0),r+=4;for(let i=0;i<t.tiles.length;++i)r+=o(t.tiles[i],e,r,n);return Ue(e,s,r-s),r}function Wd(t,e,r,n){let{featuresLength:o=0,batchTable:s}=t,a=JSON.stringify({BATCH_LENGTH:o}),f=s?JSON.stringify(s):"",c=Tt(a.length,8),l=f?Tt(f.length,8):0;t={magic:we.BATCHED_MODEL,...t};let h=r;r=Ne(t,e,r),e&&(e.setUint32(12,c,!0),e.setUint32(16,0,!0),e.setUint32(20,l,!0),e.setUint32(24,0,!0)),r+=16,r=Ao(e,r,a,8),s&&(r=Ao(e,r,f,8));let u=t.gltfEncoded;return u&&(r=An(e,r,u,u.byteLength)),Ue(e,h,r-h),r}function qd(t,e,r,n){let{featuresLength:o=1,gltfFormat:s=1,gltfUri:i=""}=t,a=i.length,f={INSTANCES_LENGTH:o,POSITION:new Array(o*3).fill(0)},c=JSON.stringify(f),l=c.length;t={magic:we.INSTANCED_MODEL,...t};let h=r;return r=Ne(t,e,0),e&&(e.setUint32(12,l,!0),e.setUint32(16,0,!0),e.setUint32(20,0,!0),e.setUint32(24,0,!0),e.setUint32(28,s,!0)),r+=20,r+=Br(e,r,c,l),r+=Br(e,r,i,a),Ue(e,h,r-h),r}var Y_={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function $d(t,e,r,n){let{featureTableJson:o=Y_}=t,s=JSON.stringify(o);s=Ps(s,4);let{featureTableJsonByteLength:i=s.length}=t,a=new ArrayBuffer(12),f=a.byteLength;t={magic:we.POINT_CLOUD,...t};let c=r;return r+=Ne(t,e,0),e&&(e.setUint32(r+0,i,!0),e.setUint32(r+4,f,!0),e.setUint32(r+8,0,!0),e.setUint32(r+12,0,!0)),r+=16,r+=Br(e,r,s,i),r+=An(e,r,a,f),Ue(e,c,r-c),r}function Sc(t,e){let r=Ic(t,null,0,e),n=new ArrayBuffer(r),o=new DataView(n);return Ic(t,o,0,e),n}function Ic(t,e,r,n){switch(z(typeof t.type=="string"),t.type){case xt.COMPOSITE:return Yd(t,e,r,n,Ic);case xt.POINT_CLOUD:return $d(t,e,r,n);case xt.BATCHED_3D_MODEL:return Wd(t,e,r,n);case xt.INSTANCED_3D_MODEL:return qd(t,e,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var e0={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:Sr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],binary:!0,options:{["3d-tiles"]:{}},encode:async(t,e)=>t0(t,e),encodeSync:t0};function t0(t,e){return Sc(t,e)}return c0(io);})();
|
|
8
8
|
/*! Bundled license information:
|
|
9
9
|
|
|
10
10
|
long/index.js:
|