@loaders.gl/3d-tiles 4.2.0-alpha.5 → 4.2.0-beta.1
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/3d-tiles-archive-archive.js +2 -0
- package/dist/3d-tiles-archive-loader.d.ts +21 -2
- package/dist/3d-tiles-archive-loader.d.ts.map +1 -1
- package/dist/3d-tiles-archive-loader.js +3 -1
- package/dist/cesium-ion-loader.d.ts +25 -2
- package/dist/cesium-ion-loader.d.ts.map +1 -1
- package/dist/dist.dev.js +7235 -5726
- package/dist/dist.min.js +1 -1
- package/dist/index.cjs +24 -5
- 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/classes/tile-3d-batch-table.js +9 -0
- package/dist/lib/classes/tile-3d-feature-table.js +4 -2
- package/dist/lib/parsers/helpers/parse-3d-implicit-tiles.js +1 -1
- package/dist/lib/utils/version.js +1 -1
- package/dist/tile-3d-subtree-loader.d.ts +14 -2
- package/dist/tile-3d-subtree-loader.d.ts.map +1 -1
- package/dist/tile-3d-subtree-loader.js +2 -0
- package/dist/tile-3d-writer.d.ts +17 -2
- package/dist/tile-3d-writer.d.ts.map +1 -1
- package/dist/tiles-3d-loader.d.ts +25 -3
- package/dist/tiles-3d-loader.d.ts.map +1 -1
- package/dist/tiles-3d-loader.js +2 -0
- package/package.json +14 -10
- package/src/3d-tiles-archive-loader.ts +4 -6
- package/src/cesium-ion-loader.ts +2 -2
- package/src/lib/parsers/helpers/parse-3d-implicit-tiles.ts +1 -1
- package/src/tile-3d-subtree-loader.ts +4 -2
- package/src/tile-3d-writer.ts +2 -2
- package/src/tiles-3d-loader.ts +8 -6
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 Ad=Object.create;var ho=Object.defineProperty;var md=Object.getOwnPropertyDescriptor;var pd=Object.getOwnPropertyNames;var gd=Object.getPrototypeOf,Bd=Object.prototype.hasOwnProperty;var at=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ht=(t,e)=>{for(var r in e)ho(t,r,{get:e[r],enumerable:!0})},lo=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of pd(e))!Bd.call(t,o)&&o!==r&&ho(t,o,{get:()=>e[o],enumerable:!(n=md(e,o))||n.enumerable});return t},uo=(t,e,r)=>(lo(t,e,"default"),r&&lo(r,e,"default")),mr=(t,e,r)=>(r=t!=null?Ad(gd(t)):{},lo(e||!t||!t.__esModule?ho(r,"default",{value:t,enumerable:!0}):r,t)),xd=t=>lo(ho({},"__esModule",{value:!0}),t);var hn=at((VE,Nc)=>{Nc.exports=globalThis.loaders});var me=at(pt=>{"use strict";var Vx=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function jx(t,e){return Object.prototype.hasOwnProperty.call(t,e)}pt.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)jx(r,n)&&(t[n]=r[n])}}return t};pt.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var Kx={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}},Xx={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)}};pt.setTyped=function(t){t?(pt.Buf8=Uint8Array,pt.Buf16=Uint16Array,pt.Buf32=Int32Array,pt.assign(pt,Kx)):(pt.Buf8=Array,pt.Buf16=Array,pt.Buf32=Array,pt.assign(pt,Xx))};pt.setTyped(Vx)});var Pu=at(tn=>{"use strict";var Zx=me(),Yx=4,gu=0,Bu=1,Wx=2;function $r(t){for(var e=t.length;--e>=0;)t[e]=0}var qx=0,Tu=1,$x=2,t_=3,e_=258,ec=29,Zn=256,Vn=Zn+1+ec,qr=30,rc=19,bu=2*Vn+1,nr=15,Za=16,r_=7,nc=256,wu=16,Mu=17,Iu=18,$a=[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],n_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Su=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],o_=512,pe=new Array((Vn+2)*2);$r(pe);var Qn=new Array(qr*2);$r(Qn);var jn=new Array(o_);$r(jn);var Kn=new Array(e_-t_+1);$r(Kn);var oc=new Array(ec);$r(oc);var Bs=new Array(qr);$r(Bs);function Ya(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 Fu,Du,Ru;function Wa(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function Lu(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 bt(t,e,r){t.bi_valid>Za-r?(t.bi_buf|=e<<t.bi_valid&65535,Xn(t,t.bi_buf),t.bi_buf=e>>Za-t.bi_valid,t.bi_valid+=r-Za):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}function ne(t,e,r){bt(t,r[e*2],r[e*2+1])}function Ou(t,e){var r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1}function s_(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 i_(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<bu;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 vu(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]=Ou(n[a]++,a))}}function a_(){var t,e,r,n,o,s=new Array(nr+1);for(r=0,n=0;n<ec-1;n++)for(oc[n]=r,t=0;t<1<<$a[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;)pe[t*2+1]=8,t++,s[8]++;for(;t<=255;)pe[t*2+1]=9,t++,s[9]++;for(;t<=279;)pe[t*2+1]=7,t++,s[7]++;for(;t<=287;)pe[t*2+1]=8,t++,s[8]++;for(vu(pe,Vn+1,s),t=0;t<qr;t++)Qn[t*2+1]=5,Qn[t*2]=Ou(t,5);Fu=new Ya(pe,$a,Zn+1,Vn,nr),Du=new Ya(Qn,gs,0,qr,nr),Ru=new Ya(new Array(0),n_,0,rc,r_)}function Gu(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<rc;e++)t.bl_tree[e*2]=0;t.dyn_ltree[nc*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}function Nu(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 c_(t,e,r,n){Nu(t),n&&(Xn(t,r),Xn(t,~r)),Zx.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}function xu(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 qa(t,e,r){for(var n=t.heap[r],o=r<<1;o<=t.heap_len&&(o<t.heap_len&&xu(e,t.heap[o+1],t.heap[o],t.depth)&&o++,!xu(e,n,t.heap[o],t.depth));)t.heap[r]=t.heap[o],r=o,o<<=1;t.heap[r]=n}function _u(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?ne(t,o,e):(i=Kn[o],ne(t,i+Zn+1,e),a=$a[i],a!==0&&(o-=oc[i],bt(t,o,a)),n--,i=Lu(n),ne(t,i,r),a=gs[i],a!==0&&(n-=Bs[i],bt(t,n,a)));while(s<t.last_lit);ne(t,nc,e)}function tc(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=bu,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--)qa(t,r,i);c=s;do i=t.heap[1],t.heap[1]=t.heap[t.heap_len--],qa(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++,qa(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],i_(t,e),vu(r,f,t.bl_count)}function Eu(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[wu*2]++):a<=10?t.bl_tree[Mu*2]++:t.bl_tree[Iu*2]++,a=0,o=s,i===0?(f=138,c=3):s===i?(f=6,c=3):(f=7,c=4))}function yu(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 ne(t,s,t.bl_tree);while(--a!==0);else s!==0?(s!==o&&(ne(t,s,t.bl_tree),a--),ne(t,wu,t.bl_tree),bt(t,a-3,2)):a<=10?(ne(t,Mu,t.bl_tree),bt(t,a-3,3)):(ne(t,Iu,t.bl_tree),bt(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 f_(t){var e;for(Eu(t,t.dyn_ltree,t.l_desc.max_code),Eu(t,t.dyn_dtree,t.d_desc.max_code),tc(t,t.bl_desc),e=rc-1;e>=3&&t.bl_tree[Su[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}function l_(t,e,r,n){var o;for(bt(t,e-257,5),bt(t,r-1,5),bt(t,n-4,4),o=0;o<n;o++)bt(t,t.bl_tree[Su[o]*2+1],3);yu(t,t.dyn_ltree,e-1),yu(t,t.dyn_dtree,r-1)}function h_(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return gu;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Bu;for(r=32;r<Zn;r++)if(t.dyn_ltree[r*2]!==0)return Bu;return gu}var Cu=!1;function u_(t){Cu||(a_(),Cu=!0),t.l_desc=new Wa(t.dyn_ltree,Fu),t.d_desc=new Wa(t.dyn_dtree,Du),t.bl_desc=new Wa(t.bl_tree,Ru),t.bi_buf=0,t.bi_valid=0,Gu(t)}function Uu(t,e,r,n){bt(t,(qx<<1)+(n?1:0),3),c_(t,e,r,!0)}function d_(t){bt(t,Tu<<1,3),ne(t,nc,pe),s_(t)}function A_(t,e,r,n){var o,s,i=0;t.level>0?(t.strm.data_type===Wx&&(t.strm.data_type=h_(t)),tc(t,t.l_desc),tc(t,t.d_desc),i=f_(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?Uu(t,e,r,n):t.strategy===Yx||s===o?(bt(t,(Tu<<1)+(n?1:0),3),_u(t,pe,Qn)):(bt(t,($x<<1)+(n?1:0),3),l_(t,t.l_desc.max_code+1,t.d_desc.max_code+1,i+1),_u(t,t.dyn_ltree,t.dyn_dtree)),Gu(t),n&&Nu(t)}function m_(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[Lu(e)*2]++),t.last_lit===t.lit_bufsize-1}tn._tr_init=u_;tn._tr_stored_block=Uu;tn._tr_flush_block=A_;tn._tr_tally=m_;tn._tr_align=d_});var sc=at((yD,Hu)=>{"use strict";function p_(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}Hu.exports=p_});var ic=at((CD,ku)=>{"use strict";function g_(){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 B_=g_();function x_(t,e,r,n){var o=B_,s=n+r;t^=-1;for(var i=n;i<s;i++)t=t>>>8^o[(t^e[i])&255];return t^-1}ku.exports=x_});var xs=at((TD,Ju)=>{"use strict";Ju.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 Wu=at(ie=>{"use strict";var gt=me(),Nt=Pu(),ju=sc(),Re=ic(),__=xs(),ar=0,E_=1,y_=3,Ne=4,zu=5,se=0,Qu=1,Ut=-2,C_=-3,ac=-5,T_=-1,b_=1,_s=2,w_=3,M_=4,I_=0,S_=2,Ts=8,F_=9,D_=15,R_=8,L_=29,O_=256,fc=O_+1+L_,v_=30,G_=19,N_=2*fc+1,U_=15,J=3,ve=258,Kt=ve+J+1,P_=32,bs=42,lc=69,Es=73,ys=91,Cs=103,or=113,Wn=666,st=1,qn=2,sr=3,nn=4,H_=3;function Ge(t,e){return t.msg=__[e],e}function Vu(t){return(t<<1)-(t>4?9:0)}function Oe(t){for(var e=t.length;--e>=0;)t[e]=0}function Le(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(gt.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 lt(t,e){Nt._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Le(t.strm)}function V(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 k_(t,e,r,n){var o=t.avail_in;return o>n&&(o=n),o===0?0:(t.avail_in-=o,gt.arraySet(e,t.input,t.next_in,o,r),t.state.wrap===1?t.adler=ju(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 Ku(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-Kt?t.strstart-(t.w_size-Kt):0,c=t.window,l=t.w_mask,h=t.prev,u=t.strstart+ve,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=ve-(u-n),n=u-ve,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-Kt)){gt.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=k_(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<Kt&&t.strm.avail_in!==0)}function J_(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,lt(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Kt&&(lt(t,!1),t.strm.avail_out===0))return st}return t.insert=0,e===Ne?(lt(t,!0),t.strm.avail_out===0?sr:nn):(t.strstart>t.block_start&&(lt(t,!1),t.strm.avail_out===0),st)}function cc(t,e){for(var r,n;;){if(t.lookahead<Kt){if(ir(t),t.lookahead<Kt&&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-Kt&&(t.match_length=Ku(t,r)),t.match_length>=J)if(n=Nt._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=Nt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(n&&(lt(t,!1),t.strm.avail_out===0))return st}return t.insert=t.strstart<J-1?t.strstart:J-1,e===Ne?(lt(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(lt(t,!1),t.strm.avail_out===0)?st:qn}function en(t,e){for(var r,n,o;;){if(t.lookahead<Kt){if(ir(t),t.lookahead<Kt&&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-Kt&&(t.match_length=Ku(t,r),t.match_length<=5&&(t.strategy===b_||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=Nt._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&&(lt(t,!1),t.strm.avail_out===0))return st}else if(t.match_available){if(n=Nt._tr_tally(t,0,t.window[t.strstart-1]),n&<(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=Nt._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<J-1?t.strstart:J-1,e===Ne?(lt(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(lt(t,!1),t.strm.avail_out===0)?st:qn}function z_(t,e){for(var r,n,o,s,i=t.window;;){if(t.lookahead<=ve){if(ir(t),t.lookahead<=ve&&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+ve;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=ve-(s-o),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=J?(r=Nt._tr_tally(t,1,t.match_length-J),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=Nt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&(lt(t,!1),t.strm.avail_out===0))return st}return t.insert=0,e===Ne?(lt(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(lt(t,!1),t.strm.avail_out===0)?st:qn}function Q_(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=Nt._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&(lt(t,!1),t.strm.avail_out===0))return st}return t.insert=0,e===Ne?(lt(t,!0),t.strm.avail_out===0?sr:nn):t.last_lit&&(lt(t,!1),t.strm.avail_out===0)?st:qn}function oe(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 oe(0,0,0,0,J_),new oe(4,4,8,4,cc),new oe(4,5,16,8,cc),new oe(4,6,32,32,cc),new oe(4,4,16,16,en),new oe(8,16,32,32,en),new oe(8,16,128,128,en),new oe(8,32,128,256,en),new oe(32,128,258,1024,en),new oe(32,258,258,4096,en)];function V_(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 j_(){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 gt.Buf16(N_*2),this.dyn_dtree=new gt.Buf16((2*v_+1)*2),this.bl_tree=new gt.Buf16((2*G_+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 gt.Buf16(U_+1),this.heap=new gt.Buf16(2*fc+1),Oe(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new gt.Buf16(2*fc+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 Xu(t){var e;return!t||!t.state?Ge(t,Ut):(t.total_in=t.total_out=0,t.data_type=S_,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,Nt._tr_init(e),se)}function Zu(t){var e=Xu(t);return e===se&&V_(t.state),e}function K_(t,e){return!t||!t.state||t.state.wrap!==2?Ut:(t.state.gzhead=e,se)}function Yu(t,e,r,n,o,s){if(!t)return Ut;var i=1;if(e===T_&&(e=6),n<0?(i=0,n=-n):n>15&&(i=2,n-=16),o<1||o>F_||r!==Ts||n<8||n>15||e<0||e>9||s<0||s>M_)return Ge(t,Ut);n===8&&(n=9);var a=new j_;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 gt.Buf8(a.w_size*2),a.head=new gt.Buf16(a.hash_size),a.prev=new gt.Buf16(a.w_size),a.lit_bufsize=1<<o+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new gt.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,Zu(t)}function X_(t,e){return Yu(t,e,Ts,D_,R_,I_)}function Z_(t,e){var r,n,o,s;if(!t||!t.state||e>zu||e<0)return t?Ge(t,Ut):Ut;if(n=t.state,!t.output||!t.input&&t.avail_in!==0||n.status===Wn&&e!==Ne)return Ge(t,t.avail_out===0?ac:Ut);if(n.strm=t,r=n.last_flush,n.last_flush=e,n.status===bs)if(n.wrap===2)t.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>=_s||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&&(t.adler=Re(t.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=lc):(V(n,0),V(n,0),V(n,0),V(n,0),V(n,0),V(n,n.level===9?2:n.strategy>=_s||n.level<2?4:0),V(n,H_),n.status=or);else{var i=Ts+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=_s||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=P_),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===lc)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)),Le(t),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&&(t.adler=Re(t.adler,n.pending_buf,n.pending-o,o)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Es)}else n.status=Es;if(n.status===Es)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)),Le(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,V(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)),Le(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,V(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&&Le(t),n.pending+2<=n.pending_buf_size&&(V(n,t.adler&255),V(n,t.adler>>8&255),t.adler=0,n.status=or)):n.status=or),n.pending!==0){if(Le(t),t.avail_out===0)return n.last_flush=-1,se}else if(t.avail_in===0&&Vu(e)<=Vu(r)&&e!==Ne)return Ge(t,ac);if(n.status===Wn&&t.avail_in!==0)return Ge(t,ac);if(t.avail_in!==0||n.lookahead!==0||e!==ar&&n.status!==Wn){var f=n.strategy===_s?Q_(n,e):n.strategy===w_?z_(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),se;if(f===qn&&(e===E_?Nt._tr_align(n):e!==zu&&(Nt._tr_stored_block(n,0,0,!1),e===y_&&(Oe(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Le(t),t.avail_out===0))return n.last_flush=-1,se}return e!==Ne?se:n.wrap<=0?Qu:(n.wrap===2?(V(n,t.adler&255),V(n,t.adler>>8&255),V(n,t.adler>>16&255),V(n,t.adler>>24&255),V(n,t.total_in&255),V(n,t.total_in>>8&255),V(n,t.total_in>>16&255),V(n,t.total_in>>24&255)):(Yn(n,t.adler>>>16),Yn(n,t.adler&65535)),Le(t),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?se:Qu)}function Y_(t){var e;return!t||!t.state?Ut:(e=t.state.status,e!==bs&&e!==lc&&e!==Es&&e!==ys&&e!==Cs&&e!==or&&e!==Wn?Ge(t,Ut):(t.state=null,e===or?Ge(t,C_):se))}function W_(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 Ut;for(i===1&&(t.adler=ju(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 gt.Buf8(n.w_size),gt.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,se}ie.deflateInit=X_;ie.deflateInit2=Yu;ie.deflateReset=Zu;ie.deflateResetKeep=Xu;ie.deflateSetHeader=K_;ie.deflate=Z_;ie.deflateEnd=Y_;ie.deflateSetDictionary=W_;ie.deflateInfo="pako deflate (from Nodeca project)"});var hc=at(on=>{"use strict";var ws=me(),qu=!0,$u=!0;try{String.fromCharCode.apply(null,[0])}catch{qu=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{$u=!1}var $n=new ws.Buf8(256);for(ge=0;ge<256;ge++)$n[ge]=ge>=252?6:ge>=248?5:ge>=240?4:ge>=224?3:ge>=192?2:1;var ge;$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 ws.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 t0(t,e){if(e<65534&&(t.subarray&&$u||!t.subarray&&qu))return String.fromCharCode.apply(null,ws.shrinkBuf(t,e));for(var r="",n=0;n<e;n++)r+=String.fromCharCode(t[n]);return r}on.buf2binstring=function(t){return t0(t,t.length)};on.binstring2buf=function(t){for(var e=new ws.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 t0(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 uc=at((MD,e0)=>{"use strict";function q_(){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}e0.exports=q_});var s0=at(ro=>{"use strict";var to=Wu(),eo=me(),Ac=hc(),mc=xs(),$_=uc(),o0=Object.prototype.toString,tE=0,dc=4,sn=0,r0=1,n0=2,eE=-1,rE=0,nE=8;function cr(t){if(!(this instanceof cr))return new cr(t);this.options=eo.assign({level:eE,method:nE,chunkSize:16384,windowBits:15,memLevel:8,strategy:rE,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 $_,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(mc[r]);if(e.header&&to.deflateSetHeader(this.strm,e.header),e.dictionary){var n;if(typeof e.dictionary=="string"?n=Ac.string2buf(e.dictionary):o0.call(e.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(e.dictionary):n=e.dictionary,r=to.deflateSetDictionary(this.strm,n),r!==sn)throw new Error(mc[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?dc:tE,typeof t=="string"?r.input=Ac.string2buf(t):o0.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!==r0&&o!==sn)return this.onEnd(o),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(s===dc||s===n0))&&(this.options.to==="string"?this.onData(Ac.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!==r0);return s===dc?(o=to.deflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===sn):(s===n0&&(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 pc(t,e){var r=new cr(e);if(r.push(t,!0),r.err)throw r.msg||mc[r.err];return r.result}function oE(t,e){return e=e||{},e.raw=!0,pc(t,e)}function sE(t,e){return e=e||{},e.gzip=!0,pc(t,e)}ro.Deflate=cr;ro.deflate=pc;ro.deflateRaw=oE;ro.gzip=sE});var a0=at((SD,i0)=>{"use strict";var Ms=30,iE=12;i0.exports=function(e,r){var n,o,s,i,a,f,c,l,h,u,d,A,m,g,_,y,T,b,C,I,M,L,B,p,x;n=e.state,o=e.next_in,p=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,g=n.lencode,_=n.distcode,y=(1<<n.lenbits)-1,T=(1<<n.distbits)-1;t:do{m<15&&(A+=p[o++]<<m,m+=8,A+=p[o++]<<m,m+=8),b=g[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){I=b&65535,C&=15,C&&(m<C&&(A+=p[o++]<<m,m+=8),I+=A&(1<<C)-1,A>>>=C,m-=C),m<15&&(A+=p[o++]<<m,m+=8,A+=p[o++]<<m,m+=8),b=_[A&T];r:for(;;){if(C=b>>>24,A>>>=C,m-=C,C=b>>>16&255,C&16){if(M=b&65535,C&=15,m<C&&(A+=p[o++]<<m,m+=8,m<C&&(A+=p[o++]<<m,m+=8)),M+=A&(1<<C)-1,M>c){e.msg="invalid distance too far back",n.mode=Ms;break t}if(A>>>=C,m-=C,C=i-a,M>C){if(C=M-C,C>h&&n.sane){e.msg="invalid distance too far back",n.mode=Ms;break t}if(L=0,B=d,u===0){if(L+=l-C,C<I){I-=C;do x[i++]=d[L++];while(--C);L=i-M,B=x}}else if(u<C){if(L+=l+u-C,C-=u,C<I){I-=C;do x[i++]=d[L++];while(--C);if(L=0,u<I){C=u,I-=C;do x[i++]=d[L++];while(--C);L=i-M,B=x}}}else if(L+=u-C,C<I){I-=C;do x[i++]=d[L++];while(--C);L=i-M,B=x}for(;I>2;)x[i++]=B[L++],x[i++]=B[L++],x[i++]=B[L++],I-=3;I&&(x[i++]=B[L++],I>1&&(x[i++]=B[L++]))}else{L=i-M;do x[i++]=x[L++],x[i++]=x[L++],x[i++]=x[L++],I-=3;while(I>2);I&&(x[i++]=x[L++],I>1&&(x[i++]=x[L++]))}}else if(C&64){e.msg="invalid distance code",n.mode=Ms;break t}else{b=_[(b&65535)+(A&(1<<C)-1)];continue r}break}}else if(C&64)if(C&32){n.mode=iE;break t}else{e.msg="invalid literal/length code",n.mode=Ms;break t}else{b=g[(b&65535)+(A&(1<<C)-1)];continue e}break}}while(o<s&&i<f);I=m>>3,o-=I,m-=I<<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 A0=at((FD,d0)=>{"use strict";var c0=me(),an=15,f0=852,l0=592,h0=0,gc=1,u0=2,aE=[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],cE=[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],fE=[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],lE=[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];d0.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,g=0,_=0,y=0,T=0,b,C,I,M,L,B=null,p=0,x,E=new c0.Buf16(an+1),U=new c0.Buf16(an+1),N=null,P=0,v,it,At;for(l=0;l<=an;l++)E[l]=0;for(h=0;h<o;h++)E[r[n+h]]++;for(A=c,d=an;d>=1&&E[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&&E[u]===0;u++);for(A<u&&(A=u),_=1,l=1;l<=an;l++)if(_<<=1,_-=E[l],_<0)return-1;if(_>0&&(e===h0||d!==1))return-1;for(U[1]=0,l=1;l<an;l++)U[l+1]=U[l]+E[l];for(h=0;h<o;h++)r[n+h]!==0&&(a[U[r[n+h]]++]=h);if(e===h0?(B=N=a,x=19):e===gc?(B=aE,p-=257,N=cE,P-=257,x=256):(B=fE,N=lE,x=-1),T=0,h=0,l=u,L=i,m=A,g=0,I=-1,y=1<<A,M=y-1,e===gc&&y>f0||e===u0&&y>l0)return 1;for(;;){v=l-g,a[h]<x?(it=0,At=a[h]):a[h]>x?(it=N[P+a[h]],At=B[p+a[h]]):(it=32+64,At=0),b=1<<l-g,C=1<<m,u=C;do C-=b,s[L+(T>>g)+C]=v<<24|it<<16|At|0;while(C!==0);for(b=1<<l-1;T&b;)b>>=1;if(b!==0?(T&=b-1,T+=b):T=0,h++,--E[l]===0){if(l===d)break;l=r[n+a[h]]}if(l>A&&(T&M)!==I){for(g===0&&(g=A),L+=u,m=l-g,_=1<<m;m+g<d&&(_-=E[m+g],!(_<=0));)m++,_<<=1;if(y+=1<<m,e===gc&&y>f0||e===u0&&y>l0)return 1;I=T&M,s[I]=A<<24|m<<16|L-i|0}}return T!==0&&(s[L+T]=l-g<<24|64<<16|0),f.bits=A,0}});var Z0=at(Xt=>{"use strict";var St=me(),Cc=sc(),ae=ic(),hE=a0(),no=A0(),uE=0,H0=1,k0=2,m0=4,dE=5,Is=6,fr=0,AE=1,mE=2,Pt=-2,J0=-3,Tc=-4,pE=-5,p0=8,z0=1,g0=2,B0=3,x0=4,_0=5,E0=6,y0=7,C0=8,T0=9,b0=10,Ds=11,Be=12,Bc=13,w0=14,xc=15,M0=16,I0=17,S0=18,F0=19,Ss=20,Fs=21,D0=22,R0=23,L0=24,O0=25,v0=26,_c=27,G0=28,N0=29,tt=30,bc=31,gE=32,BE=852,xE=592,_E=15,EE=_E;function U0(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}function yE(){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 Q0(t){var e;return!t||!t.state?Pt:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=z0,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new St.Buf32(BE),e.distcode=e.distdyn=new St.Buf32(xE),e.sane=1,e.back=-1,fr)}function V0(t){var e;return!t||!t.state?Pt:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,Q0(t))}function j0(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))?Pt:(n.window!==null&&n.wbits!==e&&(n.window=null),n.wrap=r,n.wbits=e,V0(t))}function K0(t,e){var r,n;return t?(n=new yE,t.state=n,n.window=null,r=j0(t,e),r!==fr&&(t.state=null),r):Pt}function CE(t){return K0(t,EE)}var P0=!0,Ec,yc;function TE(t){if(P0){var e;for(Ec=new St.Buf32(512),yc=new St.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(H0,t.lens,0,288,Ec,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;no(k0,t.lens,0,32,yc,0,t.work,{bits:5}),P0=!1}t.lencode=Ec,t.lenbits=9,t.distcode=yc,t.distbits=5}function X0(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 St.Buf8(s.wsize)),n>=s.wsize?(St.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),St.arraySet(s.window,e,r-n,o,s.wnext),n-=o,n?(St.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 bE(t,e){var r,n,o,s,i,a,f,c,l,h,u,d,A,m,g=0,_,y,T,b,C,I,M,L,B=new St.Buf8(4),p,x,E=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0)return Pt;r=t.state,r.mode===Be&&(r.mode=Bc),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,L=fr;t:for(;;)switch(r.mode){case z0:if(r.wrap===0){r.mode=Bc;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=ae(r.check,B,2,0),c=0,l=0,r.mode=g0;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=tt;break}if((c&15)!==p0){t.msg="unknown compression method",r.mode=tt;break}if(c>>>=4,l-=4,M=(c&15)+8,r.wbits===0)r.wbits=M;else if(M>r.wbits){t.msg="invalid window size",r.mode=tt;break}r.dmax=1<<M,t.adler=r.check=1,r.mode=c&512?b0:Be,c=0,l=0;break;case g0:for(;l<16;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(r.flags=c,(r.flags&255)!==p0){t.msg="unknown compression method",r.mode=tt;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=tt;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(B[0]=c&255,B[1]=c>>>8&255,r.check=ae(r.check,B,2,0)),c=0,l=0,r.mode=B0;case B0: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=ae(r.check,B,4,0)),c=0,l=0,r.mode=x0;case x0: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=ae(r.check,B,2,0)),c=0,l=0,r.mode=_0;case _0: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=ae(r.check,B,2,0)),c=0,l=0}else r.head&&(r.head.extra=null);r.mode=E0;case E0:if(r.flags&1024&&(d=r.length,d>a&&(d=a),d&&(r.head&&(M=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,M)),r.flags&512&&(r.check=ae(r.check,n,d,s)),a-=d,s+=d,r.length-=d),r.length))break t;r.length=0,r.mode=y0;case y0:if(r.flags&2048){if(a===0)break t;d=0;do M=n[s+d++],r.head&&M&&r.length<65536&&(r.head.name+=String.fromCharCode(M));while(M&&d<a);if(r.flags&512&&(r.check=ae(r.check,n,d,s)),a-=d,s+=d,M)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=C0;case C0:if(r.flags&4096){if(a===0)break t;d=0;do M=n[s+d++],r.head&&M&&r.length<65536&&(r.head.comment+=String.fromCharCode(M));while(M&&d<a);if(r.flags&512&&(r.check=ae(r.check,n,d,s)),a-=d,s+=d,M)break t}else r.head&&(r.head.comment=null);r.mode=T0;case T0: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=tt;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=Be;break;case b0:for(;l<32;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}t.adler=r.check=U0(c),c=0,l=0,r.mode=Ds;case Ds: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,mE;t.adler=r.check=1,r.mode=Be;case Be:if(e===dE||e===Is)break t;case Bc:if(r.last){c>>>=l&7,l-=l&7,r.mode=_c;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=w0;break;case 1:if(TE(r),r.mode=Ss,e===Is){c>>>=2,l-=2;break t}break;case 2:r.mode=I0;break;case 3:t.msg="invalid block type",r.mode=tt}c>>>=2,l-=2;break;case w0: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=tt;break}if(r.length=c&65535,c=0,l=0,r.mode=xc,e===Is)break t;case xc:r.mode=M0;case M0:if(d=r.length,d){if(d>a&&(d=a),d>f&&(d=f),d===0)break t;St.arraySet(o,n,s,d,i),a-=d,s+=d,f-=d,i+=d,r.length-=d;break}r.mode=Be;break;case I0: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=tt;break}r.have=0,r.mode=S0;case S0:for(;r.have<r.ncode;){for(;l<3;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}r.lens[E[r.have++]]=c&7,c>>>=3,l-=3}for(;r.have<19;)r.lens[E[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,p={bits:r.lenbits},L=no(uE,r.lens,0,19,r.lencode,0,r.work,p),r.lenbits=p.bits,L){t.msg="invalid code lengths set",r.mode=tt;break}r.have=0,r.mode=F0;case F0:for(;r.have<r.nlen+r.ndist;){for(;g=r.lencode[c&(1<<r.lenbits)-1],_=g>>>24,y=g>>>16&255,T=g&65535,!(_<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(T<16)c>>>=_,l-=_,r.lens[r.have++]=T;else{if(T===16){for(x=_+2;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(c>>>=_,l-=_,r.have===0){t.msg="invalid bit length repeat",r.mode=tt;break}M=r.lens[r.have-1],d=3+(c&3),c>>>=2,l-=2}else if(T===17){for(x=_+3;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=_,l-=_,M=0,d=3+(c&7),c>>>=3,l-=3}else{for(x=_+7;l<x;){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=_,l-=_,M=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=tt;break}for(;d--;)r.lens[r.have++]=M}}if(r.mode===tt)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=tt;break}if(r.lenbits=9,p={bits:r.lenbits},L=no(H0,r.lens,0,r.nlen,r.lencode,0,r.work,p),r.lenbits=p.bits,L){t.msg="invalid literal/lengths set",r.mode=tt;break}if(r.distbits=6,r.distcode=r.distdyn,p={bits:r.distbits},L=no(k0,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,p),r.distbits=p.bits,L){t.msg="invalid distances set",r.mode=tt;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,hE(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===Be&&(r.back=-1);break}for(r.back=0;g=r.lencode[c&(1<<r.lenbits)-1],_=g>>>24,y=g>>>16&255,T=g&65535,!(_<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(y&&!(y&240)){for(b=_,C=y,I=T;g=r.lencode[I+((c&(1<<b+C)-1)>>b)],_=g>>>24,y=g>>>16&255,T=g&65535,!(b+_<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=_,l-=_,r.back+=_,r.length=T,y===0){r.mode=v0;break}if(y&32){r.back=-1,r.mode=Be;break}if(y&64){t.msg="invalid literal/length code",r.mode=tt;break}r.extra=y&15,r.mode=D0;case D0: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=R0;case R0:for(;g=r.distcode[c&(1<<r.distbits)-1],_=g>>>24,y=g>>>16&255,T=g&65535,!(_<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}if(!(y&240)){for(b=_,C=y,I=T;g=r.distcode[I+((c&(1<<b+C)-1)>>b)],_=g>>>24,y=g>>>16&255,T=g&65535,!(b+_<=l);){if(a===0)break t;a--,c+=n[s++]<<l,l+=8}c>>>=b,l-=b,r.back+=b}if(c>>>=_,l-=_,r.back+=_,y&64){t.msg="invalid distance code",r.mode=tt;break}r.offset=T,r.extra=y&15,r.mode=L0;case L0: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=tt;break}r.mode=O0;case O0: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=tt;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 v0:if(f===0)break t;o[i++]=r.length,f--,r.mode=Fs;break;case _c: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?ae(r.check,o,u,i-u):Cc(r.check,o,u,i-u)),u=f,(r.flags?c:U0(c))!==r.check){t.msg="incorrect data check",r.mode=tt;break}c=0,l=0}r.mode=G0;case G0: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=tt;break}c=0,l=0}r.mode=N0;case N0:L=AE;break t;case tt:L=J0;break t;case bc:return Tc;case gE:default:return Pt}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<tt&&(r.mode<_c||e!==m0))&&X0(t,t.output,t.next_out,u-t.avail_out)?(r.mode=bc,Tc):(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?ae(r.check,o,u,t.next_out-u):Cc(r.check,o,u,t.next_out-u)),t.data_type=r.bits+(r.last?64:0)+(r.mode===Be?128:0)+(r.mode===Ss||r.mode===xc?256:0),(h===0&&u===0||e===m0)&&L===fr&&(L=pE),L)}function wE(t){if(!t||!t.state)return Pt;var e=t.state;return e.window&&(e.window=null),t.state=null,fr}function ME(t,e){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?Pt:(r.head=e,e.done=!1,fr)}function IE(t,e){var r=e.length,n,o,s;return!t||!t.state||(n=t.state,n.wrap!==0&&n.mode!==Ds)?Pt:n.mode===Ds&&(o=1,o=Cc(o,e,r,0),o!==n.check)?J0:(s=X0(t,e,r,r),s?(n.mode=bc,Tc):(n.havedict=1,fr))}Xt.inflateReset=V0;Xt.inflateReset2=j0;Xt.inflateResetKeep=Q0;Xt.inflateInit=CE;Xt.inflateInit2=K0;Xt.inflate=bE;Xt.inflateEnd=wE;Xt.inflateGetHeader=ME;Xt.inflateSetDictionary=IE;Xt.inflateInfo="pako inflate (from Nodeca project)"});var wc=at((RD,Y0)=>{"use strict";Y0.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 q0=at((LD,W0)=>{"use strict";function SE(){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}W0.exports=SE});var td=at(so=>{"use strict";var cn=Z0(),oo=me(),Rs=hc(),nt=wc(),Mc=xs(),FE=uc(),DE=q0(),$0=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 FE,this.strm.avail_out=0;var r=cn.inflateInit2(this.strm,e.windowBits);if(r!==nt.Z_OK)throw new Error(Mc[r]);if(this.header=new DE,cn.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=Rs.string2buf(e.dictionary):$0.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(Mc[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=Rs.binstring2buf(t):$0.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=Rs.utf8border(r.output,r.next_out),f=r.next_out-a,c=Rs.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 Ic(t,e){var r=new lr(e);if(r.push(t,!0),r.err)throw r.msg||Mc[r.err];return r.result}function RE(t,e){return e=e||{},e.raw=!0,Ic(t,e)}so.Inflate=lr;so.inflate=Ic;so.inflateRaw=RE;so.ungzip=Ic});var nd=at((vD,rd)=>{"use strict";var LE=me().assign,OE=s0(),vE=td(),GE=wc(),ed={};LE(ed,OE,vE,GE);rd.exports=ed});var od=at(()=>{});var io={};ht(io,{CesiumIonLoader:()=>za,TILE3D_TYPE:()=>Et,Tile3DBatchTable:()=>de,Tile3DFeatureTable:()=>zt,Tile3DSubtreeLoader:()=>Jr,Tile3DWriter:()=>ud,Tiles3DArchive:()=>fn,Tiles3DArchiveFileLoader:()=>id,Tiles3DLoader:()=>tr,_getIonTilesetMetadata:()=>As});uo(io,mr(hn(),1));async function Ht(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 Yt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},_d=Yt.self||Yt.window||Yt.global||{},Ed=Yt.window||Yt.self||Yt.global||{},yd=Yt.global||Yt.self||Yt.window||{},Cd=Yt.document||{};var xt=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Uc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),Td=Uc&&parseFloat(Uc[1])||0;function bd(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.0-alpha.4"),globalThis._loadersgl_.version}var Pc=bd();function Hc(t,e){if(!t)throw new Error(e||"loaders.gl assertion failed.")}var Wt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},WE=Wt.self||Wt.window||Wt.global||{},qE=Wt.window||Wt.self||Wt.global||{},$E=Wt.global||Wt.self||Wt.window||{},t2=Wt.document||{};var pr=typeof process!="object"||String(process)!=="[object process]"||process.browser,Ao=typeof importScripts=="function",e2=typeof window<"u"&&typeof window.orientation<"u",kc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),r2=kc&&parseFloat(kc[1])||0;var _t={};var vs={};async function qt(t,e=null,r={},n=null){return e&&(t=Jc(t,e,r,n)),vs[t]=vs[t]||wd(t),await vs[t]}function Jc(t,e,r={},n=null){if(!r.useLocalLibraries&&t.startsWith("http"))return t;n=n||t;let o=r.modules||{};return o[n]?o[n]:pr?r.CDN?(Hc(r.CDN.startsWith("http")),`${r.CDN}/${e}@${Pc}/dist/libs/${n}`):Ao?`../src/libs/${n}`:`modules/${e}/src/libs/${n}`:`modules/${e}/dist/libs/${n}`}async function wd(t){if(t.endsWith("wasm"))return await Id(t);if(!pr)try{return _t&&void 0&&await(void 0)(t)}catch(r){return console.error(r),null}if(Ao)return importScripts(t);let e=await Sd(t);return Md(e,t)}function Md(t,e){if(!pr)return void 0&&(void 0)(t,e);if(Ao)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 Id(t){return pr||!void 0||t.startsWith("http")?await(await fetch(t)).arrayBuffer():await(void 0)(t)}async function Sd(t){return pr||!void 0||t.startsWith("http")?await(await fetch(t)).text():await(void 0)(t)}function Qc(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?zc(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?zc(t,0,e):""}function zc(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 Gs(t){try{return JSON.parse(t)}catch{throw new Error(`Failed to parse JSON from data starting with "${Qc(t)}"`)}}function _e(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 Vc(t)}function Vc(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 ke(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 wt(t,e){return z(t>=0),z(e>0),t+(e-1)&~(e-1)}function Ns(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+wt(n.byteLength,4)}function Us(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 un(t,e,r,n){if(t)for(let o=0;o<n;o++)t.setUint8(e+o,r[o]);return e+n}function jc(t,e,r,n){let o=wt(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 mo(t,e,r,n){let s=new TextEncoder().encode(r);return e=jc(t,e,s,n),e}async function dn(t){let e=[];for await(let r of t)e.push(r);return gr(...e)}function Ee(t){return Ee=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ee(t)}function Ps(t,e){if(Ee(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(Ee(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Hs(t){var e=Ps(t,"string");return Ee(e)==="symbol"?e:String(e)}function X(t,e,r){return e=Hs(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Kc(t){return t&&typeof t=="object"&&t.isBuffer}function xr(t){if(Kc(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 _r(t){return e=>new Promise((r,n)=>t(e,(o,s)=>o?n(o):r(s)))}var Er={};ht(Er,{dirname:()=>Dd,filename:()=>Fd,join:()=>Rd,resolve:()=>Ld});function Xc(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let t=window.location?.pathname;return t?.slice(0,t.lastIndexOf("/")+1)||""}function Fd(t){let e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function Dd(t){let e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}function Rd(...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 Ld(...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=Xc()),i=o),i.length!==0&&(r=`${i}/${r}`,n=i.charCodeAt(0)===An)}return r=Od(r,!n),n?`/${r}`:r.length>0?r:"."}var An=47,ks=46;function Od(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===An)break;s=An}if(s===An){if(!(n===a-1||o===1))if(n!==a-1&&o===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==ks||r.charCodeAt(r.length-2)!==ks){if(r.length>2){let f=r.length-1,c=f;for(;c>=0&&r.charCodeAt(c)!==An;--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===ks&&o!==-1?++o:o=-1}return r}var mn=new Error("Not implemented"),po=class{constructor(e,r,n){if(this.size=0,this.bigsize=0n,this.url="",globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(e,r,n);throw xt?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 mn}async write(e,r,n){throw mn}async stat(){throw mn}async truncate(e){throw mn}async append(e){throw mn}async close(){}};var Js=t=>t?.getUint8&&t?.slice&&t?.length;var pn=class{constructor(e,r=!1){this.file=new po(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)},gn=class{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 vd=1/Math.PI*180,Gd=1/180*Math.PI,Nd={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...Nd}};var W=globalThis.mathgl.config;function zs(t,{precision:e=W.precision}={}){return t=Ud(t),"".concat(parseFloat(t.toPrecision(e)))}function Ft(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Qs(t){return Zc(t)}function Vs(t){return Yc(t)}function Zc(t,e){return Ks(t,r=>r*Gd,e)}function Yc(t,e){return Ks(t,r=>r*vd,e)}function js(t,e,r){return Ks(t,n=>Math.max(e,Math.min(r,n)))}function Mt(t,e,r){let n=W.EPSILON;r&&(W.EPSILON=r);try{if(t===e)return!0;if(Ft(t)&&Ft(e)){if(t.length!==e.length)return!1;for(let o=0;o<t.length;++o)if(!Mt(t[o],e[o]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=W.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{W.EPSILON=n}}function Ud(t){return Math.round(t/W.EPSILON)*W.EPSILON}function Pd(t){return t.clone?t.clone():new Array(t.length)}function Ks(t,e,r){if(Ft(t)){let n=t;r=r||Pd(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)}function Hd(t){function e(){var r=Reflect.construct(t,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return e.prototype=Object.create(t.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t,e}var ye=class extends Hd(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:Ft(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(W)}formatString(e){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+zs(this[n],e);return"".concat(e.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(e){if(!e||this.length!==e.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!Mt(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(W.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let e=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)e=e&&Number.isFinite(this[r]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]=e;return this.check()}addScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let r=0;r<this.ELEMENTS;++r)this[r]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],e),r);return this.check()}get elements(){return this}};function kd(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 ".concat(JSON.stringify(t)));return t}function Ce(t,e,r=""){if(W.debug&&!kd(t,e))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return t}function ct(t,e){if(!t)throw new Error("math.gl assertion ".concat(e))}var Te=class extends ye{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 ct(e>=0&&e<this.ELEMENTS,"index is out of range"),k(this[e])}setComponent(e,r){return ct(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 $=typeof Float32Array<"u"?Float32Array:Array,Bn=Math.random;function Cr(t){return t>=0?Math.round(t):t%.5===0?Math.floor(t):Math.round(t)}var py=Math.PI/180;function Jd(){let t=new $(2);return $!=Float32Array&&(t[0]=0,t[1]=0),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}function qc(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 go(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 Bo(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 gy=function(){let t=Jd();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 xo(t,e,r){let n=e[0],o=e[1],s=r[3]*n+r[7]*o||1;return t[0]=(r[0]*n+r[4]*o)/s,t[1]=(r[1]*n+r[5]*o)/s,t}function _o(t,e,r){let n=e[0],o=e[1],s=e[2],i=r[3]*n+r[7]*o+r[11]*s||1;return t[0]=(r[0]*n+r[4]*o+r[8]*s)/i,t[1]=(r[1]*n+r[5]*o+r[9]*s)/i,t[2]=(r[2]*n+r[6]*o+r[10]*s)/i,t}function $c(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 tf(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 Je=class extends Te{constructor(e=0,r=0){super(2),Ft(e)&&arguments.length===1?this.copy(e):(W.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 W.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 Bo(this,this,e),this.check()}transformAsVector(e){return xo(this,this,e),this.check()}transformByMatrix3(e){return go(this,this,e),this.check()}transformByMatrix2x3(e){return qc(this,this,e),this.check()}transformByMatrix2(e){return Wc(this,this,e),this.check()}};var br={};ht(br,{add:()=>jd,angle:()=>qs,bezier:()=>sA,ceil:()=>Kd,clone:()=>zd,copy:()=>Qd,create:()=>yo,cross:()=>ze,dist:()=>AA,distance:()=>sf,div:()=>dA,divide:()=>of,dot:()=>xn,equals:()=>lA,exactEquals:()=>fA,floor:()=>Xd,forEach:()=>gA,fromValues:()=>Co,hermite:()=>oA,inverse:()=>eA,len:()=>$s,length:()=>ef,lerp:()=>rA,max:()=>Yd,min:()=>Zd,mul:()=>uA,multiply:()=>nf,negate:()=>tA,normalize:()=>Xs,random:()=>iA,rotateX:()=>Zs,rotateY:()=>Ys,rotateZ:()=>Ws,round:()=>Wd,scale:()=>qd,scaleAndAdd:()=>$d,set:()=>Vd,slerp:()=>nA,sqrDist:()=>mA,sqrLen:()=>pA,squaredDistance:()=>af,squaredLength:()=>cf,str:()=>cA,sub:()=>hA,subtract:()=>rf,transformMat3:()=>_n,transformMat4:()=>Qe,transformQuat:()=>En,zero:()=>aA});function yo(){let t=new $(3);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function zd(t){let e=new $(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function ef(t){let e=t[0],r=t[1],n=t[2];return Math.sqrt(e*e+r*r+n*n)}function Co(t,e,r){let n=new $(3);return n[0]=t,n[1]=e,n[2]=r,n}function Qd(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Vd(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}function jd(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t}function rf(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}function nf(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t}function of(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}function Kd(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}function Xd(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}function Zd(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 Yd(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 Wd(t,e){return t[0]=Cr(e[0]),t[1]=Cr(e[1]),t[2]=Cr(e[2]),t}function qd(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}function $d(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 sf(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 af(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 cf(t){let e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}function tA(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t}function eA(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t}function Xs(t,e){let r=e[0],n=e[1],o=e[2],s=r*r+n*n+o*o;return s>0&&(s=1/Math.sqrt(s)),t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t}function xn(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function ze(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 rA(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 nA(t,e,r,n){let o=Math.acos(Math.min(Math.max(xn(e,r),-1),1)),s=Math.sin(o),i=Math.sin((1-n)*o)/s,a=Math.sin(n*o)/s;return t[0]=i*e[0]+a*r[0],t[1]=i*e[1]+a*r[1],t[2]=i*e[2]+a*r[2],t}function oA(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 sA(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 iA(t,e){e=e===void 0?1:e;let r=Bn()*2*Math.PI,n=Bn()*2-1,o=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*o,t[1]=Math.sin(r)*o,t[2]=n*e,t}function Qe(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 En(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,g=i*2;return l*=g,h*=g,u*=g,d*=2,A*=2,m*=2,t[0]=a+l+d,t[1]=f+h+A,t[2]=c+u+m,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[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 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[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 Ws(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 qs(t,e){let r=t[0],n=t[1],o=t[2],s=e[0],i=e[1],a=e[2],f=Math.sqrt((r*r+n*n+o*o)*(s*s+i*i+a*a)),c=f&&xn(t,e)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function aA(t){return t[0]=0,t[1]=0,t[2]=0,t}function cA(t){return"vec3(".concat(t[0],", ").concat(t[1],", ").concat(t[2],")")}function fA(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}function lA(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 hA=rf,uA=nf,dA=of,AA=sf,mA=af,$s=ef,pA=cf,gA=function(){let t=yo();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 ti=[0,0,0],To,w=class extends Te{static get ZERO(){return To||(To=new w(0,0,0),Object.freeze(To)),To}constructor(e=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Ft(e)?this.copy(e):(W.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 W.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 qs(this,e)}cross(e){return ze(this,this,e),this.check()}rotateX({radians:e,origin:r=ti}){return Zs(this,this,r,e),this.check()}rotateY({radians:e,origin:r=ti}){return Ys(this,this,r,e),this.check()}rotateZ({radians:e,origin:r=ti}){return Ws(this,this,r,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return Qe(this,this,e),this.check()}transformAsVector(e){return _o(this,this,e),this.check()}transformByMatrix3(e){return _n(this,this,e),this.check()}transformByMatrix2(e){return $c(this,this,e),this.check()}transformByQuaternion(e){return En(this,this,e),this.check()}};var bo,wr=class extends Te{static get ZERO(){return bo||(bo=new wr(0,0,0,0),Object.freeze(bo)),bo}constructor(e=0,r=0,n=0,o=0){super(-0,-0,-0,-0),Ft(e)&&arguments.length===1?this.copy(e):(W.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 W.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 Qe(this,this,e),this.check()}transformByMatrix3(e){return Eo(this,this,e),this.check()}transformByMatrix2(e){return tf(this,this,e),this.check()}transformByQuaternion(e){return En(this,this,e),this.check()}applyMatrix4(e){return e.transform(this,this),this}};var Mr=class extends ye{toString(){let e="[";if(W.printRowMajor){e+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)e+=" ".concat(this[n*this.RANK+r])}else{e+="column-major:";for(let r=0;r<this.ELEMENTS;++r)e+=" ".concat(this[r])}return e+="]",e}getElementIndex(e,r){return r*this.RANK+e}getElement(e,r){return this[r*this.RANK+e]}setElement(e,r,n){return this[r*this.RANK+e]=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 ff(){let t=new $(9);return $!=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 lf(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 hf(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 uf(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 ei(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],g=r[4],_=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+g*i+_*c,t[4]=m*o+g*a+_*l,t[5]=m*s+g*f+_*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 df(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 Af(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 ri(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 mf(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,g=s*a,_=s*f;return t[0]=1-h-A,t[3]=l-_,t[6]=u+g,t[1]=l+_,t[4]=1-c-A,t[7]=d-m,t[2]=u-g,t[5]=d+m,t[8]=1-c-h,t}var ni;(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"})(ni||(ni={}));var xA=Object.freeze([1,0,0,0,1,0,0,0,1]),Z=class extends Mr{static get IDENTITY(){return EA()}static get ZERO(){return _A()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return ni}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(xA)}fromObject(e){return this.check()}fromQuaternion(e){return mf(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 uf(this)}transpose(){return lf(this,this),this.check()}invert(){return hf(this,this),this.check()}multiplyLeft(e){return ei(this,e,this),this.check()}multiplyRight(e){return ei(this,this,e),this.check()}rotate(e){return Af(this,this,e),this.check()}scale(e){return Array.isArray(e)?ri(this,this,e):ri(this,this,[e,e]),this.check()}translate(e){return df(this,this,e),this.check()}transform(e,r){let n;switch(e.length){case 2:n=go(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 Ce(n,e.length),n}transformVector(e,r){return this.transform(e,r)}transformVector2(e,r){return this.transform(e,r)}transformVector3(e,r){return this.transform(e,r)}},wo,Mo=null;function _A(){return wo||(wo=new Z([0,0,0,0,0,0,0,0,0]),Object.freeze(wo)),wo}function EA(){return Mo||(Mo=new Z,Object.freeze(Mo)),Mo}var Io={};ht(Io,{add:()=>jA,adjoint:()=>MA,clone:()=>CA,copy:()=>TA,create:()=>yA,decompose:()=>NA,determinant:()=>ii,equals:()=>YA,exactEquals:()=>ZA,frob:()=>VA,fromQuat:()=>di,fromQuat2:()=>OA,fromRotation:()=>FA,fromRotationTranslation:()=>gf,fromRotationTranslationScale:()=>UA,fromRotationTranslationScaleOrigin:()=>PA,fromScaling:()=>SA,fromTranslation:()=>IA,fromValues:()=>bA,fromXRotation:()=>DA,fromYRotation:()=>RA,fromZRotation:()=>LA,frustum:()=>Ai,getRotation:()=>GA,getScaling:()=>Bf,getTranslation:()=>vA,identity:()=>pf,invert:()=>si,lookAt:()=>gi,mul:()=>WA,multiply:()=>yn,multiplyScalar:()=>KA,multiplyScalarAndAdd:()=>XA,ortho:()=>pi,orthoNO:()=>_f,orthoZO:()=>JA,perspective:()=>mi,perspectiveFromFieldOfView:()=>kA,perspectiveNO:()=>xf,perspectiveZO:()=>HA,rotate:()=>fi,rotateX:()=>li,rotateY:()=>hi,rotateZ:()=>ui,scale:()=>ci,set:()=>wA,str:()=>QA,sub:()=>qA,subtract:()=>Ef,targetTo:()=>zA,translate:()=>ai,transpose:()=>oi});function yA(){let t=new $(16);return $!=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 CA(t){let e=new $(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 TA(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 bA(t,e,r,n,o,s,i,a,f,c,l,h,u,d,A,m){let g=new $(16);return g[0]=t,g[1]=e,g[2]=r,g[3]=n,g[4]=o,g[5]=s,g[6]=i,g[7]=a,g[8]=f,g[9]=c,g[10]=l,g[11]=h,g[12]=u,g[13]=d,g[14]=A,g[15]=m,g}function wA(t,e,r,n,o,s,i,a,f,c,l,h,u,d,A,m,g){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]=g,t}function pf(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 oi(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 si(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],g=e[14],_=e[15],y=r*a-n*i,T=r*f-o*i,b=r*c-s*i,C=n*f-o*a,I=n*c-s*a,M=o*c-s*f,L=l*m-h*A,B=l*g-u*A,p=l*_-d*A,x=h*g-u*m,E=h*_-d*m,U=u*_-d*g,N=y*U-T*E+b*x+C*p-I*B+M*L;return N?(N=1/N,t[0]=(a*U-f*E+c*x)*N,t[1]=(o*E-n*U-s*x)*N,t[2]=(m*M-g*I+_*C)*N,t[3]=(u*I-h*M-d*C)*N,t[4]=(f*p-i*U-c*B)*N,t[5]=(r*U-o*p+s*B)*N,t[6]=(g*b-A*M-_*T)*N,t[7]=(l*M-u*b+d*T)*N,t[8]=(i*E-a*p+c*L)*N,t[9]=(n*p-r*E-s*L)*N,t[10]=(A*I-m*b+_*y)*N,t[11]=(h*b-l*I-d*y)*N,t[12]=(a*B-i*x-f*L)*N,t[13]=(r*x-n*B+o*L)*N,t[14]=(m*T-A*C-g*y)*N,t[15]=(l*C-h*T+u*y)*N,t):null}function MA(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],g=e[14],_=e[15],y=r*a-n*i,T=r*f-o*i,b=r*c-s*i,C=n*f-o*a,I=n*c-s*a,M=o*c-s*f,L=l*m-h*A,B=l*g-u*A,p=l*_-d*A,x=h*g-u*m,E=h*_-d*m,U=u*_-d*g;return t[0]=a*U-f*E+c*x,t[1]=o*E-n*U-s*x,t[2]=m*M-g*I+_*C,t[3]=u*I-h*M-d*C,t[4]=f*p-i*U-c*B,t[5]=r*U-o*p+s*B,t[6]=g*b-A*M-_*T,t[7]=l*M-u*b+d*T,t[8]=i*E-a*p+c*L,t[9]=n*p-r*E-s*L,t[10]=A*I-m*b+_*y,t[11]=h*b-l*I-d*y,t[12]=a*B-i*x-f*L,t[13]=r*x-n*B+o*L,t[14]=m*T-A*C-g*y,t[15]=l*C-h*T+u*y,t}function ii(t){let e=t[0],r=t[1],n=t[2],o=t[3],s=t[4],i=t[5],a=t[6],f=t[7],c=t[8],l=t[9],h=t[10],u=t[11],d=t[12],A=t[13],m=t[14],g=t[15],_=e*i-r*s,y=e*a-n*s,T=r*a-n*i,b=c*A-l*d,C=c*m-h*d,I=l*m-h*A,M=e*I-r*C+n*b,L=s*I-i*C+a*b,B=c*T-l*y+h*_,p=d*T-A*y+m*_;return f*M-o*L+g*B-u*p}function yn(t,e,r){let n=e[0],o=e[1],s=e[2],i=e[3],a=e[4],f=e[5],c=e[6],l=e[7],h=e[8],u=e[9],d=e[10],A=e[11],m=e[12],g=e[13],_=e[14],y=e[15],T=r[0],b=r[1],C=r[2],I=r[3];return t[0]=T*n+b*a+C*h+I*m,t[1]=T*o+b*f+C*u+I*g,t[2]=T*s+b*c+C*d+I*_,t[3]=T*i+b*l+C*A+I*y,T=r[4],b=r[5],C=r[6],I=r[7],t[4]=T*n+b*a+C*h+I*m,t[5]=T*o+b*f+C*u+I*g,t[6]=T*s+b*c+C*d+I*_,t[7]=T*i+b*l+C*A+I*y,T=r[8],b=r[9],C=r[10],I=r[11],t[8]=T*n+b*a+C*h+I*m,t[9]=T*o+b*f+C*u+I*g,t[10]=T*s+b*c+C*d+I*_,t[11]=T*i+b*l+C*A+I*y,T=r[12],b=r[13],C=r[14],I=r[15],t[12]=T*n+b*a+C*h+I*m,t[13]=T*o+b*f+C*u+I*g,t[14]=T*s+b*c+C*d+I*_,t[15]=T*i+b*l+C*A+I*y,t}function ai(t,e,r){let n=r[0],o=r[1],s=r[2],i,a,f,c,l,h,u,d,A,m,g,_;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],g=e[10],_=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]=g,t[11]=_,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+g*s+e[14],t[15]=c*n+d*o+_*s+e[15]),t}function ci(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 fi(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,g,_,y,T,b,C,I,M,L,B,p,x,E,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],g=e[5],_=e[6],y=e[7],T=e[8],b=e[9],C=e[10],I=e[11],M=o*o*l+f,L=s*o*l+i*c,B=i*o*l-s*c,p=o*s*l-i*c,x=s*s*l+f,E=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*M+m*L+T*B,t[1]=u*M+g*L+b*B,t[2]=d*M+_*L+C*B,t[3]=A*M+y*L+I*B,t[4]=h*p+m*x+T*E,t[5]=u*p+g*x+b*E,t[6]=d*p+_*x+C*E,t[7]=A*p+y*x+I*E,t[8]=h*U+m*N+T*P,t[9]=u*U+g*N+b*P,t[10]=d*U+_*N+C*P,t[11]=A*U+y*N+I*P,e!==t&&(t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t)}function li(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 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[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 ui(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 IA(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 SA(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 FA(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 DA(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 RA(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 LA(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 gf(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,g=i*a,_=i*f,y=i*c;return t[0]=1-(d+m),t[1]=h+y,t[2]=u-_,t[3]=0,t[4]=h-y,t[5]=1-(l+m),t[6]=A+g,t[7]=0,t[8]=u+_,t[9]=A-g,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 OA(t,e){let r=new $(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),gf(t,e,r),t}function vA(t,e){return t[0]=e[12],t[1]=e[13],t[2]=e[14],t}function Bf(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 GA(t,e){let r=new $(3);Bf(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,g=0;return m>0?(g=Math.sqrt(m+1)*2,t[3]=.25*g,t[0]=(h-d)/g,t[1]=(u-f)/g,t[2]=(a-c)/g):i>l&&i>A?(g=Math.sqrt(1+i-l-A)*2,t[3]=(h-d)/g,t[0]=.25*g,t[1]=(a+c)/g,t[2]=(u+f)/g):l>A?(g=Math.sqrt(1+l-i-A)*2,t[3]=(u-f)/g,t[0]=(a+c)/g,t[1]=.25*g,t[2]=(h+d)/g):(g=Math.sqrt(1+A-i-l)*2,t[3]=(a-c)/g,t[0]=(u+f)/g,t[1]=(h+d)/g,t[2]=.25*g),t}function NA(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],g=o*d,_=s*A,y=i*m,T=a*d,b=f*A,C=c*m,I=l*d,M=h*A,L=u*m,B=g+b+L,p=0;return B>0?(p=Math.sqrt(B+1)*2,t[3]=.25*p,t[0]=(C-M)/p,t[1]=(I-y)/p,t[2]=(_-T)/p):g>b&&g>L?(p=Math.sqrt(1+g-b-L)*2,t[3]=(C-M)/p,t[0]=.25*p,t[1]=(_+T)/p,t[2]=(I+y)/p):b>L?(p=Math.sqrt(1+b-g-L)*2,t[3]=(I-y)/p,t[0]=(_+T)/p,t[1]=.25*p,t[2]=(C+M)/p):(p=Math.sqrt(1+L-g-b)*2,t[3]=(_-T)/p,t[0]=(I+y)/p,t[1]=(C+M)/p,t[2]=.25*p),t}function UA(t,e,r,n){let o=e[0],s=e[1],i=e[2],a=e[3],f=o+o,c=s+s,l=i+i,h=o*f,u=o*c,d=o*l,A=s*c,m=s*l,g=i*l,_=a*f,y=a*c,T=a*l,b=n[0],C=n[1],I=n[2];return t[0]=(1-(A+g))*b,t[1]=(u+T)*b,t[2]=(d-y)*b,t[3]=0,t[4]=(u-T)*C,t[5]=(1-(h+g))*C,t[6]=(m+_)*C,t[7]=0,t[8]=(d+y)*I,t[9]=(m-_)*I,t[10]=(1-(h+A))*I,t[11]=0,t[12]=r[0],t[13]=r[1],t[14]=r[2],t[15]=1,t}function PA(t,e,r,n,o){let s=e[0],i=e[1],a=e[2],f=e[3],c=s+s,l=i+i,h=a+a,u=s*c,d=s*l,A=s*h,m=i*l,g=i*h,_=a*h,y=f*c,T=f*l,b=f*h,C=n[0],I=n[1],M=n[2],L=o[0],B=o[1],p=o[2],x=(1-(m+_))*C,E=(d+b)*C,U=(A-T)*C,N=(d-b)*I,P=(1-(u+_))*I,v=(g+y)*I,it=(A+T)*M,At=(g-y)*M,Y=(1-(u+m))*M;return t[0]=x,t[1]=E,t[2]=U,t[3]=0,t[4]=N,t[5]=P,t[6]=v,t[7]=0,t[8]=it,t[9]=At,t[10]=Y,t[11]=0,t[12]=r[0]+L-(x*L+N*B+it*p),t[13]=r[1]+B-(E*L+P*B+At*p),t[14]=r[2]+p-(U*L+v*B+Y*p),t[15]=1,t}function di(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,g=s*a,_=s*f;return t[0]=1-h-A,t[1]=l+_,t[2]=u-g,t[3]=0,t[4]=l-_,t[5]=1-c-A,t[6]=d+m,t[7]=0,t[8]=u+g,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 Ai(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 xf(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 mi=xf;function HA(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 kA(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 _f(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 pi=_f;function JA(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 gi(t,e,r,n){let o,s,i,a,f,c,l,h,u,d,A=e[0],m=e[1],g=e[2],_=n[0],y=n[1],T=n[2],b=r[0],C=r[1],I=r[2];return Math.abs(A-b)<1e-6&&Math.abs(m-C)<1e-6&&Math.abs(g-I)<1e-6?pf(t):(h=A-b,u=m-C,d=g-I,o=1/Math.sqrt(h*h+u*u+d*d),h*=o,u*=o,d*=o,s=y*d-T*u,i=T*h-_*d,a=_*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*g),t[13]=-(f*A+c*m+l*g),t[14]=-(h*A+u*m+d*g),t[15]=1,t)}function zA(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,g=a*h-f*l;return d=A*A+m*m+g*g,d>0&&(d=1/Math.sqrt(d),A*=d,m*=d,g*=d),t[0]=A,t[1]=m,t[2]=g,t[3]=0,t[4]=h*g-u*m,t[5]=u*A-l*g,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 QA(t){return"mat4(".concat(t[0],", ").concat(t[1],", ").concat(t[2],", ").concat(t[3],", ").concat(t[4],", ").concat(t[5],", ").concat(t[6],", ").concat(t[7],", ").concat(t[8],", ").concat(t[9],", ").concat(t[10],", ").concat(t[11],", ").concat(t[12],", ").concat(t[13],", ").concat(t[14],", ").concat(t[15],")")}function VA(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 jA(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 Ef(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 KA(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 XA(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 ZA(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 YA(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],g=t[14],_=t[15],y=e[0],T=e[1],b=e[2],C=e[3],I=e[4],M=e[5],L=e[6],B=e[7],p=e[8],x=e[9],E=e[10],U=e[11],N=e[12],P=e[13],v=e[14],it=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-I)<=1e-6*Math.max(1,Math.abs(i),Math.abs(I))&&Math.abs(a-M)<=1e-6*Math.max(1,Math.abs(a),Math.abs(M))&&Math.abs(f-L)<=1e-6*Math.max(1,Math.abs(f),Math.abs(L))&&Math.abs(c-B)<=1e-6*Math.max(1,Math.abs(c),Math.abs(B))&&Math.abs(l-p)<=1e-6*Math.max(1,Math.abs(l),Math.abs(p))&&Math.abs(h-x)<=1e-6*Math.max(1,Math.abs(h),Math.abs(x))&&Math.abs(u-E)<=1e-6*Math.max(1,Math.abs(u),Math.abs(E))&&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(g-v)<=1e-6*Math.max(1,Math.abs(g),Math.abs(v))&&Math.abs(_-it)<=1e-6*Math.max(1,Math.abs(_),Math.abs(it))}var WA=yn,qA=Ef;function $A(){let t=new $(4);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0,t[3]=0),t}function yf(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 Cf(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 Tf(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 bf(t){let e=t[0],r=t[1],n=t[2],o=t[3];return e*e+r*r+n*n+o*o}function wf(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 Mf(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}function If(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 Sf(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 Ff(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 Zy=function(){let t=$A();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 _i;(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"})(_i||(_i={}));var em=45*Math.PI/180,rm=1,Bi=.1,xi=500,nm=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Dt=class extends Mr{static get IDENTITY(){return sm()}static get ZERO(){return om()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return _i}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,g){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]=g,this.check()}setRowMajor(e,r,n,o,s,i,a,f,c,l,h,u,d,A,m,g){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]=g,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(nm)}fromObject(e){return this.check()}fromQuaternion(e){return di(this,e),this.check()}frustum(e){let{left:r,right:n,bottom:o,top:s,near:i=Bi,far:a=xi}=e;return a===1/0?im(this,r,n,o,s,i):Ai(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 gi(this,r,n,o),this.check()}ortho(e){let{left:r,right:n,bottom:o,top:s,near:i=Bi,far:a=xi}=e;return pi(this,r,n,o,s,i,a),this.check()}orthographic(e){let{fovy:r=em,aspect:n=rm,focalDistance:o=1,near:s=Bi,far:i=xi}=e;Df(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 Df(r),mi(this,r,n,o,s),this.check()}determinant(){return ii(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 oi(this,this),this.check()}invert(){return si(this,this),this.check()}multiplyLeft(e){return yn(this,e,this),this.check()}multiplyRight(e){return yn(this,this,e),this.check()}rotateX(e){return li(this,this,e),this.check()}rotateY(e){return hi(this,this,e),this.check()}rotateZ(e){return ui(this,this,e),this.check()}rotateXYZ(e){return this.rotateX(e[0]).rotateY(e[1]).rotateZ(e[2])}rotateAxis(e,r){return fi(this,this,e,r),this.check()}scale(e){return ci(this,this,Array.isArray(e)?e:[e,e,e]),this.check()}translate(e){return ai(this,this,e),this.check()}transform(e,r){return e.length===4?(r=Sf(r||[-0,-0,-0,-0],e,this),Ce(r,4),r):this.transformAsPoint(e,r)}transformAsPoint(e,r){let{length:n}=e,o;switch(n){case 2:o=Bo(r||[-0,-0],e,this);break;case 3:o=Qe(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ce(o,e.length),o}transformAsVector(e,r){let n;switch(e.length){case 2:n=xo(r||[-0,-0],e,this);break;case 3:n=_o(r||[-0,-0,-0],e,this);break;default:throw new Error("Illegal vector")}return Ce(n,e.length),n}transformPoint(e,r){return this.transformAsPoint(e,r)}transformVector(e,r){return this.transformAsPoint(e,r)}transformDirection(e,r){return this.transformAsVector(e,r)}makeRotationX(e){return this.identity().rotateX(e)}makeTranslation(e,r,n){return this.identity().translate([e,r,n])}},So,Fo;function om(){return So||(So=new Dt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(So)),So}function sm(){return Fo||(Fo=new Dt,Object.freeze(Fo)),Fo}function Df(t){if(t>Math.PI*2)throw Error("expected radians")}function im(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 Rf(){let t=new $(4);return $!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t[3]=1,t}function Lf(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 yi(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 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+i*a,t[1]=o*f+s*a,t[2]=s*f-o*a,t[3]=i*f-n*a,t}function vf(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 Gf(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 Nf(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 Cn(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,g;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),g=Math.sin(d),A=Math.sin((1-n)*d)/g,m=Math.sin(n*d)/g):(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 Uf(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 Pf(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=e[3],t}function Ci(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 Hf=yf;var kf=Cf,Jf=Mf,zf=If,Qf=Tf;var Vf=bf;var jf=wf;var Kf=function(){let t=yo(),e=Co(1,0,0),r=Co(0,1,0);return function(n,o,s){let i=xn(o,s);return i<-.999999?(ze(t,e,o),$s(t)<1e-6&&ze(t,r,o),Xs(t,t),Ei(n,t,Math.PI),n):i>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(ze(t,o,s),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=1+i,jf(n,n))}}(),fC=function(){let t=Rf(),e=Rf();return function(r,n,o,s,i,a){return Cn(t,n,i,a),Cn(e,o,s,a),Cn(r,t,e,2*a*(1-a)),r}}(),lC=function(){let t=ff();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],jf(e,Ci(e,t))}}();var am=[0,0,0,1],be=class extends ye{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 Ci(this,e),this.check()}fromAxisRotation(e,r){return Ei(this,e,r),this.check()}identity(){return Lf(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 Qf(this)}lengthSquared(){return Vf(this)}dot(e){return Jf(this,e)}rotationTo(e,r){return Kf(this,e,r),this.check()}add(e){return Hf(this,this,e),this.check()}calculateW(){return Nf(this,this),this.check()}conjugate(){return Pf(this,this),this.check()}invert(){return Uf(this,this),this.check()}lerp(e,r,n){return n===void 0?this.lerp(this,e,r):(zf(this,e,r,n),this.check())}multiplyRight(e){return yi(this,this,e),this.check()}multiplyLeft(e){return yi(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 Of(this,this,e),this.check()}rotateY(e){return vf(this,this,e),this.check()}rotateZ(e){return Gf(this,this,e),this.check()}scale(e){return kf(this,this,e),this.check()}slerp(e,r,n){let o,s,i;switch(arguments.length){case 1:({start:o=am,target:s,ratio:i}=e);break;case 2:o=this,s=e,i=r;break;default:o=e,s=r,i=n}return Cn(this,o,s,i),this.check()}transformVector4(e,r=new wr){return Ff(r,e,this),Ce(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 kt={};ht(kt,{EPSILON1:()=>cm,EPSILON10:()=>gm,EPSILON11:()=>Bm,EPSILON12:()=>xm,EPSILON13:()=>_m,EPSILON14:()=>Em,EPSILON15:()=>ym,EPSILON16:()=>Cm,EPSILON17:()=>Tm,EPSILON18:()=>bm,EPSILON19:()=>wm,EPSILON2:()=>fm,EPSILON20:()=>Mm,EPSILON3:()=>lm,EPSILON4:()=>hm,EPSILON5:()=>um,EPSILON6:()=>dm,EPSILON7:()=>Am,EPSILON8:()=>mm,EPSILON9:()=>pm,PI_OVER_FOUR:()=>Sm,PI_OVER_SIX:()=>Fm,PI_OVER_TWO:()=>Im,TWO_PI:()=>Dm});var cm=.1,fm=.01,lm=.001,hm=1e-4,um=1e-5,dm=1e-6,Am=1e-7,mm=1e-8,pm=1e-9,gm=1e-10,Bm=1e-11,xm=1e-12,_m=1e-13,Em=1e-14,ym=1e-15,Cm=1e-16,Tm=1e-17,bm=1e-18,wm=1e-19,Mm=1e-20,Im=Math.PI/2,Sm=Math.PI/4,Fm=Math.PI/6,Dm=Math.PI*2;var ce=6356752314245179e-9,Rm={radii:[6378137,6378137,ce],radiiSquared:[6378137*6378137,6378137*6378137,ce*ce],oneOverRadii:[1/6378137,1/6378137,1/ce],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(ce*ce)],maximumRadius:Math.max(6378137,6378137,ce),centerToleranceSquared:.1};function Do(t){return t}var HC=new w;function Lm(t,e=[],r=Do){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 Xf(t,e=[]){return Lm(t,e,W._cartographicRadians?Do:Qs)}function Om(t,e,r=Do){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 Zf(t,e){return Om(t,e,W._cartographicRadians?Do:Vs)}var Yf=1e-14,vm=new w,Wf={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Ti={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Tn={east:new w,north:new w,up:new w,west:new w,south:new w,down:new w},Gm=new w,Nm=new w,Um=new w;function bi(t,e,r,n,o,s){let i=Wf[e]&&Wf[e][r];ct(i&&(!n||n===i));let a,f,c,l=vm.copy(o);if(Mt(l.x,0,Yf)&&Mt(l.y,0,Yf)){let u=Math.sign(l.z);a=Gm.fromArray(Ti[e]),e!=="east"&&e!=="west"&&a.scale(u),f=Nm.fromArray(Ti[r]),r!=="east"&&r!=="west"&&f.scale(u),c=Um.fromArray(Ti[n]),n!=="east"&&n!=="west"&&c.scale(u)}else{let{up:u,east:d,north:A}=Tn;d.set(-l.y,l.x,0).normalize(),t.geodeticSurfaceNormal(l,u),A.copy(u).cross(d);let{down:m,west:g,south:_}=Tn;m.copy(u).scale(-1),g.copy(d).scale(-1),_.copy(A).scale(-1),a=Tn[e],f=Tn[r],c=Tn[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 Ir=new w,Pm=new w,Hm=new w;function qf(t,e,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:o,centerToleranceSquared:s}=e;Ir.from(t);let i=Ir.x,a=Ir.y,f=Ir.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,g=Math.sqrt(1/m);if(!Number.isFinite(g))return;let _=Pm;if(_.copy(t).scale(g),m<s)return _.to(r);let y=o.x,T=o.y,b=o.z,C=Hm;C.set(_.x*y*2,_.y*T*2,_.z*b*2);let I=(1-g)*Ir.len()/(.5*C.len()),M=0,L,B,p,x;do{I-=M,L=1/(1+I*y),B=1/(1+I*T),p=1/(1+I*b);let E=L*L,U=B*B,N=p*p,P=E*L,v=U*B,it=N*p;x=u*E+d*U+A*N-1;let Y=-2*(u*P*y+d*v*T+A*it*b);M=x/Y}while(Math.abs(x)>kt.EPSILON12);return Ir.scale([L,B,p]).to(r)}var Ro=new w,$f=new w,zm=new w,Jt=new w,Qm=new w,Lo=new w,fe=class{constructor(e=0,r=0,n=0){X(this,"radii",void 0),X(this,"radiiSquared",void 0),X(this,"radiiToTheFourth",void 0),X(this,"oneOverRadii",void 0),X(this,"oneOverRadiiSquared",void 0),X(this,"minimumRadius",void 0),X(this,"maximumRadius",void 0),X(this,"centerToleranceSquared",kt.EPSILON1),X(this,"squaredXOverSquaredZ",void 0),ct(e>=0),ct(r>=0),ct(n>=0),this.radii=new w(e,r,n),this.radiiSquared=new w(e*e,r*r,n*n),this.radiiToTheFourth=new w(e*e*e*e,r*r*r*r,n*n*n*n),this.oneOverRadii=new w(e===0?0:1/e,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new w(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=$f,o=zm,[,,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]){Lo.from(e);let n=this.scaleToGeodeticSurface(Lo,Jt);if(!n)return;let o=this.geodeticSurfaceNormal(n,$f),s=Qm;s.copy(Lo).subtract(n);let i=Math.atan2(o.y,o.x),a=Math.asin(o.z),f=Math.sign(br.dot(s,Lo))*br.length(s);return Zf([i,a,f],r)}eastNorthUpToFixedFrame(e,r=new Dt){return bi(this,"east","north","up",e,r)}localFrameToFixedFrame(e,r,n,o,s=new Dt){return bi(this,e,r,n,o,s)}geocentricSurfaceNormal(e,r=[0,0,0]){return Ro.from(e).normalize().to(r)}geodeticSurfaceNormalCartographic(e,r=[0,0,0]){let n=Xf(e),o=n[0],s=n[1],i=Math.cos(s);return Ro.set(i*Math.cos(o),i*Math.sin(o),Math.sin(s)).normalize(),Ro.to(r)}geodeticSurfaceNormal(e,r=[0,0,0]){return Ro.from(e).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(e,r){return qf(e,this,r)}scaleToGeocentricSurface(e,r=[0,0,0]){Jt.from(e);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(e,r=[0,0,0]){return Jt.from(e).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(e,r=[0,0,0]){return Jt.from(e).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(e,r=0,n=[0,0,0]){ct(Mt(this.radii.x,this.radii.y,kt.EPSILON15)),ct(this.radii.z>0),Jt.from(e);let o=Jt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(o)>=this.radii.z-r))return Jt.set(0,0,o).to(n)}};X(fe,"WGS84",new fe(6378137,6378137,ce));var ft={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var aT=new w,cT=new w;var bn=new w,tl=new w,we=class{constructor(e=[0,0,0],r=0){X(this,"center",void 0),X(this,"radius",void 0),this.radius=-0,this.center=new w,this.fromCenterRadius(e,r)}fromCenterRadius(e,r){return this.center.from(e),this.radius=r,this}fromCornerPoints(e,r){return r=bn.from(r),this.center=new w().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 we(this.center,this.radius)}union(e){let r=this.center,n=this.radius,o=e.center,s=e.radius,i=bn.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 tl.copy(i).scale((-n+f)/a).add(r),this.center.copy(tl),this.radius=f,this}expand(e){let n=bn.from(e).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(e){this.center.transform(e);let r=Io.getScaling(bn,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=bn.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?ft.OUTSIDE:s<n?ft.INTERSECTING:ft.INSIDE}};var Vm=new w,jm=new w,Oo=new w,vo=new w,Go=new w,Km=new w,Xm=new w,le={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]){X(this,"center",void 0),X(this,"halfAxes",void 0),this.center=new w().from(e),this.halfAxes=new Z(r)}get halfSize(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new w(e).len(),new w(r).len(),new w(n).len()]}get quaternion(){let e=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),o=new w(e).normalize(),s=new w(r).normalize(),i=new w(n).normalize();return new be().fromMatrix3(new Z([...o,...s,...i]))}fromCenterHalfSizeQuaternion(e,r,n){let o=new be(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 w().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 we){let r=this.halfAxes,n=r.getColumn(0,Oo),o=r.getColumn(1,vo),s=r.getColumn(2,Go),i=Vm.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[le.COLUMN0ROW0]+i*o[le.COLUMN0ROW1]+a*o[le.COLUMN0ROW2])+Math.abs(s*o[le.COLUMN1ROW0]+i*o[le.COLUMN1ROW1]+a*o[le.COLUMN1ROW2])+Math.abs(s*o[le.COLUMN2ROW0]+i*o[le.COLUMN2ROW1]+a*o[le.COLUMN2ROW2]),c=n.dot(r)+e.distance;return c<=-f?ft.OUTSIDE:c>=f?ft.INSIDE:ft.INTERSECTING}distanceTo(e){return Math.sqrt(this.distanceSquaredTo(e))}distanceSquaredTo(e){let r=jm.from(e).subtract(this.center),n=this.halfAxes,o=n.getColumn(0,Oo),s=n.getColumn(1,vo),i=n.getColumn(2,Go),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,Oo),c=a.getColumn(1,vo),l=a.getColumn(2,Go),h=Km.copy(f).add(c).add(l).add(i),u=Xm.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,Oo);r.transformAsPoint(e);let n=this.halfAxes.getColumn(1,vo);n.transformAsPoint(e);let o=this.halfAxes.getColumn(2,Go);return o.transformAsPoint(e),this.halfAxes=new Z([...r,...n,...o]),this}getTransform(){throw new Error("not implemented")}};var el=new w,rl=new w,he=class{constructor(e=[0,0,1],r=0){X(this,"normal",void 0),X(this,"distance",void 0),this.normal=new w,this.distance=-0,this.fromNormalDistance(e,r)}fromNormalDistance(e,r){return ct(Number.isFinite(r)),this.normal.from(e).normalize(),this.distance=r,this}fromPointNormal(e,r){e=el.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),ct(Mt(this.normal.len(),1)),this.distance=o,this}clone(){return new he(this.normal,this.distance)}equals(e){return Mt(this.distance,e.distance)&&Mt(this.normal,e.normal)}getPointDistance(e){return this.normal.dot(e)+this.distance}transform(e){let r=rl.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=el.from(e),o=this.getPointDistance(n),s=rl.copy(this.normal).scale(o);return n.subtract(s).to(r)}};var nl=[new w([1,0,0]),new w([0,1,0]),new w([0,0,1])],ol=new w,Zm=new w,Rt=class{constructor(e=[]){X(this,"planes",void 0),this.planes=e}fromBoundingSphere(e){this.planes.length=2*nl.length;let r=e.center,n=e.radius,o=0;for(let s of nl){let i=this.planes[o],a=this.planes[o+1];i||(i=this.planes[o]=new he),a||(a=this.planes[o+1]=new he);let f=ol.copy(s).scale(-n).add(r);i.fromPointNormal(f,s);let c=ol.copy(s).scale(n).add(r),l=Zm.copy(s).negate();a.fromPointNormal(c,l),o+=2}return this}computeVisibility(e){let r=ft.INSIDE;for(let n of this.planes)switch(e.intersectPlane(n)){case ft.OUTSIDE:return ft.OUTSIDE;case ft.INTERSECTING:r=ft.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(e,r){if(ct(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===ft.OUTSIDE)return Rt.MASK_OUTSIDE;f===ft.INTERSECTING&&(n|=i)}return n}};X(Rt,"MASK_OUTSIDE",4294967295);X(Rt,"MASK_INSIDE",0);X(Rt,"MASK_INDETERMINATE",2147483647);var DT=new w,RT=new w,LT=new w,OT=new w,vT=new w;var JT=new w,zT=new w,QT=new w,VT=new w,jT=new w,KT=new w,XT=new w,ZT=new w,YT=new w,WT=new w,qT=new w,$T=new w;var $t=new Z,Wm=new Z,qm=new Z,No=new Z,sl=new Z;function Ii(t,e={}){let r=kt.EPSILON20,n=10,o=0,s=0,i=Wm,a=qm;i.identity(),a.copy(t);let f=r*$m(a);for(;s<n&&tp(a)>f;)ep(a,No),sl.copy(No).transpose(),a.multiplyRight(No),a.multiplyLeft(sl),i.multiplyRight(No),++o>2&&(++s,o=0);return e.unitary=i.toTarget(e.unitary),e.diagonal=a.toTarget(e.diagonal),e}function $m(t){let e=0;for(let r=0;r<9;++r){let n=t[r];e+=n*n}return Math.sqrt(e)}var wi=[1,0,0],Mi=[2,2,1];function tp(t){let e=0;for(let r=0;r<3;++r){let n=t[$t.getElementIndex(Mi[r],wi[r])];e+=2*n*n}return Math.sqrt(e)}function ep(t,e){let r=kt.EPSILON15,n=0,o=1;for(let c=0;c<3;++c){let l=Math.abs(t[$t.getElementIndex(Mi[c],wi[c])]);l>n&&(o=c,n=l)}let s=wi[o],i=Mi[o],a=1,f=0;if(Math.abs(t[$t.getElementIndex(i,s)])>r){let c=t[$t.getElementIndex(i,i)],l=t[$t.getElementIndex(s,s)],h=t[$t.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 Z.IDENTITY.to(e),e[$t.getElementIndex(s,s)]=e[$t.getElementIndex(i,i)]=a,e[$t.getElementIndex(i,s)]=f,e[$t.getElementIndex(s,i)]=-f,e}var Me=new w,np=new w,op=new w,sp=new w,ip=new w,ap=new Z,cp={diagonal:new Z,unitary:new Z};function Si(t,e=new Ve){if(!t||t.length===0)return e.halfAxes=new Z([0,0,0,0,0,0,0,0,0]),e.center=new w,e;let r=t.length,n=new w(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 p=Me.copy(B).subtract(n);s+=p.x*p.x,i+=p.x*p.y,a+=p.x*p.z,f+=p.y*p.y,c+=p.y*p.z,l+=p.z*p.z}s*=o,i*=o,a*=o,f*=o,c*=o,l*=o;let h=ap;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}=Ii(h,cp),d=e.halfAxes.copy(u),A=d.getColumn(0,op),m=d.getColumn(1,sp),g=d.getColumn(2,ip),_=-Number.MAX_VALUE,y=-Number.MAX_VALUE,T=-Number.MAX_VALUE,b=Number.MAX_VALUE,C=Number.MAX_VALUE,I=Number.MAX_VALUE;for(let B of t)Me.copy(B),_=Math.max(Me.dot(A),_),y=Math.max(Me.dot(m),y),T=Math.max(Me.dot(g),T),b=Math.min(Me.dot(A),b),C=Math.min(Me.dot(m),C),I=Math.min(Me.dot(g),I);A=A.multiplyByScalar(.5*(b+_)),m=m.multiplyByScalar(.5*(C+y)),g=g.multiplyByScalar(.5*(I+T)),e.center.copy(A).add(m).add(g);let M=np.set(_-b,y-C,T-I).multiplyByScalar(.5),L=new Z([M[0],0,0,0,M[1],0,0,0,M[2]]);return e.halfAxes.multiplyRight(L),e}var Sr;(function(t){t[t.ADD=1]="ADD",t[t.REPLACE=2]="REPLACE"})(Sr||(Sr={}));var Ie;(function(t){t.EMPTY="empty",t.SCENEGRAPH="scenegraph",t.POINTCLOUD="pointcloud",t.MESH="mesh"})(Ie||(Ie={}));var wn;(function(t){t.I3S="I3S",t.TILES3D="TILES3D"})(wn||(wn={}));var ue;(function(t){t.GEOMETRIC_ERROR="geometricError",t.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(ue||(ue={}));var Fr="4.2.0-alpha.4";var Et={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},Ib=Object.keys(Et),Se={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function Fi(t,e,r){z(t instanceof ArrayBuffer);let n=new TextDecoder("utf8"),o=new Uint8Array(t,e,r);return n.decode(o)}function il(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 al="4.2.0-alpha.4";var cl={name:"Draco",id:"draco",module:"draco",version:al,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 fl(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 Di(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=fl(e.value),o=r||ll(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:n}]},nullable:!1,metadata:o}}function ll(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 ul(t,e,r){let n=dl(e.metadata),o=[],s=fp(e.attributes);for(let i in t){let a=t[i],f=hl(i,a,s[i]);o.push(f)}if(r){let i=hl("indices",r);o.push(i)}return{fields:o,metadata:n}}function fp(t){let e={};for(let r in t){let n=t[r];e[n.name||"undefined"]=n}return e}function hl(t,e,r){let n=r?dl(r.metadata):void 0;return Ri(t,e,n)}function dl(t){Object.entries(t);let e={};for(let r in t)e[`${r}.string`]=JSON.stringify(t[r]);return e}var Al={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},lp={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},hp=4,Mn=class{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=Di(f.attributes),l=ul(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{value:a,size:f}=this._getAttributeValues(r,s);o[i]={value:a,size:f,byteOffset:s.byte_offset,byteStride:s.byte_stride,normalized:s.normalized}}return o}_getTriangleListIndices(e){let n=e.num_faces()*3,o=n*hp,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),Ap(r)}finally{this.draco.destroy(r)}}_getAttributeValues(e,r){let n=lp[r.data_type],o=r.num_components,i=e.num_points()*o,a=i*n.BYTES_PER_ELEMENT,f=up(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 Al)if(this.draco[i]===o)return Al[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=dp(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 up(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 dp(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}function Ap(t){let e=t.size(),r=new Int32Array(e);for(let n=0;n<e;n++)r[n]=t.GetValue(n);return r}var mp="1.5.6",pp="1.4.1",Li=`https://www.gstatic.com/draco/versioned/decoders/${mp}`,yt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},Oi={[yt.DECODER]:`${Li}/${yt.DECODER}`,[yt.DECODER_WASM]:`${Li}/${yt.DECODER_WASM}`,[yt.FALLBACK_DECODER]:`${Li}/${yt.FALLBACK_DECODER}`,[yt.ENCODER]:`https://raw.githubusercontent.com/google/draco/${pp}/javascript/${yt.ENCODER}`},In;async function ml(t){let e=t.modules||{};return e.draco3d?In=In||e.draco3d.createDecoderModule({}).then(r=>({draco:r})):In=In||gp(t),await In}async function gp(t){let e,r;switch(t.draco&&t.draco.decoderType){case"js":e=await qt(Oi[yt.FALLBACK_DECODER],"draco",t,yt.FALLBACK_DECODER);break;case"wasm":default:[e,r]=await Promise.all([await qt(Oi[yt.DECODER],"draco",t,yt.DECODER),await qt(Oi[yt.DECODER_WASM],"draco",t,yt.DECODER_WASM)])}return e=e||globalThis.DracoDecoderModule,await Bp(e,r)}function Bp(t,e){let r={};return e&&(r.wasmBinary=e),new Promise(n=>{t({...r,onModuleLoaded:o=>n({draco:o})})})}var Uo={...cl,parse:xp};async function xp(t,e){let{draco:r}=await ml(e),n=new Mn(r);try{return n.parseSync(t,e?.draco)}finally{n.destroy()}}var _p={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={..._p,...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},Ep={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",ut=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=Ep[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 ut.getArrayType(e).BYTES_PER_ELEMENT}static validate(e){return Boolean(ut.getArrayType(e))}static createTypedArray(e,r,n=0,o){o===void 0&&(o=(r.byteLength-n)/ut.getByteSize(e));let s=ut.getArrayType(e);return new s(r,n,o)}};function pl(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 cw=1/256;var fw=new Je,lw=new w,hw=new Je,uw=new Je,dw=new Uint8Array(1);function gl(t,e=255){return js(t,0,e)/e*2-1}function Bl(t){return t<0?-1:1}function xl(t,e,r,n){if(pl(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=gl(t,r),n.y=gl(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))*Bl(o),n.y=(1-Math.abs(o))*Bl(n.y)}return n.normalize()}function Ui(t,e,r){return xl(t,e,255,r)}var zt=class{constructor(e,r){this.featuresLength=0,this._cachedTypedArrays={},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=ut.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=ut.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=ut.createTypedArray(r,n),o[e]=s),s}};var yp={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Cp={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]]},Tp={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 _l(t,e,r,n){let{componentType:o}=t;z(t.componentType);let s=typeof o=="string"?ut.fromName(o):o,i=yp[t.type],a=Cp[t.type],f=Tp[t.type];return r+=t.byteOffset,{values:ut.createTypedArray(s,e,r,i*n),type:s,size:i,unpacker:a,packer:f}}var te=t=>t!==void 0;function El(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?bp(n,r):null}function bp(t,e){let r,n,o,s=t.instancesLength,i=t.classes,a=t.classIds,f=t.parentCounts,c=t.parentIds,l=s;te(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(te(f))for(te(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];te(c)&&te(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 g=i[r].length,_=i[r].instances,y=getBinaryProperties(g,_,e);i[r].instances=combine(y,_)}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 Ip(m),m}function Dr(t,e,r){if(!t)return;let n=t.parentCounts;return t.parentIds?r(t,e):n>0?wp(t,e,r):Mp(t,e,r)}function wp(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(te(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(te(o))return o;let s=t.parentIds[e];n=s!==e,e=s}throw new Error("traverseHierarchySingleParent")}function Ip(t){let e=[],n=t.classIds.length;for(let o=0;o<n;++o)yl(t,o,stack)}function yl(t,e,r){let n=t.parentCounts,o=t.parentIds,s=t.parentIndexes,a=t.classIds.length;if(!te(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=te(n)?n[e]:1,c=te(n)?s[e]:e;for(let l=0;l<f;++l){let h=o[c+l];h!==e&&yl(t,h,r)}r.pop(e)}function Ct(t){return t!=null}var Po=(t,e)=>t,Sp={HIERARCHY:!0,extensions:!0,extras:!0},de=class{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)Sp[s]||(this._properties[s]=this.json[s]);this._binaryProperties=this._initializeBinaryProperties(),o["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=El(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=Dr(this._hierarchy,e,(o,s)=>{let i=o.classIds[s];return o.classes[i].name===r});return Ct(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),Ct(this._properties[r])||this._hasPropertyInHierarchy(e,r)}getPropertyNames(e,r){this._checkBatchId(e),r=Ct(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(Ct(o))return this._getBinaryProperty(o,e)}let n=this._properties[r];if(Ct(n))return Po(n[e],!0);if(this._hierarchy){let o=this._getHierarchyProperty(e,r);if(Ct(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];Ct(s)||(this._properties[r]=new Array(o),s=this._properties[r]),s[e]=Po(n,!0)}_checkBatchId(e){if(!(e>=0&&e<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(e,r){return e.unpack(e.typedArray,r)}_setBinaryProperty(e,r,n){e.pack(n,e.typedArray,r)}_initializeBinaryProperties(){let e=null;for(let r in this._properties){let n=this._properties[r],o=this._initializeBinaryProperty(r,n);o&&(e=e||{},e[r]=o)}return e}_initializeBinaryProperty(e,r){if("byteOffset"in r){let n=r;z(this.binary,`Property ${e} requires a batch table binary.`),z(n.type,`Property ${e} requires a type.`);let o=_l(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=Dr(this._hierarchy,e,(o,s)=>{let i=o.classIds[s],a=o.classes[i].instances;return Ct(a[r])});return Ct(n)}_getPropertyNamesInHierarchy(e,r){Dr(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 Dr(this._hierarchy,e,(n,o)=>{let s=n.classIds[o],i=n.classes[s],a=n.classIndexes[o],f=i.instances[r];return Ct(f)?Ct(f.typedArray)?this._getBinaryProperty(f,a):Po(f[a],!0):null})}_setHierarchyProperty(e,r,n,o){let s=Dr(this._hierarchy,r,(i,a)=>{let f=i.classIds[a],c=i.classes[f],l=i.classIndexes[a],h=c.instances[n];return Ct(h)?(z(a===r,`Inherited property "${n}" is read-only.`),Ct(h.typedArray)?this._setBinaryProperty(h,l,o):h[l]=Po(o,!0),!0):!1});return Ct(s)}};function Fe(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,Cl="b3dm tile in legacy format.";function Lr(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(Cl)):f>=570425344&&(r-=Rr,o=a,a=s,f=i,s=0,i=0,console.warn(Cl)),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=Fp(t,e,r,n),r=Dp(t,e,r,n),r}function Fp(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=Fi(e,r,o);t.featureTableJson=JSON.parse(a)}return r+=o||0,t.featureTableBinary=new Uint8Array(e,r,s),r+=s||0,r}function Dp(t,e,r,n){let{batchTableJsonByteLength:o,batchTableBinaryByteLength:s}=t.header||{};if(o&&o>0){let i=Fi(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 Tl=new w;function bl(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],Tl),Tl.toArray(r,n*3);return{type:H.FLOAT,size:2,value:r}}return{type:H.FLOAT,size:2,value:e}}function wl(t,e,r){return t.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(t.isQuantized=!1,Rp(t,e)):{type:H.UNSIGNED_SHORT,value:e,size:3,normalized:!0}:e}function Rp(t,e){let r=new w,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 Ml(t,e,r,n,o){r=Fe(t,e,r),r=Lr(t,e,r),r=Or(t,e,r,n),Lp(t);let{featureTable:s,batchTable:i}=Op(t);return await Pp(t,s,i,n,o),vp(t,s,n),Gp(t,s,i),Np(t,s),r}function Lp(t){t.attributes={positions:null,colors:null,normals:null,batchIds:null},t.isQuantized=!1,t.isTranslucent=!1,t.isRGB565=!1,t.isOctEncoded16P=!1}function Op(t){let e=new zt(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=Up(t,e);return{featureTable:e,batchTable:n}}function vp(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=wl(t,n,r)}}if(!t.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function Gp(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 Np(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=bl(t,r)}}function Up(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 de(o,s,n)}return r}async function Pp(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 Hp(t,l,n,o)}async function Hp(t,e,r,n){if(!n)return;let o={...r,draco:{...r?.draco,extraAttributes:e.batchTableProperties||{}}};delete o["3d-tiles"];let s=await Ht(e.buffer,Uo,o,n),i=s.attributes.POSITION&&s.attributes.POSITION.value,a=s.attributes.COLOR_0&&s.attributes.COLOR_0.value,f=s.attributes.NORMAL&&s.attributes.NORMAL.value,c=s.attributes.BATCH_ID&&s.attributes.BATCH_ID.value,l=i&&s.attributes.POSITION.value.quantization,h=f&&s.attributes.NORMAL.value.quantization;if(l){let d=s.POSITION.data.quantization,A=d.range;t.quantizedVolumeScale=new w(A,A,A),t.quantizedVolumeOffset=new w(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={};ht(Ki,{decode:()=>T1,name:()=>C1});var Il="4.2.0-alpha.4";var kp=globalThis.loaders?.parseImageNode,Hi=typeof Image<"u",ki=typeof ImageBitmap<"u",Jp=Boolean(kp),Ji=xt?!0:Jp;function Sl(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 Fl(){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 Dl(t){let e=zp(t);if(!e)throw new Error("Not an image");return e}function Sn(t){switch(Dl(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 zp(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 Qp=/^data:image\/svg\+xml/,Vp=/\.svg((\?|#).*)?$/;function Ho(t){return t&&(Qp.test(t)||Vp.test(t))}function Rl(t,e){if(Ho(e)){let n=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(s){throw new Error(s.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return zi(t,e)}function zi(t,e){if(Ho(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function ko(t,e,r){let n=Rl(t,r),o=self.URL||self.webkitURL,s=typeof n!="string"&&o.createObjectURL(n);try{return await jp(s||n,e)}finally{s&&o.revokeObjectURL(s)}}async function jp(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 Kp={},Ll=!0;async function Ol(t,e,r){let n;Ho(r)?n=await ko(t,e,r):n=zi(t,r);let o=e&&e.imagebitmap;return await Xp(n,o)}async function Xp(t,e=null){if((Zp(e)||!Ll)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(r){console.warn(r),Ll=!1}return await createImageBitmap(t)}function Zp(t){for(let e in t||Kp)return!1;return!0}function vl(t){return!$p(t,"ftyp",4)||!(t[8]&96)?null:Yp(t)}function Yp(t){switch(Wp(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function Wp(t,e,r){return String.fromCharCode(...t.slice(e,r))}function qp(t){return[...t].map(e=>e.charCodeAt(0))}function $p(t,e,r=0){let n=qp(e);for(let o=0;o<n.length;++o)if(n[o]!==t[o+r])return!1;return!0}var ee=!1,Fn=!0;function je(t){let e=Dn(t);return e1(e)||o1(e)||r1(e)||n1(e)||t1(e)}function t1(t){let e=new Uint8Array(t instanceof DataView?t.buffer:t),r=vl(e);return r?{mimeType:r.mimeType,width:0,height:0}:null}function e1(t){let e=Dn(t);return e.byteLength>=24&&e.getUint32(0,ee)===2303741511?{mimeType:"image/png",width:e.getUint32(16,ee),height:e.getUint32(20,ee)}:null}function r1(t){let e=Dn(t);return e.byteLength>=10&&e.getUint32(0,ee)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,Fn),height:e.getUint16(8,Fn)}:null}function n1(t){let e=Dn(t);return e.byteLength>=14&&e.getUint16(0,ee)===16973&&e.getUint32(2,Fn)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,Fn),height:e.getUint32(22,Fn)}:null}function o1(t){let e=Dn(t);if(!(e.byteLength>=3&&e.getUint16(0,ee)===65496&&e.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:o}=s1(),s=2;for(;s+9<e.byteLength;){let i=e.getUint16(s,ee);if(o.has(i))return{mimeType:"image/jpeg",height:e.getUint16(s+5,ee),width:e.getUint16(s+7,ee)};if(!n.has(i))return null;s+=2,s+=e.getUint16(s,ee)}return null}function s1(){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 Gl(t,e){let{mimeType:r}=je(t)||{},n=globalThis.loaders?.parseImageNode;return z(n),await n(t,r)}async function Nl(t,e,r){e=e||{};let o=(e.image||{}).type||"auto",{url:s}=r||{},i=i1(o),a;switch(i){case"imagebitmap":a=await Ol(t,e,s);break;case"image":a=await ko(t,e,s);break;case"data":a=await Gl(t,e);break;default:z(!1)}return o==="data"&&(a=Sn(a)),a}function i1(t){switch(t){case"auto":case"data":return Fl();default:return Sl(t),t}}var a1=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],c1=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],f1={image:{type:"auto",decode:!0}},Qi={id:"image",module:"images",name:"Images",version:Il,mimeTypes:c1,extensions:a1,parse:Nl,tests:[t=>Boolean(je(new DataView(t)))],options:f1};var Vi={};function ji(t){if(Vi[t]===void 0){let e=xt?h1(t):l1(t);Vi[t]=e}return Vi[t]}function l1(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 h1(t){switch(t){case"image/avif":case"image/webp":return u1(t);default:return!0}}function u1(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}function ot(t,e){if(!t)throw new Error(e||"assert failed: gltf")}var Jo={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zo={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var d1=1.33,Ul=["SCALAR","VEC2","VEC3","VEC4"],A1=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],m1=new Map(A1),p1={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},g1={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},B1={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Qo(t){return Ul[t-1]||Ul[0]}function vr(t){let e=m1.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function Gr(t,e){let r=B1[t.componentType],n=p1[t.type],o=g1[t.componentType],s=t.count*n,i=t.count*n*o;ot(i>=0&&i<=e.byteLength);let a=zo[t.componentType],f=Jo[t.type];return{ArrayType:r,length:s,byteLength:i,componentByteSize:a,numberOfComponentsInElement:f}}function Rn(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*d1)}function Pl(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 Hl(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}=Gr(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 g=new f(s,a+m*d,h);A.set(g,m*h)}return A}function x1(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var K=class{constructor(e){this.gltf={json:e?.json||x1(),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 Hl(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+=wt(o,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(s),this.json.bufferViews.length-1}addAccessor(e,r){let n={bufferView:e,type:Qo(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(e,r={size:3}){let n=this.addBufferView(e),o={min:r.min,max:r.max};(!o.min||!o.max)&&(o=this._getAccessorMinMax(e,r.size));let s={size:r.size,componentType:vr(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(){this.gltf.buffers=[];let e=this.byteLength,r=new ArrayBuffer(e),n=new Uint8Array(r),o=0;for(let s of this.sourceBuffers||[])o=Ns(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]}_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 kl(t){return(t%1+1)%1}var Jl={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},_1={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},zl={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 zl[e]*Jl[t]}function Nr(t,e,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let o=t.getTypedArrayForBufferView(e),s=Ur(o,"SCALAR",r,n+1);return s instanceof BigInt64Array||s instanceof BigUint64Array?null:s}function Ur(t,e,r,n=1){let o=Jl[e],s=_1[r],i=zl[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 Pr(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=E1(l,c,s,u,e.channels);h.push(d)}return h}}return[]}function Vo(t,e,r,n,o){if(!r?.length)return;let s=[];for(let l of r){let h=n.findIndex(u=>u===l);h===-1&&(h=n.push(l)-1),s.push(h)}let i=new Uint32Array(s),a=t.gltf.buffers.push({arrayBuffer:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength})-1,f=t.addBufferView(i,a,0),c=t.addAccessor(f,{size:1,componentType:vr(i),count:i.length});o.attributes[e]=c}function E1(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=y1(i,a,t,f),l=0;for(let h of o){let u=typeof h=="number"?Object.values(s)[h]:s[h],d=c+u.offset,A=Sn(t);if(A.data.length<=d)throw new Error(`${A.data.length} <= ${d}`);let m=A.data[d];l|=m<<u.shift}return l}function y1(t,e,r,n=1){let o=r.width,s=kl(t)*(o-1),i=Math.round(s),a=r.height,f=kl(e)*(a-1),c=Math.round(f),l=r.components?r.components:n;return(c*o+i)*l}function jo(t,e,r,n,o){let s=[];for(let i=0;i<e;i++){let a=r[i],f=r[i+1]-r[i];if(f+a>n)break;let c=a/o,l=f/o;s.push(t.slice(c,c+l))}return s}function Ko(t,e,r){let n=[];for(let o=0;o<e;o++){let s=o*r;n.push(t.slice(s,s+r))}return n}function Xo(t,e,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let o=[],s=new TextDecoder("utf8"),i=0;for(let a=0;a<t;a++){let f=n[a+1]-n[a];if(f+i<=e.length){let c=e.subarray(i,f+i),l=s.decode(c);o.push(l),i+=f}}return o}return[]}var Ql="EXT_mesh_features",C1=Ql;async function T1(t,e){let r=new K(t);b1(r,e)}function b1(t,e){let r=t.gltf.json;if(r.meshes)for(let n of r.meshes)for(let o of n.primitives)w1(t,o,e)}function w1(t,e,r){if(!r?.gltf?.loadBuffers)return;let o=e.extensions?.[Ql]?.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=Pr(t,s.texture,e):i=[];s.data=i}}var Yi={};ht(Yi,{decode:()=>I1,name:()=>M1});var Xi="EXT_structural_metadata",M1=Xi;async function I1(t,e){let r=new K(t);S1(r,e)}function S1(t,e){if(!e.gltf?.loadBuffers)return;let r=t.getExtension(Xi);r&&(e.gltf?.loadImages&&F1(t,r),D1(t,r))}function F1(t,e){let r=e.propertyTextures,n=t.gltf.json;if(r&&n.meshes)for(let o of n.meshes)for(let s of o.primitives)L1(t,r,s,e)}function D1(t,e){let r=e.schema;if(!r)return;let n=r.classes,o=e.propertyTables;if(n&&o)for(let s in n){let i=R1(o,s);i&&v1(t,r,i)}}function R1(t,e){for(let r of t)if(r.class===e)return r;return null}function L1(t,e,r,n){if(!e)return;let s=r.extensions?.[Xi]?.propertyTextures;if(s)for(let i of s){let a=e[i];O1(t,a,r,n)}}function O1(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=Pr(t,a,r);c!==null&&(Vo(t,i,c,f,r),a.data=f,n.dataAttributeNames.push(i))}}function v1(t,e,r){let n=e.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let o=r.count;for(let s in n.properties){let i=n.properties[s],a=r.properties?.[s];if(a){let f=G1(t,e,i,o,a);a.data=f}}}function G1(t,e,r,n,o){let s=[],i=o.values,a=t.getTypedArrayForBufferView(i),f=N1(t,r,o,n),c=U1(t,o,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{s=P1(r,n,a,f);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{s=Xo(n,a,f,c);break}case"ENUM":{s=H1(e,r,n,a,f);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return s}function N1(t,e,r,n){return e.array&&typeof e.count>"u"&&typeof r.arrayOffsets<"u"?Nr(t,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function U1(t,e,r){return typeof e.stringOffsets<"u"?Nr(t,e.stringOffsets,e.stringOffsetType||"UINT32",r):null}function P1(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=Ur(r,t.type,t.componentType,a):f=r,o?n?jo(f,e,n,r.length,i):s?Ko(f,e,s):[]:f}function H1(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=Ur(n,e.type,a,c);if(l||(l=n),e.array){if(o)return k1({valuesData:l,numberOfElements:r,arrayOffsets:o,valuesDataBytesLength:n.length,elementSize:f,enumEntry:i});let h=e.count;return h?J1(l,r,h,i):[]}return Zi(l,0,r,i)}function k1(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 J1(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=z1(n,i);a?o.push(a.name):o.push("")}return o}function z1(t,e){for(let r of t.values)if(r.value===e)return r;return null}var Wi={};ht(Wi,{decode:()=>V1,name:()=>Q1});var Vl="EXT_feature_metadata",Q1=Vl;async function V1(t,e){let r=new K(t);j1(r,e)}function j1(t,e){if(!e.gltf?.loadBuffers)return;let r=t.getExtension(Vl);r&&(e.gltf?.loadImages&&K1(t,r),X1(t,r))}function K1(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=Y1(o,s);a&&q1(t,a,i)}}function X1(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=Z1(o,s);i&&W1(t,r,i)}}function Z1(t,e){for(let r in t){let n=t[r];if(n.class===e)return n}return null}function Y1(t,e){for(let r in t){let n=t[r];if(n.class===e)return n}return null}function W1(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=$1(t,e,i,o,a);a.data=f}}}function q1(t,e,r){let n=e.class;for(let o in r.properties){let s=e?.properties?.[o];if(s){let i=og(t,s,n);s.data=i}}}function $1(t,e,r,n,o){let s=[],i=o.bufferView,a=t.getTypedArrayForBufferView(i),f=tg(t,r,o,n),c=eg(t,r,o,n);return r.type==="STRING"||r.componentType==="STRING"?s=Xo(n,a,f,c):rg(r)&&(s=ng(r,n,a,f)),s}function tg(t,e,r,n){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?Nr(t,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function eg(t,e,r,n){return typeof r.stringOffsetBufferView<"u"?Nr(t,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function rg(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 ng(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=Ur(r,i,a,c);return o?n?jo(l,e,n,r.length,f):s?Ko(l,e,s):[]:l}function og(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)sg(t,r,e,o,i);return o}function sg(t,e,r,n,o){let s={channels:r.channels,...r.texture},i=Pr(t,s,o);i&&Vo(t,e,i,n,o)}var jl="4.2.0-alpha.4";var Kl="4.2.0-alpha.4";var Zo={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},qi;async function ta(t){let e=t.modules||{};return e.basis?e.basis:(qi=qi||ig(t),await qi)}async function ig(t){let e=null,r=null;return[e,r]=await Promise.all([await qt(Zo.TRANSCODER,"textures",t),await qt(Zo.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await ag(e,r)}function ag(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 $i;async function ea(t){let e=t.modules||{};return e.basisEncoder?e.basisEncoder:($i=$i||cg(t),await $i)}async function cg(t){let e=null,r=null;return[e,r]=await Promise.all([await qt(Zo.ENCODER,"textures",t),await qt(Zo.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await fg(e,r)}function fg(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 lg=["","WEBKIT_","MOZ_"],Xl={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},Yo=null;function Zl(t){if(!Yo){t=t||hg()||void 0,Yo=new Set;for(let e of lg)for(let r in Xl)if(t&&t.getExtension(`${e}${r}`)){let n=Xl[r];Yo.add(n)}}return Yo}function hg(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var CI=new Uint8Array([0]);var Yl,Wl,ql,$l,th,eh,rh,nh;(function(t){t[t.NONE=0]="NONE",t[t.BASISLZ=1]="BASISLZ",t[t.ZSTD=2]="ZSTD",t[t.ZLIB=3]="ZLIB"})(Yl||(Yl={})),function(t){t[t.BASICFORMAT=0]="BASICFORMAT"}(Wl||(Wl={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.ETC1S=163]="ETC1S",t[t.UASTC=166]="UASTC"}(ql||(ql={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.SRGB=1]="SRGB"}($l||($l={})),function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.LINEAR=1]="LINEAR",t[t.SRGB=2]="SRGB",t[t.ITU=3]="ITU",t[t.NTSC=4]="NTSC",t[t.SLOG=5]="SLOG",t[t.SLOG2=6]="SLOG2"}(th||(th={})),function(t){t[t.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",t[t.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(eh||(eh={})),function(t){t[t.RGB=0]="RGB",t[t.RRR=3]="RRR",t[t.GGG=4]="GGG",t[t.AAA=15]="AAA"}(rh||(rh={})),function(t){t[t.RGB=0]="RGB",t[t.RGBA=3]="RGBA",t[t.RRR=4]="RRR",t[t.RRRG=5]="RRRG"}(nh||(nh={}));var It=[171,75,84,88,32,50,48,187,13,10,26,10];function oh(t){let e=new Uint8Array(t);return!(e.byteLength<It.length||e[0]!==It[0]||e[1]!==It[1]||e[2]!==It[2]||e[3]!==It[3]||e[4]!==It[4]||e[5]!==It[5]||e[6]!==It[6]||e[7]!==It[7]||e[8]!==It[8]||e[9]!==It[9]||e[10]!==It[10]||e[11]!==It[11])}var ug={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 na(t,e){if(e.basis.containerFormat==="auto"){if(oh(t)){let n=await ea(e);return sh(n.KTX2File,t,e)}let{BasisFile:r}=await ta(e);return ra(r,t,e)}switch(e.basis.module){case"encoder":let r=await ea(e);switch(e.basis.containerFormat){case"ktx2":return sh(r.KTX2File,t,e);case"basis":default:return ra(r.BasisFile,t,e)}case"transcoder":default:let{BasisFile:n}=await ta(e);return ra(n,t,e)}}function ra(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(dg(n,i,c,r));s.push(f)}return s}finally{n.close(),n.delete()}}function dg(t,e,r,n){let o=t.getImageWidth(e,r),s=t.getImageHeight(e,r),i=t.getHasAlpha(),{compressed:a,format:f,basisFormat:c}=ih(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 sh(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(Ag(n,i,r));break}return[s]}finally{n.close(),n.delete()}}function Ag(t,e,r){let{alphaFlag:n,height:o,width:s}=t.getImageLevelInfo(e,0,0),{compressed:i,format:a,basisFormat:f}=ih(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 ih(t,e){let r=t&&t.basis&&t.basis.format;return r==="auto"&&(r=Wo()),typeof r=="object"&&(r=e?r.alpha:r.noAlpha),r=r.toLowerCase(),ug[r]}function Wo(){let t=Zl();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 ah={name:"Basis",id:"basis",module:"textures",version:Kl,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"}}},oa={...ah,parse:na};var Hr=!0,ch=1735152710,aa=12,qo=8,mg=1313821514,pg=5130562,gg=0,Bg=0,xg=1;function _g(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 fh(t,e=0,r={}){let n=new DataView(t),{magic:o=ch}=r,s=n.getUint32(e,!1);return s===o||s===ch}function lh(t,e,r=0,n={}){let o=new DataView(e),s=_g(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+=aa,t.version){case 1:return Eg(t,o,r);case 2:return yg(t,o,r,n={});default:throw new Error(`Invalid GLB version ${t.version}. Only supports version 1 and 2.`)}}function Eg(t,e,r){z(t.header.byteLength>aa+qo);let n=e.getUint32(r+0,Hr),o=e.getUint32(r+4,Hr);return r+=qo,z(o===gg),sa(t,e,r,n),r+=n,r+=ia(t,e,r,t.header.byteLength),r}function yg(t,e,r,n){return z(t.header.byteLength>aa+qo),Cg(t,e,r,n),r+t.header.byteLength}function Cg(t,e,r,n){for(;r+8<=t.header.byteLength;){let o=e.getUint32(r+0,Hr),s=e.getUint32(r+4,Hr);switch(r+=qo,s){case mg:sa(t,e,r,o);break;case pg:ia(t,e,r,o);break;case Bg:n.strict||sa(t,e,r,o);break;case xg:n.strict||ia(t,e,r,o);break;default:break}r+=wt(o,4)}return r}function sa(t,e,r,n){let o=new Uint8Array(e.buffer,r,n),i=new TextDecoder("utf8").decode(o);return t.json=JSON.parse(i),wt(n,4)}function ia(t,e,r,n){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:e.buffer}),wt(n,4)}function ca(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 la={};ht(la,{decode:()=>vg,name:()=>Og});var Tg="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRN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BABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",wg=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]),Mg=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]),Ig={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Sg={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function hh(t,e,r,n,o,s="NONE"){let i=await Fg();Lg(i,i.exports[Sg[o]],t,e,r,n,i.exports[Ig[s||"NONE"]])}var fa;async function Fg(){return fa||(fa=Dg()),fa}async function Dg(){let t=Tg;WebAssembly.validate(wg)&&(t=bg,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let e=await WebAssembly.instantiate(Rg(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}function Rg(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?Mg[e[n]]:(e[n]-60)*64+e[++n];return e.buffer.slice(0,r)}function Lg(t,e,r,n,o,s,i){let a=t.exports.sbrk,f=n+3&-4,c=a(f*o),l=a(s.length),h=new Uint8Array(t.exports.memory.buffer);h.set(s,l);let u=e(c,n,o,l,s.length);if(u===0&&i&&i(c,f,o),r.set(h.subarray(c,c+n*o)),a(c-a(0)),u!==0)throw new Error(`Malformed buffer data: ${u}`)}var $o="EXT_meshopt_compression",Og=$o;async function vg(t,e){let r=new K(t);if(!e?.gltf?.decompressMeshes||!e.gltf?.loadBuffers)return;let n=[];for(let o of t.json.bufferViews||[])n.push(Gg(r,o));await Promise.all(n),r.removeExtension($o)}async function Gg(t,e){let r=t.getObjectExtension(e,$o);if(r){let{byteOffset:n=0,byteLength:o=0,byteStride:s,count:i,mode:a,filter:f="NONE",buffer:c}=r,l=t.gltf.buffers[c],h=new Uint8Array(l.arrayBuffer,l.byteOffset+n,o),u=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);await hh(u,i,s,h,a,f),t.removeObjectExtension(e,$o)}}var ha={};ht(ha,{name:()=>Ng,preprocess:()=>Ug});var kr="EXT_texture_webp",Ng=kr;function Ug(t,e){let r=new K(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 ua={};ht(ua,{name:()=>Pg,preprocess:()=>Hg});var ts="KHR_texture_basisu",Pg=ts;function Hg(t,e){let r=new K(t),{json:n}=r;for(let o of n.textures||[]){let s=r.getObjectExtension(o,ts);s&&(o.source=s.source,r.removeObjectExtension(o,ts))}r.removeExtension(ts)}var Aa={};ht(Aa,{decode:()=>Vg,encode:()=>jg,name:()=>zg,preprocess:()=>Qg});function uh(t){let e={};for(let r in t){let n=t[r];if(r!=="indices"){let o=da(n);e[r]=o}}return e}function da(t){let{buffer:e,size:r,count:n}=kg(t);return{value:e,size:r,byteOffset:0,count:n,type:Qo(r),componentType:vr(e)}}function kg(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 De="KHR_draco_mesh_compression",zg=De;function Qg(t,e,r){let n=new K(t);for(let o of dh(n))n.getObjectExtension(o,De)}async function Vg(t,e,r){if(!e?.gltf?.decompressMeshes)return;let n=new K(t),o=[];for(let s of dh(n))n.getObjectExtension(s,De)&&o.push(Kg(n,s,e,r));await Promise.all(o),n.removeExtension(De)}function jg(t,e={}){let r=new K(t);for(let n of r.json.meshes||[])Xg(n,e),r.addRequiredExtension(De)}async function Kg(t,e,r,n){let o=t.getObjectExtension(e,De);if(!o)return;let s=t.getTypedArrayForBufferView(o.bufferView),i=ke(s.buffer,s.byteOffset),a={...r};delete a["3d-tiles"];let f=await Ht(i,Uo,a,n),c=uh(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=da(f.indices)),t.removeObjectExtension(e,De),Zg(e)}function Xg(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:{[De]:{bufferView:f,attributes:a}}}]}}function Zg(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*dh(t){for(let e of t.json.meshes||[])for(let r of e.primitives)yield r}var pa={};ht(pa,{decode:()=>$g,name:()=>Yg});var ma="KHR_texture_transform",Yg=ma,es=new w,Wg=new Z,qg=new Z;async function $g(t,e){if(!new K(t).hasExtension(ma)||!e.gltf?.loadBuffers)return;let o=t.json.materials||[];for(let s=0;s<o.length;s++)tB(s,t)}function tB(t,e){let r=[],n=e.json.materials?.[t],o=n?.pbrMetallicRoughness?.baseColorTexture;o&&On(e,t,o,r);let s=n?.emissiveTexture;s&&On(e,t,s,r);let i=n?.normalTexture;i&&On(e,t,i,r);let a=n?.occlusionTexture;a&&On(e,t,a,r);let f=n?.pbrMetallicRoughness?.metallicRoughnessTexture;f&&On(e,t,f,r)}function On(t,e,r,n){let o=eB(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&&rB(t,a,o)}}function eB(t,e){let r=t.extensions?.[ma],{texCoord:n=0}=t,{texCoord:o=n}=r;if(!(e.findIndex(([i,a])=>i===n&&a===o)!==-1)){let i=sB(r);return n!==o&&(t.texCoord=o),e.push([n,o]),{originalTexCoord:n,texCoord:o,matrix:i}}return null}function rB(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}=Gr(a,f),A=zo[a.componentType],m=Jo[a.type],g=f.byteStride||A*m,_=new Float32Array(d);for(let y=0;y<a.count;y++){let T=new u(c,h+y*g,2);es.set(T[0],T[1],1),es.transformByMatrix3(s),_.set([es[0],es[1]],y*m)}n===o?nB(a,f,t.buffers,_):oB(o,a,e,t,_)}}}}function nB(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 oB(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 sB(t){let{offset:e=[0,0],rotation:r=0,scale:n=[1,1]}=t,o=new Z().set(1,0,0,0,1,0,e[0],e[1],1),s=Wg.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),i=qg.set(n[0],0,0,0,n[1],0,0,0,1);return o.multiplyRight(s).multiplyRight(i)}var ga={};ht(ga,{decode:()=>aB,encode:()=>cB,name:()=>iB});var Xe="KHR_lights_punctual",iB=Xe;async function aB(t){let e=new K(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 cB(t){let e=new K(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 Ba={};ht(Ba,{decode:()=>lB,encode:()=>hB,name:()=>fB});var vn="KHR_materials_unlit",fB=vn;async function lB(t){let e=new K(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 hB(t){let e=new K(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 xa={};ht(xa,{decode:()=>dB,encode:()=>AB,name:()=>uB});var Gn="KHR_techniques_webgl",uB=Gn;async function dB(t){let e=new K(t),{json:r}=e,n=e.getExtension(Gn);if(n){let o=mB(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=pB(s.technique,e)),e.removeObjectExtension(s,Gn)}e.removeExtension(Gn)}}async function AB(t,e){}function mB(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 pB(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 Ah=[Yi,Ki,la,ha,ua,Aa,ga,Ba,xa,pa,Wi];function mh(t,e={},r){let n=Ah.filter(o=>gh(o.name,e));for(let o of n)o.preprocess?.(t,e,r)}async function ph(t,e={},r){let n=Ah.filter(o=>gh(o.name,e));for(let o of n)await o.decode?.(t,e,r)}function gh(t,e){let r=e?.gltf?.excludeExtensions||{};return!(t in r&&!r[t])}var _a="KHR_binary_glTF";function Bh(t){let e=new K(t),{json:r}=e;for(let n of r.images||[]){let o=e.getObjectExtension(n,_a);o&&Object.assign(n,o),e.removeObjectExtension(n,_a)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,e.removeExtension(_a)}var xh={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},BB={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},Ea=class{constructor(){this.idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}}}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),Bh(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 xh)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 xh)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=BB[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 _h(t,e={}){return new Ea().normalize(t,e)}async function Eh(t,e,r=0,n,o){return xB(t,e,r,n),_h(t,{normalize:n?.gltf?.normalize}),mh(t,n,o),n?.gltf?.loadBuffers&&t.json.buffers&&await _B(t,n,o),n?.gltf?.loadImages&&await EB(t,n,o),await ph(t,n,o),t}function xB(t,e,r,n){if(n.uri&&(t.baseUri=n.uri),e instanceof ArrayBuffer&&!fh(e,r,n)&&(e=new TextDecoder().decode(e)),typeof e=="string")t.json=Gs(e);else if(e instanceof ArrayBuffer){let i={};r=lh(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 _B(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=ca(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 EB(t,e,r){let n=yB(t),o=t.json.images||[],s=[];for(let i of n)s.push(CB(t,o[i],i,e,r));return await Promise.all(s)}function yB(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 CB(t,e,r,n,o){let s;if(e.uri&&!e.hasOwnProperty("bufferView")){let a=ca(e.uri,n),{fetch:f}=o;s=await(await f(a)).arrayBuffer(),e.bufferView={data:s}}if(Number.isFinite(e.bufferView)){let a=Pl(t.json,t.buffers,e.bufferView);s=ke(a.buffer,a.byteOffset,a.byteLength)}ot(s,"glTF image has no data");let i=await Ht(s,[Qi,oa],{...n,mimeType:e.mimeType,basis:n.basis||{format:Wo()}},o);i&&i[0]&&(i={compressed:!0,mipmaps:!1,width:i[0].width,height:i[0].height,data:i[0]}),t.images=t.images||[],t.images[r]=i}var Ze={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:TB,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function TB(t,e={},r){e={...Ze.options,...e},e.gltf={...Ze.options.gltf,...e.gltf};let{byteOffset:n=0}=e;return await Eh({},t,n,e,r)}var bB={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},wB={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Lt={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},MB={magFilter:Lt.TEXTURE_MAG_FILTER,minFilter:Lt.TEXTURE_MIN_FILTER,wrapS:Lt.TEXTURE_WRAP_S,wrapT:Lt.TEXTURE_WRAP_T},IB={[Lt.TEXTURE_MAG_FILTER]:Lt.LINEAR,[Lt.TEXTURE_MIN_FILTER]:Lt.NEAREST_MIPMAP_LINEAR,[Lt.TEXTURE_WRAP_S]:Lt.REPEAT,[Lt.TEXTURE_WRAP_T]:Lt.REPEAT};function SB(){return{id:"default-sampler",parameters:IB}}function FB(t){return wB[t]}function DB(t){return bB[t]}var ya=class{constructor(){this.baseUri="",this.buffers=[],this.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=FB(e.componentType),o=DB(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}=Gr(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):SB(),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 MB[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 ya().postProcess(t,e)}var rs={URI:0,EMBEDDED:1};function ns(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=ke(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 os(t,e,r,n){let o=r?.["3d-tiles"]||{};if(RB(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 Ht(t.gltfArrayBuffer,Ze,r,n);t.gltf=Nn(s),t.gpuMemoryUsageInBytes=Rn(t.gltf),delete t.gltfArrayBuffer,delete t.gltfByteOffset,delete t.gltfByteLength}}}function RB(t,e,r){switch(e){case rs.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 rs.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function yh(t,e,r,n,o){r=LB(t,e,r,n,o),await os(t,rs.EMBEDDED,n,o);let s=t?.gltf?.extensions;return s&&s.CESIUM_RTC&&(t.rtcCenter=s.CESIUM_RTC.center),r}function LB(t,e,r,n,o){r=Fe(t,e,r),r=Lr(t,e,r),r=Or(t,e,r,n),r=ns(t,e,r,n);let s=new zt(t.featureTableJson,t.featureTableBinary);return t.rtcCenter=s.getGlobalProperty("RTC_CENTER",H.FLOAT,3),r}async function Ch(t,e,r,n,o){return r=OB(t,e,r,n,o),await os(t,t.gltfFormat||0,n,o),r}function OB(t,e,r,n,o){if(r=Fe(t,e,r),t.version!==1)throw new Error(`Instanced 3D Model version ${t.version} is not supported`);r=Lr(t,e,r);let s=new DataView(e);if(t.gltfFormat=s.getUint32(r,!0),r+=4,r=Or(t,e,r,n),r=ns(t,e,r,n),!t?.header?.featureTableJsonByteLength||t.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let i=new zt(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 de(t.batchTableJson,t.batchTableBinary,a);return vB(t,i,f,a),r}function vB(t,e,r,n){let o=new Array(n),s=new w,i=new w,a=new w,f=new w,c=new Z,l=new be,h=new w,u={},d=new Dt,A=[],m=[],g=[],_=[];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 p=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3);if(!p)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 E=65535;for(let U=0;U<3;U++)T[U]=T[U]/E*x[U]+p[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?(fe.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,g);Number.isFinite(C)&&h.multiplyByScalar(C);let I=e.getProperty("SCALE_NON_UNIFORM",H.FLOAT,3,y,A);I&&h.scale(I),u.scale=h;let M=e.getProperty("BATCH_ID",H.UNSIGNED_SHORT,1,y,_);M===void 0&&(M=y);let L=new Dt().fromQuaternion(u.rotation);d.identity(),d.translate(u.translation),d.multiplyRight(L),d.scale(u.scale);let B=d.clone();o[y]={modelMatrix:B,batchId:M}}t.instances=o}async function Th(t,e,r,n,o,s){r=Fe(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 bh(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 Ht(e,Ze,r,n);t.gltf=Nn(o),t.gpuMemoryUsageInBytes=Rn(t.gltf)}else t.gltfArrayBuffer=e;return e.byteLength}async function Ca(t,e=0,r,n,o={shape:"tile3d"}){switch(o.byteOffset=e,o.type=il(t,e),o.type){case Et.COMPOSITE:return await Th(o,t,e,r,n,Ca);case Et.BATCHED_3D_MODEL:return await yh(o,t,e,r,n);case Et.GLTF:return await bh(o,t,r,n);case Et.INSTANCED_3D_MODEL:return await Ch(o,t,e,r,n);case Et.POINT_CLOUD:return await Ml(o,t,e,r,n);default:throw new Error(`3DTileLoader: unknown type ${o.type}`)}}async function Ta(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=wh(t.slice(8,16)),i=new Uint8Array(t,24,s),f=new TextDecoder("utf8").decode(i),c=JSON.parse(f),l=wh(t.slice(16,24)),h=new ArrayBuffer(0);if(l&&(h=t.slice(24+s)),await ss(c,c.tileAvailability,h,r),Array.isArray(c.contentAvailability))for(let u of c.contentAvailability)await ss(c,u,h,r);else await ss(c,c.contentAvailability,h,r);return await ss(c,c.childSubtreeAvailability,h,r),c}async function ss(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 wh(t){let e=new DataView(t),r=e.getUint32(0,!0),n=e.getUint32(4,!0);return r+2**32*n}var Jr={id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Fr,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Ta,options:{}};var nu=mr(hn(),1);var $h=mr(hn(),1);function ba(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 Qt(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||ba()}var GB=globalThis.self||globalThis.window||globalThis.global,zr=globalThis.window||globalThis.self||globalThis.global,NB=globalThis.document||{},Ye=globalThis.process||{},UB=globalThis.console,mS=globalThis.navigator||{};var is=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",BS=Qt();function PB(t){try{let e=window[t],r="__storage_test__";return e.setItem(r,r),e.removeItem(r),e}catch{return null}}var as=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=PB(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 Mh(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 Ih(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 cs(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 fs;(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"})(fs||(fs={}));var HB=10;function Sh(t){return typeof t!="string"?t:(t=t.toUpperCase(),fs[t]||fs.WHITE)}function Fh(t,e,r){if(!Qt&&typeof t=="string"){if(e){let n=Sh(e);t="\x1B[".concat(n,"m").concat(t,"\x1B[39m")}if(r){let n=Sh(r);t="\x1B[".concat(n+HB,"m").concat(t,"\x1B[49m")}}return t}function Dh(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(Qt()&&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:Qt()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},kB={enabled:!0,level:0};function Ot(){}var Rh={},Lh={once:!0},Un=class{constructor(){let{id:e}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=is,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 as("__probe-".concat(this.id,"__"),kB),this.timeStamp("".concat(this.id," started")),Dh(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,Lh)}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,Lh)}table(e,r,n){return r?this._getLogFunction(e,r,console.table||Ot,n&&[n],{tag:VB(r)}):Ot}image(e){let{logLevel:r,priority:n,image:o,message:s="",scale:i=1}=e;return this._shouldLog(r||n)?Qt()?QB({image:o,message:s,scale:i}):zB({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=Oh({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()>=vh(e)}_getLogFunction(e,r,n,o,s){if(this._shouldLog(e)){s=Oh({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(!Rh[i])Rh[i]=We();else return Ot;return r=JB(this.id,s.message,s),n.bind(console,r,...s.args)}return Ot}};Un.VERSION=is;function vh(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 Oh(t){let{logLevel:e,message:r}=t;t.logLevel=vh(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 JB(t,e,r){if(typeof e=="string"){let n=r.time?Ih(Mh(r.total)):"";e=r.time?"".concat(t,": ").concat(n," ").concat(e):"".concat(t,": ").concat(e),e=Fh(e,r.color,r.background)}return e}function zB(t){let{image:e,message:r="",scale:n=1}=t;return console.warn("removed"),Ot}function QB(t){let{image:e,message:r="",scale:n=1}=t;if(typeof e=="string"){let s=new Image;return s.onload=()=>{let i=cs(s,r,n);console.log(...i)},s.src=e,Ot}let o=e.nodeName||"";if(o.toLowerCase()==="img")return console.log(...cs(e,r,n)),Ot;if(o.toLowerCase()==="canvas"){let s=new Image;return s.onload=()=>console.log(...cs(s,r,n)),s.src=e.toDataURL(),Ot}return Ot}function VB(t){for(let e in t)for(let r in t[e])return r||"untitled";return"empty"}var wa=new Un({id:"@probe.gl/log"});var vt=null;try{vt=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 q(t,e,r){this.low=t|0,this.high=e|0,this.unsigned=!!r}q.prototype.__isLong__;Object.defineProperty(q.prototype,"__isLong__",{value:!0});function dt(t){return(t&&t.__isLong__)===!0}function Gh(t){var e=Math.clz32(t&-t);return t?31-e:e}q.isLong=dt;var Nh={},Uh={};function qe(t,e){var r,n,o;return e?(t>>>=0,(o=0<=t&&t<256)&&(n=Uh[t],n)?n:(r=Q(t,0,!0),o&&(Uh[t]=r),r)):(t|=0,(o=-128<=t&&t<128)&&(n=Nh[t],n)?n:(r=Q(t,t<0?-1:0,!1),o&&(Nh[t]=r),r))}q.fromInt=qe;function Gt(t,e){if(isNaN(t))return e?Ae:Vt;if(e){if(t<0)return Ae;if(t>=Jh)return Vh}else{if(t<=-Hh)return Tt;if(t+1>=Hh)return Qh}return t<0?Gt(-t,e).neg():Q(t%Kr|0,t/Kr|0,e)}q.fromNumber=Gt;function Q(t,e,r){return new q(t,e,r)}q.fromBits=Q;var ls=Math.pow;function Ia(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?Ae:Vt;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 Ia(t.substring(1),e,r).neg();for(var o=Gt(ls(r,8)),s=Vt,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=Gt(ls(r,a));s=s.mul(c).add(Gt(f))}else s=s.mul(o),s=s.add(Gt(f))}return s.unsigned=e,s}q.fromString=Ia;function jt(t,e){return typeof t=="number"?Gt(t,e):typeof t=="string"?Ia(t,e):Q(t.low,t.high,typeof e=="boolean"?e:t.unsigned)}q.fromValue=jt;var Ph=1<<16,jB=1<<24,Kr=Ph*Ph,Jh=Kr*Kr,Hh=Jh/2,kh=qe(jB),Vt=qe(0);q.ZERO=Vt;var Ae=qe(0,!0);q.UZERO=Ae;var jr=qe(1);q.ONE=jr;var zh=qe(1,!0);q.UONE=zh;var Ma=qe(-1);q.NEG_ONE=Ma;var Qh=Q(-1,2147483647,!1);q.MAX_VALUE=Qh;var Vh=Q(-1,-1,!0);q.MAX_UNSIGNED_VALUE=Vh;var Tt=Q(0,-2147483648,!1);q.MIN_VALUE=Tt;var O=q.prototype;O.toInt=function(){return this.unsigned?this.low>>>0:this.low};O.toNumber=function(){return this.unsigned?(this.high>>>0)*Kr+(this.low>>>0):this.high*Kr+(this.low>>>0)};O.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(Tt)){var r=Gt(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=Gt(ls(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}};O.getHighBits=function(){return this.high};O.getHighBitsUnsigned=function(){return this.high>>>0};O.getLowBits=function(){return this.low};O.getLowBitsUnsigned=function(){return this.low>>>0};O.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Tt)?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};O.isZero=function(){return this.high===0&&this.low===0};O.eqz=O.isZero;O.isNegative=function(){return!this.unsigned&&this.high<0};O.isPositive=function(){return this.unsigned||this.high>=0};O.isOdd=function(){return(this.low&1)===1};O.isEven=function(){return(this.low&1)===0};O.equals=function(e){return dt(e)||(e=jt(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low};O.eq=O.equals;O.notEquals=function(e){return!this.eq(e)};O.neq=O.notEquals;O.ne=O.notEquals;O.lessThan=function(e){return this.comp(e)<0};O.lt=O.lessThan;O.lessThanOrEqual=function(e){return this.comp(e)<=0};O.lte=O.lessThanOrEqual;O.le=O.lessThanOrEqual;O.greaterThan=function(e){return this.comp(e)>0};O.gt=O.greaterThan;O.greaterThanOrEqual=function(e){return this.comp(e)>=0};O.gte=O.greaterThanOrEqual;O.ge=O.greaterThanOrEqual;O.compare=function(e){if(dt(e)||(e=jt(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1};O.comp=O.compare;O.negate=function(){return!this.unsigned&&this.eq(Tt)?Tt:this.not().add(jr)};O.neg=O.negate;O.add=function(e){dt(e)||(e=jt(e));var r=this.high>>>16,n=this.high&65535,o=this.low>>>16,s=this.low&65535,i=e.high>>>16,a=e.high&65535,f=e.low>>>16,c=e.low&65535,l=0,h=0,u=0,d=0;return d+=s+c,u+=d>>>16,d&=65535,u+=o+f,h+=u>>>16,u&=65535,h+=n+a,l+=h>>>16,h&=65535,l+=r+i,l&=65535,Q(u<<16|d,l<<16|h,this.unsigned)};O.subtract=function(e){return dt(e)||(e=jt(e)),this.add(e.neg())};O.sub=O.subtract;O.multiply=function(e){if(this.isZero())return this;if(dt(e)||(e=jt(e)),vt){var r=vt.mul(this.low,this.high,e.low,e.high);return Q(r,vt.get_high(),this.unsigned)}if(e.isZero())return this.unsigned?Ae:Vt;if(this.eq(Tt))return e.isOdd()?Tt:Vt;if(e.eq(Tt))return this.isOdd()?Tt:Vt;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(kh)&&e.lt(kh))return Gt(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,Q(d<<16|A,h<<16|u,this.unsigned)};O.mul=O.multiply;O.divide=function(e){if(dt(e)||(e=jt(e)),e.isZero())throw Error("division by zero");if(vt){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var r=(this.unsigned?vt.div_u:vt.div_s)(this.low,this.high,e.low,e.high);return Q(r,vt.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?Ae:Vt;var n,o,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return Ae;if(e.gt(this.shru(1)))return zh;s=Ae}else{if(this.eq(Tt)){if(e.eq(jr)||e.eq(Ma))return Tt;if(e.eq(Tt))return jr;var i=this.shr(1);return n=i.div(e).shl(1),n.eq(Vt)?e.isNegative()?jr:Ma:(o=this.sub(e.mul(n)),s=n.add(o.div(e)),s)}else if(e.eq(Tt))return this.unsigned?Ae:Vt;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=Vt}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:ls(2,a-48),c=Gt(n),l=c.mul(e);l.isNegative()||l.gt(o);)n-=f,c=Gt(n,this.unsigned),l=c.mul(e);c.isZero()&&(c=jr),s=s.add(c),o=o.sub(l)}return s};O.div=O.divide;O.modulo=function(e){if(dt(e)||(e=jt(e)),vt){var r=(this.unsigned?vt.rem_u:vt.rem_s)(this.low,this.high,e.low,e.high);return Q(r,vt.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))};O.mod=O.modulo;O.rem=O.modulo;O.not=function(){return Q(~this.low,~this.high,this.unsigned)};O.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};O.clz=O.countLeadingZeros;O.countTrailingZeros=function(){return this.low?Gh(this.low):Gh(this.high)+32};O.ctz=O.countTrailingZeros;O.and=function(e){return dt(e)||(e=jt(e)),Q(this.low&e.low,this.high&e.high,this.unsigned)};O.or=function(e){return dt(e)||(e=jt(e)),Q(this.low|e.low,this.high|e.high,this.unsigned)};O.xor=function(e){return dt(e)||(e=jt(e)),Q(this.low^e.low,this.high^e.high,this.unsigned)};O.shiftLeft=function(e){return dt(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Q(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):Q(0,this.low<<e-32,this.unsigned)};O.shl=O.shiftLeft;O.shiftRight=function(e){return dt(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Q(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):Q(this.high>>e-32,this.high>=0?0:-1,this.unsigned)};O.shr=O.shiftRight;O.shiftRightUnsigned=function(e){return dt(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?Q(this.low>>>e|this.high<<32-e,this.high>>>e,this.unsigned):e===32?Q(this.high,0,this.unsigned):Q(this.high>>>e-32,0,this.unsigned)};O.shru=O.shiftRightUnsigned;O.shr_u=O.shiftRightUnsigned;O.rotateLeft=function(e){var r;return dt(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?Q(this.high,this.low,this.unsigned):e<32?(r=32-e,Q(this.low<<e|this.high>>>r,this.high<<e|this.low>>>r,this.unsigned)):(e-=32,r=32-e,Q(this.high<<e|this.low>>>r,this.low<<e|this.high>>>r,this.unsigned))};O.rotl=O.rotateLeft;O.rotateRight=function(e){var r;return dt(e)&&(e=e.toInt()),(e&=63)===0?this:e===32?Q(this.high,this.low,this.unsigned):e<32?(r=32-e,Q(this.high<<r|this.low>>>e,this.low<<r|this.high>>>e,this.unsigned)):(e-=32,r=32-e,Q(this.low<<r|this.high>>>e,this.high<<r|this.low>>>e,this.unsigned))};O.rotr=O.rotateRight;O.toSigned=function(){return this.unsigned?Q(this.low,this.high,!1):this};O.toUnsigned=function(){return this.unsigned?this:Q(this.low,this.high,!0)};O.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()};O.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]};O.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]};q.fromBytes=function(e,r,n){return n?q.fromBytesLE(e,r):q.fromBytesBE(e,r)};q.fromBytesLE=function(e,r){return new q(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)};q.fromBytesBE=function(e,r){return new q(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=q;var KB=16;function Pn(t){t==="X"&&(t="");let e=t.padEnd(KB,"0");return Xr.fromString(e,!0,16)}function Sa(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 Fa(t,e){let r=XB(t).shiftRightUnsigned(2);return t.add(Xr.fromNumber(2*e+1-4).multiply(r))}function XB(t){return t.and(t.not().add(1))}var ZB=3,YB=30,WB=2*YB+1,jh=180/Math.PI;function Xh(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);qB(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 Zh(t){if(t.isZero())return"";let e=t.toString(2);for(;e.length<ZB+WB;)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 Da(t,e,r){let n=1<<e;return[(t[0]+r[0])/n,(t[1]+r[1])/n]}function Kh(t){return t>=.5?1/3*(4*t*t-1):1/3*(1-4*(1-t)*(1-t))}function Ra(t){return[Kh(t[0]),Kh(t[1])]}function La(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 Oa([t,e,r]){let n=Math.atan2(r,Math.sqrt(t*t+e*e));return[Math.atan2(e,t)*jh,n*jh]}function qB(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 Yh(t){let e=Da(t.ij,t.level,[.5,.5]),r=Ra(e),n=La(t.face,r);return Oa(n)}var $B=100;function va(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($B*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=Da(r,n,l),g=Ra(m),_=La(e,g),y=Oa(_);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=tx(t);return Xh(e)}function tx(t){if(t.indexOf("/")>0)return t;let e=Pn(t);return Zh(e)}function Ga(t){let e=Zr(t);return Yh(e)}function qh(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=va(i);(typeof r>"u"||r===null)&&(r=new Float64Array(4*a.length)),r.set(a,n),n+=a.length}e=Wh(r)}else{let r=va(t);e=Wh(r)}return e}function Wh(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 Na(t,e){let r=e?.minimumHeight||0,n=e?.maximumHeight||0,o=Zr(t),s=qh(o),i=s.west,a=s.south,f=s.east,c=s.north,l=[];return l.push(new w(i,c,r)),l.push(new w(f,c,r)),l.push(new w(f,a,r)),l.push(new w(i,a,r)),l.push(new w(i,c,n)),l.push(new w(f,c,n)),l.push(new w(f,a,n)),l.push(new w(i,a,n)),l}function hs(t){let e=t.token,r={minimumHeight:t.minimumHeight,maximumHeight:t.maximumHeight},n=Na(e,r),o=Ga(e),s=o[0],i=o[1],a=fe.WGS84.cartographicToCartesian([s,i,r.maximumHeight]),f=new w(a[0],a[1],a[2]);n.push(f);let c=Si(n);return[...c.center,...c.halfAxes]}var ex=4,rx=8,nx={QUADTREE:ex,OCTREE:rx};function ox(t,e,r){if(t?.box){let n=Pn(t.s2VolumeInfo.token),o=Fa(n,e),s=Sa(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:hs(i),s2VolumeInfo:i}}}async function Pa(t){let{implicitOptions:e,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,s2VolumeBox:o,loaderOptions:s}=t,{subtree:i,level:a=0,globalData:f={level:0,mortonIndex:0,x:0,y:0,z:0}}=t,{subdivisionScheme:c,subtreeLevels:l,maximumLevel:h,contentUrlTemplate:u,subtreesUriTemplate:d,basePath:A}=e,m={children:[],lodMetricValue:0,contentUrl:""};if(!h)return wa.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${u} won't be loaded...`),m;let g=a+f.level;if(g>h)return m;let _=nx[c],y=Math.log2(_),T=n&1,b=n>>1&1,C=n>>2&1,I=(_**a-1)/(_-1),M=$e(r.mortonIndex,n,y),L=I+M,B=$e(r.x,T,1),p=$e(r.y,b,1),x=$e(r.z,C,1),E=!1;a>=l&&(E=Ua(i.childSubtreeAvailability,M));let U=$e(f.x,B,a),N=$e(f.y,p,a),P=$e(f.z,x,a);if(E){let He=`${A}/${d}`,ao=us(He,g,U,N,P);i=await(0,$h.load)(ao,Jr,s),f={mortonIndex:M,x:B,y:p,z:x,level:a},M=0,L=0,B=0,p=0,x=0,a=0}if(!Ua(i.tileAvailability,L))return m;Ua(i.contentAvailability,L)&&(m.contentUrl=us(u,g,U,N,P));let At=a+1,Y={mortonIndex:M,x:B,y:p,z:x};for(let He=0;He<_;He++){let ao=ox(o,He,c),Ar=await Pa({subtree:i,implicitOptions:e,loaderOptions:s,parentData:Y,childIndex:He,level:At,globalData:{...f},s2VolumeBox:ao});if(Ar.contentUrl||Ar.children.length){let S=g+1,F=sx(Ar,S,{childTileX:B,childTileY:p,childTileZ:x},e,o);m.children.push(F)}}return m}function Ua(t,e){let r;return Array.isArray(t)?(r=t[0],t.length>1&&wa.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=t,"constant"in r?Boolean(r.constant):r.explicitBitstream?cx(e,r.explicitBitstream):!1}function sx(t,e,r,n,o){let{basePath:s,refine:i,getRefine:a,lodMetricType:f,getTileType:c,rootLodMetricValue:l,rootBoundingVolume:h}=n,u=t.contentUrl&&t.contentUrl.replace(`${s}/`,""),d=l/2**e,A=o?.box?{box:o.box}:h,m=ix(e,A,r);return{children:t.children,contentUrl:t.contentUrl,content:{uri:u},id:t.contentUrl,refine:a(i),type:c(t),lodMetricType:f,lodMetricValue:d,geometricError:d,transform:t.transform,boundingVolume:m}}function ix(t,e,r){if(e.region){let{childTileX:n,childTileY:o,childTileZ:s}=r,[i,a,f,c,l,h]=e.region,u=2**t,d=(f-i)/u,A=(c-a)/u,m=(h-l)/u,[g,_]=[i+d*n,i+d*(n+1)],[y,T]=[a+A*o,a+A*(o+1)],[b,C]=[l+m*s,l+m*(s+1)];return{region:[g,y,_,T,b,C]}}if(e.box)return e;throw new Error(`Unsupported bounding volume type ${e}`)}function $e(t,e,r){return(t<<r)+e}function us(t,e,r,n,o){let s=ax({level:e,x:r,y:n,z:o});return t.replace(/{level}|{x}|{y}|{z}/gi,i=>s[i])}function ax(t){let e={};for(let r in t)e[`{${r}}`]=t[r];return e}function cx(t,e){let r=Math.floor(t/8),n=t%8;return(e[r]>>n&1)===1}function ka(t,e=""){if(!e)return Ie.EMPTY;let n=e.split("?")[0].split(".").pop();switch(n){case"pnts":return Ie.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Ie.SCENEGRAPH;default:return n||Ie.EMPTY}}function Ja(t){switch(t){case"REPLACE":case"replace":return Sr.REPLACE;case"ADD":case"add":return Sr.ADD;default:return t}}function Ha(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 Er.resolve(e,t)}function tu(t,e){if(!t)return null;let r;if(t.content){let o=t.content.uri||t.content?.url;typeof o<"u"&&(r=Ha(o,e))}return{...t,id:r,contentUrl:r,lodMetricType:ue.GEOMETRIC_ERROR,lodMetricValue:t.geometricError,transformMatrix:t.transform,type:ka(t,r),refine:Ja(t.refine)}}async function ou(t,e,r){let n=null,o=ru(t.root);o&&t.root?n=await eu(t.root,t,e,o,r):n=tu(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=ru(c),h;l?h=await eu(c,t,e,l,r):h=tu(c,e),h&&(f.push(h),s.push(h))}i.children=f}return n}async function eu(t,e,r,n,o){let{subdivisionScheme:s,maximumLevel:i,availableLevels:a,subtreeLevels:f,subtrees:{uri:c}}=n,l=us(c,0,0,0,0),h=Ha(l,r),u=await(0,nu.load)(h,Jr,o),d=t.content?.uri,A=d?Ha(d,r):"",m=e?.root?.refine,g=t.geometricError,_=t.boundingVolume.extensions?.["3DTILES_bounding_volume_S2"];if(_){let C={box:hs(_),s2VolumeInfo:_};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:ue.GEOMETRIC_ERROR,rootLodMetricValue:g,rootBoundingVolume:y,getTileType:ka,getRefine:Ja};return await fx(t,r,u,T,o)}async function fx(t,e,r,n,o){if(!t)return null;let{children:s,contentUrl:i}=await Pa({subtree:r,implicitOptions:n,loaderOptions:o}),a,f=null;return i&&(a=i,f={uri:i.replace(`${e}/`,"")}),{...t,id:a,contentUrl:a,lodMetricType:ue.GEOMETRIC_ERROR,lodMetricValue:t.geometricError,transformMatrix:t.transform,type:ka(t,a),refine:Ja(t.refine),content:f||t.content,children:s}}function ru(t){return t?.extensions?.["3DTILES_implicit_tiling"]||t?.implicitTiling}var tr={id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Fr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:lx,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function lx(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?hx(t,e,r):ux(t,e,r)}async function hx(t,e,r){let n=JSON.parse(new TextDecoder().decode(t)),o=r?.url||"",s=dx(o),i=await ou(n,s,e||{});return{...n,shape:"tileset3d",loader:tr,url:o,queryString:r?.queryString||"",basePath:s,root:i||n.root,type:wn.TILES3D,lodMetricType:ue.GEOMETRIC_ERROR,lodMetricValue:n.root?.geometricError||0}}async function ux(t,e,r){let n={content:{shape:"tile3d",featureIds:null}};return await Ca(t,0,e,r,n.content),n.content}function dx(t){return Er.dirname(t)}var ds=mr(hn(),1);var su="https://api.cesium.com/v1/assets";async function As(t,e){if(!e){let s=await Ax(t);for(let i of s.items)i.type==="3DTILES"&&(e=i.id)}let r=await mx(t,e),{type:n,url:o}=r;return z(n==="3DTILES"&&o),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function Ax(t){z(t);let e=su,r={Authorization:`Bearer ${t}`},n=await(0,ds.fetchFile)(e,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function mx(t,e){z(t,e);let r={Authorization:`Bearer ${t}`},n=`${su}/${e}`,o=await(0,ds.fetchFile)(`${n}`,{headers:r});if(!o.ok)throw new Error(o.statusText);let s=await o.json();if(o=await(0,ds.fetchFile)(`${n}/endpoint`,{headers:r}),!o.ok)throw new Error(o.statusText);let i=await o.json();return s={...s,...i},s}async function px(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 As(r,n)}var za={...tr,id:"cesium-ion",name:"Cesium Ion",preload:px,parse:async(t,e,r)=>(e={...e},e["3d-tiles"]=e["cesium-ion"],e.loader=za,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=0n;for(let o=t.length-4n;o>-1;o--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=await t.getUint8(o),r.every((s,i)=>s===e[i])){n=o;break}return n};var iu=new Uint8Array([80,75,5,6]),au=new Uint8Array([80,75,6,7]),cu=new Uint8Array([80,75,6,6]),gx=8n;var Bx=16n;var xx=8n,_x=24n;var Ex=48n;var fu=async t=>{let e=await Hn(t,iu),r=BigInt(await t.getUint16(e+gx)),n=BigInt(await t.getUint32(e+Bx)),o=e-20n,s=0n,i=await t.slice(o,o+4n);if(_e(i,au)){s=await t.getBigUint64(o+xx);let a=await t.slice(s,s+4n);if(!_e(a,cu.buffer))throw new Error("zip64 EoCD not found");r=await t.getBigUint64(s+_x),n=await t.getBigUint64(s+Ex)}else o=0n;return{cdRecordsNumber:r,cdStartOffset:n,offsets:{zip64EoCDOffset:s,zip64EoCDLocatorOffset:o,zipEoCDOffset:e}}};var jF=[{offset:0,size:4,default:new DataView(iu.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(au.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],XF=[{offset:0,size:4,default:new DataView(cu.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 yx=20n,Cx=24n,Tx=28n,bx=30n,wx=32n,Mx=42n,Qa=46n,Jn=new Uint8Array([80,75,1,2]),kn=async(t,e)=>{let r=await e.slice(t,t+4n);if(!_e(r,Jn.buffer))return null;let n=BigInt(await e.getUint32(t+yx)),o=BigInt(await e.getUint32(t+Cx)),s=await e.getUint16(t+bx),i=BigInt(await e.getUint16(t+wx)),a=await e.getUint16(t+Tx),f=await e.slice(t+Qa,t+Qa+BigInt(a)),c=new TextDecoder().decode(f),l=t+Qa+BigInt(a),h=await e.getUint32(t+Mx),u=BigInt(h),d=new DataView(await e.slice(l,l+BigInt(s))),A={uncompressedSize:o,compressedSize:n,localHeaderOffset:u,startDisk:i},m=Ix(A,d);return{...A,...m,extraFieldLength:s,fileNameLength:a,fileName:c,extraOffset:l}};async function*Yr(t){let{cdStartOffset:e}=await fu(t),r=await kn(e,t);for(;r;)yield r,r=await kn(r.extraOffset+BigInt(r.extraFieldLength),t)}var lu=(...t)=>t[0]+t[1]*16,Ix=(t,e)=>{let r=Sx(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)=>lu(c[f],c[f+1])===1&&lu(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},Sx=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 qF=[{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 Fx=8n,Dx=18n,Rx=22n,Lx=26n,Ox=28n,ms=30n,Va=new Uint8Array([80,75,3,4]),er=async(t,e)=>{let r=await e.slice(t,t+4n);if(!_e(r,Va))return null;let n=await e.getUint16(t+Lx),o=new TextDecoder().decode(await e.slice(t+ms,t+ms+BigInt(n))).split("\\").join("/"),s=await e.getUint16(t+Ox),i=t+ms+BigInt(n+s),a=await e.getUint16(t+Fx),f=BigInt(await e.getUint32(t+Dx)),c=BigInt(await e.getUint32(t+Rx)),l=t+ms+BigInt(n),h=4n;return c===BigInt(4294967295)&&(c=await e.getBigUint64(l+h),h+=8n),f===BigInt(4294967295)&&(f=await e.getBigUint64(l+h),h+=8n),i===BigInt(4294967295)&&(i=await e.getBigUint64(l+h)),{fileNameLength:n,fileName:o,extraFieldLength:s,fileDataOffset:i,compressedSize:f,compressionMethod:a}};var eD=[{offset:0,size:4,default:new DataView(Va.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 dn(e)}};function hu(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+=vx(n[o])}return e}function vx(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 uu(t,e){switch(e){case"hex":return t;case"base64":return Gx(t);default:throw new Error(e)}}function Gx(t){t.length%2!==0&&(t=`0${t}`);let r=(t.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return hu(r)||""}var Au=typeof atob=="function"?atob:typeof Buffer=="function"?zx:pu,Nx=Au("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1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0QS4Ec2V0Qi8Ec2V0QzAEc2V0RDEEc2V0WALNATIAAQAAAQIAAAEIbnVtbG9vcHMCAAMABAAFAAYABwAIAAkACgALAAwADQAOAA8AEAARABIAEwAUABUAFgAXABgCAAABAW4ZAgAAAQFuGgIAAAEBbhsCAAABAW4cAgAAAQFuHQIAAAEBbh4CAAABAW4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),ja=WebAssembly&&Au!==pu?Jx(Nx).buffer:!1,re=Qx(),Ka=240*16*16,mu=Math.floor(Ka*16*1.066666667),Ux=268435456-65536,du="Parameter must be Buffer, ArrayBuffer or Uint8Array",Px="Parameter exceeds max size of 255.9 Mbytes";ja||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function Xa(t){var e,r,n,o,s,i,a,f,c,l;let h=kx(),u=Hx(),d={},A=new Date().getTime();return d.then=function(y){return a=y,g(),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:_(new TypeError(du)):_(new TypeError(du)),i&&(s=i.length,ja&&s>mu?s>Ux?_(new Error(Px)):(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(ja,n).then(m)):g(h(i))),d;function m(y){g(u(i,y.instance.exports,r))}function g(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 _(y){typeof f=="function"&&f(y)}}function Hx(){var t,e,r,n,o,s,i,a,f,c,l,h,u,d=function(A){var m,g,_,y,T,b,C,I,M,L,B,p,x,E,U,N,P,v,it,At,Y,He,ao=new Date().getTime(),Ar=0,S=1732584193,D=-271733879,F=-1732584194,R=271733878,et=0,ln=A.length*8,co;for(co=dd(A,u),u[ln>>>5]|=128<<ln%32,u[(ln+64>>>9<<4)+14]=ln,co=(ln+64>>>9<<4)+15,Y=u;et<co;)co>et+mu?(n(S),s(D),a(F),c(R),e(Ka),et=et+Ka*16,S=r(),D=o(),F=i(),R=f(),Ar++):(P=S,v=D,it=F,At=R,m=Y[et+0]>>>0,g=Y[et+1]>>>0,_=Y[et+2]>>>0,y=Y[et+3]>>>0,T=Y[et+4]>>>0,b=Y[et+5]>>>0,C=Y[et+6]>>>0,I=Y[et+7]>>>0,M=Y[et+8]>>>0,L=Y[et+9]>>>0,B=Y[et+10]>>>0,p=Y[et+11]>>>0,x=Y[et+12]>>>0,E=Y[et+13]>>>0,U=Y[et+14]>>>0,N=Y[et+15]>>>0,S=G(7,25,S+(D&F|~D&R)+m-680876936)+D,R=G(12,20,R+(S&D|~S&F)+g-389564586)+S,F=G(17,15,F+(R&S|~R&D)+_+606105819)+R,D=G(22,10,D+(F&R|~F&S)+y-1044525330)+F,S=G(7,25,S+(D&F|~D&R)+T-176418897)+D,R=G(12,20,R+(S&D|~S&F)+b+1200080426)+S,F=G(17,15,F+(R&S|~R&D)+C-1473231341)+R,D=G(22,10,D+(F&R|~F&S)+I-45705983)+F,S=G(7,25,S+(D&F|~D&R)+M+1770035416)+D,R=G(12,20,R+(S&D|~S&F)+L-1958414417)+S,F=G(17,15,F+(R&S|~R&D)+B-42063)+R,D=G(22,10,D+(F&R|~F&S)+p-1990404162)+F,S=G(7,25,S+(D&F|~D&R)+x+1804603682)+D,R=G(12,20,R+(S&D|~S&F)+E-40341101)+S,F=G(17,15,F+(R&S|~R&D)+U-1502002290)+R,D=G(22,10,D+(F&R|~F&S)+N+1236535329)+F,S=G(5,27,S+(D&R|F&~R)+g-165796510)+D,R=G(9,23,R+(S&F|D&~F)+C-1069501632)+S,F=G(14,18,F+(R&D|S&~D)+p+643717713)+R,D=G(20,12,D+(F&S|R&~S)+m-373897302)+F,S=G(5,27,S+(D&R|F&~R)+b-701558691)+D,R=G(9,23,R+(S&F|D&~F)+B+38016083)+S,F=G(14,18,F+(R&D|S&~D)+N-660478335)+R,D=G(20,12,D+(F&S|R&~S)+T-405537848)+F,S=G(5,27,S+(D&R|F&~R)+L+568446438)+D,R=G(9,23,R+(S&F|D&~F)+U-1019803690)+S,F=G(14,18,F+(R&D|S&~D)+y-187363961)+R,D=G(20,12,D+(F&S|R&~S)+M+1163531501)+F,S=G(5,27,S+(D&R|F&~R)+E-1444681467)+D,R=G(9,23,R+(S&F|D&~F)+_-51403784)+S,F=G(14,18,F+(R&D|S&~D)+I+1735328473)+R,D=G(20,12,D+(F&S|R&~S)+x-1926607734)+F,S=G(4,28,S+(D^F^R)+b-378558)+D,R=G(11,21,R+(S^D^F)+M-2022574463)+S,F=G(16,16,F+(R^S^D)+p+1839030562)+R,D=G(23,9,D+(F^R^S)+U-35309556)+F,S=G(4,28,S+(D^F^R)+g-1530992060)+D,R=G(11,21,R+(S^D^F)+T+1272893353)+S,F=G(16,16,F+(R^S^D)+I-155497632)+R,D=G(23,9,D+(F^R^S)+B-1094730640)+F,S=G(4,28,S+(D^F^R)+E+681279174)+D,R=G(11,21,R+(S^D^F)+m-358537222)+S,F=G(16,16,F+(R^S^D)+y-722521979)+R,D=G(23,9,D+(F^R^S)+C+76029189)+F,S=G(4,28,S+(D^F^R)+L-640364487)+D,R=G(11,21,R+(S^D^F)+x-421815835)+S,F=G(16,16,F+(R^S^D)+N+530742520)+R,D=G(23,9,D+(F^R^S)+_-995338651)+F,S=G(6,26,S+(F^(D|~R))+m-198630844)+D,R=G(10,22,R+(D^(S|~F))+I+1126891415)+S,F=G(15,17,F+(S^(R|~D))+U-1416354905)+R,D=G(21,11,D+(R^(F|~S))+b-57434055)+F,S=G(6,26,S+(F^(D|~R))+x+1700485571)+D,R=G(10,22,R+(D^(S|~F))+y-1894986606)+S,F=G(15,17,F+(S^(R|~D))+B-1051523)+R,D=G(21,11,D+(R^(F|~S))+g-2054922799)+F,S=G(6,26,S+(F^(D|~R))+M+1873313359)+D,R=G(10,22,R+(D^(S|~F))+N-30611744)+S,F=G(15,17,F+(S^(R|~D))+C-1560198380)+R,D=G(21,11,D+(R^(F|~S))+E+1309151649)+F,S=G(6,26,S+(F^(D|~R))+T-145523070)+D,R=G(10,22,R+(D^(S|~F))+p-1120210379)+S,F=G(15,17,F+(S^(R|~D))+_+718787259)+R,D=G(21,11,D+(R^(F|~S))+L-343485551)+F,et=et+16,S=S+P>>>0,D=D+v>>>0,F=F+it>>>0,R=R+At>>>0);return re.endian([S,D,F,R]);function G(mt,fo,Zt){return Zt<<mt|Zt>>>fo}function dd(mt,fo){for(var Zt=-1,Os=Math.floor((mt.length-1)/4),Bt=0,Lc,Oc,vc,Gc;Os-8>Zt++;)Bt=Zt<<2,fo[Zt]=mt[Bt+0]|mt[Bt+1]<<8|mt[Bt+2]<<16|mt[Bt+3]<<24;for(Zt--;Os>Zt++;)Bt=Zt<<2,Lc=typeof mt[Bt+0]>"u"?0:mt[Bt+0],Oc=typeof mt[Bt+1]>"u"?0:mt[Bt+1],vc=typeof mt[Bt+2]>"u"?0:mt[Bt+2],Gc=typeof mt[Bt+3]>"u"?0:mt[Bt+3],fo[Zt]=Lc|Oc<<8|vc<<16|Gc<<24;return Os+1}};return function(A,m,g,_){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=g,y=re.wordsToBytes(d(A)),_&&_.asBytes?y:re.bytesconvertNumberToHex(y)}}function kx(){var t=function(e,r){var n,o,s,i,a,f,c,l,h,u,d,A,m,g,_,y,T,b,C,I,M,L=new Date().getTime(),B=1732584193,p=-271733879,x=-1732584194,E=271733878,U=e.length*8;M=re.bytesToWords(e);for(var N=0;N<M.length;N++)M[N]=(M[N]<<8|M[N]>>>24)&16711935|(M[N]<<24|M[N]>>>8)&4278255360;M[U>>>5]|=128<<U%32,M[(U+64>>>9<<4)+14]=U;for(var P=0;P<M.length;P+=16)T=B,b=p,C=x,I=E,n=M[P+0]>>>0,o=M[P+1]>>>0,s=M[P+2]>>>0,i=M[P+3]>>>0,a=M[P+4]>>>0,f=M[P+5]>>>0,c=M[P+6]>>>0,l=M[P+7]>>>0,h=M[P+8]>>>0,u=M[P+9]>>>0,d=M[P+10]>>>0,A=M[P+11]>>>0,m=M[P+12]>>>0,g=M[P+13]>>>0,_=M[P+14]>>>0,y=M[P+15]>>>0,B=v(7,25,B+(p&x|~p&E)+n-680876936)+p,E=v(12,20,E+(B&p|~B&x)+o-389564586)+B,x=v(17,15,x+(E&B|~E&p)+s+606105819)+E,p=v(22,10,p+(x&E|~x&B)+i-1044525330)+x,B=v(7,25,B+(p&x|~p&E)+a-176418897)+p,E=v(12,20,E+(B&p|~B&x)+f+1200080426)+B,x=v(17,15,x+(E&B|~E&p)+c-1473231341)+E,p=v(22,10,p+(x&E|~x&B)+l-45705983)+x,B=v(7,25,B+(p&x|~p&E)+h+1770035416)+p,E=v(12,20,E+(B&p|~B&x)+u-1958414417)+B,x=v(17,15,x+(E&B|~E&p)+d-42063)+E,p=v(22,10,p+(x&E|~x&B)+A-1990404162)+x,B=v(7,25,B+(p&x|~p&E)+m+1804603682)+p,E=v(12,20,E+(B&p|~B&x)+g-40341101)+B,x=v(17,15,x+(E&B|~E&p)+_-1502002290)+E,p=v(22,10,p+(x&E|~x&B)+y+1236535329)+x,B=v(5,27,B+(p&E|x&~E)+o-165796510)+p,E=v(9,23,E+(B&x|p&~x)+c-1069501632)+B,x=v(14,18,x+(E&p|B&~p)+A+643717713)+E,p=v(20,12,p+(x&B|E&~B)+n-373897302)+x,B=v(5,27,B+(p&E|x&~E)+f-701558691)+p,E=v(9,23,E+(B&x|p&~x)+d+38016083)+B,x=v(14,18,x+(E&p|B&~p)+y-660478335)+E,p=v(20,12,p+(x&B|E&~B)+a-405537848)+x,B=v(5,27,B+(p&E|x&~E)+u+568446438)+p,E=v(9,23,E+(B&x|p&~x)+_-1019803690)+B,x=v(14,18,x+(E&p|B&~p)+i-187363961)+E,p=v(20,12,p+(x&B|E&~B)+h+1163531501)+x,B=v(5,27,B+(p&E|x&~E)+g-1444681467)+p,E=v(9,23,E+(B&x|p&~x)+s-51403784)+B,x=v(14,18,x+(E&p|B&~p)+l+1735328473)+E,p=v(20,12,p+(x&B|E&~B)+m-1926607734)+x,B=v(4,28,B+(p^x^E)+f-378558)+p,E=v(11,21,E+(B^p^x)+h-2022574463)+B,x=v(16,16,x+(E^B^p)+A+1839030562)+E,p=v(23,9,p+(x^E^B)+_-35309556)+x,B=v(4,28,B+(p^x^E)+o-1530992060)+p,E=v(11,21,E+(B^p^x)+a+1272893353)+B,x=v(16,16,x+(E^B^p)+l-155497632)+E,p=v(23,9,p+(x^E^B)+d-1094730640)+x,B=v(4,28,B+(p^x^E)+g+681279174)+p,E=v(11,21,E+(B^p^x)+n-358537222)+B,x=v(16,16,x+(E^B^p)+i-722521979)+E,p=v(23,9,p+(x^E^B)+c+76029189)+x,B=v(4,28,B+(p^x^E)+u-640364487)+p,E=v(11,21,E+(B^p^x)+m-421815835)+B,x=v(16,16,x+(E^B^p)+y+530742520)+E,p=v(23,9,p+(x^E^B)+s-995338651)+x,B=v(6,26,B+(x^(p|~E))+n-198630844)+p,E=v(10,22,E+(p^(B|~x))+l+1126891415)+B,x=v(15,17,x+(B^(E|~p))+_-1416354905)+E,p=v(21,11,p+(E^(x|~B))+f-57434055)+x,B=v(6,26,B+(x^(p|~E))+m+1700485571)+p,E=v(10,22,E+(p^(B|~x))+i-1894986606)+B,x=v(15,17,x+(B^(E|~p))+d-1051523)+E,p=v(21,11,p+(E^(x|~B))+o-2054922799)+x,B=v(6,26,B+(x^(p|~E))+h+1873313359)+p,E=v(10,22,E+(p^(B|~x))+y-30611744)+B,x=v(15,17,x+(B^(E|~p))+c-1560198380)+E,p=v(21,11,p+(E^(x|~B))+g+1309151649)+x,B=v(6,26,B+(x^(p|~E))+a-145523070)+p,E=v(10,22,E+(p^(B|~x))+A-1120210379)+B,x=v(15,17,x+(B^(E|~p))+s+718787259)+E,p=v(21,11,p+(E^(x|~B))+u-343485551)+x,B=B+T>>>0,p=p+b>>>0,x=x+C>>>0,E=E+I>>>0;return re.endian([B,p,x,E]);function v(it,At,Y){return Y<<it|Y>>>At}};return function(e,r){var n=re.wordsToBytes(t(e,r)),o=r&&r.asBytes?n:re.bytesconvertNumberToHex(n);return o}}function Jx(t){var e,r,n,o=-1;for(e=t.length-1,r=new ArrayBuffer(t.length),n=new Uint8Array(r);e>o++;)n[o]=t.charCodeAt(o);return n}function zx(t){return Buffer.from(t,"base64").toString("binary")}function pu(t){return t}function Qx(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(e,r){return e<<r|e>>>32-r},endian:function(e){if(e.constructor==Number)return re.rotl(e,8)&16711935|re.rotl(e,24)&4278255360;for(var r=0;r<e.length;r++)e[r]=re.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{constructor(e={}){super(),this.name="md5",this.options=e}async hash(e,r){let o=await new Promise((s,i)=>Xa(e).then(s).catch(i));return uu(o,r)}};var Wr=class{constructor(e){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(){}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 dn(e)}improveError(e){return e.message.includes(this.name)||(e.message=`${this.name} ${e.message}`),e}};var zn=class extends Wr{constructor(e){super(e),this.name="uncompressed",this.extensions=[],this.contentEncodings=[],this.isSupported=!0,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(nd(),1),xe=mr(od(),1);var ur=class extends Wr{constructor(e={}){super(e),this.name="deflate",this.extensions=[],this.contentEncodings=["deflate"],this.isSupported=!0,this._chunks=[],this.options=e}async compress(e){if(!xt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await _r(xe.default.gzip)(e):await _r(xe.default.deflate)(e);return xr(r)}return this.compressSync(e)}async decompress(e){if(!xt&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await _r(xe.default.gunzip)(e):await _r(xe.default.inflate)(e);return xr(r)}return this.decompressSync(e)}compressSync(e){if(!xt&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?xe.default.gzipSync(e):xe.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(!xt&&this.options.deflate?.useZlib){let s=this.options.deflate?.gzip?xe.default.gunzipSync(e):xe.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 NE={0:async t=>t,8:async t=>await new ur({raw:!0}).decompress(t)},Ls=class{constructor(e){if(this.fileProvider=null,this.archive=null,typeof e=="string")if(this.fileName=e,!xt)this.fileProvider=new pn(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):Js(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){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=NE[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{constructor(e,r,n){this.fileProvider=e,this.fileName=n}async getFileWithoutHash(e){return await(await new Ls(this.fileProvider).fetch(e)).arrayBuffer()}};function Sc(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=UE(t,n,16);r[s]=o}return r}function UE(t,e,r){return[...new Uint8Array(t,e,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function Fc(t){let e=Yr(t);return PE(e)}async function PE(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 HE={0:t=>new zn().decompress(t),8:t=>new ur({raw:!0}).decompress(t)},fn=class extends dr{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=HE[i.compressionMethod];if(!f)throw Error("Only Deflation compression is supported");r=await f(a)}else r=await this.getFileWithoutHash(e);return r}};var sd=async(t,e)=>{let r=await Hn(t,Jn),n=await kn(r,t),o;if(n?.fileName!=="@3dtilesIndex1@")o=await Fc(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=Sc(a)}return new fn(t,o)};var kE="4.2.0-alpha.4",id={name:"3tz",id:"3tz",module:"3d-tiles",version:kE,mimeTypes:["application/octet-stream","application/vnd.maxar.archive.3tz+zip"],parse:JE,extensions:["3tz"],options:{}};async function JE(t,e={}){return(await sd(new gn(new DataView(t)))).getFile(e["3d-tiles-archive"]?.path??"")}function Ue(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 Pe(t,e,r){t&&t.setUint32(e+8,r,!0)}function ad(t,e,r,n,o){t={magic:Se.COMPOSITE,tiles:[],...t};let s=r;r+=Ue(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 Pe(e,s,r-s),r}function cd(t,e,r,n){let{featuresLength:o=0,batchTable:s}=t,a=JSON.stringify({BATCH_LENGTH:o}),f=s?JSON.stringify(s):"",c=wt(a.length,8),l=f?wt(f.length,8):0;t={magic:Se.BATCHED_MODEL,...t};let h=r;r=Ue(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=mo(e,r,a,8),s&&(r=mo(e,r,f,8));let u=t.gltfEncoded;return u&&(r=un(e,r,u,u.byteLength)),Pe(e,h,r-h),r}function fd(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:Se.INSTANCED_MODEL,...t};let h=r;return r=Ue(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),Pe(e,h,r-h),r}var zE={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function ld(t,e,r,n){let{featureTableJson:o=zE}=t,s=JSON.stringify(o);s=Us(s,4);let{featureTableJsonByteLength:i=s.length}=t,a=new ArrayBuffer(12),f=a.byteLength;t={magic:Se.POINT_CLOUD,...t};let c=r;return r+=Ue(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+=un(e,r,a,f),Pe(e,c,r-c),r}function Rc(t,e){let r=Dc(t,null,0,e),n=new ArrayBuffer(r),o=new DataView(n);return Dc(t,o,0,e),n}function Dc(t,e,r,n){switch(z(typeof t.type=="string"),t.type){case Et.COMPOSITE:return ad(t,e,r,n,Dc);case Et.POINT_CLOUD:return ld(t,e,r,n);case Et.BATCHED_3D_MODEL:return cd(t,e,r,n);case Et.INSTANCED_3D_MODEL:return fd(t,e,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var ud={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:Fr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],binary:!0,options:{["3d-tiles"]:{}},encode:async(t,e)=>hd(t,e),encodeSync:hd};function hd(t,e){return Rc(t,e)}return xd(io);})();
|
|
7
|
+
"use strict";var __exports__=(()=>{var qd=Object.create;var ps=Object.defineProperty;var Wd=Object.getOwnPropertyDescriptor;var $d=Object.getOwnPropertyNames;var t1=Object.getPrototypeOf,e1=Object.prototype.hasOwnProperty;var ct=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ut=(e,t)=>{for(var r in t)ps(e,r,{get:t[r],enumerable:!0})},ms=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of $d(t))!e1.call(e,s)&&s!==r&&ps(e,s,{get:()=>t[s],enumerable:!(n=Wd(t,s))||n.enumerable});return e},gs=(e,t,r)=>(ms(e,t,"default"),r&&ms(r,t,"default")),gr=(e,t,r)=>(r=e!=null?qd(t1(e)):{},ms(t||!e||!e.__esModule?ps(r,"default",{value:e,enumerable:!0}):r,e)),r1=e=>ms(ps({},"__esModule",{value:!0}),e);var pn=ct((z_,Yc)=>{Yc.exports=globalThis.loaders});var xe=ct(gt=>{"use strict";var z2=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function Q2(e,t){return Object.prototype.hasOwnProperty.call(e,t)}gt.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var n in r)Q2(r,n)&&(e[n]=r[n])}}return e};gt.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var V2={arraySet:function(e,t,r,n,s){if(t.subarray&&e.subarray){e.set(t.subarray(r,r+n),s);return}for(var o=0;o<n;o++)e[s+o]=t[r+o]},flattenChunks:function(e){var t,r,n,s,o,i;for(n=0,t=0,r=e.length;t<r;t++)n+=e[t].length;for(i=new Uint8Array(n),s=0,t=0,r=e.length;t<r;t++)o=e[t],i.set(o,s),s+=o.length;return i}},j2={arraySet:function(e,t,r,n,s){for(var o=0;o<n;o++)e[s+o]=t[r+o]},flattenChunks:function(e){return[].concat.apply([],e)}};gt.setTyped=function(e){e?(gt.Buf8=Uint8Array,gt.Buf16=Uint16Array,gt.Buf32=Int32Array,gt.assign(gt,V2)):(gt.Buf8=Array,gt.Buf16=Array,gt.Buf32=Array,gt.assign(gt,j2))};gt.setTyped(z2)});var y0=ct(on=>{"use strict";var K2=xe(),X2=4,t0=0,e0=1,Y2=2;function sn(e){for(var t=e.length;--t>=0;)e[t]=0}var Z2=0,a0=1,q2=2,W2=3,$2=258,dc=29,ts=256,Zn=ts+1+dc,nn=30,Ac=19,c0=2*Zn+1,or=15,ac=16,tE=7,mc=256,f0=16,h0=17,l0=18,lc=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],bo=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],eE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],u0=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],rE=512,Be=new Array((Zn+2)*2);sn(Be);var Yn=new Array(nn*2);sn(Yn);var qn=new Array(rE);sn(qn);var Wn=new Array($2-W2+1);sn(Wn);var pc=new Array(dc);sn(pc);var wo=new Array(nn);sn(wo);function cc(e,t,r,n,s){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=s,this.has_stree=e&&e.length}var d0,A0,m0;function fc(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function p0(e){return e<256?qn[e]:qn[256+(e>>>7)]}function $n(e,t){e.pending_buf[e.pending++]=t&255,e.pending_buf[e.pending++]=t>>>8&255}function Mt(e,t,r){e.bi_valid>ac-r?(e.bi_buf|=t<<e.bi_valid&65535,$n(e,e.bi_buf),e.bi_buf=t>>ac-e.bi_valid,e.bi_valid+=r-ac):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)}function se(e,t,r){Mt(e,r[t*2],r[t*2+1])}function g0(e,t){var r=0;do r|=e&1,e>>>=1,r<<=1;while(--t>0);return r>>>1}function nE(e){e.bi_valid===16?($n(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)}function sE(e,t){var r=t.dyn_tree,n=t.max_code,s=t.stat_desc.static_tree,o=t.stat_desc.has_stree,i=t.stat_desc.extra_bits,a=t.stat_desc.extra_base,f=t.stat_desc.max_length,c,h,l,u,d,A,m=0;for(u=0;u<=or;u++)e.bl_count[u]=0;for(r[e.heap[e.heap_max]*2+1]=0,c=e.heap_max+1;c<c0;c++)h=e.heap[c],u=r[r[h*2+1]*2+1]+1,u>f&&(u=f,m++),r[h*2+1]=u,!(h>n)&&(e.bl_count[u]++,d=0,h>=a&&(d=i[h-a]),A=r[h*2],e.opt_len+=A*(u+d),o&&(e.static_len+=A*(s[h*2+1]+d)));if(m!==0){do{for(u=f-1;e.bl_count[u]===0;)u--;e.bl_count[u]--,e.bl_count[u+1]+=2,e.bl_count[f]--,m-=2}while(m>0);for(u=f;u!==0;u--)for(h=e.bl_count[u];h!==0;)l=e.heap[--c],!(l>n)&&(r[l*2+1]!==u&&(e.opt_len+=(u-r[l*2+1])*r[l*2],r[l*2+1]=u),h--)}}function x0(e,t,r){var n=new Array(or+1),s=0,o,i;for(o=1;o<=or;o++)n[o]=s=s+r[o-1]<<1;for(i=0;i<=t;i++){var a=e[i*2+1];a!==0&&(e[i*2]=g0(n[a]++,a))}}function oE(){var e,t,r,n,s,o=new Array(or+1);for(r=0,n=0;n<dc-1;n++)for(pc[n]=r,e=0;e<1<<lc[n];e++)Wn[r++]=n;for(Wn[r-1]=n,s=0,n=0;n<16;n++)for(wo[n]=s,e=0;e<1<<bo[n];e++)qn[s++]=n;for(s>>=7;n<nn;n++)for(wo[n]=s<<7,e=0;e<1<<bo[n]-7;e++)qn[256+s++]=n;for(t=0;t<=or;t++)o[t]=0;for(e=0;e<=143;)Be[e*2+1]=8,e++,o[8]++;for(;e<=255;)Be[e*2+1]=9,e++,o[9]++;for(;e<=279;)Be[e*2+1]=7,e++,o[7]++;for(;e<=287;)Be[e*2+1]=8,e++,o[8]++;for(x0(Be,Zn+1,o),e=0;e<nn;e++)Yn[e*2+1]=5,Yn[e*2]=g0(e,5);d0=new cc(Be,lc,ts+1,Zn,or),A0=new cc(Yn,bo,0,nn,or),m0=new cc(new Array(0),eE,0,Ac,tE)}function B0(e){var t;for(t=0;t<Zn;t++)e.dyn_ltree[t*2]=0;for(t=0;t<nn;t++)e.dyn_dtree[t*2]=0;for(t=0;t<Ac;t++)e.bl_tree[t*2]=0;e.dyn_ltree[mc*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function E0(e){e.bi_valid>8?$n(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function iE(e,t,r,n){E0(e),n&&($n(e,r),$n(e,~r)),K2.arraySet(e.pending_buf,e.window,t,r,e.pending),e.pending+=r}function r0(e,t,r,n){var s=t*2,o=r*2;return e[s]<e[o]||e[s]===e[o]&&n[t]<=n[r]}function hc(e,t,r){for(var n=e.heap[r],s=r<<1;s<=e.heap_len&&(s<e.heap_len&&r0(t,e.heap[s+1],e.heap[s],e.depth)&&s++,!r0(t,n,e.heap[s],e.depth));)e.heap[r]=e.heap[s],r=s,s<<=1;e.heap[r]=n}function n0(e,t,r){var n,s,o=0,i,a;if(e.last_lit!==0)do n=e.pending_buf[e.d_buf+o*2]<<8|e.pending_buf[e.d_buf+o*2+1],s=e.pending_buf[e.l_buf+o],o++,n===0?se(e,s,t):(i=Wn[s],se(e,i+ts+1,t),a=lc[i],a!==0&&(s-=pc[i],Mt(e,s,a)),n--,i=p0(n),se(e,i,r),a=bo[i],a!==0&&(n-=wo[i],Mt(e,n,a)));while(o<e.last_lit);se(e,mc,t)}function uc(e,t){var r=t.dyn_tree,n=t.stat_desc.static_tree,s=t.stat_desc.has_stree,o=t.stat_desc.elems,i,a,f=-1,c;for(e.heap_len=0,e.heap_max=c0,i=0;i<o;i++)r[i*2]!==0?(e.heap[++e.heap_len]=f=i,e.depth[i]=0):r[i*2+1]=0;for(;e.heap_len<2;)c=e.heap[++e.heap_len]=f<2?++f:0,r[c*2]=1,e.depth[c]=0,e.opt_len--,s&&(e.static_len-=n[c*2+1]);for(t.max_code=f,i=e.heap_len>>1;i>=1;i--)hc(e,r,i);c=o;do i=e.heap[1],e.heap[1]=e.heap[e.heap_len--],hc(e,r,1),a=e.heap[1],e.heap[--e.heap_max]=i,e.heap[--e.heap_max]=a,r[c*2]=r[i*2]+r[a*2],e.depth[c]=(e.depth[i]>=e.depth[a]?e.depth[i]:e.depth[a])+1,r[i*2+1]=r[a*2+1]=c,e.heap[1]=c++,hc(e,r,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],sE(e,t),x0(r,f,e.bl_count)}function s0(e,t,r){var n,s=-1,o,i=t[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),t[(r+1)*2+1]=65535,n=0;n<=r;n++)o=i,i=t[(n+1)*2+1],!(++a<f&&o===i)&&(a<c?e.bl_tree[o*2]+=a:o!==0?(o!==s&&e.bl_tree[o*2]++,e.bl_tree[f0*2]++):a<=10?e.bl_tree[h0*2]++:e.bl_tree[l0*2]++,a=0,s=o,i===0?(f=138,c=3):o===i?(f=6,c=3):(f=7,c=4))}function o0(e,t,r){var n,s=-1,o,i=t[0*2+1],a=0,f=7,c=4;for(i===0&&(f=138,c=3),n=0;n<=r;n++)if(o=i,i=t[(n+1)*2+1],!(++a<f&&o===i)){if(a<c)do se(e,o,e.bl_tree);while(--a!==0);else o!==0?(o!==s&&(se(e,o,e.bl_tree),a--),se(e,f0,e.bl_tree),Mt(e,a-3,2)):a<=10?(se(e,h0,e.bl_tree),Mt(e,a-3,3)):(se(e,l0,e.bl_tree),Mt(e,a-11,7));a=0,s=o,i===0?(f=138,c=3):o===i?(f=6,c=3):(f=7,c=4)}}function aE(e){var t;for(s0(e,e.dyn_ltree,e.l_desc.max_code),s0(e,e.dyn_dtree,e.d_desc.max_code),uc(e,e.bl_desc),t=Ac-1;t>=3&&e.bl_tree[u0[t]*2+1]===0;t--);return e.opt_len+=3*(t+1)+5+5+4,t}function cE(e,t,r,n){var s;for(Mt(e,t-257,5),Mt(e,r-1,5),Mt(e,n-4,4),s=0;s<n;s++)Mt(e,e.bl_tree[u0[s]*2+1],3);o0(e,e.dyn_ltree,t-1),o0(e,e.dyn_dtree,r-1)}function fE(e){var t=4093624447,r;for(r=0;r<=31;r++,t>>>=1)if(t&1&&e.dyn_ltree[r*2]!==0)return t0;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return e0;for(r=32;r<ts;r++)if(e.dyn_ltree[r*2]!==0)return e0;return t0}var i0=!1;function hE(e){i0||(oE(),i0=!0),e.l_desc=new fc(e.dyn_ltree,d0),e.d_desc=new fc(e.dyn_dtree,A0),e.bl_desc=new fc(e.bl_tree,m0),e.bi_buf=0,e.bi_valid=0,B0(e)}function _0(e,t,r,n){Mt(e,(Z2<<1)+(n?1:0),3),iE(e,t,r,!0)}function lE(e){Mt(e,a0<<1,3),se(e,mc,Be),nE(e)}function uE(e,t,r,n){var s,o,i=0;e.level>0?(e.strm.data_type===Y2&&(e.strm.data_type=fE(e)),uc(e,e.l_desc),uc(e,e.d_desc),i=aE(e),s=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=s&&(s=o)):s=o=r+5,r+4<=s&&t!==-1?_0(e,t,r,n):e.strategy===X2||o===s?(Mt(e,(a0<<1)+(n?1:0),3),n0(e,Be,Yn)):(Mt(e,(q2<<1)+(n?1:0),3),cE(e,e.l_desc.max_code+1,e.d_desc.max_code+1,i+1),n0(e,e.dyn_ltree,e.dyn_dtree)),B0(e),n&&E0(e)}function dE(e,t,r){return e.pending_buf[e.d_buf+e.last_lit*2]=t>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=t&255,e.pending_buf[e.l_buf+e.last_lit]=r&255,e.last_lit++,t===0?e.dyn_ltree[r*2]++:(e.matches++,t--,e.dyn_ltree[(Wn[r]+ts+1)*2]++,e.dyn_dtree[p0(t)*2]++),e.last_lit===e.lit_bufsize-1}on._tr_init=hE;on._tr_stored_block=_0;on._tr_flush_block=uE;on._tr_tally=dE;on._tr_align=lE});var gc=ct((AL,T0)=>{"use strict";function AE(e,t,r,n){for(var s=e&65535|0,o=e>>>16&65535|0,i=0;r!==0;){i=r>2e3?2e3:r,r-=i;do s=s+t[n++]|0,o=o+s|0;while(--i);s%=65521,o%=65521}return s|o<<16|0}T0.exports=AE});var xc=ct((mL,C0)=>{"use strict";function mE(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=e&1?3988292384^e>>>1:e>>>1;t[r]=e}return t}var pE=mE();function gE(e,t,r,n){var s=pE,o=n+r;e^=-1;for(var i=n;i<o;i++)e=e>>>8^s[(e^t[i])&255];return e^-1}C0.exports=gE});var Io=ct((pL,M0)=>{"use strict";M0.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var O0=ct(ae=>{"use strict";var xt=xe(),Nt=y0(),S0=gc(),Le=xc(),xE=Io(),fr=0,BE=1,EE=3,Ue=4,b0=5,ie=0,w0=1,Gt=-2,_E=-3,Bc=-5,yE=-1,TE=1,So=2,CE=3,ME=4,bE=0,wE=2,Lo=8,IE=9,SE=15,RE=8,FE=29,DE=256,_c=DE+1+FE,LE=30,OE=19,vE=2*_c+1,NE=15,k=3,Ne=258,jt=Ne+k+1,GE=32,Oo=42,yc=69,Ro=73,Fo=91,Do=103,ir=113,rs=666,it=1,ns=2,ar=3,fn=4,UE=3;function Ge(e,t){return e.msg=xE[t],t}function I0(e){return(e<<1)-(e>4?9:0)}function ve(e){for(var t=e.length;--t>=0;)e[t]=0}function Oe(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),r!==0&&(xt.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,t.pending===0&&(t.pending_out=0))}function lt(e,t){Nt._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Oe(e.strm)}function V(e,t){e.pending_buf[e.pending++]=t}function es(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=t&255}function PE(e,t,r,n){var s=e.avail_in;return s>n&&(s=n),s===0?0:(e.avail_in-=s,xt.arraySet(t,e.input,e.next_in,s,r),e.state.wrap===1?e.adler=S0(e.adler,t,s,r):e.state.wrap===2&&(e.adler=Le(e.adler,t,s,r)),e.next_in+=s,e.total_in+=s,s)}function R0(e,t){var r=e.max_chain_length,n=e.strstart,s,o,i=e.prev_length,a=e.nice_match,f=e.strstart>e.w_size-jt?e.strstart-(e.w_size-jt):0,c=e.window,h=e.w_mask,l=e.prev,u=e.strstart+Ne,d=c[n+i-1],A=c[n+i];e.prev_length>=e.good_match&&(r>>=2),a>e.lookahead&&(a=e.lookahead);do if(s=t,!(c[s+i]!==A||c[s+i-1]!==d||c[s]!==c[n]||c[++s]!==c[n+1])){n+=2,s++;do;while(c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&c[++n]===c[++s]&&n<u);if(o=Ne-(u-n),n=u-Ne,o>i){if(e.match_start=t,i=o,o>=a)break;d=c[n+i-1],A=c[n+i]}}while((t=l[t&h])>f&&--r!==0);return i<=e.lookahead?i:e.lookahead}function cr(e){var t=e.w_size,r,n,s,o,i;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-jt)){xt.arraySet(e.window,e.window,t,t,0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do s=e.head[--r],e.head[r]=s>=t?s-t:0;while(--n);n=t,r=n;do s=e.prev[--r],e.prev[r]=s>=t?s-t:0;while(--n);o+=t}if(e.strm.avail_in===0)break;if(n=PE(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=n,e.lookahead+e.insert>=k)for(i=e.strstart-e.insert,e.ins_h=e.window[i],e.ins_h=(e.ins_h<<e.hash_shift^e.window[i+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[i+k-1])&e.hash_mask,e.prev[i&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=i,i++,e.insert--,!(e.lookahead+e.insert<k)););}while(e.lookahead<jt&&e.strm.avail_in!==0)}function HE(e,t){var r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(cr(e),e.lookahead===0&&t===fr)return it;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((e.strstart===0||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,lt(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-jt&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=0,t===Ue?(lt(e,!0),e.strm.avail_out===0?ar:fn):(e.strstart>e.block_start&&(lt(e,!1),e.strm.avail_out===0),it)}function Ec(e,t){for(var r,n;;){if(e.lookahead<jt){if(cr(e),e.lookahead<jt&&t===fr)return it;if(e.lookahead===0)break}if(r=0,e.lookahead>=k&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),r!==0&&e.strstart-r<=e.w_size-jt&&(e.match_length=R0(e,r)),e.match_length>=k)if(n=Nt._tr_tally(e,e.strstart-e.match_start,e.match_length-k),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=k){e.match_length--;do e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else n=Nt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=e.strstart<k-1?e.strstart:k-1,t===Ue?(lt(e,!0),e.strm.avail_out===0?ar:fn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function an(e,t){for(var r,n,s;;){if(e.lookahead<jt){if(cr(e),e.lookahead<jt&&t===fr)return it;if(e.lookahead===0)break}if(r=0,e.lookahead>=k&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=k-1,r!==0&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-jt&&(e.match_length=R0(e,r),e.match_length<=5&&(e.strategy===TE||e.match_length===k&&e.strstart-e.match_start>4096)&&(e.match_length=k-1)),e.prev_length>=k&&e.match_length<=e.prev_length){s=e.strstart+e.lookahead-k,n=Nt._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-k),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=s&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+k-1])&e.hash_mask,r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=k-1,e.strstart++,n&&(lt(e,!1),e.strm.avail_out===0))return it}else if(e.match_available){if(n=Nt._tr_tally(e,0,e.window[e.strstart-1]),n&<(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return it}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Nt._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<k-1?e.strstart:k-1,t===Ue?(lt(e,!0),e.strm.avail_out===0?ar:fn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function kE(e,t){for(var r,n,s,o,i=e.window;;){if(e.lookahead<=Ne){if(cr(e),e.lookahead<=Ne&&t===fr)return it;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=k&&e.strstart>0&&(s=e.strstart-1,n=i[s],n===i[++s]&&n===i[++s]&&n===i[++s])){o=e.strstart+Ne;do;while(n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&n===i[++s]&&s<o);e.match_length=Ne-(o-s),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=k?(r=Nt._tr_tally(e,1,e.match_length-k),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Nt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=0,t===Ue?(lt(e,!0),e.strm.avail_out===0?ar:fn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function JE(e,t){for(var r;;){if(e.lookahead===0&&(cr(e),e.lookahead===0)){if(t===fr)return it;break}if(e.match_length=0,r=Nt._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(lt(e,!1),e.strm.avail_out===0))return it}return e.insert=0,t===Ue?(lt(e,!0),e.strm.avail_out===0?ar:fn):e.last_lit&&(lt(e,!1),e.strm.avail_out===0)?it:ns}function oe(e,t,r,n,s){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=s}var cn;cn=[new oe(0,0,0,0,HE),new oe(4,4,8,4,Ec),new oe(4,5,16,8,Ec),new oe(4,6,32,32,Ec),new oe(4,4,16,16,an),new oe(8,16,32,32,an),new oe(8,16,128,128,an),new oe(8,32,128,256,an),new oe(32,128,258,1024,an),new oe(32,258,258,4096,an)];function zE(e){e.window_size=2*e.w_size,ve(e.head),e.max_lazy_match=cn[e.level].max_lazy,e.good_match=cn[e.level].good_length,e.nice_match=cn[e.level].nice_length,e.max_chain_length=cn[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=k-1,e.match_available=0,e.ins_h=0}function QE(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Lo,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new xt.Buf16(vE*2),this.dyn_dtree=new xt.Buf16((2*LE+1)*2),this.bl_tree=new xt.Buf16((2*OE+1)*2),ve(this.dyn_ltree),ve(this.dyn_dtree),ve(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new xt.Buf16(NE+1),this.heap=new xt.Buf16(2*_c+1),ve(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new xt.Buf16(2*_c+1),ve(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function F0(e){var t;return!e||!e.state?Ge(e,Gt):(e.total_in=e.total_out=0,e.data_type=wE,t=e.state,t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?Oo:ir,e.adler=t.wrap===2?0:1,t.last_flush=fr,Nt._tr_init(t),ie)}function D0(e){var t=F0(e);return t===ie&&zE(e.state),t}function VE(e,t){return!e||!e.state||e.state.wrap!==2?Gt:(e.state.gzhead=t,ie)}function L0(e,t,r,n,s,o){if(!e)return Gt;var i=1;if(t===yE&&(t=6),n<0?(i=0,n=-n):n>15&&(i=2,n-=16),s<1||s>IE||r!==Lo||n<8||n>15||t<0||t>9||o<0||o>ME)return Ge(e,Gt);n===8&&(n=9);var a=new QE;return e.state=a,a.strm=e,a.wrap=i,a.gzhead=null,a.w_bits=n,a.w_size=1<<a.w_bits,a.w_mask=a.w_size-1,a.hash_bits=s+7,a.hash_size=1<<a.hash_bits,a.hash_mask=a.hash_size-1,a.hash_shift=~~((a.hash_bits+k-1)/k),a.window=new xt.Buf8(a.w_size*2),a.head=new xt.Buf16(a.hash_size),a.prev=new xt.Buf16(a.w_size),a.lit_bufsize=1<<s+6,a.pending_buf_size=a.lit_bufsize*4,a.pending_buf=new xt.Buf8(a.pending_buf_size),a.d_buf=1*a.lit_bufsize,a.l_buf=(1+2)*a.lit_bufsize,a.level=t,a.strategy=o,a.method=r,D0(e)}function jE(e,t){return L0(e,t,Lo,SE,RE,bE)}function KE(e,t){var r,n,s,o;if(!e||!e.state||t>b0||t<0)return e?Ge(e,Gt):Gt;if(n=e.state,!e.output||!e.input&&e.avail_in!==0||n.status===rs&&t!==Ue)return Ge(e,e.avail_out===0?Bc:Gt);if(n.strm=e,r=n.last_flush,n.last_flush=t,n.status===Oo)if(n.wrap===2)e.adler=0,V(n,31),V(n,139),V(n,8),n.gzhead?(V(n,(n.gzhead.text?1:0)+(n.gzhead.hcrc?2:0)+(n.gzhead.extra?4:0)+(n.gzhead.name?8:0)+(n.gzhead.comment?16:0)),V(n,n.gzhead.time&255),V(n,n.gzhead.time>>8&255),V(n,n.gzhead.time>>16&255),V(n,n.gzhead.time>>24&255),V(n,n.level===9?2:n.strategy>=So||n.level<2?4:0),V(n,n.gzhead.os&255),n.gzhead.extra&&n.gzhead.extra.length&&(V(n,n.gzhead.extra.length&255),V(n,n.gzhead.extra.length>>8&255)),n.gzhead.hcrc&&(e.adler=Le(e.adler,n.pending_buf,n.pending,0)),n.gzindex=0,n.status=yc):(V(n,0),V(n,0),V(n,0),V(n,0),V(n,0),V(n,n.level===9?2:n.strategy>=So||n.level<2?4:0),V(n,UE),n.status=ir);else{var i=Lo+(n.w_bits-8<<4)<<8,a=-1;n.strategy>=So||n.level<2?a=0:n.level<6?a=1:n.level===6?a=2:a=3,i|=a<<6,n.strstart!==0&&(i|=GE),i+=31-i%31,n.status=ir,es(n,i),n.strstart!==0&&(es(n,e.adler>>>16),es(n,e.adler&65535)),e.adler=1}if(n.status===yc)if(n.gzhead.extra){for(s=n.pending;n.gzindex<(n.gzhead.extra.length&65535)&&!(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),Oe(e),s=n.pending,n.pending===n.pending_buf_size));)V(n,n.gzhead.extra[n.gzindex]&255),n.gzindex++;n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),n.gzindex===n.gzhead.extra.length&&(n.gzindex=0,n.status=Ro)}else n.status=Ro;if(n.status===Ro)if(n.gzhead.name){s=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),Oe(e),s=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.name.length?o=n.gzhead.name.charCodeAt(n.gzindex++)&255:o=0,V(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),o===0&&(n.gzindex=0,n.status=Fo)}else n.status=Fo;if(n.status===Fo)if(n.gzhead.comment){s=n.pending;do{if(n.pending===n.pending_buf_size&&(n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),Oe(e),s=n.pending,n.pending===n.pending_buf_size)){o=1;break}n.gzindex<n.gzhead.comment.length?o=n.gzhead.comment.charCodeAt(n.gzindex++)&255:o=0,V(n,o)}while(o!==0);n.gzhead.hcrc&&n.pending>s&&(e.adler=Le(e.adler,n.pending_buf,n.pending-s,s)),o===0&&(n.status=Do)}else n.status=Do;if(n.status===Do&&(n.gzhead.hcrc?(n.pending+2>n.pending_buf_size&&Oe(e),n.pending+2<=n.pending_buf_size&&(V(n,e.adler&255),V(n,e.adler>>8&255),e.adler=0,n.status=ir)):n.status=ir),n.pending!==0){if(Oe(e),e.avail_out===0)return n.last_flush=-1,ie}else if(e.avail_in===0&&I0(t)<=I0(r)&&t!==Ue)return Ge(e,Bc);if(n.status===rs&&e.avail_in!==0)return Ge(e,Bc);if(e.avail_in!==0||n.lookahead!==0||t!==fr&&n.status!==rs){var f=n.strategy===So?JE(n,t):n.strategy===CE?kE(n,t):cn[n.level].func(n,t);if((f===ar||f===fn)&&(n.status=rs),f===it||f===ar)return e.avail_out===0&&(n.last_flush=-1),ie;if(f===ns&&(t===BE?Nt._tr_align(n):t!==b0&&(Nt._tr_stored_block(n,0,0,!1),t===EE&&(ve(n.head),n.lookahead===0&&(n.strstart=0,n.block_start=0,n.insert=0))),Oe(e),e.avail_out===0))return n.last_flush=-1,ie}return t!==Ue?ie:n.wrap<=0?w0:(n.wrap===2?(V(n,e.adler&255),V(n,e.adler>>8&255),V(n,e.adler>>16&255),V(n,e.adler>>24&255),V(n,e.total_in&255),V(n,e.total_in>>8&255),V(n,e.total_in>>16&255),V(n,e.total_in>>24&255)):(es(n,e.adler>>>16),es(n,e.adler&65535)),Oe(e),n.wrap>0&&(n.wrap=-n.wrap),n.pending!==0?ie:w0)}function XE(e){var t;return!e||!e.state?Gt:(t=e.state.status,t!==Oo&&t!==yc&&t!==Ro&&t!==Fo&&t!==Do&&t!==ir&&t!==rs?Ge(e,Gt):(e.state=null,t===ir?Ge(e,_E):ie))}function YE(e,t){var r=t.length,n,s,o,i,a,f,c,h;if(!e||!e.state||(n=e.state,i=n.wrap,i===2||i===1&&n.status!==Oo||n.lookahead))return Gt;for(i===1&&(e.adler=S0(e.adler,t,r,0)),n.wrap=0,r>=n.w_size&&(i===0&&(ve(n.head),n.strstart=0,n.block_start=0,n.insert=0),h=new xt.Buf8(n.w_size),xt.arraySet(h,t,r-n.w_size,n.w_size,0),t=h,r=n.w_size),a=e.avail_in,f=e.next_in,c=e.input,e.avail_in=r,e.next_in=0,e.input=t,cr(n);n.lookahead>=k;){s=n.strstart,o=n.lookahead-(k-1);do n.ins_h=(n.ins_h<<n.hash_shift^n.window[s+k-1])&n.hash_mask,n.prev[s&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=s,s++;while(--o);n.strstart=s,n.lookahead=k-1,cr(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=k-1,n.match_available=0,e.next_in=f,e.input=c,e.avail_in=a,n.wrap=i,ie}ae.deflateInit=jE;ae.deflateInit2=L0;ae.deflateReset=D0;ae.deflateResetKeep=F0;ae.deflateSetHeader=VE;ae.deflate=KE;ae.deflateEnd=XE;ae.deflateSetDictionary=YE;ae.deflateInfo="pako deflate (from Nodeca project)"});var Tc=ct(hn=>{"use strict";var vo=xe(),v0=!0,N0=!0;try{String.fromCharCode.apply(null,[0])}catch{v0=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{N0=!1}var ss=new vo.Buf8(256);for(Ee=0;Ee<256;Ee++)ss[Ee]=Ee>=252?6:Ee>=248?5:Ee>=240?4:Ee>=224?3:Ee>=192?2:1;var Ee;ss[254]=ss[254]=1;hn.string2buf=function(e){var t,r,n,s,o,i=e.length,a=0;for(s=0;s<i;s++)r=e.charCodeAt(s),(r&64512)===55296&&s+1<i&&(n=e.charCodeAt(s+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),s++)),a+=r<128?1:r<2048?2:r<65536?3:4;for(t=new vo.Buf8(a),o=0,s=0;o<a;s++)r=e.charCodeAt(s),(r&64512)===55296&&s+1<i&&(n=e.charCodeAt(s+1),(n&64512)===56320&&(r=65536+(r-55296<<10)+(n-56320),s++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|r&63):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|r&63):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|r&63);return t};function G0(e,t){if(t<65534&&(e.subarray&&N0||!e.subarray&&v0))return String.fromCharCode.apply(null,vo.shrinkBuf(e,t));for(var r="",n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r}hn.buf2binstring=function(e){return G0(e,e.length)};hn.binstring2buf=function(e){for(var t=new vo.Buf8(e.length),r=0,n=t.length;r<n;r++)t[r]=e.charCodeAt(r);return t};hn.buf2string=function(e,t){var r,n,s,o,i=t||e.length,a=new Array(i*2);for(n=0,r=0;r<i;){if(s=e[r++],s<128){a[n++]=s;continue}if(o=ss[s],o>4){a[n++]=65533,r+=o-1;continue}for(s&=o===2?31:o===3?15:7;o>1&&r<i;)s=s<<6|e[r++]&63,o--;if(o>1){a[n++]=65533;continue}s<65536?a[n++]=s:(s-=65536,a[n++]=55296|s>>10&1023,a[n++]=56320|s&1023)}return G0(a,n)};hn.utf8border=function(e,t){var r;for(t=t||e.length,t>e.length&&(t=e.length),r=t-1;r>=0&&(e[r]&192)===128;)r--;return r<0||r===0?t:r+ss[e[r]]>t?r:t}});var Cc=ct((BL,U0)=>{"use strict";function ZE(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}U0.exports=ZE});var J0=ct(as=>{"use strict";var os=O0(),is=xe(),bc=Tc(),wc=Io(),qE=Cc(),k0=Object.prototype.toString,WE=0,Mc=4,ln=0,P0=1,H0=2,$E=-1,t_=0,e_=8;function hr(e){if(!(this instanceof hr))return new hr(e);this.options=is.assign({level:$E,method:e_,chunkSize:16384,windowBits:15,memLevel:8,strategy:t_,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new qE,this.strm.avail_out=0;var r=os.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==ln)throw new Error(wc[r]);if(t.header&&os.deflateSetHeader(this.strm,t.header),t.dictionary){var n;if(typeof t.dictionary=="string"?n=bc.string2buf(t.dictionary):k0.call(t.dictionary)==="[object ArrayBuffer]"?n=new Uint8Array(t.dictionary):n=t.dictionary,r=os.deflateSetDictionary(this.strm,n),r!==ln)throw new Error(wc[r]);this._dict_set=!0}}hr.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,s,o;if(this.ended)return!1;o=t===~~t?t:t===!0?Mc:WE,typeof e=="string"?r.input=bc.string2buf(e):k0.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new is.Buf8(n),r.next_out=0,r.avail_out=n),s=os.deflate(r,o),s!==P0&&s!==ln)return this.onEnd(s),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===Mc||o===H0))&&(this.options.to==="string"?this.onData(bc.buf2binstring(is.shrinkBuf(r.output,r.next_out))):this.onData(is.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&s!==P0);return o===Mc?(s=os.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===ln):(o===H0&&(this.onEnd(ln),r.avail_out=0),!0)};hr.prototype.onData=function(e){this.chunks.push(e)};hr.prototype.onEnd=function(e){e===ln&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=is.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Ic(e,t){var r=new hr(t);if(r.push(e,!0),r.err)throw r.msg||wc[r.err];return r.result}function r_(e,t){return t=t||{},t.raw=!0,Ic(e,t)}function n_(e,t){return t=t||{},t.gzip=!0,Ic(e,t)}as.Deflate=hr;as.deflate=Ic;as.deflateRaw=r_;as.gzip=n_});var Q0=ct((_L,z0)=>{"use strict";var No=30,s_=12;z0.exports=function(t,r){var n,s,o,i,a,f,c,h,l,u,d,A,m,p,E,y,C,M,T,I,w,L,x,g,B;n=t.state,s=t.next_in,g=t.input,o=s+(t.avail_in-5),i=t.next_out,B=t.output,a=i-(r-t.avail_out),f=i+(t.avail_out-257),c=n.dmax,h=n.wsize,l=n.whave,u=n.wnext,d=n.window,A=n.hold,m=n.bits,p=n.lencode,E=n.distcode,y=(1<<n.lenbits)-1,C=(1<<n.distbits)-1;t:do{m<15&&(A+=g[s++]<<m,m+=8,A+=g[s++]<<m,m+=8),M=p[A&y];e:for(;;){if(T=M>>>24,A>>>=T,m-=T,T=M>>>16&255,T===0)B[i++]=M&65535;else if(T&16){I=M&65535,T&=15,T&&(m<T&&(A+=g[s++]<<m,m+=8),I+=A&(1<<T)-1,A>>>=T,m-=T),m<15&&(A+=g[s++]<<m,m+=8,A+=g[s++]<<m,m+=8),M=E[A&C];r:for(;;){if(T=M>>>24,A>>>=T,m-=T,T=M>>>16&255,T&16){if(w=M&65535,T&=15,m<T&&(A+=g[s++]<<m,m+=8,m<T&&(A+=g[s++]<<m,m+=8)),w+=A&(1<<T)-1,w>c){t.msg="invalid distance too far back",n.mode=No;break t}if(A>>>=T,m-=T,T=i-a,w>T){if(T=w-T,T>l&&n.sane){t.msg="invalid distance too far back",n.mode=No;break t}if(L=0,x=d,u===0){if(L+=h-T,T<I){I-=T;do B[i++]=d[L++];while(--T);L=i-w,x=B}}else if(u<T){if(L+=h+u-T,T-=u,T<I){I-=T;do B[i++]=d[L++];while(--T);if(L=0,u<I){T=u,I-=T;do B[i++]=d[L++];while(--T);L=i-w,x=B}}}else if(L+=u-T,T<I){I-=T;do B[i++]=d[L++];while(--T);L=i-w,x=B}for(;I>2;)B[i++]=x[L++],B[i++]=x[L++],B[i++]=x[L++],I-=3;I&&(B[i++]=x[L++],I>1&&(B[i++]=x[L++]))}else{L=i-w;do B[i++]=B[L++],B[i++]=B[L++],B[i++]=B[L++],I-=3;while(I>2);I&&(B[i++]=B[L++],I>1&&(B[i++]=B[L++]))}}else if(T&64){t.msg="invalid distance code",n.mode=No;break t}else{M=E[(M&65535)+(A&(1<<T)-1)];continue r}break}}else if(T&64)if(T&32){n.mode=s_;break t}else{t.msg="invalid literal/length code",n.mode=No;break t}else{M=p[(M&65535)+(A&(1<<T)-1)];continue e}break}}while(s<o&&i<f);I=m>>3,s-=I,m-=I<<3,A&=(1<<m)-1,t.next_in=s,t.next_out=i,t.avail_in=s<o?5+(o-s):5-(s-o),t.avail_out=i<f?257+(f-i):257-(i-f),n.hold=A,n.bits=m}});var q0=ct((yL,Z0)=>{"use strict";var V0=xe(),un=15,j0=852,K0=592,X0=0,Sc=1,Y0=2,o_=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],i_=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a_=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],c_=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];Z0.exports=function(t,r,n,s,o,i,a,f){var c=f.bits,h=0,l=0,u=0,d=0,A=0,m=0,p=0,E=0,y=0,C=0,M,T,I,w,L,x=null,g=0,B,_=new V0.Buf16(un+1),U=new V0.Buf16(un+1),G=null,P=0,v,at,mt;for(h=0;h<=un;h++)_[h]=0;for(l=0;l<s;l++)_[r[n+l]]++;for(A=c,d=un;d>=1&&_[d]===0;d--);if(A>d&&(A=d),d===0)return o[i++]=1<<24|64<<16|0,o[i++]=1<<24|64<<16|0,f.bits=1,0;for(u=1;u<d&&_[u]===0;u++);for(A<u&&(A=u),E=1,h=1;h<=un;h++)if(E<<=1,E-=_[h],E<0)return-1;if(E>0&&(t===X0||d!==1))return-1;for(U[1]=0,h=1;h<un;h++)U[h+1]=U[h]+_[h];for(l=0;l<s;l++)r[n+l]!==0&&(a[U[r[n+l]]++]=l);if(t===X0?(x=G=a,B=19):t===Sc?(x=o_,g-=257,G=i_,P-=257,B=256):(x=a_,G=c_,B=-1),C=0,l=0,h=u,L=i,m=A,p=0,I=-1,y=1<<A,w=y-1,t===Sc&&y>j0||t===Y0&&y>K0)return 1;for(;;){v=h-p,a[l]<B?(at=0,mt=a[l]):a[l]>B?(at=G[P+a[l]],mt=x[g+a[l]]):(at=32+64,mt=0),M=1<<h-p,T=1<<m,u=T;do T-=M,o[L+(C>>p)+T]=v<<24|at<<16|mt|0;while(T!==0);for(M=1<<h-1;C&M;)M>>=1;if(M!==0?(C&=M-1,C+=M):C=0,l++,--_[h]===0){if(h===d)break;h=r[n+a[l]]}if(h>A&&(C&w)!==I){for(p===0&&(p=A),L+=u,m=h-p,E=1<<m;m+p<d&&(E-=_[m+p],!(E<=0));)m++,E<<=1;if(y+=1<<m,t===Sc&&y>j0||t===Y0&&y>K0)return 1;I=C&w,o[I]=A<<24|m<<16|L-i|0}}return C!==0&&(o[L+C]=h-p<<24|64<<16|0),f.bits=A,0}});var Dd=ct(Kt=>{"use strict";var St=xe(),vc=gc(),ce=xc(),f_=Q0(),cs=q0(),h_=0,Td=1,Cd=2,W0=4,l_=5,Go=6,lr=0,u_=1,d_=2,Ut=-2,Md=-3,Nc=-4,A_=-5,$0=8,bd=1,td=2,ed=3,rd=4,nd=5,sd=6,od=7,id=8,ad=9,cd=10,Ho=11,_e=12,Rc=13,fd=14,Fc=15,hd=16,ld=17,ud=18,dd=19,Uo=20,Po=21,Ad=22,md=23,pd=24,gd=25,xd=26,Dc=27,Bd=28,Ed=29,$=30,Gc=31,m_=32,p_=852,g_=592,x_=15,B_=x_;function _d(e){return(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24)}function E_(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new St.Buf16(320),this.work=new St.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function wd(e){var t;return!e||!e.state?Ut:(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=t.wrap&1),t.mode=bd,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new St.Buf32(p_),t.distcode=t.distdyn=new St.Buf32(g_),t.sane=1,t.back=-1,lr)}function Id(e){var t;return!e||!e.state?Ut:(t=e.state,t.wsize=0,t.whave=0,t.wnext=0,wd(e))}function Sd(e,t){var r,n;return!e||!e.state||(n=e.state,t<0?(r=0,t=-t):(r=(t>>4)+1,t<48&&(t&=15)),t&&(t<8||t>15))?Ut:(n.window!==null&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,Id(e))}function Rd(e,t){var r,n;return e?(n=new E_,e.state=n,n.window=null,r=Sd(e,t),r!==lr&&(e.state=null),r):Ut}function __(e){return Rd(e,B_)}var yd=!0,Lc,Oc;function y_(e){if(yd){var t;for(Lc=new St.Buf32(512),Oc=new St.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(cs(Td,e.lens,0,288,Lc,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;cs(Cd,e.lens,0,32,Oc,0,e.work,{bits:5}),yd=!1}e.lencode=Lc,e.lenbits=9,e.distcode=Oc,e.distbits=5}function Fd(e,t,r,n){var s,o=e.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new St.Buf8(o.wsize)),n>=o.wsize?(St.arraySet(o.window,t,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(s=o.wsize-o.wnext,s>n&&(s=n),St.arraySet(o.window,t,r-n,s,o.wnext),n-=s,n?(St.arraySet(o.window,t,r-n,n,0),o.wnext=n,o.whave=o.wsize):(o.wnext+=s,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=s))),0}function T_(e,t){var r,n,s,o,i,a,f,c,h,l,u,d,A,m,p=0,E,y,C,M,T,I,w,L,x=new St.Buf8(4),g,B,_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Ut;r=e.state,r.mode===_e&&(r.mode=Rc),i=e.next_out,s=e.output,f=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,c=r.hold,h=r.bits,l=a,u=f,L=lr;t:for(;;)switch(r.mode){case bd:if(r.wrap===0){r.mode=Rc;break}for(;h<16;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(r.wrap&2&&c===35615){r.check=0,x[0]=c&255,x[1]=c>>>8&255,r.check=ce(r.check,x,2,0),c=0,h=0,r.mode=td;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=$;break}if((c&15)!==$0){e.msg="unknown compression method",r.mode=$;break}if(c>>>=4,h-=4,w=(c&15)+8,r.wbits===0)r.wbits=w;else if(w>r.wbits){e.msg="invalid window size",r.mode=$;break}r.dmax=1<<w,e.adler=r.check=1,r.mode=c&512?cd:_e,c=0,h=0;break;case td:for(;h<16;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(r.flags=c,(r.flags&255)!==$0){e.msg="unknown compression method",r.mode=$;break}if(r.flags&57344){e.msg="unknown header flags set",r.mode=$;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,r.check=ce(r.check,x,2,0)),c=0,h=0,r.mode=ed;case ed:for(;h<32;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.head&&(r.head.time=c),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,x[2]=c>>>16&255,x[3]=c>>>24&255,r.check=ce(r.check,x,4,0)),c=0,h=0,r.mode=rd;case rd:for(;h<16;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,r.check=ce(r.check,x,2,0)),c=0,h=0,r.mode=nd;case nd:if(r.flags&1024){for(;h<16;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(x[0]=c&255,x[1]=c>>>8&255,r.check=ce(r.check,x,2,0)),c=0,h=0}else r.head&&(r.head.extra=null);r.mode=sd;case sd:if(r.flags&1024&&(d=r.length,d>a&&(d=a),d&&(r.head&&(w=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),St.arraySet(r.head.extra,n,o,d,w)),r.flags&512&&(r.check=ce(r.check,n,d,o)),a-=d,o+=d,r.length-=d),r.length))break t;r.length=0,r.mode=od;case od:if(r.flags&2048){if(a===0)break t;d=0;do w=n[o+d++],r.head&&w&&r.length<65536&&(r.head.name+=String.fromCharCode(w));while(w&&d<a);if(r.flags&512&&(r.check=ce(r.check,n,d,o)),a-=d,o+=d,w)break t}else r.head&&(r.head.name=null);r.length=0,r.mode=id;case id:if(r.flags&4096){if(a===0)break t;d=0;do w=n[o+d++],r.head&&w&&r.length<65536&&(r.head.comment+=String.fromCharCode(w));while(w&&d<a);if(r.flags&512&&(r.check=ce(r.check,n,d,o)),a-=d,o+=d,w)break t}else r.head&&(r.head.comment=null);r.mode=ad;case ad:if(r.flags&512){for(;h<16;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(c!==(r.check&65535)){e.msg="header crc mismatch",r.mode=$;break}c=0,h=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=_e;break;case cd:for(;h<32;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}e.adler=r.check=_d(c),c=0,h=0,r.mode=Ho;case Ho:if(r.havedict===0)return e.next_out=i,e.avail_out=f,e.next_in=o,e.avail_in=a,r.hold=c,r.bits=h,d_;e.adler=r.check=1,r.mode=_e;case _e:if(t===l_||t===Go)break t;case Rc:if(r.last){c>>>=h&7,h-=h&7,r.mode=Dc;break}for(;h<3;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}switch(r.last=c&1,c>>>=1,h-=1,c&3){case 0:r.mode=fd;break;case 1:if(y_(r),r.mode=Uo,t===Go){c>>>=2,h-=2;break t}break;case 2:r.mode=ld;break;case 3:e.msg="invalid block type",r.mode=$}c>>>=2,h-=2;break;case fd:for(c>>>=h&7,h-=h&7;h<32;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if((c&65535)!==(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=$;break}if(r.length=c&65535,c=0,h=0,r.mode=Fc,t===Go)break t;case Fc:r.mode=hd;case hd:if(d=r.length,d){if(d>a&&(d=a),d>f&&(d=f),d===0)break t;St.arraySet(s,n,o,d,i),a-=d,o+=d,f-=d,i+=d,r.length-=d;break}r.mode=_e;break;case ld:for(;h<14;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(r.nlen=(c&31)+257,c>>>=5,h-=5,r.ndist=(c&31)+1,c>>>=5,h-=5,r.ncode=(c&15)+4,c>>>=4,h-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=$;break}r.have=0,r.mode=ud;case ud:for(;r.have<r.ncode;){for(;h<3;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.lens[_[r.have++]]=c&7,c>>>=3,h-=3}for(;r.have<19;)r.lens[_[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,g={bits:r.lenbits},L=cs(h_,r.lens,0,19,r.lencode,0,r.work,g),r.lenbits=g.bits,L){e.msg="invalid code lengths set",r.mode=$;break}r.have=0,r.mode=dd;case dd:for(;r.have<r.nlen+r.ndist;){for(;p=r.lencode[c&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(C<16)c>>>=E,h-=E,r.lens[r.have++]=C;else{if(C===16){for(B=E+2;h<B;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(c>>>=E,h-=E,r.have===0){e.msg="invalid bit length repeat",r.mode=$;break}w=r.lens[r.have-1],d=3+(c&3),c>>>=2,h-=2}else if(C===17){for(B=E+3;h<B;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}c>>>=E,h-=E,w=0,d=3+(c&7),c>>>=3,h-=3}else{for(B=E+7;h<B;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}c>>>=E,h-=E,w=0,d=11+(c&127),c>>>=7,h-=7}if(r.have+d>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=$;break}for(;d--;)r.lens[r.have++]=w}}if(r.mode===$)break;if(r.lens[256]===0){e.msg="invalid code -- missing end-of-block",r.mode=$;break}if(r.lenbits=9,g={bits:r.lenbits},L=cs(Td,r.lens,0,r.nlen,r.lencode,0,r.work,g),r.lenbits=g.bits,L){e.msg="invalid literal/lengths set",r.mode=$;break}if(r.distbits=6,r.distcode=r.distdyn,g={bits:r.distbits},L=cs(Cd,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,g),r.distbits=g.bits,L){e.msg="invalid distances set",r.mode=$;break}if(r.mode=Uo,t===Go)break t;case Uo:r.mode=Po;case Po:if(a>=6&&f>=258){e.next_out=i,e.avail_out=f,e.next_in=o,e.avail_in=a,r.hold=c,r.bits=h,f_(e,u),i=e.next_out,s=e.output,f=e.avail_out,o=e.next_in,n=e.input,a=e.avail_in,c=r.hold,h=r.bits,r.mode===_e&&(r.back=-1);break}for(r.back=0;p=r.lencode[c&(1<<r.lenbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(y&&!(y&240)){for(M=E,T=y,I=C;p=r.lencode[I+((c&(1<<M+T)-1)>>M)],E=p>>>24,y=p>>>16&255,C=p&65535,!(M+E<=h);){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}c>>>=M,h-=M,r.back+=M}if(c>>>=E,h-=E,r.back+=E,r.length=C,y===0){r.mode=xd;break}if(y&32){r.back=-1,r.mode=_e;break}if(y&64){e.msg="invalid literal/length code",r.mode=$;break}r.extra=y&15,r.mode=Ad;case Ad:if(r.extra){for(B=r.extra;h<B;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,h-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=md;case md:for(;p=r.distcode[c&(1<<r.distbits)-1],E=p>>>24,y=p>>>16&255,C=p&65535,!(E<=h);){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(!(y&240)){for(M=E,T=y,I=C;p=r.distcode[I+((c&(1<<M+T)-1)>>M)],E=p>>>24,y=p>>>16&255,C=p&65535,!(M+E<=h);){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}c>>>=M,h-=M,r.back+=M}if(c>>>=E,h-=E,r.back+=E,y&64){e.msg="invalid distance code",r.mode=$;break}r.offset=C,r.extra=y&15,r.mode=pd;case pd:if(r.extra){for(B=r.extra;h<B;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,h-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=$;break}r.mode=gd;case gd:if(f===0)break t;if(d=u-f,r.offset>d){if(d=r.offset-d,d>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=$;break}d>r.wnext?(d-=r.wnext,A=r.wsize-d):A=r.wnext-d,d>r.length&&(d=r.length),m=r.window}else m=s,A=i-r.offset,d=r.length;d>f&&(d=f),f-=d,r.length-=d;do s[i++]=m[A++];while(--d);r.length===0&&(r.mode=Po);break;case xd:if(f===0)break t;s[i++]=r.length,f--,r.mode=Po;break;case Dc:if(r.wrap){for(;h<32;){if(a===0)break t;a--,c|=n[o++]<<h,h+=8}if(u-=f,e.total_out+=u,r.total+=u,u&&(e.adler=r.check=r.flags?ce(r.check,s,u,i-u):vc(r.check,s,u,i-u)),u=f,(r.flags?c:_d(c))!==r.check){e.msg="incorrect data check",r.mode=$;break}c=0,h=0}r.mode=Bd;case Bd:if(r.wrap&&r.flags){for(;h<32;){if(a===0)break t;a--,c+=n[o++]<<h,h+=8}if(c!==(r.total&4294967295)){e.msg="incorrect length check",r.mode=$;break}c=0,h=0}r.mode=Ed;case Ed:L=u_;break t;case $:L=Md;break t;case Gc:return Nc;case m_:default:return Ut}return e.next_out=i,e.avail_out=f,e.next_in=o,e.avail_in=a,r.hold=c,r.bits=h,(r.wsize||u!==e.avail_out&&r.mode<$&&(r.mode<Dc||t!==W0))&&Fd(e,e.output,e.next_out,u-e.avail_out)?(r.mode=Gc,Nc):(l-=e.avail_in,u-=e.avail_out,e.total_in+=l,e.total_out+=u,r.total+=u,r.wrap&&u&&(e.adler=r.check=r.flags?ce(r.check,s,u,e.next_out-u):vc(r.check,s,u,e.next_out-u)),e.data_type=r.bits+(r.last?64:0)+(r.mode===_e?128:0)+(r.mode===Uo||r.mode===Fc?256:0),(l===0&&u===0||t===W0)&&L===lr&&(L=A_),L)}function C_(e){if(!e||!e.state)return Ut;var t=e.state;return t.window&&(t.window=null),e.state=null,lr}function M_(e,t){var r;return!e||!e.state||(r=e.state,!(r.wrap&2))?Ut:(r.head=t,t.done=!1,lr)}function b_(e,t){var r=t.length,n,s,o;return!e||!e.state||(n=e.state,n.wrap!==0&&n.mode!==Ho)?Ut:n.mode===Ho&&(s=1,s=vc(s,t,r,0),s!==n.check)?Md:(o=Fd(e,t,r,r),o?(n.mode=Gc,Nc):(n.havedict=1,lr))}Kt.inflateReset=Id;Kt.inflateReset2=Sd;Kt.inflateResetKeep=wd;Kt.inflateInit=__;Kt.inflateInit2=Rd;Kt.inflate=T_;Kt.inflateEnd=C_;Kt.inflateGetHeader=M_;Kt.inflateSetDictionary=b_;Kt.inflateInfo="pako inflate (from Nodeca project)"});var Uc=ct((CL,Ld)=>{"use strict";Ld.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var vd=ct((ML,Od)=>{"use strict";function w_(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}Od.exports=w_});var Gd=ct(hs=>{"use strict";var dn=Dd(),fs=xe(),ko=Tc(),st=Uc(),Pc=Io(),I_=Cc(),S_=vd(),Nd=Object.prototype.toString;function ur(e){if(!(this instanceof ur))return new ur(e);this.options=fs.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,t.windowBits===0&&(t.windowBits=-15)),t.windowBits>=0&&t.windowBits<16&&!(e&&e.windowBits)&&(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(t.windowBits&15||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new I_,this.strm.avail_out=0;var r=dn.inflateInit2(this.strm,t.windowBits);if(r!==st.Z_OK)throw new Error(Pc[r]);if(this.header=new S_,dn.inflateGetHeader(this.strm,this.header),t.dictionary&&(typeof t.dictionary=="string"?t.dictionary=ko.string2buf(t.dictionary):Nd.call(t.dictionary)==="[object ArrayBuffer]"&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=dn.inflateSetDictionary(this.strm,t.dictionary),r!==st.Z_OK)))throw new Error(Pc[r])}ur.prototype.push=function(e,t){var r=this.strm,n=this.options.chunkSize,s=this.options.dictionary,o,i,a,f,c,h=!1;if(this.ended)return!1;i=t===~~t?t:t===!0?st.Z_FINISH:st.Z_NO_FLUSH,typeof e=="string"?r.input=ko.binstring2buf(e):Nd.call(e)==="[object ArrayBuffer]"?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new fs.Buf8(n),r.next_out=0,r.avail_out=n),o=dn.inflate(r,st.Z_NO_FLUSH),o===st.Z_NEED_DICT&&s&&(o=dn.inflateSetDictionary(this.strm,s)),o===st.Z_BUF_ERROR&&h===!0&&(o=st.Z_OK,h=!1),o!==st.Z_STREAM_END&&o!==st.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===st.Z_STREAM_END||r.avail_in===0&&(i===st.Z_FINISH||i===st.Z_SYNC_FLUSH))&&(this.options.to==="string"?(a=ko.utf8border(r.output,r.next_out),f=r.next_out-a,c=ko.buf2string(r.output,a),r.next_out=f,r.avail_out=n-f,f&&fs.arraySet(r.output,r.output,a,f,0),this.onData(c)):this.onData(fs.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(h=!0)}while((r.avail_in>0||r.avail_out===0)&&o!==st.Z_STREAM_END);return o===st.Z_STREAM_END&&(i=st.Z_FINISH),i===st.Z_FINISH?(o=dn.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===st.Z_OK):(i===st.Z_SYNC_FLUSH&&(this.onEnd(st.Z_OK),r.avail_out=0),!0)};ur.prototype.onData=function(e){this.chunks.push(e)};ur.prototype.onEnd=function(e){e===st.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=fs.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function Hc(e,t){var r=new ur(t);if(r.push(e,!0),r.err)throw r.msg||Pc[r.err];return r.result}function R_(e,t){return t=t||{},t.raw=!0,Hc(e,t)}hs.Inflate=ur;hs.inflate=Hc;hs.inflateRaw=R_;hs.ungzip=Hc});var Hd=ct((wL,Pd)=>{"use strict";var F_=xe().assign,D_=J0(),L_=Gd(),O_=Uc(),Ud={};F_(Ud,D_,L_,O_);Pd.exports=Ud});var kd=ct(()=>{});var ls={};ut(ls,{CesiumIonLoader:()=>ec,TILE3D_TYPE:()=>_t,Tile3DBatchTable:()=>ue,Tile3DFeatureTable:()=>kt,Tile3DSubtreeLoader:()=>Kr,Tile3DWriter:()=>Yd,Tiles3DArchive:()=>An,Tiles3DArchiveFileLoader:()=>zd,Tiles3DLoader:()=>rr,_getIonTilesetMetadata:()=>To});gs(ls,gr(pn(),1));async function Pt(e,t,r,n){return n._parse(e,t,r,n)}function J(e,t){if(!e)throw new Error(t||"loader assertion failed.")}var Yt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},n1=Yt.self||Yt.window||Yt.global||{},s1=Yt.window||Yt.self||Yt.global||{},o1=Yt.global||Yt.self||Yt.window||{},i1=Yt.document||{};var Et=Boolean(typeof process!="object"||String(process)!=="[object process]"||process.browser);var Zc=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),a1=Zc&&parseFloat(Zc[1])||0;function gn(e){globalThis.loaders||={},globalThis.loaders.modules||={},Object.assign(globalThis.loaders.modules,e)}function Qo(e){return globalThis.loaders?.modules?.[e]||null}function c1(){return globalThis._loadersgl_?.version||(globalThis._loadersgl_=globalThis._loadersgl_||{},globalThis._loadersgl_.version="4.2.0-alpha.6"),globalThis._loadersgl_.version}var qc=c1();function Wc(e,t){if(!e)throw new Error(t||"loaders.gl assertion failed.")}var Zt={self:typeof self<"u"&&self,window:typeof window<"u"&&window,global:typeof global<"u"&&global,document:typeof document<"u"&&document},Z_=Zt.self||Zt.window||Zt.global||{},q_=Zt.window||Zt.self||Zt.global||{},W_=Zt.global||Zt.self||Zt.window||{},$_=Zt.document||{};var xr=typeof process!="object"||String(process)!=="[object process]"||process.browser,xs=typeof importScripts=="function",ty=typeof window<"u"&&typeof window.orientation<"u",$c=typeof process<"u"&&process.version&&/v([0-9]*)/.exec(process.version),ey=$c&&parseFloat($c[1])||0;var Vo={};async function qt(e,t=null,r={},n=null){return t&&(e=tf(e,t,r,n)),Vo[e]=Vo[e]||f1(e),await Vo[e]}function tf(e,t,r={},n=null){if(!r.useLocalLibraries&&e.startsWith("http"))return e;n=n||e;let s=r.modules||{};return s[n]?s[n]:xr?r.CDN?(Wc(r.CDN.startsWith("http")),`${r.CDN}/${t}@${qc}/dist/libs/${n}`):xs?`../src/libs/${n}`:`modules/${t}/src/libs/${n}`:`modules/${t}/dist/libs/${n}`}async function f1(e){if(e.endsWith("wasm"))return await l1(e);if(!xr)try{let{requireFromFile:r}=globalThis.loaders||{};return await r?.(e)}catch(r){return console.error(r),null}if(xs)return importScripts(e);let t=await u1(e);return h1(t,e)}function h1(e,t){if(!xr){let{requireFromString:n}=globalThis.loaders||{};return n?.(e,t)}if(xs)return eval.call(globalThis,e),null;let r=document.createElement("script");r.id=t;try{r.appendChild(document.createTextNode(e))}catch{r.text=e}return document.body.appendChild(r),null}async function l1(e){let{readFileAsArrayBuffer:t}=globalThis.loaders||{};return xr||!t||e.startsWith("http")?await(await fetch(e)).arrayBuffer():await t(e)}async function u1(e){let{readFileAsText:t}=globalThis.loaders||{};return xr||!t||e.startsWith("http")?await(await fetch(e)).text():await t(e)}function rf(e,t=5){return typeof e=="string"?e.slice(0,t):ArrayBuffer.isView(e)?ef(e.buffer,e.byteOffset,t):e instanceof ArrayBuffer?ef(e,0,t):""}function ef(e,t,r){if(e.byteLength<=t+r)return"";let n=new DataView(e),s="";for(let o=0;o<r;o++)s+=String.fromCharCode(n.getUint8(t+o));return s}function jo(e){try{return JSON.parse(e)}catch{throw new Error(`Failed to parse JSON from data starting with "${rf(e)}"`)}}function Te(e,t,r){if(r=r||e.byteLength,e.byteLength<r||t.byteLength<r)return!1;let n=new Uint8Array(e),s=new Uint8Array(t);for(let o=0;o<n.length;++o)if(n[o]!==s[o])return!1;return!0}function Br(...e){return nf(e)}function nf(e){let t=e.map(o=>o instanceof ArrayBuffer?new Uint8Array(o):o),r=t.reduce((o,i)=>o+i.byteLength,0),n=new Uint8Array(r),s=0;for(let o of t)n.set(o,s),s+=o.byteLength;return n.buffer}function Je(e,t,r){let n=r!==void 0?new Uint8Array(e).subarray(t,t+r):new Uint8Array(e).subarray(t);return new Uint8Array(n).buffer}function bt(e,t){return J(e>=0),J(t>0),e+(t-1)&~(t-1)}function Ko(e,t,r){let n;if(e instanceof ArrayBuffer)n=new Uint8Array(e);else{let s=e.byteOffset,o=e.byteLength;n=new Uint8Array(e.buffer||e.arrayBuffer,s,o)}return t.set(n,r),r+bt(n.byteLength,4)}function Xo(e,t){let r=e.length,s=Math.ceil(r/t)*t-r,o="";for(let i=0;i<s;++i)o+=" ";return e+o}function Er(e,t,r,n){if(e)for(let s=0;s<n;s++)e.setUint8(t+s,r.charCodeAt(s));return t+n}function xn(e,t,r,n){if(e)for(let s=0;s<n;s++)e.setUint8(t+s,r[s]);return t+n}function sf(e,t,r,n){let s=bt(r.byteLength,n),o=s-r.byteLength;if(e){let i=new Uint8Array(e.buffer,e.byteOffset+t,r.byteLength),a=new Uint8Array(r);i.set(a);for(let f=0;f<o;++f)e.setUint8(t+r.byteLength+f,32)}return t+=s,t}function Bs(e,t,r,n){let o=new TextEncoder().encode(r);return t=sf(e,t,o,n),t}async function Bn(e){let t=[];for await(let r of e)t.push(r);return Br(...t)}function of(e){return e&&typeof e=="object"&&e.isBuffer}function _r(e){if(of(e))return e;if(e instanceof ArrayBuffer)return e;if(ArrayBuffer.isView(e))return e.byteOffset===0&&e.byteLength===e.buffer.byteLength?e.buffer:e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);if(typeof e=="string"){let t=e;return new TextEncoder().encode(t).buffer}if(e&&typeof e=="object"&&e._toArrayBuffer)return e._toArrayBuffer();throw new Error("toArrayBuffer")}function yr(e){return t=>new Promise((r,n)=>e(t,(s,o)=>s?n(s):r(o)))}var Tr={};ut(Tr,{dirname:()=>A1,filename:()=>d1,join:()=>m1,resolve:()=>p1});function af(){if(typeof process<"u"&&typeof process.cwd<"u")return process.cwd();let e=window.location?.pathname;return e?.slice(0,e.lastIndexOf("/")+1)||""}function d1(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(t+1):""}function A1(e){let t=e?e.lastIndexOf("/"):-1;return t>=0?e.substr(0,t):""}function m1(...e){let t="/";return e=e.map((r,n)=>(n&&(r=r.replace(new RegExp(`^${t}`),"")),n!==e.length-1&&(r=r.replace(new RegExp(`${t}$`),"")),r)),e.join(t)}function p1(...e){let t=[];for(let o=0;o<e.length;o++)t[o]=e[o];let r="",n=!1,s;for(let o=t.length-1;o>=-1&&!n;o--){let i;o>=0?i=t[o]:(s===void 0&&(s=af()),i=s),i.length!==0&&(r=`${i}/${r}`,n=i.charCodeAt(0)===En)}return r=g1(r,!n),n?`/${r}`:r.length>0?r:"."}var En=47,Yo=46;function g1(e,t){let r="",n=-1,s=0,o,i=!1;for(let a=0;a<=e.length;++a){if(a<e.length)o=e.charCodeAt(a);else{if(o===En)break;o=En}if(o===En){if(!(n===a-1||s===1))if(n!==a-1&&s===2){if(r.length<2||!i||r.charCodeAt(r.length-1)!==Yo||r.charCodeAt(r.length-2)!==Yo){if(r.length>2){let f=r.length-1,c=f;for(;c>=0&&r.charCodeAt(c)!==En;--c);if(c!==f){r=c===-1?"":r.slice(0,c),n=a,s=0,i=!1;continue}}else if(r.length===2||r.length===1){r="",n=a,s=0,i=!1;continue}}t&&(r.length>0?r+="/..":r="..",i=!0)}else{let f=e.slice(n+1,a);r.length>0?r+=`/${f}`:r=f,i=!1}n=a,s=0}else o===Yo&&s!==-1?++s:s=-1}return r}var _n=new Error("Not implemented"),Es=class{handle;size=0;bigsize=0n;url="";constructor(t,r,n){if(globalThis.loaders?.NodeFile)return new globalThis.loaders.NodeFile(t,r,n);throw Et?new Error("Can't instantiate NodeFile in browser."):new Error("Can't instantiate NodeFile. Make sure to import @loaders.gl/polyfills first.")}async read(t,r){throw _n}async write(t,r,n){throw _n}async stat(){throw _n}async truncate(t){throw _n}async append(t){throw _n}async close(){}};var Zo=e=>e?.getUint8&&e?.slice&&e?.length;var yn=class{file;constructor(t,r=!1){this.file=new Es(t,r?"a+":"r")}async truncate(t){await this.file.truncate(t)}async append(t){await this.file.append(t)}async destroy(){await this.file.close()}async getUint8(t){let r=await this.file.read(t,1),n=new Uint8Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint16(t){let r=await this.file.read(t,2),n=new Uint16Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getUint32(t){let r=await this.file.read(t,4),n=new Uint32Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async getBigUint64(t){let r=await this.file.read(t,8),n=new BigInt64Array(r).at(0);if(n===void 0)throw new Error("something went wrong");return n}async slice(t,r){let n=r-t;if(n>Number.MAX_SAFE_INTEGER)throw new Error("too big slice");let s=Number(n);return await this.file.read(t,s)}get length(){return this.file.bigsize}};var Cr=e=>{if(e>Number.MAX_SAFE_INTEGER)throw new Error("Offset is out of bounds");return Number(e)},Tn=class{file;constructor(t){this.file=t}async destroy(){}async getUint8(t){return this.file.getUint8(Cr(t))}async getUint16(t){return this.file.getUint16(Cr(t),!0)}async getUint32(t){return this.file.getUint32(Cr(t),!0)}async getBigUint64(t){return this.file.getBigUint64(Cr(t),!0)}async slice(t,r){return this.file.buffer.slice(Cr(t),Cr(r))}get length(){return BigInt(this.file.byteLength)}};var eT=1/Math.PI*180,rT=1/180*Math.PI,x1={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...x1}};var et=globalThis.mathgl.config;function qo(e,{precision:t=et.precision}={}){return e=B1(e),"".concat(parseFloat(e.toPrecision(t)))}function Wt(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Wo(e,t,r){return _1(e,n=>Math.max(t,Math.min(r,n)))}function _s(e,t,r){let n=et.EPSILON;r&&(et.EPSILON=r);try{if(e===t)return!0;if(Wt(e)&&Wt(t)){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!_s(e[s],t[s]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=et.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{et.EPSILON=n}}function B1(e){return Math.round(e/et.EPSILON)*et.EPSILON}function E1(e){return e.clone?e.clone():new Array(e.length)}function _1(e,t,r){if(Wt(e)){let n=e;r=r||E1(n);for(let s=0;s<r.length&&s<n.length;++s){let o=typeof e=="number"?e:e[s];r[s]=t(o,s,r)}return r}return t(e)}function y1(e){function t(){var r=Reflect.construct(e,Array.from(arguments));return Object.setPrototypeOf(r,Object.getPrototypeOf(this)),r}return t.prototype=Object.create(e.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e,t}var Mr=class extends y1(Array){clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:Wt(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(et)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+qo(this[n],t);return"".concat(t.printTypes?this.constructor.name:"","[").concat(r,"]")}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!_s(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let s=0;s<this.ELEMENTS;++s){let o=t[s],i=typeof r=="number"?r:r[s];this[s]=o+n*(i-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(et.debug&&!this.validate())throw new Error("math.gl: ".concat(this.constructor.name," some fields set to invalid numbers'"));return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function T1(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function rt(e){if(!Number.isFinite(e))throw new Error("Invalid number ".concat(JSON.stringify(e)));return e}function cf(e,t,r=""){if(et.debug&&!T1(e,t))throw new Error("math.gl: ".concat(r," some fields set to invalid numbers'"));return e}function $o(e,t){if(!e)throw new Error("math.gl assertion ".concat(t))}var br=class extends Mr{get x(){return this[0]}set x(t){this[0]=rt(t)}get y(){return this[1]}set y(t){this[1]=rt(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let s=this[n]-t[n];r+=s*s}return rt(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return rt(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return $o(t>=0&&t<this.ELEMENTS,"index is out of range"),rt(this[t])}setComponent(t,r){return $o(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var wr=typeof Float32Array<"u"?Float32Array:Array;var dT=Math.PI/180;function w1(){let e=new wr(2);return wr!=Float32Array&&(e[0]=0,e[1]=0),e}function hf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e}function lf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s+r[4],e[1]=r[1]*n+r[3]*s+r[5],e}function ys(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[3]*s+r[6],e[1]=r[1]*n+r[4]*s+r[7],e}function uf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[4]*s+r[12],e[1]=r[1]*n+r[5]*s+r[13],e}var AT=function(){let e=w1();return function(t,r,n,s,o,i){let a,f;for(r||(r=2),n||(n=0),s?f=Math.min(s*r+n,t.length):f=t.length,a=n;a<f;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,i),t[a]=e[0],t[a+1]=e[1];return t}}();function df(e,t,r){let n=t[0],s=t[1],o=r[3]*n+r[7]*s||1;return e[0]=(r[0]*n+r[4]*s)/o,e[1]=(r[1]*n+r[5]*s)/o,e}function Af(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o||1;return e[0]=(r[0]*n+r[4]*s+r[8]*o)/i,e[1]=(r[1]*n+r[5]*s+r[9]*o)/i,e[2]=(r[2]*n+r[6]*s+r[10]*o)/i,e}function mf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e}function pf(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=r[0]*n+r[3]*s+r[6]*o,e[1]=r[1]*n+r[4]*s+r[7]*o,e[2]=r[2]*n+r[5]*s+r[8]*o,e[3]=t[3],e}var ze=class extends br{constructor(t=0,r=0){super(2),Wt(t)&&arguments.length===1?this.copy(t):(et.debug&&(rt(t),rt(r)),this[0]=t,this[1]=r)}set(t,r){return this[0]=t,this[1]=r,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this.check()}fromObject(t){return et.debug&&(rt(t.x),rt(t.y)),this[0]=t.x,this[1]=t.y,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t}get ELEMENTS(){return 2}horizontalAngle(){return Math.atan2(this.y,this.x)}verticalAngle(){return Math.atan2(this.x,this.y)}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return uf(this,this,t),this.check()}transformAsVector(t){return df(this,this,t),this.check()}transformByMatrix3(t){return ys(this,this,t),this.check()}transformByMatrix2x3(t){return lf(this,this,t),this.check()}transformByMatrix2(t){return hf(this,this,t),this.check()}};function I1(){let e=new wr(3);return wr!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function S1(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function gf(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],f=r[2];return e[0]=s*f-o*a,e[1]=o*i-n*f,e[2]=n*a-s*i,e}function xf(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*s+r[8]*o+r[12])/i,e[1]=(r[1]*n+r[5]*s+r[9]*o+r[13])/i,e[2]=(r[2]*n+r[6]*s+r[10]*o+r[14])/i,e}function Ts(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=n*r[0]+s*r[3]+o*r[6],e[1]=n*r[1]+s*r[4]+o*r[7],e[2]=n*r[2]+s*r[5]+o*r[8],e}function Bf(e,t,r){let n=r[0],s=r[1],o=r[2],i=r[3],a=t[0],f=t[1],c=t[2],h=s*c-o*f,l=o*a-n*c,u=n*f-s*a,d=s*u-o*l,A=o*h-n*u,m=n*l-s*h,p=i*2;return h*=p,l*=p,u*=p,d*=2,A*=2,m*=2,e[0]=a+h+d,e[1]=f+l+A,e[2]=c+u+m,e}function Ef(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0],o[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),o[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function _f(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),o[1]=s[1],o[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function yf(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),o[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),o[2]=s[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Tf(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2],f=Math.sqrt((r*r+n*n+s*s)*(o*o+i*i+a*a)),c=f&&S1(e,t)/f;return Math.acos(Math.min(Math.max(c,-1),1))}var TT=function(){let e=I1();return function(t,r,n,s,o,i){let a,f;for(r||(r=3),n||(n=0),s?f=Math.min(s*r+n,t.length):f=t.length,a=n;a<f;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}();var ti=[0,0,0],Cs,fe=class extends br{static get ZERO(){return Cs||(Cs=new fe(0,0,0),Object.freeze(Cs)),Cs}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&Wt(t)?this.copy(t):(et.debug&&(rt(t),rt(r),rt(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return et.debug&&(rt(t.x),rt(t.y),rt(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=rt(t)}angle(t){return Tf(this,t)}cross(t){return gf(this,this,t),this.check()}rotateX({radians:t,origin:r=ti}){return Ef(this,this,r,t),this.check()}rotateY({radians:t,origin:r=ti}){return _f(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=ti}){return yf(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return xf(this,this,t),this.check()}transformAsVector(t){return Af(this,this,t),this.check()}transformByMatrix3(t){return Ts(this,this,t),this.check()}transformByMatrix2(t){return mf(this,this,t),this.check()}transformByQuaternion(t){return Bf(this,this,t),this.check()}};var Ms=class extends Mr{toString(){let t="[";if(et.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=" ".concat(this[n*this.RANK+r])}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=" ".concat(this[r])}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=rt(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)r[s]=this[n+s];return r}setColumn(t,r){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)this[n+s]=r[s];return this}};function Cf(e,t){if(e===t){let r=t[1],n=t[2],s=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=s}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function Mf(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],f=t[6],c=t[7],h=t[8],l=h*i-a*c,u=-h*o+a*f,d=c*o-i*f,A=r*l+n*u+s*d;return A?(A=1/A,e[0]=l*A,e[1]=(-h*n+s*c)*A,e[2]=(a*n-s*i)*A,e[3]=u*A,e[4]=(h*r-s*f)*A,e[5]=(-a*r+s*o)*A,e[6]=d*A,e[7]=(-c*r+n*f)*A,e[8]=(i*r-n*o)*A,e):null}function bf(e){let t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],i=e[5],a=e[6],f=e[7],c=e[8];return t*(c*o-i*f)+r*(-c*s+i*a)+n*(f*s-o*a)}function ei(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=r[0],d=r[1],A=r[2],m=r[3],p=r[4],E=r[5],y=r[6],C=r[7],M=r[8];return e[0]=u*n+d*i+A*c,e[1]=u*s+d*a+A*h,e[2]=u*o+d*f+A*l,e[3]=m*n+p*i+E*c,e[4]=m*s+p*a+E*h,e[5]=m*o+p*f+E*l,e[6]=y*n+C*i+M*c,e[7]=y*s+C*a+M*h,e[8]=y*o+C*f+M*l,e}function wf(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=r[0],d=r[1];return e[0]=n,e[1]=s,e[2]=o,e[3]=i,e[4]=a,e[5]=f,e[6]=u*n+d*i+c,e[7]=u*s+d*a+h,e[8]=u*o+d*f+l,e}function If(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=Math.sin(r),d=Math.cos(r);return e[0]=d*n+u*i,e[1]=d*s+u*a,e[2]=d*o+u*f,e[3]=d*i-u*n,e[4]=d*a-u*s,e[5]=d*f-u*o,e[6]=c,e[7]=h,e[8]=l,e}function ri(e,t,r){let n=r[0],s=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=s*t[3],e[4]=s*t[4],e[5]=s*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function Sf(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,f=s+s,c=r*i,h=n*i,l=n*a,u=s*i,d=s*a,A=s*f,m=o*i,p=o*a,E=o*f;return e[0]=1-l-A,e[3]=h-E,e[6]=u+p,e[1]=h+E,e[4]=1-c-A,e[7]=d-m,e[2]=u-p,e[5]=d+m,e[8]=1-c-l,e}var ni;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(ni||(ni={}));var R1=Object.freeze([1,0,0,0,1,0,0,0,1]),he=class extends Ms{static get IDENTITY(){return D1()}static get ZERO(){return F1()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return ni}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(R1)}fromObject(t){return this.check()}fromQuaternion(t){return Sf(this,t),this.check()}set(t,r,n,s,o,i,a,f,c){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(t,r,n,s,o,i,a,f,c){return this[0]=t,this[1]=s,this[2]=a,this[3]=r,this[4]=o,this[5]=f,this[6]=n,this[7]=i,this[8]=c,this.check()}determinant(){return bf(this)}transpose(){return Cf(this,this),this.check()}invert(){return Mf(this,this),this.check()}multiplyLeft(t){return ei(this,t,this),this.check()}multiplyRight(t){return ei(this,this,t),this.check()}rotate(t){return If(this,this,t),this.check()}scale(t){return Array.isArray(t)?ri(this,this,t):ri(this,this,[t,t]),this.check()}translate(t){return wf(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=ys(r||[-0,-0],t,this);break;case 3:n=Ts(r||[-0,-0,-0],t,this);break;case 4:n=pf(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return cf(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},bs,ws=null;function F1(){return bs||(bs=new he([0,0,0,0,0,0,0,0,0]),Object.freeze(bs)),bs}function D1(){return ws||(ws=new he,Object.freeze(ws)),ws}var Ir;(function(e){e[e.ADD=1]="ADD",e[e.REPLACE=2]="REPLACE"})(Ir||(Ir={}));var Ce;(function(e){e.EMPTY="empty",e.SCENEGRAPH="scenegraph",e.POINTCLOUD="pointcloud",e.MESH="mesh"})(Ce||(Ce={}));var Cn;(function(e){e.I3S="I3S",e.TILES3D="TILES3D"})(Cn||(Cn={}));var le;(function(e){e.GEOMETRIC_ERROR="geometricError",e.MAX_SCREEN_THRESHOLD="maxScreenThreshold"})(le||(le={}));var Sr="4.2.0-alpha.6";var _t={COMPOSITE:"cmpt",POINT_CLOUD:"pnts",BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",GEOMETRY:"geom",VECTOR:"vect",GLTF:"glTF"},AC=Object.keys(_t),Me={BATCHED_MODEL:[98,51,100,109],INSTANCED_MODEL:[105,51,100,109],POINT_CLOUD:[112,110,116,115],COMPOSITE:[99,109,112,116]};function si(e,t,r){J(e instanceof ArrayBuffer);let n=new TextDecoder("utf8"),s=new Uint8Array(e,t,r);return n.decode(s)}function Rf(e,t=0){let r=new DataView(e);return`${String.fromCharCode(r.getUint8(t+0))}${String.fromCharCode(r.getUint8(t+1))}${String.fromCharCode(r.getUint8(t+2))}${String.fromCharCode(r.getUint8(t+3))}`}var Ff="4.2.0-alpha.6";var Df={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:Ff,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function Lf(e){switch(e.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function oi(e){let t=1/0,r=1/0,n=1/0,s=-1/0,o=-1/0,i=-1/0,a=e.POSITION?e.POSITION.value:[],f=a&&a.length;for(let c=0;c<f;c+=3){let h=a[c],l=a[c+1],u=a[c+2];t=h<t?h:t,r=l<r?l:r,n=u<n?u:n,s=h>s?h:s,o=l>o?l:o,i=u>i?u:i}return[[t,r,n],[s,o,i]]}function ii(e,t,r){let n=Lf(t.value),s=r||Of(t);return{name:e,type:{type:"fixed-size-list",listSize:t.size,children:[{name:"value",type:n}]},nullable:!1,metadata:s}}function Of(e){let t={};return"byteOffset"in e&&(t.byteOffset=e.byteOffset.toString(10)),"byteStride"in e&&(t.byteStride=e.byteStride.toString(10)),"normalized"in e&&(t.normalized=e.normalized.toString()),t}function Nf(e,t,r){let n=Gf(t.metadata),s=[],o=L1(t.attributes);for(let i in e){let a=e[i],f=vf(i,a,o[i]);s.push(f)}if(r){let i=vf("indices",r);s.push(i)}return{fields:s,metadata:n}}function L1(e){let t={};for(let r in e){let n=e[r];t[n.name||"undefined"]=n}return t}function vf(e,t,r){let n=r?Gf(r.metadata):void 0;return ii(e,t,n)}function Gf(e){Object.entries(e);let t={};for(let r in e)t[`${r}.string`]=JSON.stringify(e[r]);return t}var Uf={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},O1={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},v1=4,Mn=class{draco;decoder;metadataQuerier;constructor(t){this.draco=t,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(t,r={}){let n=new this.draco.DecoderBuffer;n.Init(new Int8Array(t),t.byteLength),this._disableAttributeTransforms(r);let s=this.decoder.GetEncodedGeometryType(n),o=s===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let i;switch(s){case this.draco.TRIANGULAR_MESH:i=this.decoder.DecodeBufferToMesh(n,o);break;case this.draco.POINT_CLOUD:i=this.decoder.DecodeBufferToPointCloud(n,o);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!i.ok()||!o.ptr){let u=`DRACO decompression failed: ${i.error_msg()}`;throw new Error(u)}let a=this._getDracoLoaderData(o,s,r),f=this._getMeshData(o,a,r),c=oi(f.attributes),h=Nf(f.attributes,a,f.indices);return{loader:"draco",loaderData:a,header:{vertexCount:o.num_points(),boundingBox:c},...f,schema:h}}finally{this.draco.destroy(n),o&&this.draco.destroy(o)}}_getDracoLoaderData(t,r,n){let s=this._getTopLevelMetadata(t),o=this._getDracoAttributes(t,n);return{geometry_type:r,num_attributes:t.num_attributes(),num_points:t.num_points(),num_faces:t instanceof this.draco.Mesh?t.num_faces():0,metadata:s,attributes:o}}_getDracoAttributes(t,r){let n={};for(let s=0;s<t.num_attributes();s++){let o=this.decoder.GetAttribute(t,s),i=this._getAttributeMetadata(t,s);n[o.unique_id()]={unique_id:o.unique_id(),attribute_type:o.attribute_type(),data_type:o.data_type(),num_components:o.num_components(),byte_offset:o.byte_offset(),byte_stride:o.byte_stride(),normalized:o.normalized(),attribute_index:s,metadata:i};let a=this._getQuantizationTransform(o,r);a&&(n[o.unique_id()].quantization_transform=a);let f=this._getOctahedronTransform(o,r);f&&(n[o.unique_id()].octahedron_transform=f)}return n}_getMeshData(t,r,n){let s=this._getMeshAttributes(r,t,n);if(!s.POSITION)throw new Error("DRACO: No position attribute found.");if(t instanceof this.draco.Mesh)switch(n.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:s,indices:{value:this._getTriangleStripIndices(t),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:s,indices:{value:this._getTriangleListIndices(t),size:1}}}return{topology:"point-list",mode:0,attributes:s}}_getMeshAttributes(t,r,n){let s={};for(let o of Object.values(t.attributes)){let i=this._deduceAttributeName(o,n);o.name=i;let a=this._getAttributeValues(r,o);if(a){let{value:f,size:c}=a;s[i]={value:f,size:c,byteOffset:o.byte_offset,byteStride:o.byte_stride,normalized:o.normalized}}}return s}_getTriangleListIndices(t){let n=t.num_faces()*3,s=n*v1,o=this.draco._malloc(s);try{return this.decoder.GetTrianglesUInt32Array(t,s,o),new Uint32Array(this.draco.HEAPF32.buffer,o,n).slice()}finally{this.draco._free(o)}}_getTriangleStripIndices(t){let r=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(t,r),U1(r)}finally{this.draco.destroy(r)}}_getAttributeValues(t,r){let n=O1[r.data_type];if(!n)return console.warn(`DRACO: Unsupported attribute type ${r.data_type}`),null;let s=r.num_components,i=t.num_points()*s,a=i*n.BYTES_PER_ELEMENT,f=N1(this.draco,n),c,h=this.draco._malloc(a);try{let l=this.decoder.GetAttribute(t,r.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(t,l,f,a,h),c=new n(this.draco.HEAPF32.buffer,h,i).slice()}finally{this.draco._free(h)}return{value:c,size:s}}_deduceAttributeName(t,r){let n=t.unique_id;for(let[i,a]of Object.entries(r.extraAttributes||{}))if(a===n)return i;let s=t.attribute_type;for(let i in Uf)if(this.draco[i]===s)return Uf[i];let o=r.attributeNameEntry||"name";return t.metadata[o]?t.metadata[o].string:`CUSTOM_ATTRIBUTE_${n}`}_getTopLevelMetadata(t){let r=this.decoder.GetMetadata(t);return this._getDracoMetadata(r)}_getAttributeMetadata(t,r){let n=this.decoder.GetAttributeMetadata(t,r);return this._getDracoMetadata(n)}_getDracoMetadata(t){if(!t||!t.ptr)return{};let r={},n=this.metadataQuerier.NumEntries(t);for(let s=0;s<n;s++){let o=this.metadataQuerier.GetEntryName(t,s);r[o]=this._getDracoMetadataField(t,o)}return r}_getDracoMetadataField(t,r){let n=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(t,r,n);let s=G1(n);return{int:this.metadataQuerier.GetIntEntry(t,r),string:this.metadataQuerier.GetStringEntry(t,r),double:this.metadataQuerier.GetDoubleEntry(t,r),intArray:s}}finally{this.draco.destroy(n)}}_disableAttributeTransforms(t){let{quantizedAttributes:r=[],octahedronAttributes:n=[]}=t,s=[...r,...n];for(let o of s)this.decoder.SkipAttributeTransform(this.draco[o])}_getQuantizationTransform(t,r){let{quantizedAttributes:n=[]}=r,s=t.attribute_type();if(n.map(i=>this.decoder[i]).includes(s)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(t))return{quantization_bits:i.quantization_bits(),range:i.range(),min_values:new Float32Array([1,2,3]).map(a=>i.min_value(a))}}finally{this.draco.destroy(i)}}return null}_getOctahedronTransform(t,r){let{octahedronAttributes:n=[]}=r,s=t.attribute_type();if(n.map(i=>this.decoder[i]).includes(s)){let i=new this.draco.AttributeQuantizationTransform;try{if(i.InitFromAttribute(t))return{quantization_bits:i.quantization_bits()}}finally{this.draco.destroy(i)}}return null}};function N1(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32;default:return e.DT_INVALID}}function G1(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}function U1(e){let t=e.size(),r=new Int32Array(t);for(let n=0;n<t;n++)r[n]=e.GetValue(n);return r}var P1="1.5.6",H1="1.4.1",ai=`https://www.gstatic.com/draco/versioned/decoders/${P1}`,yt={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},ci={[yt.DECODER]:`${ai}/${yt.DECODER}`,[yt.DECODER_WASM]:`${ai}/${yt.DECODER_WASM}`,[yt.FALLBACK_DECODER]:`${ai}/${yt.FALLBACK_DECODER}`,[yt.ENCODER]:`https://raw.githubusercontent.com/google/draco/${H1}/javascript/${yt.ENCODER}`},fi;async function Pf(e){let t=e.modules||{};return t.draco3d?fi||=t.draco3d.createDecoderModule({}).then(r=>({draco:r})):fi||=k1(e),await fi}async function k1(e){let t,r;switch(e.draco&&e.draco.decoderType){case"js":t=await qt(ci[yt.FALLBACK_DECODER],"draco",e,yt.FALLBACK_DECODER);break;case"wasm":default:[t,r]=await Promise.all([await qt(ci[yt.DECODER],"draco",e,yt.DECODER),await qt(ci[yt.DECODER_WASM],"draco",e,yt.DECODER_WASM)])}return t=t||globalThis.DracoDecoderModule,await J1(t,r)}function J1(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e({...r,onModuleLoaded:s=>n({draco:s})})})}var Is={...Df,parse:z1};async function z1(e,t){let{draco:r}=await Pf(t),n=new Mn(r);try{return n.parseSync(e,t?.draco)}finally{n.destroy()}}var Q1={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},nt={BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DOUBLE:5130},H={...Q1,...nt};var hi={[nt.DOUBLE]:Float64Array,[nt.FLOAT]:Float32Array,[nt.UNSIGNED_SHORT]:Uint16Array,[nt.UNSIGNED_INT]:Uint32Array,[nt.UNSIGNED_BYTE]:Uint8Array,[nt.BYTE]:Int8Array,[nt.SHORT]:Int16Array,[nt.INT]:Int32Array},V1={DOUBLE:nt.DOUBLE,FLOAT:nt.FLOAT,UNSIGNED_SHORT:nt.UNSIGNED_SHORT,UNSIGNED_INT:nt.UNSIGNED_INT,UNSIGNED_BYTE:nt.UNSIGNED_BYTE,BYTE:nt.BYTE,SHORT:nt.SHORT,INT:nt.INT},li="Failed to convert GL type",dt=class{static fromTypedArray(t){t=ArrayBuffer.isView(t)?t.constructor:t;for(let r in hi)if(hi[r]===t)return r;throw new Error(li)}static fromName(t){let r=V1[t];if(!r)throw new Error(li);return r}static getArrayType(t){switch(t){case nt.UNSIGNED_SHORT_5_6_5:case nt.UNSIGNED_SHORT_4_4_4_4:case nt.UNSIGNED_SHORT_5_5_5_1:return Uint16Array;default:let r=hi[t];if(!r)throw new Error(li);return r}}static getByteSize(t){return dt.getArrayType(t).BYTES_PER_ELEMENT}static validate(t){return Boolean(dt.getArrayType(t))}static createTypedArray(t,r,n=0,s){s===void 0&&(s=(r.byteLength-n)/dt.getByteSize(t));let o=dt.getArrayType(t);return new o(r,n,s)}};function Hf(e,t){if(!e)throw new Error(`math.gl assertion failed. ${t}`)}function ui(e,t=[0,0,0]){let r=e>>11&31,n=e>>5&63,s=e&31;return t[0]=r<<3,t[1]=n<<2,t[2]=s<<3,t}var YC=1/256;var ZC=new ze,qC=new fe,WC=new ze,$C=new ze,tM=new Uint8Array(1);function kf(e,t=255){return Wo(e,0,t)/t*2-1}function Jf(e){return e<0?-1:1}function zf(e,t,r,n){if(Hf(n),e<0||e>r||t<0||t>r)throw new Error(`x and y must be unsigned normalized integers between 0 and ${r}`);if(n.x=kf(e,r),n.y=kf(t,r),n.z=1-(Math.abs(n.x)+Math.abs(n.y)),n.z<0){let s=n.x;n.x=(1-Math.abs(n.y))*Jf(s),n.y=(1-Math.abs(s))*Jf(n.y)}return n.normalize()}function di(e,t,r){return zf(e,t,255,r)}var j1=1/Math.PI*180,K1=1/180*Math.PI,X1={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...X1}};var q=globalThis.mathgl.config;function Ai(e,{precision:t=q.precision}={}){return e=Y1(e),`${parseFloat(e.toPrecision(t))}`}function $t(e){return Array.isArray(e)||ArrayBuffer.isView(e)&&!(e instanceof DataView)}function mi(e){return Qf(e)}function pi(e){return Vf(e)}function Qf(e,t){return jf(e,r=>r*K1,t)}function Vf(e,t){return jf(e,r=>r*j1,t)}function wt(e,t,r){let n=q.EPSILON;r&&(q.EPSILON=r);try{if(e===t)return!0;if($t(e)&&$t(t)){if(e.length!==t.length)return!1;for(let s=0;s<e.length;++s)if(!wt(e[s],t[s]))return!1;return!0}return e&&e.equals?e.equals(t):t&&t.equals?t.equals(e):typeof e=="number"&&typeof t=="number"?Math.abs(e-t)<=q.EPSILON*Math.max(1,Math.abs(e),Math.abs(t)):!1}finally{q.EPSILON=n}}function Y1(e){return Math.round(e/q.EPSILON)*q.EPSILON}function Z1(e){return e.clone?e.clone():new Array(e.length)}function jf(e,t,r){if($t(e)){let n=e;r=r||Z1(n);for(let s=0;s<r.length&&s<n.length;++s){let o=typeof e=="number"?e:e[s];r[s]=t(o,s,r)}return r}return t(e)}var be=class extends Array{clone(){return new this.constructor().copy(this)}fromArray(t,r=0){for(let n=0;n<this.ELEMENTS;++n)this[n]=t[n+r];return this.check()}toArray(t=[],r=0){for(let n=0;n<this.ELEMENTS;++n)t[r+n]=this[n];return t}toObject(t){return t}from(t){return Array.isArray(t)?this.copy(t):this.fromObject(t)}to(t){return t===this?this:$t(t)?this.toArray(t):this.toObject(t)}toTarget(t){return t?this.to(t):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(q)}formatString(t){let r="";for(let n=0;n<this.ELEMENTS;++n)r+=(n>0?", ":"")+Ai(this[n],t);return`${t.printTypes?this.constructor.name:""}[${r}]`}equals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(!wt(this[r],t[r]))return!1;return!0}exactEquals(t){if(!t||this.length!==t.length)return!1;for(let r=0;r<this.ELEMENTS;++r)if(this[r]!==t[r])return!1;return!0}negate(){for(let t=0;t<this.ELEMENTS;++t)this[t]=-this[t];return this.check()}lerp(t,r,n){if(n===void 0)return this.lerp(this,t,r);for(let s=0;s<this.ELEMENTS;++s){let o=t[s],i=typeof r=="number"?r:r[s];this[s]=o+n*(i-o)}return this.check()}min(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(t[r],this[r]);return this.check()}max(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.max(t[r],this[r]);return this.check()}clamp(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t[n]),r[n]);return this.check()}add(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]+=r[n];return this.check()}subtract(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]-=r[n];return this.check()}scale(t){if(typeof t=="number")for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;else for(let r=0;r<this.ELEMENTS&&r<t.length;++r)this[r]*=t[r];return this.check()}multiplyByScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}check(){if(q.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let t=this.length===this.ELEMENTS;for(let r=0;r<this.ELEMENTS;++r)t=t&&Number.isFinite(this[r]);return t}sub(t){return this.subtract(t)}setScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]=t;return this.check()}addScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]+=t;return this.check()}subScalar(t){return this.addScalar(-t)}multiplyScalar(t){for(let r=0;r<this.ELEMENTS;++r)this[r]*=t;return this.check()}divideScalar(t){return this.multiplyByScalar(1/t)}clampScalar(t,r){for(let n=0;n<this.ELEMENTS;++n)this[n]=Math.min(Math.max(this[n],t),r);return this.check()}get elements(){return this}};function q1(e,t){if(e.length!==t)return!1;for(let r=0;r<e.length;++r)if(!Number.isFinite(e[r]))return!1;return!0}function z(e){if(!Number.isFinite(e))throw new Error(`Invalid number ${JSON.stringify(e)}`);return e}function we(e,t,r=""){if(q.debug&&!q1(e,t))throw new Error(`math.gl: ${r} some fields set to invalid numbers'`);return e}function ft(e,t){if(!e)throw new Error(`math.gl assertion ${t}`)}var Rr=class extends be{get x(){return this[0]}set x(t){this[0]=z(t)}get y(){return this[1]}set y(t){this[1]=z(t)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let t=0;for(let r=0;r<this.ELEMENTS;++r)t+=this[r]*this[r];return t}magnitudeSquared(){return this.lengthSquared()}distance(t){return Math.sqrt(this.distanceSquared(t))}distanceSquared(t){let r=0;for(let n=0;n<this.ELEMENTS;++n){let s=this[n]-t[n];r+=s*s}return z(r)}dot(t){let r=0;for(let n=0;n<this.ELEMENTS;++n)r+=this[n]*t[n];return z(r)}normalize(){let t=this.magnitude();if(t!==0)for(let r=0;r<this.ELEMENTS;++r)this[r]/=t;return this.check()}multiply(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]*=r[n];return this.check()}divide(...t){for(let r of t)for(let n=0;n<this.ELEMENTS;++n)this[n]/=r[n];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(t){return this.distance(t)}distanceToSquared(t){return this.distanceSquared(t)}getComponent(t){return ft(t>=0&&t<this.ELEMENTS,"index is out of range"),z(this[t])}setComponent(t,r){return ft(t>=0&&t<this.ELEMENTS,"index is out of range"),this[t]=r,this.check()}addVectors(t,r){return this.copy(t).add(r)}subVectors(t,r){return this.copy(t).subtract(r)}multiplyVectors(t,r){return this.copy(t).multiply(r)}addScaledVector(t,r){return this.add(new this.constructor(t).multiplyScalar(r))}};var W=typeof Float32Array<"u"?Float32Array:Array,bn=Math.random;function Fr(e){return e>=0?Math.round(e):e%.5===0?Math.floor(e):Math.round(e)}var RM=Math.PI/180;function W1(){let e=new W(2);return W!=Float32Array&&(e[0]=0,e[1]=0),e}function Kf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[3]*s+r[6],e[1]=r[1]*n+r[4]*s+r[7],e}function Xf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[4]*s+r[12],e[1]=r[1]*n+r[5]*s+r[13],e}var FM=function(){let e=W1();return function(t,r,n,s,o,i){let a,f;for(r||(r=2),n||(n=0),s?f=Math.min(s*r+n,t.length):f=t.length,a=n;a<f;a+=r)e[0]=t[a],e[1]=t[a+1],o(e,e,i),t[a]=e[0],t[a+1]=e[1];return t}}();function Yf(e,t,r){let n=t[0],s=t[1],o=r[3]*n+r[7]*s||1;return e[0]=(r[0]*n+r[4]*s)/o,e[1]=(r[1]*n+r[5]*s)/o,e}function Ss(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o||1;return e[0]=(r[0]*n+r[4]*s+r[8]*o)/i,e[1]=(r[1]*n+r[5]*s+r[9]*o)/i,e[2]=(r[2]*n+r[6]*s+r[10]*o)/i,e}function Zf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e}function qf(e,t,r){let n=t[0],s=t[1];return e[0]=r[0]*n+r[2]*s,e[1]=r[1]*n+r[3]*s,e[2]=t[2],e[3]=t[3],e}function Rs(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=r[0]*n+r[3]*s+r[6]*o,e[1]=r[1]*n+r[4]*s+r[7]*o,e[2]=r[2]*n+r[5]*s+r[8]*o,e[3]=t[3],e}var je={};ut(je,{add:()=>rA,angle:()=>_i,bezier:()=>mA,ceil:()=>nA,clone:()=>$1,copy:()=>tA,create:()=>Fs,cross:()=>Qe,dist:()=>CA,distance:()=>rh,div:()=>TA,divide:()=>eh,dot:()=>wn,equals:()=>EA,exactEquals:()=>BA,floor:()=>sA,forEach:()=>wA,fromValues:()=>Ds,hermite:()=>AA,inverse:()=>lA,len:()=>yi,length:()=>Wf,lerp:()=>uA,max:()=>iA,min:()=>oA,mul:()=>yA,multiply:()=>th,negate:()=>hA,normalize:()=>gi,random:()=>pA,rotateX:()=>xi,rotateY:()=>Bi,rotateZ:()=>Ei,round:()=>aA,scale:()=>cA,scaleAndAdd:()=>fA,set:()=>eA,slerp:()=>dA,sqrDist:()=>MA,sqrLen:()=>bA,squaredDistance:()=>nh,squaredLength:()=>sh,str:()=>xA,sub:()=>_A,subtract:()=>$f,transformMat3:()=>In,transformMat4:()=>Ve,transformQuat:()=>Sn,zero:()=>gA});function Fs(){let e=new W(3);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e}function $1(e){let t=new W(3);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function Wf(e){let t=e[0],r=e[1],n=e[2];return Math.sqrt(t*t+r*r+n*n)}function Ds(e,t,r){let n=new W(3);return n[0]=e,n[1]=t,n[2]=r,n}function tA(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}function eA(e,t,r,n){return e[0]=t,e[1]=r,e[2]=n,e}function rA(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e}function $f(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e}function th(e,t,r){return e[0]=t[0]*r[0],e[1]=t[1]*r[1],e[2]=t[2]*r[2],e}function eh(e,t,r){return e[0]=t[0]/r[0],e[1]=t[1]/r[1],e[2]=t[2]/r[2],e}function nA(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e[2]=Math.ceil(t[2]),e}function sA(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e[2]=Math.floor(t[2]),e}function oA(e,t,r){return e[0]=Math.min(t[0],r[0]),e[1]=Math.min(t[1],r[1]),e[2]=Math.min(t[2],r[2]),e}function iA(e,t,r){return e[0]=Math.max(t[0],r[0]),e[1]=Math.max(t[1],r[1]),e[2]=Math.max(t[2],r[2]),e}function aA(e,t){return e[0]=Fr(t[0]),e[1]=Fr(t[1]),e[2]=Fr(t[2]),e}function cA(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e}function fA(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e}function rh(e,t){let r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];return Math.sqrt(r*r+n*n+s*s)}function nh(e,t){let r=t[0]-e[0],n=t[1]-e[1],s=t[2]-e[2];return r*r+n*n+s*s}function sh(e){let t=e[0],r=e[1],n=e[2];return t*t+r*r+n*n}function hA(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e}function lA(e,t){return e[0]=1/t[0],e[1]=1/t[1],e[2]=1/t[2],e}function gi(e,t){let r=t[0],n=t[1],s=t[2],o=r*r+n*n+s*s;return o>0&&(o=1/Math.sqrt(o)),e[0]=t[0]*o,e[1]=t[1]*o,e[2]=t[2]*o,e}function wn(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]}function Qe(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],f=r[2];return e[0]=s*f-o*a,e[1]=o*i-n*f,e[2]=n*a-s*i,e}function uA(e,t,r,n){let s=t[0],o=t[1],i=t[2];return e[0]=s+n*(r[0]-s),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e}function dA(e,t,r,n){let s=Math.acos(Math.min(Math.max(wn(t,r),-1),1)),o=Math.sin(s),i=Math.sin((1-n)*s)/o,a=Math.sin(n*s)/o;return e[0]=i*t[0]+a*r[0],e[1]=i*t[1]+a*r[1],e[2]=i*t[2]+a*r[2],e}function AA(e,t,r,n,s,o){let i=o*o,a=i*(2*o-3)+1,f=i*(o-2)+o,c=i*(o-1),h=i*(3-2*o);return e[0]=t[0]*a+r[0]*f+n[0]*c+s[0]*h,e[1]=t[1]*a+r[1]*f+n[1]*c+s[1]*h,e[2]=t[2]*a+r[2]*f+n[2]*c+s[2]*h,e}function mA(e,t,r,n,s,o){let i=1-o,a=i*i,f=o*o,c=a*i,h=3*o*a,l=3*f*i,u=f*o;return e[0]=t[0]*c+r[0]*h+n[0]*l+s[0]*u,e[1]=t[1]*c+r[1]*h+n[1]*l+s[1]*u,e[2]=t[2]*c+r[2]*h+n[2]*l+s[2]*u,e}function pA(e,t){t=t===void 0?1:t;let r=bn()*2*Math.PI,n=bn()*2-1,s=Math.sqrt(1-n*n)*t;return e[0]=Math.cos(r)*s,e[1]=Math.sin(r)*s,e[2]=n*t,e}function Ve(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[3]*n+r[7]*s+r[11]*o+r[15];return i=i||1,e[0]=(r[0]*n+r[4]*s+r[8]*o+r[12])/i,e[1]=(r[1]*n+r[5]*s+r[9]*o+r[13])/i,e[2]=(r[2]*n+r[6]*s+r[10]*o+r[14])/i,e}function In(e,t,r){let n=t[0],s=t[1],o=t[2];return e[0]=n*r[0]+s*r[3]+o*r[6],e[1]=n*r[1]+s*r[4]+o*r[7],e[2]=n*r[2]+s*r[5]+o*r[8],e}function Sn(e,t,r){let n=r[0],s=r[1],o=r[2],i=r[3],a=t[0],f=t[1],c=t[2],h=s*c-o*f,l=o*a-n*c,u=n*f-s*a,d=s*u-o*l,A=o*h-n*u,m=n*l-s*h,p=i*2;return h*=p,l*=p,u*=p,d*=2,A*=2,m*=2,e[0]=a+h+d,e[1]=f+l+A,e[2]=c+u+m,e}function xi(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0],o[1]=s[1]*Math.cos(n)-s[2]*Math.sin(n),o[2]=s[1]*Math.sin(n)+s[2]*Math.cos(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Bi(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[2]*Math.sin(n)+s[0]*Math.cos(n),o[1]=s[1],o[2]=s[2]*Math.cos(n)-s[0]*Math.sin(n),e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function Ei(e,t,r,n){let s=[],o=[];return s[0]=t[0]-r[0],s[1]=t[1]-r[1],s[2]=t[2]-r[2],o[0]=s[0]*Math.cos(n)-s[1]*Math.sin(n),o[1]=s[0]*Math.sin(n)+s[1]*Math.cos(n),o[2]=s[2],e[0]=o[0]+r[0],e[1]=o[1]+r[1],e[2]=o[2]+r[2],e}function _i(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2],f=Math.sqrt((r*r+n*n+s*s)*(o*o+i*i+a*a)),c=f&&wn(e,t)/f;return Math.acos(Math.min(Math.max(c,-1),1))}function gA(e){return e[0]=0,e[1]=0,e[2]=0,e}function xA(e){return`vec3(${e[0]}, ${e[1]}, ${e[2]})`}function BA(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function EA(e,t){let r=e[0],n=e[1],s=e[2],o=t[0],i=t[1],a=t[2];return Math.abs(r-o)<=1e-6*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(n-i)<=1e-6*Math.max(1,Math.abs(n),Math.abs(i))&&Math.abs(s-a)<=1e-6*Math.max(1,Math.abs(s),Math.abs(a))}var _A=$f,yA=th,TA=eh,CA=rh,MA=nh,yi=Wf,bA=sh,wA=function(){let e=Fs();return function(t,r,n,s,o,i){let a,f;for(r||(r=3),n||(n=0),s?f=Math.min(s*r+n,t.length):f=t.length,a=n;a<f;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2];return t}}();var Ti=[0,0,0],Ls,b=class extends Rr{static get ZERO(){return Ls||(Ls=new b(0,0,0),Object.freeze(Ls)),Ls}constructor(t=0,r=0,n=0){super(-0,-0,-0),arguments.length===1&&$t(t)?this.copy(t):(q.debug&&(z(t),z(r),z(n)),this[0]=t,this[1]=r,this[2]=n)}set(t,r,n){return this[0]=t,this[1]=r,this[2]=n,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this.check()}fromObject(t){return q.debug&&(z(t.x),z(t.y),z(t.z)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this.check()}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t}get ELEMENTS(){return 3}get z(){return this[2]}set z(t){this[2]=z(t)}angle(t){return _i(this,t)}cross(t){return Qe(this,this,t),this.check()}rotateX({radians:t,origin:r=Ti}){return xi(this,this,r,t),this.check()}rotateY({radians:t,origin:r=Ti}){return Bi(this,this,r,t),this.check()}rotateZ({radians:t,origin:r=Ti}){return Ei(this,this,r,t),this.check()}transform(t){return this.transformAsPoint(t)}transformAsPoint(t){return Ve(this,this,t),this.check()}transformAsVector(t){return Ss(this,this,t),this.check()}transformByMatrix3(t){return In(this,this,t),this.check()}transformByMatrix2(t){return Zf(this,this,t),this.check()}transformByQuaternion(t){return Sn(this,this,t),this.check()}};var Os,Lr=class extends Rr{static get ZERO(){return Os||(Os=new Lr(0,0,0,0),Object.freeze(Os)),Os}constructor(t=0,r=0,n=0,s=0){super(-0,-0,-0,-0),$t(t)&&arguments.length===1?this.copy(t):(q.debug&&(z(t),z(r),z(n),z(s)),this[0]=t,this[1]=r,this[2]=n,this[3]=s)}set(t,r,n,s){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this.check()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}fromObject(t){return q.debug&&(z(t.x),z(t.y),z(t.z),z(t.w)),this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this}toObject(t){return t.x=this[0],t.y=this[1],t.z=this[2],t.w=this[3],t}get ELEMENTS(){return 4}get z(){return this[2]}set z(t){this[2]=z(t)}get w(){return this[3]}set w(t){this[3]=z(t)}transform(t){return Ve(this,this,t),this.check()}transformByMatrix3(t){return Rs(this,this,t),this.check()}transformByMatrix2(t){return qf(this,this,t),this.check()}transformByQuaternion(t){return Sn(this,this,t),this.check()}applyMatrix4(t){return t.transform(this,this),this}};var Or=class extends be{toString(){let t="[";if(q.printRowMajor){t+="row-major:";for(let r=0;r<this.RANK;++r)for(let n=0;n<this.RANK;++n)t+=` ${this[n*this.RANK+r]}`}else{t+="column-major:";for(let r=0;r<this.ELEMENTS;++r)t+=` ${this[r]}`}return t+="]",t}getElementIndex(t,r){return r*this.RANK+t}getElement(t,r){return this[r*this.RANK+t]}setElement(t,r,n){return this[r*this.RANK+t]=z(n),this}getColumn(t,r=new Array(this.RANK).fill(-0)){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)r[s]=this[n+s];return r}setColumn(t,r){let n=t*this.RANK;for(let s=0;s<this.RANK;++s)this[n+s]=r[s];return this}};function oh(){let e=new W(9);return W!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[5]=0,e[6]=0,e[7]=0),e[0]=1,e[4]=1,e[8]=1,e}function ih(e,t){if(e===t){let r=t[1],n=t[2],s=t[5];e[1]=t[3],e[2]=t[6],e[3]=r,e[5]=t[7],e[6]=n,e[7]=s}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function ah(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],f=t[6],c=t[7],h=t[8],l=h*i-a*c,u=-h*o+a*f,d=c*o-i*f,A=r*l+n*u+s*d;return A?(A=1/A,e[0]=l*A,e[1]=(-h*n+s*c)*A,e[2]=(a*n-s*i)*A,e[3]=u*A,e[4]=(h*r-s*f)*A,e[5]=(-a*r+s*o)*A,e[6]=d*A,e[7]=(-c*r+n*f)*A,e[8]=(i*r-n*o)*A,e):null}function ch(e){let t=e[0],r=e[1],n=e[2],s=e[3],o=e[4],i=e[5],a=e[6],f=e[7],c=e[8];return t*(c*o-i*f)+r*(-c*s+i*a)+n*(f*s-o*a)}function Ci(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=r[0],d=r[1],A=r[2],m=r[3],p=r[4],E=r[5],y=r[6],C=r[7],M=r[8];return e[0]=u*n+d*i+A*c,e[1]=u*s+d*a+A*h,e[2]=u*o+d*f+A*l,e[3]=m*n+p*i+E*c,e[4]=m*s+p*a+E*h,e[5]=m*o+p*f+E*l,e[6]=y*n+C*i+M*c,e[7]=y*s+C*a+M*h,e[8]=y*o+C*f+M*l,e}function fh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=r[0],d=r[1];return e[0]=n,e[1]=s,e[2]=o,e[3]=i,e[4]=a,e[5]=f,e[6]=u*n+d*i+c,e[7]=u*s+d*a+h,e[8]=u*o+d*f+l,e}function hh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=Math.sin(r),d=Math.cos(r);return e[0]=d*n+u*i,e[1]=d*s+u*a,e[2]=d*o+u*f,e[3]=d*i-u*n,e[4]=d*a-u*s,e[5]=d*f-u*o,e[6]=c,e[7]=h,e[8]=l,e}function Mi(e,t,r){let n=r[0],s=r[1];return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=s*t[3],e[4]=s*t[4],e[5]=s*t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function lh(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,f=s+s,c=r*i,h=n*i,l=n*a,u=s*i,d=s*a,A=s*f,m=o*i,p=o*a,E=o*f;return e[0]=1-l-A,e[3]=h-E,e[6]=u+p,e[1]=h+E,e[4]=1-c-A,e[7]=d-m,e[2]=u-p,e[5]=d+m,e[8]=1-c-l,e}var bi;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL1ROW0=3]="COL1ROW0",e[e.COL1ROW1=4]="COL1ROW1",e[e.COL1ROW2=5]="COL1ROW2",e[e.COL2ROW0=6]="COL2ROW0",e[e.COL2ROW1=7]="COL2ROW1",e[e.COL2ROW2=8]="COL2ROW2"})(bi||(bi={}));var SA=Object.freeze([1,0,0,0,1,0,0,0,1]),Z=class extends Or{static get IDENTITY(){return FA()}static get ZERO(){return RA()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return bi}constructor(t,...r){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):r.length>0?this.copy([t,...r]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(SA)}fromObject(t){return this.check()}fromQuaternion(t){return lh(this,t),this.check()}set(t,r,n,s,o,i,a,f,c){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this.check()}setRowMajor(t,r,n,s,o,i,a,f,c){return this[0]=t,this[1]=s,this[2]=a,this[3]=r,this[4]=o,this[5]=f,this[6]=n,this[7]=i,this[8]=c,this.check()}determinant(){return ch(this)}transpose(){return ih(this,this),this.check()}invert(){return ah(this,this),this.check()}multiplyLeft(t){return Ci(this,t,this),this.check()}multiplyRight(t){return Ci(this,this,t),this.check()}rotate(t){return hh(this,this,t),this.check()}scale(t){return Array.isArray(t)?Mi(this,this,t):Mi(this,this,[t,t]),this.check()}translate(t){return fh(this,this,t),this.check()}transform(t,r){let n;switch(t.length){case 2:n=Kf(r||[-0,-0],t,this);break;case 3:n=In(r||[-0,-0,-0],t,this);break;case 4:n=Rs(r||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(n,t.length),n}transformVector(t,r){return this.transform(t,r)}transformVector2(t,r){return this.transform(t,r)}transformVector3(t,r){return this.transform(t,r)}},vs,Ns=null;function RA(){return vs||(vs=new Z([0,0,0,0,0,0,0,0,0]),Object.freeze(vs)),vs}function FA(){return Ns||(Ns=new Z,Object.freeze(Ns)),Ns}var Fn={};ut(Fn,{add:()=>rm,adjoint:()=>GA,clone:()=>LA,copy:()=>OA,create:()=>DA,decompose:()=>KA,determinant:()=>Si,equals:()=>im,exactEquals:()=>om,frob:()=>em,fromQuat:()=>Ni,fromQuat2:()=>QA,fromRotation:()=>HA,fromRotationTranslation:()=>dh,fromRotationTranslationScale:()=>XA,fromRotationTranslationScaleOrigin:()=>YA,fromScaling:()=>PA,fromTranslation:()=>UA,fromValues:()=>vA,fromXRotation:()=>kA,fromYRotation:()=>JA,fromZRotation:()=>zA,frustum:()=>Gi,getRotation:()=>jA,getScaling:()=>Ah,getTranslation:()=>VA,identity:()=>uh,invert:()=>Ii,lookAt:()=>Hi,mul:()=>am,multiply:()=>Rn,multiplyScalar:()=>nm,multiplyScalarAndAdd:()=>sm,ortho:()=>Pi,orthoNO:()=>ph,orthoZO:()=>WA,perspective:()=>Ui,perspectiveFromFieldOfView:()=>qA,perspectiveNO:()=>mh,perspectiveZO:()=>ZA,rotate:()=>Di,rotateX:()=>Li,rotateY:()=>Oi,rotateZ:()=>vi,scale:()=>Fi,set:()=>NA,str:()=>tm,sub:()=>cm,subtract:()=>gh,targetTo:()=>$A,translate:()=>Ri,transpose:()=>wi});function DA(){let e=new W(16);return W!=Float32Array&&(e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=0,e[12]=0,e[13]=0,e[14]=0),e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function LA(e){let t=new W(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function OA(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function vA(e,t,r,n,s,o,i,a,f,c,h,l,u,d,A,m){let p=new W(16);return p[0]=e,p[1]=t,p[2]=r,p[3]=n,p[4]=s,p[5]=o,p[6]=i,p[7]=a,p[8]=f,p[9]=c,p[10]=h,p[11]=l,p[12]=u,p[13]=d,p[14]=A,p[15]=m,p}function NA(e,t,r,n,s,o,i,a,f,c,h,l,u,d,A,m,p){return e[0]=t,e[1]=r,e[2]=n,e[3]=s,e[4]=o,e[5]=i,e[6]=a,e[7]=f,e[8]=c,e[9]=h,e[10]=l,e[11]=u,e[12]=d,e[13]=A,e[14]=m,e[15]=p,e}function uh(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function wi(e,t){if(e===t){let r=t[1],n=t[2],s=t[3],o=t[6],i=t[7],a=t[11];e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=r,e[6]=t[9],e[7]=t[13],e[8]=n,e[9]=o,e[11]=t[14],e[12]=s,e[13]=i,e[14]=a}else e[0]=t[0],e[1]=t[4],e[2]=t[8],e[3]=t[12],e[4]=t[1],e[5]=t[5],e[6]=t[9],e[7]=t[13],e[8]=t[2],e[9]=t[6],e[10]=t[10],e[11]=t[14],e[12]=t[3],e[13]=t[7],e[14]=t[11],e[15]=t[15];return e}function Ii(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=t[4],a=t[5],f=t[6],c=t[7],h=t[8],l=t[9],u=t[10],d=t[11],A=t[12],m=t[13],p=t[14],E=t[15],y=r*a-n*i,C=r*f-s*i,M=r*c-o*i,T=n*f-s*a,I=n*c-o*a,w=s*c-o*f,L=h*m-l*A,x=h*p-u*A,g=h*E-d*A,B=l*p-u*m,_=l*E-d*m,U=u*E-d*p,G=y*U-C*_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m-l*A,w=t*I-r*T+n*M,L=o*I-i*T+a*M,x=c*C-h*y+l*E,g=d*C-A*y+m*E;return f*w-s*L+p*x-u*g}function Rn(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=t[8],u=t[9],d=t[10],A=t[11],m=t[12],p=t[13],E=t[14],y=t[15],C=r[0],M=r[1],T=r[2],I=r[3];return e[0]=C*n+M*a+T*l+I*m,e[1]=C*s+M*f+T*u+I*p,e[2]=C*o+M*c+T*d+I*E,e[3]=C*i+M*h+T*A+I*y,C=r[4],M=r[5],T=r[6],I=r[7],e[4]=C*n+M*a+T*l+I*m,e[5]=C*s+M*f+T*u+I*p,e[6]=C*o+M*c+T*d+I*E,e[7]=C*i+M*h+T*A+I*y,C=r[8],M=r[9],T=r[10],I=r[11],e[8]=C*n+M*a+T*l+I*m,e[9]=C*s+M*f+T*u+I*p,e[10]=C*o+M*c+T*d+I*E,e[11]=C*i+M*h+T*A+I*y,C=r[12],M=r[13],T=r[14],I=r[15],e[12]=C*n+M*a+T*l+I*m,e[13]=C*s+M*f+T*u+I*p,e[14]=C*o+M*c+T*d+I*E,e[15]=C*i+M*h+T*A+I*y,e}function Ri(e,t,r){let n=r[0],s=r[1],o=r[2],i,a,f,c,h,l,u,d,A,m,p,E;return t===e?(e[12]=t[0]*n+t[4]*s+t[8]*o+t[12],e[13]=t[1]*n+t[5]*s+t[9]*o+t[13],e[14]=t[2]*n+t[6]*s+t[10]*o+t[14],e[15]=t[3]*n+t[7]*s+t[11]*o+t[15]):(i=t[0],a=t[1],f=t[2],c=t[3],h=t[4],l=t[5],u=t[6],d=t[7],A=t[8],m=t[9],p=t[10],E=t[11],e[0]=i,e[1]=a,e[2]=f,e[3]=c,e[4]=h,e[5]=l,e[6]=u,e[7]=d,e[8]=A,e[9]=m,e[10]=p,e[11]=E,e[12]=i*n+h*s+A*o+t[12],e[13]=a*n+l*s+m*o+t[13],e[14]=f*n+u*s+p*o+t[14],e[15]=c*n+d*s+E*o+t[15]),e}function Fi(e,t,r){let n=r[0],s=r[1],o=r[2];return e[0]=t[0]*n,e[1]=t[1]*n,e[2]=t[2]*n,e[3]=t[3]*n,e[4]=t[4]*s,e[5]=t[5]*s,e[6]=t[6]*s,e[7]=t[7]*s,e[8]=t[8]*o,e[9]=t[9]*o,e[10]=t[10]*o,e[11]=t[11]*o,e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15],e}function Di(e,t,r,n){let s=n[0],o=n[1],i=n[2],a=Math.sqrt(s*s+o*o+i*i),f,c,h,l,u,d,A,m,p,E,y,C,M,T,I,w,L,x,g,B,_,U,G,P;return a<1e-6?null:(a=1/a,s*=a,o*=a,i*=a,c=Math.sin(r),f=Math.cos(r),h=1-f,l=t[0],u=t[1],d=t[2],A=t[3],m=t[4],p=t[5],E=t[6],y=t[7],C=t[8],M=t[9],T=t[10],I=t[11],w=s*s*h+f,L=o*s*h+i*c,x=i*s*h-o*c,g=s*o*h-i*c,B=o*o*h+f,_=i*o*h+s*c,U=s*i*h+o*c,G=o*i*h-s*c,P=i*i*h+f,e[0]=l*w+m*L+C*x,e[1]=u*w+p*L+M*x,e[2]=d*w+E*L+T*x,e[3]=A*w+y*L+I*x,e[4]=l*g+m*B+C*_,e[5]=u*g+p*B+M*_,e[6]=d*g+E*B+T*_,e[7]=A*g+y*B+I*_,e[8]=l*U+m*G+C*P,e[9]=u*U+p*G+M*P,e[10]=d*U+E*G+T*P,e[11]=A*U+y*G+I*P,t!==e&&(e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e)}function Li(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[4],i=t[5],a=t[6],f=t[7],c=t[8],h=t[9],l=t[10],u=t[11];return t!==e&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[4]=o*s+c*n,e[5]=i*s+h*n,e[6]=a*s+l*n,e[7]=f*s+u*n,e[8]=c*s-o*n,e[9]=h*s-i*n,e[10]=l*s-a*n,e[11]=u*s-f*n,e}function Oi(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[0],i=t[1],a=t[2],f=t[3],c=t[8],h=t[9],l=t[10],u=t[11];return t!==e&&(e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*s-c*n,e[1]=i*s-h*n,e[2]=a*s-l*n,e[3]=f*s-u*n,e[8]=o*n+c*s,e[9]=i*n+h*s,e[10]=a*n+l*s,e[11]=f*n+u*s,e}function vi(e,t,r){let n=Math.sin(r),s=Math.cos(r),o=t[0],i=t[1],a=t[2],f=t[3],c=t[4],h=t[5],l=t[6],u=t[7];return t!==e&&(e[8]=t[8],e[9]=t[9],e[10]=t[10],e[11]=t[11],e[12]=t[12],e[13]=t[13],e[14]=t[14],e[15]=t[15]),e[0]=o*s+c*n,e[1]=i*s+h*n,e[2]=a*s+l*n,e[3]=f*s+u*n,e[4]=c*s-o*n,e[5]=h*s-i*n,e[6]=l*s-a*n,e[7]=u*s-f*n,e}function UA(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=t[0],e[13]=t[1],e[14]=t[2],e[15]=1,e}function PA(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=t[1],e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=t[2],e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function HA(e,t,r){let n=r[0],s=r[1],o=r[2],i=Math.sqrt(n*n+s*s+o*o),a,f,c;return i<1e-6?null:(i=1/i,n*=i,s*=i,o*=i,f=Math.sin(t),a=Math.cos(t),c=1-a,e[0]=n*n*c+a,e[1]=s*n*c+o*f,e[2]=o*n*c-s*f,e[3]=0,e[4]=n*s*c-o*f,e[5]=s*s*c+a,e[6]=o*s*c+n*f,e[7]=0,e[8]=n*o*c+s*f,e[9]=s*o*c-n*f,e[10]=o*o*c+a,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e)}function kA(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=r,e[7]=0,e[8]=0,e[9]=-r,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function JA(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=0,e[2]=-r,e[3]=0,e[4]=0,e[5]=1,e[6]=0,e[7]=0,e[8]=r,e[9]=0,e[10]=n,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function zA(e,t){let r=Math.sin(t),n=Math.cos(t);return e[0]=n,e[1]=r,e[2]=0,e[3]=0,e[4]=-r,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=1,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function dh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=n+n,f=s+s,c=o+o,h=n*a,l=n*f,u=n*c,d=s*f,A=s*c,m=o*c,p=i*a,E=i*f,y=i*c;return e[0]=1-(d+m),e[1]=l+y,e[2]=u-E,e[3]=0,e[4]=l-y,e[5]=1-(h+m),e[6]=A+p,e[7]=0,e[8]=u+E,e[9]=A-p,e[10]=1-(h+d),e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function QA(e,t){let r=new W(3),n=-t[0],s=-t[1],o=-t[2],i=t[3],a=t[4],f=t[5],c=t[6],h=t[7],l=n*n+s*s+o*o+i*i;return l>0?(r[0]=(a*i+h*n+f*o-c*s)*2/l,r[1]=(f*i+h*s+c*n-a*o)*2/l,r[2]=(c*i+h*o+a*s-f*n)*2/l):(r[0]=(a*i+h*n+f*o-c*s)*2,r[1]=(f*i+h*s+c*n-a*o)*2,r[2]=(c*i+h*o+a*s-f*n)*2),dh(e,t,r),e}function VA(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function Ah(e,t){let r=t[0],n=t[1],s=t[2],o=t[4],i=t[5],a=t[6],f=t[8],c=t[9],h=t[10];return e[0]=Math.sqrt(r*r+n*n+s*s),e[1]=Math.sqrt(o*o+i*i+a*a),e[2]=Math.sqrt(f*f+c*c+h*h),e}function jA(e,t){let r=new W(3);Ah(r,t);let n=1/r[0],s=1/r[1],o=1/r[2],i=t[0]*n,a=t[1]*s,f=t[2]*o,c=t[4]*n,h=t[5]*s,l=t[6]*o,u=t[8]*n,d=t[9]*s,A=t[10]*o,m=i+h+A,p=0;return m>0?(p=Math.sqrt(m+1)*2,e[3]=.25*p,e[0]=(l-d)/p,e[1]=(u-f)/p,e[2]=(a-c)/p):i>h&&i>A?(p=Math.sqrt(1+i-h-A)*2,e[3]=(l-d)/p,e[0]=.25*p,e[1]=(a+c)/p,e[2]=(u+f)/p):h>A?(p=Math.sqrt(1+h-i-A)*2,e[3]=(u-f)/p,e[0]=(a+c)/p,e[1]=.25*p,e[2]=(l+d)/p):(p=Math.sqrt(1+A-i-h)*2,e[3]=(a-c)/p,e[0]=(u+f)/p,e[1]=(l+d)/p,e[2]=.25*p),e}function KA(e,t,r,n){t[0]=n[12],t[1]=n[13],t[2]=n[14];let s=n[0],o=n[1],i=n[2],a=n[4],f=n[5],c=n[6],h=n[8],l=n[9],u=n[10];r[0]=Math.sqrt(s*s+o*o+i*i),r[1]=Math.sqrt(a*a+f*f+c*c),r[2]=Math.sqrt(h*h+l*l+u*u);let d=1/r[0],A=1/r[1],m=1/r[2],p=s*d,E=o*A,y=i*m,C=a*d,M=f*A,T=c*m,I=h*d,w=l*A,L=u*m,x=p+M+L,g=0;return x>0?(g=Math.sqrt(x+1)*2,e[3]=.25*g,e[0]=(T-w)/g,e[1]=(I-y)/g,e[2]=(E-C)/g):p>M&&p>L?(g=Math.sqrt(1+p-M-L)*2,e[3]=(T-w)/g,e[0]=.25*g,e[1]=(E+C)/g,e[2]=(I+y)/g):M>L?(g=Math.sqrt(1+M-p-L)*2,e[3]=(I-y)/g,e[0]=(E+C)/g,e[1]=.25*g,e[2]=(T+w)/g):(g=Math.sqrt(1+L-p-M)*2,e[3]=(E-C)/g,e[0]=(I+y)/g,e[1]=(T+w)/g,e[2]=.25*g),e}function XA(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3],f=s+s,c=o+o,h=i+i,l=s*f,u=s*c,d=s*h,A=o*c,m=o*h,p=i*h,E=a*f,y=a*c,C=a*h,M=n[0],T=n[1],I=n[2];return e[0]=(1-(A+p))*M,e[1]=(u+C)*M,e[2]=(d-y)*M,e[3]=0,e[4]=(u-C)*T,e[5]=(1-(l+p))*T,e[6]=(m+E)*T,e[7]=0,e[8]=(d+y)*I,e[9]=(m-E)*I,e[10]=(1-(l+A))*I,e[11]=0,e[12]=r[0],e[13]=r[1],e[14]=r[2],e[15]=1,e}function YA(e,t,r,n,s){let o=t[0],i=t[1],a=t[2],f=t[3],c=o+o,h=i+i,l=a+a,u=o*c,d=o*h,A=o*l,m=i*h,p=i*l,E=a*l,y=f*c,C=f*h,M=f*l,T=n[0],I=n[1],w=n[2],L=s[0],x=s[1],g=s[2],B=(1-(m+E))*T,_=(d+M)*T,U=(A-C)*T,G=(d-M)*I,P=(1-(u+E))*I,v=(p+y)*I,at=(A+C)*w,mt=(p-y)*w,X=(1-(u+m))*w;return e[0]=B,e[1]=_,e[2]=U,e[3]=0,e[4]=G,e[5]=P,e[6]=v,e[7]=0,e[8]=at,e[9]=mt,e[10]=X,e[11]=0,e[12]=r[0]+L-(B*L+G*x+at*g),e[13]=r[1]+x-(_*L+P*x+mt*g),e[14]=r[2]+g-(U*L+v*x+X*g),e[15]=1,e}function Ni(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r+r,a=n+n,f=s+s,c=r*i,h=n*i,l=n*a,u=s*i,d=s*a,A=s*f,m=o*i,p=o*a,E=o*f;return e[0]=1-l-A,e[1]=h+E,e[2]=u-p,e[3]=0,e[4]=h-E,e[5]=1-c-A,e[6]=d+m,e[7]=0,e[8]=u+p,e[9]=d-m,e[10]=1-c-l,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function Gi(e,t,r,n,s,o,i){let a=1/(r-t),f=1/(s-n),c=1/(o-i);return e[0]=o*2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o*2*f,e[6]=0,e[7]=0,e[8]=(r+t)*a,e[9]=(s+n)*f,e[10]=(i+o)*c,e[11]=-1,e[12]=0,e[13]=0,e[14]=i*o*2*c,e[15]=0,e}function mh(e,t,r,n,s){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,s!=null&&s!==1/0){let i=1/(n-s);e[10]=(s+n)*i,e[14]=2*s*n*i}else e[10]=-1,e[14]=-2*n;return e}var Ui=mh;function ZA(e,t,r,n,s){let o=1/Math.tan(t/2);if(e[0]=o/r,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=o,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,s!=null&&s!==1/0){let i=1/(n-s);e[10]=s*i,e[14]=s*n*i}else e[10]=-1,e[14]=-n;return e}function qA(e,t,r,n){let s=Math.tan(t.upDegrees*Math.PI/180),o=Math.tan(t.downDegrees*Math.PI/180),i=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),f=2/(i+a),c=2/(s+o);return e[0]=f,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=c,e[6]=0,e[7]=0,e[8]=-((i-a)*f*.5),e[9]=(s-o)*c*.5,e[10]=n/(r-n),e[11]=-1,e[12]=0,e[13]=0,e[14]=n*r/(r-n),e[15]=0,e}function ph(e,t,r,n,s,o,i){let a=1/(t-r),f=1/(n-s),c=1/(o-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*f,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*c,e[11]=0,e[12]=(t+r)*a,e[13]=(s+n)*f,e[14]=(i+o)*c,e[15]=1,e}var Pi=ph;function WA(e,t,r,n,s,o,i){let a=1/(t-r),f=1/(n-s),c=1/(o-i);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*f,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=c,e[11]=0,e[12]=(t+r)*a,e[13]=(s+n)*f,e[14]=o*c,e[15]=1,e}function Hi(e,t,r,n){let s,o,i,a,f,c,h,l,u,d,A=t[0],m=t[1],p=t[2],E=n[0],y=n[1],C=n[2],M=r[0],T=r[1],I=r[2];return Math.abs(A-M)<1e-6&&Math.abs(m-T)<1e-6&&Math.abs(p-I)<1e-6?uh(e):(l=A-M,u=m-T,d=p-I,s=1/Math.sqrt(l*l+u*u+d*d),l*=s,u*=s,d*=s,o=y*d-C*u,i=C*l-E*d,a=E*u-y*l,s=Math.sqrt(o*o+i*i+a*a),s?(s=1/s,o*=s,i*=s,a*=s):(o=0,i=0,a=0),f=u*a-d*i,c=d*o-l*a,h=l*i-u*o,s=Math.sqrt(f*f+c*c+h*h),s?(s=1/s,f*=s,c*=s,h*=s):(f=0,c=0,h=0),e[0]=o,e[1]=f,e[2]=l,e[3]=0,e[4]=i,e[5]=c,e[6]=u,e[7]=0,e[8]=a,e[9]=h,e[10]=d,e[11]=0,e[12]=-(o*A+i*m+a*p),e[13]=-(f*A+c*m+h*p),e[14]=-(l*A+u*m+d*p),e[15]=1,e)}function $A(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=n[0],f=n[1],c=n[2],h=s-r[0],l=o-r[1],u=i-r[2],d=h*h+l*l+u*u;d>0&&(d=1/Math.sqrt(d),h*=d,l*=d,u*=d);let A=f*u-c*l,m=c*h-a*u,p=a*l-f*h;return d=A*A+m*m+p*p,d>0&&(d=1/Math.sqrt(d),A*=d,m*=d,p*=d),e[0]=A,e[1]=m,e[2]=p,e[3]=0,e[4]=l*p-u*m,e[5]=u*A-h*p,e[6]=h*m-l*A,e[7]=0,e[8]=h,e[9]=l,e[10]=u,e[11]=0,e[12]=s,e[13]=o,e[14]=i,e[15]=1,e}function tm(e){return`mat4(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]}, ${e[4]}, ${e[5]}, ${e[6]}, ${e[7]}, ${e[8]}, ${e[9]}, ${e[10]}, ${e[11]}, ${e[12]}, ${e[13]}, ${e[14]}, ${e[15]})`}function em(e){return Math.sqrt(e[0]*e[0]+e[1]*e[1]+e[2]*e[2]+e[3]*e[3]+e[4]*e[4]+e[5]*e[5]+e[6]*e[6]+e[7]*e[7]+e[8]*e[8]+e[9]*e[9]+e[10]*e[10]+e[11]*e[11]+e[12]*e[12]+e[13]*e[13]+e[14]*e[14]+e[15]*e[15])}function rm(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e[4]=t[4]+r[4],e[5]=t[5]+r[5],e[6]=t[6]+r[6],e[7]=t[7]+r[7],e[8]=t[8]+r[8],e[9]=t[9]+r[9],e[10]=t[10]+r[10],e[11]=t[11]+r[11],e[12]=t[12]+r[12],e[13]=t[13]+r[13],e[14]=t[14]+r[14],e[15]=t[15]+r[15],e}function gh(e,t,r){return e[0]=t[0]-r[0],e[1]=t[1]-r[1],e[2]=t[2]-r[2],e[3]=t[3]-r[3],e[4]=t[4]-r[4],e[5]=t[5]-r[5],e[6]=t[6]-r[6],e[7]=t[7]-r[7],e[8]=t[8]-r[8],e[9]=t[9]-r[9],e[10]=t[10]-r[10],e[11]=t[11]-r[11],e[12]=t[12]-r[12],e[13]=t[13]-r[13],e[14]=t[14]-r[14],e[15]=t[15]-r[15],e}function nm(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e[4]=t[4]*r,e[5]=t[5]*r,e[6]=t[6]*r,e[7]=t[7]*r,e[8]=t[8]*r,e[9]=t[9]*r,e[10]=t[10]*r,e[11]=t[11]*r,e[12]=t[12]*r,e[13]=t[13]*r,e[14]=t[14]*r,e[15]=t[15]*r,e}function sm(e,t,r,n){return e[0]=t[0]+r[0]*n,e[1]=t[1]+r[1]*n,e[2]=t[2]+r[2]*n,e[3]=t[3]+r[3]*n,e[4]=t[4]+r[4]*n,e[5]=t[5]+r[5]*n,e[6]=t[6]+r[6]*n,e[7]=t[7]+r[7]*n,e[8]=t[8]+r[8]*n,e[9]=t[9]+r[9]*n,e[10]=t[10]+r[10]*n,e[11]=t[11]+r[11]*n,e[12]=t[12]+r[12]*n,e[13]=t[13]+r[13]*n,e[14]=t[14]+r[14]*n,e[15]=t[15]+r[15]*n,e}function om(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function im(e,t){let r=e[0],n=e[1],s=e[2],o=e[3],i=e[4],a=e[5],f=e[6],c=e[7],h=e[8],l=e[9],u=e[10],d=e[11],A=e[12],m=e[13],p=e[14],E=e[15],y=t[0],C=t[1],M=t[2],T=t[3],I=t[4],w=t[5],L=t[6],x=t[7],g=t[8],B=t[9],_=t[10],U=t[11],G=t[12],P=t[13],v=t[14],at=t[15];return Math.abs(r-y)<=1e-6*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-C)<=1e-6*Math.max(1,Math.abs(n),Math.abs(C))&&Math.abs(s-M)<=1e-6*Math.max(1,Math.abs(s),Math.abs(M))&&Math.abs(o-T)<=1e-6*Math.max(1,Math.abs(o),Math.abs(T))&&Math.abs(i-I)<=1e-6*Math.max(1,Math.abs(i),Math.abs(I))&&Math.abs(a-w)<=1e-6*Math.max(1,Math.abs(a),Math.abs(w))&&Math.abs(f-L)<=1e-6*Math.max(1,Math.abs(f),Math.abs(L))&&Math.abs(c-x)<=1e-6*Math.max(1,Math.abs(c),Math.abs(x))&&Math.abs(h-g)<=1e-6*Math.max(1,Math.abs(h),Math.abs(g))&&Math.abs(l-B)<=1e-6*Math.max(1,Math.abs(l),Math.abs(B))&&Math.abs(u-_)<=1e-6*Math.max(1,Math.abs(u),Math.abs(_))&&Math.abs(d-U)<=1e-6*Math.max(1,Math.abs(d),Math.abs(U))&&Math.abs(A-G)<=1e-6*Math.max(1,Math.abs(A),Math.abs(G))&&Math.abs(m-P)<=1e-6*Math.max(1,Math.abs(m),Math.abs(P))&&Math.abs(p-v)<=1e-6*Math.max(1,Math.abs(p),Math.abs(v))&&Math.abs(E-at)<=1e-6*Math.max(1,Math.abs(E),Math.abs(at))}var am=Rn,cm=gh;function fm(){let e=new W(4);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0,e[3]=0),e}function xh(e,t,r){return e[0]=t[0]+r[0],e[1]=t[1]+r[1],e[2]=t[2]+r[2],e[3]=t[3]+r[3],e}function Bh(e,t,r){return e[0]=t[0]*r,e[1]=t[1]*r,e[2]=t[2]*r,e[3]=t[3]*r,e}function Eh(e){let t=e[0],r=e[1],n=e[2],s=e[3];return Math.sqrt(t*t+r*r+n*n+s*s)}function _h(e){let t=e[0],r=e[1],n=e[2],s=e[3];return t*t+r*r+n*n+s*s}function yh(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r*r+n*n+s*s+o*o;return i>0&&(i=1/Math.sqrt(i)),e[0]=r*i,e[1]=n*i,e[2]=s*i,e[3]=o*i,e}function Th(e,t){return e[0]*t[0]+e[1]*t[1]+e[2]*t[2]+e[3]*t[3]}function Ch(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3];return e[0]=s+n*(r[0]-s),e[1]=o+n*(r[1]-o),e[2]=i+n*(r[2]-i),e[3]=a+n*(r[3]-a),e}function Mh(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3];return e[0]=r[0]*n+r[4]*s+r[8]*o+r[12]*i,e[1]=r[1]*n+r[5]*s+r[9]*o+r[13]*i,e[2]=r[2]*n+r[6]*s+r[10]*o+r[14]*i,e[3]=r[3]*n+r[7]*s+r[11]*o+r[15]*i,e}function bh(e,t,r){let n=t[0],s=t[1],o=t[2],i=r[0],a=r[1],f=r[2],c=r[3],h=c*n+a*o-f*s,l=c*s+f*n-i*o,u=c*o+i*s-a*n,d=-i*n-a*s-f*o;return e[0]=h*c+d*-i+l*-f-u*-a,e[1]=l*c+d*-a+u*-i-h*-f,e[2]=u*c+d*-f+h*-a-l*-i,e[3]=t[3],e}var nb=function(){let e=fm();return function(t,r,n,s,o,i){let a,f;for(r||(r=4),n||(n=0),s?f=Math.min(s*r+n,t.length):f=t.length,a=n;a<f;a+=r)e[0]=t[a],e[1]=t[a+1],e[2]=t[a+2],e[3]=t[a+3],o(e,e,i),t[a]=e[0],t[a+1]=e[1],t[a+2]=e[2],t[a+3]=e[3];return t}}();var zi;(function(e){e[e.COL0ROW0=0]="COL0ROW0",e[e.COL0ROW1=1]="COL0ROW1",e[e.COL0ROW2=2]="COL0ROW2",e[e.COL0ROW3=3]="COL0ROW3",e[e.COL1ROW0=4]="COL1ROW0",e[e.COL1ROW1=5]="COL1ROW1",e[e.COL1ROW2=6]="COL1ROW2",e[e.COL1ROW3=7]="COL1ROW3",e[e.COL2ROW0=8]="COL2ROW0",e[e.COL2ROW1=9]="COL2ROW1",e[e.COL2ROW2=10]="COL2ROW2",e[e.COL2ROW3=11]="COL2ROW3",e[e.COL3ROW0=12]="COL3ROW0",e[e.COL3ROW1=13]="COL3ROW1",e[e.COL3ROW2=14]="COL3ROW2",e[e.COL3ROW3=15]="COL3ROW3"})(zi||(zi={}));var lm=45*Math.PI/180,um=1,ki=.1,Ji=500,dm=Object.freeze([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]),Rt=class extends Or{static get IDENTITY(){return mm()}static get ZERO(){return Am()}get ELEMENTS(){return 16}get RANK(){return 4}get INDICES(){return zi}constructor(t){super(-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this.check()}set(t,r,n,s,o,i,a,f,c,h,l,u,d,A,m,p){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this[4]=o,this[5]=i,this[6]=a,this[7]=f,this[8]=c,this[9]=h,this[10]=l,this[11]=u,this[12]=d,this[13]=A,this[14]=m,this[15]=p,this.check()}setRowMajor(t,r,n,s,o,i,a,f,c,h,l,u,d,A,m,p){return this[0]=t,this[1]=o,this[2]=c,this[3]=d,this[4]=r,this[5]=i,this[6]=h,this[7]=A,this[8]=n,this[9]=a,this[10]=l,this[11]=m,this[12]=s,this[13]=f,this[14]=u,this[15]=p,this.check()}toRowMajor(t){return t[0]=this[0],t[1]=this[4],t[2]=this[8],t[3]=this[12],t[4]=this[1],t[5]=this[5],t[6]=this[9],t[7]=this[13],t[8]=this[2],t[9]=this[6],t[10]=this[10],t[11]=this[14],t[12]=this[3],t[13]=this[7],t[14]=this[11],t[15]=this[15],t}identity(){return this.copy(dm)}fromObject(t){return this.check()}fromQuaternion(t){return Ni(this,t),this.check()}frustum(t){let{left:r,right:n,bottom:s,top:o,near:i=ki,far:a=Ji}=t;return a===1/0?pm(this,r,n,s,o,i):Gi(this,r,n,s,o,i,a),this.check()}lookAt(t){let{eye:r,center:n=[0,0,0],up:s=[0,1,0]}=t;return Hi(this,r,n,s),this.check()}ortho(t){let{left:r,right:n,bottom:s,top:o,near:i=ki,far:a=Ji}=t;return Pi(this,r,n,s,o,i,a),this.check()}orthographic(t){let{fovy:r=lm,aspect:n=um,focalDistance:s=1,near:o=ki,far:i=Ji}=t;wh(r);let a=r/2,f=s*Math.tan(a),c=f*n;return this.ortho({left:-c,right:c,bottom:-f,top:f,near:o,far:i})}perspective(t){let{fovy:r=45*Math.PI/180,aspect:n=1,near:s=.1,far:o=500}=t;return wh(r),Ui(this,r,n,s,o),this.check()}determinant(){return Si(this)}getScale(t=[-0,-0,-0]){return t[0]=Math.sqrt(this[0]*this[0]+this[1]*this[1]+this[2]*this[2]),t[1]=Math.sqrt(this[4]*this[4]+this[5]*this[5]+this[6]*this[6]),t[2]=Math.sqrt(this[8]*this[8]+this[9]*this[9]+this[10]*this[10]),t}getTranslation(t=[-0,-0,-0]){return t[0]=this[12],t[1]=this[13],t[2]=this[14],t}getRotation(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),s=1/n[0],o=1/n[1],i=1/n[2];return t[0]=this[0]*s,t[1]=this[1]*o,t[2]=this[2]*i,t[3]=0,t[4]=this[4]*s,t[5]=this[5]*o,t[6]=this[6]*i,t[7]=0,t[8]=this[8]*s,t[9]=this[9]*o,t[10]=this[10]*i,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}getRotationMatrix3(t,r){t=t||[-0,-0,-0,-0,-0,-0,-0,-0,-0],r=r||[-0,-0,-0];let n=this.getScale(r),s=1/n[0],o=1/n[1],i=1/n[2];return t[0]=this[0]*s,t[1]=this[1]*o,t[2]=this[2]*i,t[3]=this[4]*s,t[4]=this[5]*o,t[5]=this[6]*i,t[6]=this[8]*s,t[7]=this[9]*o,t[8]=this[10]*i,t}transpose(){return wi(this,this),this.check()}invert(){return Ii(this,this),this.check()}multiplyLeft(t){return Rn(this,t,this),this.check()}multiplyRight(t){return Rn(this,this,t),this.check()}rotateX(t){return Li(this,this,t),this.check()}rotateY(t){return Oi(this,this,t),this.check()}rotateZ(t){return vi(this,this,t),this.check()}rotateXYZ(t){return this.rotateX(t[0]).rotateY(t[1]).rotateZ(t[2])}rotateAxis(t,r){return Di(this,this,t,r),this.check()}scale(t){return Fi(this,this,Array.isArray(t)?t:[t,t,t]),this.check()}translate(t){return Ri(this,this,t),this.check()}transform(t,r){return t.length===4?(r=Mh(r||[-0,-0,-0,-0],t,this),we(r,4),r):this.transformAsPoint(t,r)}transformAsPoint(t,r){let{length:n}=t,s;switch(n){case 2:s=Xf(r||[-0,-0],t,this);break;case 3:s=Ve(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(s,t.length),s}transformAsVector(t,r){let n;switch(t.length){case 2:n=Yf(r||[-0,-0],t,this);break;case 3:n=Ss(r||[-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return we(n,t.length),n}transformPoint(t,r){return this.transformAsPoint(t,r)}transformVector(t,r){return this.transformAsPoint(t,r)}transformDirection(t,r){return this.transformAsVector(t,r)}makeRotationX(t){return this.identity().rotateX(t)}makeTranslation(t,r,n){return this.identity().translate([t,r,n])}},Gs,Us;function Am(){return Gs||(Gs=new Rt([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),Object.freeze(Gs)),Gs}function mm(){return Us||(Us=new Rt,Object.freeze(Us)),Us}function wh(e){if(e>Math.PI*2)throw Error("expected radians")}function pm(e,t,r,n,s,o){let i=2*o/(r-t),a=2*o/(s-n),f=(r+t)/(r-t),c=(s+n)/(s-n),h=-1,l=-1,u=-2*o;return e[0]=i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=a,e[6]=0,e[7]=0,e[8]=f,e[9]=c,e[10]=h,e[11]=l,e[12]=0,e[13]=0,e[14]=u,e[15]=0,e}function Ih(){let e=new W(4);return W!=Float32Array&&(e[0]=0,e[1]=0,e[2]=0),e[3]=1,e}function Sh(e){return e[0]=0,e[1]=0,e[2]=0,e[3]=1,e}function Qi(e,t,r){r=r*.5;let n=Math.sin(r);return e[0]=n*t[0],e[1]=n*t[1],e[2]=n*t[2],e[3]=Math.cos(r),e}function Vi(e,t,r){let n=t[0],s=t[1],o=t[2],i=t[3],a=r[0],f=r[1],c=r[2],h=r[3];return e[0]=n*h+i*a+s*c-o*f,e[1]=s*h+i*f+o*a-n*c,e[2]=o*h+i*c+n*f-s*a,e[3]=i*h-n*a-s*f-o*c,e}function Rh(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),f=Math.cos(r);return e[0]=n*f+i*a,e[1]=s*f+o*a,e[2]=o*f-s*a,e[3]=i*f-n*a,e}function Fh(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),f=Math.cos(r);return e[0]=n*f-o*a,e[1]=s*f+i*a,e[2]=o*f+n*a,e[3]=i*f-s*a,e}function Dh(e,t,r){r*=.5;let n=t[0],s=t[1],o=t[2],i=t[3],a=Math.sin(r),f=Math.cos(r);return e[0]=n*f+s*a,e[1]=s*f-n*a,e[2]=o*f+i*a,e[3]=i*f-o*a,e}function Lh(e,t){let r=t[0],n=t[1],s=t[2];return e[0]=r,e[1]=n,e[2]=s,e[3]=Math.sqrt(Math.abs(1-r*r-n*n-s*s)),e}function Dn(e,t,r,n){let s=t[0],o=t[1],i=t[2],a=t[3],f=r[0],c=r[1],h=r[2],l=r[3],u,d,A,m,p;return u=s*f+o*c+i*h+a*l,u<0&&(u=-u,f=-f,c=-c,h=-h,l=-l),1-u>1e-6?(d=Math.acos(u),p=Math.sin(d),A=Math.sin((1-n)*d)/p,m=Math.sin(n*d)/p):(A=1-n,m=n),e[0]=A*s+m*f,e[1]=A*o+m*c,e[2]=A*i+m*h,e[3]=A*a+m*l,e}function Oh(e,t){let r=t[0],n=t[1],s=t[2],o=t[3],i=r*r+n*n+s*s+o*o,a=i?1/i:0;return e[0]=-r*a,e[1]=-n*a,e[2]=-s*a,e[3]=o*a,e}function vh(e,t){return e[0]=-t[0],e[1]=-t[1],e[2]=-t[2],e[3]=t[3],e}function ji(e,t){let r=t[0]+t[4]+t[8],n;if(r>0)n=Math.sqrt(r+1),e[3]=.5*n,n=.5/n,e[0]=(t[5]-t[7])*n,e[1]=(t[6]-t[2])*n,e[2]=(t[1]-t[3])*n;else{let s=0;t[4]>t[0]&&(s=1),t[8]>t[s*3+s]&&(s=2);let o=(s+1)%3,i=(s+2)%3;n=Math.sqrt(t[s*3+s]-t[o*3+o]-t[i*3+i]+1),e[s]=.5*n,n=.5/n,e[3]=(t[o*3+i]-t[i*3+o])*n,e[o]=(t[o*3+s]+t[s*3+o])*n,e[i]=(t[i*3+s]+t[s*3+i])*n}return e}var Nh=xh;var Gh=Bh,Uh=Th,Ph=Ch,Hh=Eh;var kh=_h;var Jh=yh;var zh=function(){let e=Fs(),t=Ds(1,0,0),r=Ds(0,1,0);return function(n,s,o){let i=wn(s,o);return i<-.999999?(Qe(e,t,s),yi(e)<1e-6&&Qe(e,r,s),gi(e,e),Qi(n,e,Math.PI),n):i>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(Qe(e,s,o),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=1+i,Jh(n,n))}}(),gb=function(){let e=Ih(),t=Ih();return function(r,n,s,o,i,a){return Dn(e,n,i,a),Dn(t,s,o,a),Dn(r,e,t,2*a*(1-a)),r}}(),xb=function(){let e=oh();return function(t,r,n,s){return e[0]=n[0],e[3]=n[1],e[6]=n[2],e[1]=s[0],e[4]=s[1],e[7]=s[2],e[2]=-r[0],e[5]=-r[1],e[8]=-r[2],Jh(t,ji(t,e))}}();var gm=[0,0,0,1],Ie=class extends be{constructor(t=0,r=0,n=0,s=1){super(-0,-0,-0,-0),Array.isArray(t)&&arguments.length===1?this.copy(t):this.set(t,r,n,s)}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this.check()}set(t,r,n,s){return this[0]=t,this[1]=r,this[2]=n,this[3]=s,this.check()}fromObject(t){return this[0]=t.x,this[1]=t.y,this[2]=t.z,this[3]=t.w,this.check()}fromMatrix3(t){return ji(this,t),this.check()}fromAxisRotation(t,r){return Qi(this,t,r),this.check()}identity(){return Sh(this),this.check()}setAxisAngle(t,r){return this.fromAxisRotation(t,r)}get ELEMENTS(){return 4}get x(){return this[0]}set x(t){this[0]=z(t)}get y(){return this[1]}set y(t){this[1]=z(t)}get z(){return this[2]}set z(t){this[2]=z(t)}get w(){return this[3]}set w(t){this[3]=z(t)}len(){return Hh(this)}lengthSquared(){return kh(this)}dot(t){return Uh(this,t)}rotationTo(t,r){return zh(this,t,r),this.check()}add(t){return Nh(this,this,t),this.check()}calculateW(){return Lh(this,this),this.check()}conjugate(){return vh(this,this),this.check()}invert(){return Oh(this,this),this.check()}lerp(t,r,n){return n===void 0?this.lerp(this,t,r):(Ph(this,t,r,n),this.check())}multiplyRight(t){return Vi(this,this,t),this.check()}multiplyLeft(t){return Vi(this,t,this),this.check()}normalize(){let t=this.len(),r=t>0?1/t:0;return this[0]=this[0]*r,this[1]=this[1]*r,this[2]=this[2]*r,this[3]=this[3]*r,t===0&&(this[3]=1),this.check()}rotateX(t){return Rh(this,this,t),this.check()}rotateY(t){return Fh(this,this,t),this.check()}rotateZ(t){return Dh(this,this,t),this.check()}scale(t){return Gh(this,this,t),this.check()}slerp(t,r,n){let s,o,i;switch(arguments.length){case 1:({start:s=gm,target:o,ratio:i}=t);break;case 2:s=this,o=t,i=r;break;default:s=t,o=r,i=n}return Dn(this,s,o,i),this.check()}transformVector4(t,r=new Lr){return bh(r,t,this),we(r,4)}lengthSq(){return this.lengthSquared()}setFromAxisAngle(t,r){return this.setAxisAngle(t,r)}premultiply(t){return this.multiplyLeft(t)}multiply(t){return this.multiplyRight(t)}};var Ht={};ut(Ht,{EPSILON1:()=>xm,EPSILON10:()=>wm,EPSILON11:()=>Im,EPSILON12:()=>Sm,EPSILON13:()=>Rm,EPSILON14:()=>Fm,EPSILON15:()=>Dm,EPSILON16:()=>Lm,EPSILON17:()=>Om,EPSILON18:()=>vm,EPSILON19:()=>Nm,EPSILON2:()=>Bm,EPSILON20:()=>Gm,EPSILON3:()=>Em,EPSILON4:()=>_m,EPSILON5:()=>ym,EPSILON6:()=>Tm,EPSILON7:()=>Cm,EPSILON8:()=>Mm,EPSILON9:()=>bm,PI_OVER_FOUR:()=>Pm,PI_OVER_SIX:()=>Hm,PI_OVER_TWO:()=>Um,TWO_PI:()=>km});var xm=.1,Bm=.01,Em=.001,_m=1e-4,ym=1e-5,Tm=1e-6,Cm=1e-7,Mm=1e-8,bm=1e-9,wm=1e-10,Im=1e-11,Sm=1e-12,Rm=1e-13,Fm=1e-14,Dm=1e-15,Lm=1e-16,Om=1e-17,vm=1e-18,Nm=1e-19,Gm=1e-20,Um=Math.PI/2,Pm=Math.PI/4,Hm=Math.PI/6,km=Math.PI*2;var kt=class{json;buffer;featuresLength=0;_cachedTypedArrays={};constructor(t,r){this.json=t,this.buffer=r}getExtension(t){return this.json.extensions&&this.json.extensions[t]}hasProperty(t){return Boolean(this.json[t])}getGlobalProperty(t,r=H.UNSIGNED_INT,n=1){let s=this.json[t];return s&&Number.isFinite(s.byteOffset)?this._getTypedArrayFromBinary(t,r,n,1,s.byteOffset):s}getPropertyArray(t,r,n){let s=this.json[t];return s&&Number.isFinite(s.byteOffset)?("componentType"in s&&(r=dt.fromName(s.componentType)),this._getTypedArrayFromBinary(t,r,n,this.featuresLength,s.byteOffset)):this._getTypedArrayFromArray(t,r,s)}getProperty(t,r,n,s,o){let i=this.json[t];if(!i)return i;let a=this.getPropertyArray(t,r,n);if(n===1)return a[s];for(let f=0;f<n;++f)o[f]=a[n*s+f];return o}_getTypedArrayFromBinary(t,r,n,s,o){let i=this._cachedTypedArrays,a=i[t];return a||(a=dt.createTypedArray(r,this.buffer.buffer,this.buffer.byteOffset+o,s*n),i[t]=a),a}_getTypedArrayFromArray(t,r,n){let s=this._cachedTypedArrays,o=s[t];return o||(o=dt.createTypedArray(r,n),s[t]=o),o}};var Jm={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zm={SCALAR:(e,t)=>e[t],VEC2:(e,t)=>[e[2*t+0],e[2*t+1]],VEC3:(e,t)=>[e[3*t+0],e[3*t+1],e[3*t+2]],VEC4:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT2:(e,t)=>[e[4*t+0],e[4*t+1],e[4*t+2],e[4*t+3]],MAT3:(e,t)=>[e[9*t+0],e[9*t+1],e[9*t+2],e[9*t+3],e[9*t+4],e[9*t+5],e[9*t+6],e[9*t+7],e[9*t+8]],MAT4:(e,t)=>[e[16*t+0],e[16*t+1],e[16*t+2],e[16*t+3],e[16*t+4],e[16*t+5],e[16*t+6],e[16*t+7],e[16*t+8],e[16*t+9],e[16*t+10],e[16*t+11],e[16*t+12],e[16*t+13],e[16*t+14],e[16*t+15]]},Qm={SCALAR:(e,t,r)=>{t[r]=e},VEC2:(e,t,r)=>{t[2*r+0]=e[0],t[2*r+1]=e[1]},VEC3:(e,t,r)=>{t[3*r+0]=e[0],t[3*r+1]=e[1],t[3*r+2]=e[2]},VEC4:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT2:(e,t,r)=>{t[4*r+0]=e[0],t[4*r+1]=e[1],t[4*r+2]=e[2],t[4*r+3]=e[3]},MAT3:(e,t,r)=>{t[9*r+0]=e[0],t[9*r+1]=e[1],t[9*r+2]=e[2],t[9*r+3]=e[3],t[9*r+4]=e[4],t[9*r+5]=e[5],t[9*r+6]=e[6],t[9*r+7]=e[7],t[9*r+8]=e[8],t[9*r+9]=e[9]},MAT4:(e,t,r)=>{t[16*r+0]=e[0],t[16*r+1]=e[1],t[16*r+2]=e[2],t[16*r+3]=e[3],t[16*r+4]=e[4],t[16*r+5]=e[5],t[16*r+6]=e[6],t[16*r+7]=e[7],t[16*r+8]=e[8],t[16*r+9]=e[9],t[16*r+10]=e[10],t[16*r+11]=e[11],t[16*r+12]=e[12],t[16*r+13]=e[13],t[16*r+14]=e[14],t[16*r+15]=e[15]}};function Qh(e,t,r,n){let{componentType:s}=e;J(e.componentType);let o=typeof s=="string"?dt.fromName(s):s,i=Jm[e.type],a=zm[e.type],f=Qm[e.type];return r+=e.byteOffset,{values:dt.createTypedArray(o,t,r,i*n),type:o,size:i,unpacker:a,packer:f}}var te=e=>e!==void 0;function Vh(e,t,r){if(!t)return null;let n=e.getExtension("3DTILES_batch_table_hierarchy"),s=t.HIERARCHY;return s&&(console.warn("3D Tile Parser: HIERARCHY is deprecated. Use 3DTILES_batch_table_hierarchy."),t.extensions=t.extensions||{},t.extensions["3DTILES_batch_table_hierarchy"]=s,n=s),n?Vm(n,r):null}function Vm(e,t){let r,n,s,o=e.instancesLength,i=e.classes,a=e.classIds,f=e.parentCounts,c=e.parentIds,h=o;te(a.byteOffset)&&(a.componentType=defaultValue(a.componentType,GL.UNSIGNED_SHORT),a.type=AttributeType.SCALAR,s=getBinaryAccessor(a),a=s.createArrayBufferView(t.buffer,t.byteOffset+a.byteOffset,o));let l;if(te(f))for(te(f.byteOffset)&&(f.componentType=defaultValue(f.componentType,GL.UNSIGNED_SHORT),f.type=AttributeType.SCALAR,s=getBinaryAccessor(f),f=s.createArrayBufferView(t.buffer,t.byteOffset+f.byteOffset,o)),l=new Uint16Array(o),h=0,r=0;r<o;++r)l[r]=h,h+=f[r];te(c)&&te(c.byteOffset)&&(c.componentType=defaultValue(c.componentType,GL.UNSIGNED_SHORT),c.type=AttributeType.SCALAR,s=getBinaryAccessor(c),c=s.createArrayBufferView(t.buffer,t.byteOffset+c.byteOffset,h));let u=i.length;for(r=0;r<u;++r){let p=i[r].length,E=i[r].instances,y=getBinaryProperties(p,E,t);i[r].instances=combine(y,E)}let d=new Array(u).fill(0),A=new Uint16Array(o);for(r=0;r<o;++r)n=a[r],A[r]=d[n],++d[n];let m={classes:i,classIds:a,classIndexes:A,parentCounts:f,parentIndexes:l,parentIds:c};return Xm(m),m}function vr(e,t,r){if(!e)return;let n=e.parentCounts;return e.parentIds?r(e,t):n>0?jm(e,t,r):Km(e,t,r)}function jm(e,t,r){let n=e.classIds,s=e.parentCounts,o=e.parentIds,i=e.parentIndexes,a=n.length,f=scratchVisited;f.length=Math.max(f.length,a);let c=++marker,h=scratchStack;for(h.length=0,h.push(t);h.length>0;){if(t=h.pop(),f[t]===c)continue;f[t]=c;let l=r(e,t);if(te(l))return l;let u=s[t],d=i[t];for(let A=0;A<u;++A){let m=o[d+A];m!==t&&h.push(m)}}return null}function Km(e,t,r){let n=!0;for(;n;){let s=r(e,t);if(te(s))return s;let o=e.parentIds[t];n=o!==t,t=o}throw new Error("traverseHierarchySingleParent")}function Xm(e){let t=[],n=e.classIds.length;for(let s=0;s<n;++s)jh(e,s,stack)}function jh(e,t,r){let n=e.parentCounts,s=e.parentIds,o=e.parentIndexes,a=e.classIds.length;if(!te(s))return;assert(t<a,`Parent index ${t} exceeds the total number of instances: ${a}`),assert(r.indexOf(t)===-1,"Circular dependency detected in the batch table hierarchy."),r.push(t);let f=te(n)?n[t]:1,c=te(n)?o[t]:t;for(let h=0;h<f;++h){let l=s[c+h];l!==t&&jh(e,l,r)}r.pop(t)}function Tt(e){return e!=null}var Ps=(e,t)=>e,Ym={HIERARCHY:!0,extensions:!0,extras:!0},ue=class{json;binary;featureCount;_extensions;_properties;_binaryProperties;_hierarchy;constructor(t,r,n,s={}){J(n>=0),this.json=t||{},this.binary=r,this.featureCount=n,this._extensions=this.json?.extensions||{},this._properties={};for(let o in this.json)Ym[o]||(this._properties[o]=this.json[o]);this._binaryProperties=this._initializeBinaryProperties(),s["3DTILES_batch_table_hierarchy"]&&(this._hierarchy=Vh(this,this.json,this.binary))}getExtension(t){return this.json&&this.json.extensions&&this.json.extensions[t]}memorySizeInBytes(){return 0}isClass(t,r){if(this._checkBatchId(t),J(typeof r=="string",r),this._hierarchy){let n=vr(this._hierarchy,t,(s,o)=>{let i=s.classIds[o];return s.classes[i].name===r});return Tt(n)}return!1}isExactClass(t,r){return J(typeof r=="string",r),this.getExactClassName(t)===r}getExactClassName(t){if(this._checkBatchId(t),this._hierarchy){let r=this._hierarchy.classIds[t];return this._hierarchy.classes[r].name}}hasProperty(t,r){return this._checkBatchId(t),J(typeof r=="string",r),Tt(this._properties[r])||this._hasPropertyInHierarchy(t,r)}getPropertyNames(t,r){this._checkBatchId(t),r=Tt(r)?r:[],r.length=0;let n=Object.keys(this._properties);return r.push(...n),this._hierarchy&&this._getPropertyNamesInHierarchy(t,r),r}getProperty(t,r){if(this._checkBatchId(t),J(typeof r=="string",r),this._binaryProperties){let s=this._binaryProperties[r];if(Tt(s))return this._getBinaryProperty(s,t)}let n=this._properties[r];if(Tt(n))return Ps(n[t],!0);if(this._hierarchy){let s=this._getHierarchyProperty(t,r);if(Tt(s))return s}}setProperty(t,r,n){let s=this.featureCount;if(this._checkBatchId(t),J(typeof r=="string",r),this._binaryProperties){let i=this._binaryProperties[r];if(i){this._setBinaryProperty(i,t,n);return}}if(this._hierarchy&&this._setHierarchyProperty(this,t,r,n))return;let o=this._properties[r];Tt(o)||(this._properties[r]=new Array(s),o=this._properties[r]),o[t]=Ps(n,!0)}_checkBatchId(t){if(!(t>=0&&t<this.featureCount))throw new Error("batchId not in range [0, featureCount - 1].")}_getBinaryProperty(t,r){return t.unpack(t.typedArray,r)}_setBinaryProperty(t,r,n){t.pack(n,t.typedArray,r)}_initializeBinaryProperties(){let t=null;for(let r in this._properties){let n=this._properties[r],s=this._initializeBinaryProperty(r,n);s&&(t=t||{},t[r]=s)}return t}_initializeBinaryProperty(t,r){if("byteOffset"in r){let n=r;J(this.binary,`Property ${t} requires a batch table binary.`),J(n.type,`Property ${t} requires a type.`);let s=Qh(n,this.binary.buffer,this.binary.byteOffset|0,this.featureCount);return{typedArray:s.values,componentCount:s.size,unpack:s.unpacker,pack:s.packer}}return null}_hasPropertyInHierarchy(t,r){if(!this._hierarchy)return!1;let n=vr(this._hierarchy,t,(s,o)=>{let i=s.classIds[o],a=s.classes[i].instances;return Tt(a[r])});return Tt(n)}_getPropertyNamesInHierarchy(t,r){vr(this._hierarchy,t,(n,s)=>{let o=n.classIds[s],i=n.classes[o].instances;for(let a in i)i.hasOwnProperty(a)&&r.indexOf(a)===-1&&r.push(a)})}_getHierarchyProperty(t,r){return vr(this._hierarchy,t,(n,s)=>{let o=n.classIds[s],i=n.classes[o],a=n.classIndexes[s],f=i.instances[r];return Tt(f)?Tt(f.typedArray)?this._getBinaryProperty(f,a):Ps(f[a],!0):null})}_setHierarchyProperty(t,r,n,s){let o=vr(this._hierarchy,r,(i,a)=>{let f=i.classIds[a],c=i.classes[f],h=i.classIndexes[a],l=c.instances[n];return Tt(l)?(J(a===r,`Inherited property "${n}" is read-only.`),Tt(l.typedArray)?this._setBinaryProperty(l,h,s):l[h]=Ps(s,!0),!0):!1});return Tt(o)}};function Se(e,t,r=0){let n=new DataView(t);if(e.magic=n.getUint32(r,!0),r+=4,e.version=n.getUint32(r,!0),r+=4,e.byteLength=n.getUint32(r,!0),r+=4,e.version!==1)throw new Error(`3D Tile Version ${e.version} not supported`);return r}var Nr=4,Kh="b3dm tile in legacy format.";function Gr(e,t,r){let n=new DataView(t),s;e.header=e.header||{};let o=n.getUint32(r,!0);r+=Nr;let i=n.getUint32(r,!0);r+=Nr;let a=n.getUint32(r,!0);r+=Nr;let f=n.getUint32(r,!0);return r+=Nr,a>=570425344?(r-=Nr*2,s=o,a=i,f=0,o=0,i=0,console.warn(Kh)):f>=570425344&&(r-=Nr,s=a,a=o,f=i,o=0,i=0,console.warn(Kh)),e.header.featureTableJsonByteLength=o,e.header.featureTableBinaryByteLength=i,e.header.batchTableJsonByteLength=a,e.header.batchTableBinaryByteLength=f,e.header.batchLength=s,r}function Ur(e,t,r,n){return r=Zm(e,t,r,n),r=qm(e,t,r,n),r}function Zm(e,t,r,n){let{featureTableJsonByteLength:s,featureTableBinaryByteLength:o,batchLength:i}=e.header||{};if(e.featureTableJson={BATCH_LENGTH:i||0},s&&s>0){let a=si(t,r,s);e.featureTableJson=JSON.parse(a)}return r+=s||0,e.featureTableBinary=new Uint8Array(t,r,o),r+=o||0,r}function qm(e,t,r,n){let{batchTableJsonByteLength:s,batchTableBinaryByteLength:o}=e.header||{};if(s&&s>0){let i=si(t,r,s);e.batchTableJson=JSON.parse(i),r+=s,o&&o>0&&(e.batchTableBinary=new Uint8Array(t,r,o),e.batchTableBinary=new Uint8Array(e.batchTableBinary),r+=o)}return r}function Ki(e,t,r){if(!t&&(!e||!e.batchIds||!r))return null;let{batchIds:n,isRGB565:s,pointCount:o=0}=e;if(n&&r){let i=new Uint8ClampedArray(o*3);for(let a=0;a<o;a++){let f=n[a],h=r.getProperty(f,"dimensions").map(l=>l*255);i[a*3]=h[0],i[a*3+1]=h[1],i[a*3+2]=h[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}if(t&&s){let i=new Uint8ClampedArray(o*3);for(let a=0;a<o;a++){let f=ui(t[a]);i[a*3]=f[0],i[a*3+1]=f[1],i[a*3+2]=f[2]}return{type:H.UNSIGNED_BYTE,value:i,size:3,normalized:!0}}return t&&t.length===o*3?{type:H.UNSIGNED_BYTE,value:t,size:3,normalized:!0}:{type:H.UNSIGNED_BYTE,value:t||new Uint8ClampedArray,size:4,normalized:!0}}var Xh=new b;function Yh(e,t){if(!t)return null;if(e.isOctEncoded16P){let r=new Float32Array((e.pointsLength||0)*3);for(let n=0;n<(e.pointsLength||0);n++)di(t[n*2],t[n*2+1],Xh),Xh.toArray(r,n*3);return{type:H.FLOAT,size:2,value:r}}return{type:H.FLOAT,size:2,value:t}}function Zh(e,t,r){return e.isQuantized?r["3d-tiles"]&&r["3d-tiles"].decodeQuantizedPositions?(e.isQuantized=!1,Wm(e,t)):{type:H.UNSIGNED_SHORT,value:t,size:3,normalized:!0}:t}function Wm(e,t){let r=new b,n=new Float32Array(e.pointCount*3);for(let s=0;s<e.pointCount;s++)r.set(t[s*3],t[s*3+1],t[s*3+2]).scale(1/e.quantizedRange).multiply(e.quantizedVolumeScale).add(e.quantizedVolumeOffset).toArray(n,s*3);return n}async function qh(e,t,r,n,s){r=Se(e,t,r),r=Gr(e,t,r),r=Ur(e,t,r,n),$m(e);let{featureTable:o,batchTable:i}=tp(e);return await op(e,o,i,n,s),ep(e,o,n),rp(e,o,i),np(e,o),r}function $m(e){e.attributes={positions:null,colors:null,normals:null,batchIds:null},e.isQuantized=!1,e.isTranslucent=!1,e.isRGB565=!1,e.isOctEncoded16P=!1}function tp(e){let t=new kt(e.featureTableJson,e.featureTableBinary),r=t.getGlobalProperty("POINTS_LENGTH");if(!Number.isFinite(r))throw new Error("POINTS_LENGTH must be defined");t.featuresLength=r,e.featuresLength=r,e.pointsLength=r,e.pointCount=r,e.rtcCenter=t.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let n=sp(e,t);return{featureTable:t,batchTable:n}}function ep(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.positions){if(t.hasProperty("POSITION"))e.attributes.positions=t.getPropertyArray("POSITION",H.FLOAT,3);else if(t.hasProperty("POSITION_QUANTIZED")){let n=t.getPropertyArray("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3);if(e.isQuantized=!0,e.quantizedRange=(1<<16)-1,e.quantizedVolumeScale=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3),!e.quantizedVolumeScale)throw new Error("QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");if(e.quantizedVolumeOffset=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3),!e.quantizedVolumeOffset)throw new Error("QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");e.attributes.positions=Zh(e,n,r)}}if(!e.attributes.positions)throw new Error("Either POSITION or POSITION_QUANTIZED must be defined.")}function rp(e,t,r){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.colors){let n=null;t.hasProperty("RGBA")?(n=t.getPropertyArray("RGBA",H.UNSIGNED_BYTE,4),e.isTranslucent=!0):t.hasProperty("RGB")?n=t.getPropertyArray("RGB",H.UNSIGNED_BYTE,3):t.hasProperty("RGB565")&&(n=t.getPropertyArray("RGB565",H.UNSIGNED_SHORT,1),e.isRGB565=!0),e.attributes.colors=Ki(e,n,r)}t.hasProperty("CONSTANT_RGBA")&&(e.constantRGBA=t.getGlobalProperty("CONSTANT_RGBA",H.UNSIGNED_BYTE,4))}function np(e,t){if(e.attributes=e.attributes||{positions:null,colors:null,normals:null,batchIds:null},!e.attributes.normals){let r=null;t.hasProperty("NORMAL")?r=t.getPropertyArray("NORMAL",H.FLOAT,3):t.hasProperty("NORMAL_OCT16P")&&(r=t.getPropertyArray("NORMAL_OCT16P",H.UNSIGNED_BYTE,2),e.isOctEncoded16P=!0),e.attributes.normals=Yh(e,r)}}function sp(e,t){let r=null;if(!e.batchIds&&t.hasProperty("BATCH_ID")&&(e.batchIds=t.getPropertyArray("BATCH_ID",H.UNSIGNED_SHORT,1),e.batchIds)){let n=t.getGlobalProperty("BATCH_LENGTH");if(!n)throw new Error("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");let{batchTableJson:s,batchTableBinary:o}=e;r=new ue(s,o,n)}return r}async function op(e,t,r,n,s){let o,i,a,f=e.batchTableJson&&e.batchTableJson.extensions&&e.batchTableJson.extensions["3DTILES_draco_point_compression"];f&&(a=f.properties);let c=t.getExtension("3DTILES_draco_point_compression");if(c){i=c.properties;let l=c.byteOffset,u=c.byteLength;if(!i||!Number.isFinite(l)||!u)throw new Error("Draco properties, byteOffset, and byteLength must be defined");o=(e.featureTableBinary||[]).slice(l,l+u),e.hasPositions=Number.isFinite(i.POSITION),e.hasColors=Number.isFinite(i.RGB)||Number.isFinite(i.RGBA),e.hasNormals=Number.isFinite(i.NORMAL),e.hasBatchIds=Number.isFinite(i.BATCH_ID),e.isTranslucent=Number.isFinite(i.RGBA)}if(!o)return!0;let h={buffer:o,properties:{...i,...a},featureTableProperties:i,batchTableProperties:a,dequantizeInShader:!1};return await ip(e,h,n,s)}async function ip(e,t,r,n){if(!n)return;let s={...r,draco:{...r?.draco,extraAttributes:t.batchTableProperties||{}}};delete s["3d-tiles"];let o=await Pt(t.buffer,Is,s,n),i=o.attributes.POSITION&&o.attributes.POSITION.value,a=o.attributes.COLOR_0&&o.attributes.COLOR_0.value,f=o.attributes.NORMAL&&o.attributes.NORMAL.value,c=o.attributes.BATCH_ID&&o.attributes.BATCH_ID.value,h=i&&o.attributes.POSITION.value.quantization,l=f&&o.attributes.NORMAL.value.quantization;if(h){let d=o.POSITION.data.quantization,A=d.range;e.quantizedVolumeScale=new b(A,A,A),e.quantizedVolumeOffset=new b(d.minValues),e.quantizedRange=(1<<d.quantizationBits)-1,e.isQuantizedDraco=!0}l&&(e.octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e.isOctEncodedDraco=!0);let u={};if(t.batchTableProperties)for(let d of Object.keys(t.batchTableProperties))o.attributes[d]&&o.attributes[d].value&&(u[d.toLowerCase()]=o.attributes[d].value);e.attributes={positions:i,colors:Ki(e,a,void 0),normals:f,batchIds:c,...u}}var ea={};ut(ea,{decode:()=>Qp,name:()=>zp});var Wh="4.2.0-alpha.6";var ap=globalThis.loaders?.parseImageNode,Xi=typeof Image<"u",Yi=typeof ImageBitmap<"u",cp=Boolean(ap),Zi=Et?!0:cp;function $h(e){switch(e){case"auto":return Yi||Xi||Zi;case"imagebitmap":return Yi;case"image":return Xi;case"data":return Zi;default:throw new Error(`@loaders.gl/images: image ${e} not supported in this environment`)}}function tl(){if(Yi)return"imagebitmap";if(Xi)return"image";if(Zi)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function el(e){let t=fp(e);if(!t)throw new Error("Not an image");return t}function Ln(e){switch(el(e)){case"data":return e;case"image":case"imagebitmap":let t=document.createElement("canvas"),r=t.getContext("2d");if(!r)throw new Error("getImageData");return t.width=e.width,t.height=e.height,r.drawImage(e,0,0),r.getImageData(0,0,e.width,e.height);default:throw new Error("getImageData")}}function fp(e){return typeof ImageBitmap<"u"&&e instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&e instanceof Image?"image":e&&typeof e=="object"&&e.data&&e.width&&e.height?"data":null}var hp=/^data:image\/svg\+xml/,lp=/\.svg((\?|#).*)?$/;function Hs(e){return e&&(hp.test(e)||lp.test(e))}function rl(e,t){if(Hs(t)){let n=new TextDecoder().decode(e);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(n=unescape(encodeURIComponent(n)))}catch(o){throw new Error(o.message)}return`data:image/svg+xml;base64,${btoa(n)}`}return qi(e,t)}function qi(e,t){if(Hs(t))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(e)])}async function ks(e,t,r){let n=rl(e,r),s=self.URL||self.webkitURL,o=typeof n!="string"&&s.createObjectURL(n);try{return await up(o||n,t)}finally{o&&s.revokeObjectURL(o)}}async function up(e,t){let r=new Image;return r.src=e,t.image&&t.image.decode&&r.decode?(await r.decode(),r):await new Promise((n,s)=>{try{r.onload=()=>n(r),r.onerror=o=>{let i=o instanceof Error?o.message:"error";s(new Error(i))}}catch(o){s(o)}})}var dp={},nl=!0;async function sl(e,t,r){let n;Hs(r)?n=await ks(e,t,r):n=qi(e,r);let s=t&&t.imagebitmap;return await Ap(n,s)}async function Ap(e,t=null){if((mp(t)||!nl)&&(t=null),t)try{return await createImageBitmap(e,t)}catch(r){console.warn(r),nl=!1}return await createImageBitmap(e)}function mp(e){for(let t in e||dp)return!1;return!0}function ol(e){return!Bp(e,"ftyp",4)||!(e[8]&96)?null:pp(e)}function pp(e){switch(gp(e,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function gp(e,t,r){return String.fromCharCode(...e.slice(t,r))}function xp(e){return[...e].map(t=>t.charCodeAt(0))}function Bp(e,t,r=0){let n=xp(t);for(let s=0;s<n.length;++s)if(n[s]!==e[s+r])return!1;return!0}var ee=!1,On=!0;function Ke(e){let t=vn(e);return _p(t)||Cp(t)||yp(t)||Tp(t)||Ep(t)}function Ep(e){let t=new Uint8Array(e instanceof DataView?e.buffer:e),r=ol(t);return r?{mimeType:r.mimeType,width:0,height:0}:null}function _p(e){let t=vn(e);return t.byteLength>=24&&t.getUint32(0,ee)===2303741511?{mimeType:"image/png",width:t.getUint32(16,ee),height:t.getUint32(20,ee)}:null}function yp(e){let t=vn(e);return t.byteLength>=10&&t.getUint32(0,ee)===1195984440?{mimeType:"image/gif",width:t.getUint16(6,On),height:t.getUint16(8,On)}:null}function Tp(e){let t=vn(e);return t.byteLength>=14&&t.getUint16(0,ee)===16973&&t.getUint32(2,On)===t.byteLength?{mimeType:"image/bmp",width:t.getUint32(18,On),height:t.getUint32(22,On)}:null}function Cp(e){let t=vn(e);if(!(t.byteLength>=3&&t.getUint16(0,ee)===65496&&t.getUint8(2)===255))return null;let{tableMarkers:n,sofMarkers:s}=Mp(),o=2;for(;o+9<t.byteLength;){let i=t.getUint16(o,ee);if(s.has(i))return{mimeType:"image/jpeg",height:t.getUint16(o+5,ee),width:t.getUint16(o+7,ee)};if(!n.has(i))return null;o+=2,o+=t.getUint16(o,ee)}return null}function Mp(){let e=new Set([65499,65476,65484,65501,65534]);for(let r=65504;r<65520;++r)e.add(r);return{tableMarkers:e,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function vn(e){if(e instanceof DataView)return e;if(ArrayBuffer.isView(e))return new DataView(e.buffer);if(e instanceof ArrayBuffer)return new DataView(e);throw new Error("toDataView")}async function il(e,t){let{mimeType:r}=Ke(e)||{},n=globalThis.loaders?.parseImageNode;return J(n),await n(e,r)}async function al(e,t,r){t=t||{};let s=(t.image||{}).type||"auto",{url:o}=r||{},i=bp(s),a;switch(i){case"imagebitmap":a=await sl(e,t,o);break;case"image":a=await ks(e,t,o);break;case"data":a=await il(e,t);break;default:J(!1)}return s==="data"&&(a=Ln(a)),a}function bp(e){switch(e){case"auto":case"data":return tl();default:return $h(e),e}}var wp=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],Ip=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],Sp={image:{type:"auto",decode:!0}},Wi={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:Wh,mimeTypes:Ip,extensions:wp,parse:al,tests:[e=>Boolean(Ke(new DataView(e)))],options:Sp};var $i={};function ta(e){if($i[e]===void 0){let t=Et?Fp(e):Rp(e);$i[e]=t}return $i[e]}function Rp(e){let t=["image/png","image/jpeg","image/gif"],r=globalThis.loaders?.imageFormatsNode||t,n=globalThis.loaders?.parseImageNode;return Boolean(n)&&r.includes(e)}function Fp(e){switch(e){case"image/avif":case"image/webp":return Dp(e);default:return!0}}function Dp(e){try{return document.createElement("canvas").toDataURL(e).indexOf(`data:${e}`)===0}catch{return!1}}function ot(e,t){if(!e)throw new Error(t||"assert failed: gltf")}var Js={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},zs={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4};var Lp=1.33,cl=["SCALAR","VEC2","VEC3","VEC4"],Op=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],vp=new Map(Op),Np={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Gp={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Up={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function Qs(e){return cl[e-1]||cl[0]}function Pr(e){let t=vp.get(e.constructor);if(!t)throw new Error("Illegal typed array");return t}function Hr(e,t){let r=Up[e.componentType],n=Np[e.type],s=Gp[e.componentType],o=e.count*n,i=e.count*n*s;ot(i>=0&&i<=t.byteLength);let a=zs[e.componentType],f=Js[e.type];return{ArrayType:r,length:o,byteLength:i,componentByteSize:a,numberOfComponentsInElement:f}}function Nn(e){let{images:t,bufferViews:r}=e;t=t||[],r=r||[];let n=t.map(i=>i.bufferView);r=r.filter(i=>!n.includes(i));let s=r.reduce((i,a)=>i+a.byteLength,0),o=t.reduce((i,a)=>{let{width:f,height:c}=a.image;return i+f*c},0);return s+Math.ceil(4*o*Lp)}function fl(e,t,r){let n=e.bufferViews[r];ot(n);let s=n.buffer,o=t[s];ot(o);let i=(n.byteOffset||0)+o.byteOffset;return new Uint8Array(o.arrayBuffer,i,n.byteLength)}function hl(e,t,r){let n=typeof r=="number"?e.accessors?.[r]:r;if(!n)throw new Error(`No gltf accessor ${JSON.stringify(r)}`);let s=e.bufferViews?.[n.bufferView||0];if(!s)throw new Error(`No gltf buffer view for accessor ${s}`);let{arrayBuffer:o,byteOffset:i}=t[s.buffer],a=(i||0)+(n.byteOffset||0)+(s.byteOffset||0),{ArrayType:f,length:c,componentByteSize:h,numberOfComponentsInElement:l}=Hr(n,s),u=h*l,d=s.byteStride||u;if(typeof s.byteStride>"u"||s.byteStride===u)return new f(o,a,c);let A=new f(c);for(let m=0;m<n.count;m++){let p=new f(o,a+m*d,l);A.set(p,m*l)}return A}function Pp(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}var K=class{gltf;sourceBuffers;byteLength;constructor(t){this.gltf={json:t?.json||Pp(),buffers:t?.buffers||[],images:t?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(t){return this.json[t]}getExtraData(t){return(this.json.extras||{})[t]}hasExtension(t){let r=this.getUsedExtensions().find(s=>s===t),n=this.getRequiredExtensions().find(s=>s===t);return typeof r=="string"||typeof n=="string"}getExtension(t){let r=this.getUsedExtensions().find(s=>s===t),n=this.json.extensions||{};return r?n[t]:null}getRequiredExtension(t){return this.getRequiredExtensions().find(n=>n===t)?this.getExtension(t):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(t,r){return(t.extensions||{})[r]}getScene(t){return this.getObject("scenes",t)}getNode(t){return this.getObject("nodes",t)}getSkin(t){return this.getObject("skins",t)}getMesh(t){return this.getObject("meshes",t)}getMaterial(t){return this.getObject("materials",t)}getAccessor(t){return this.getObject("accessors",t)}getTexture(t){return this.getObject("textures",t)}getSampler(t){return this.getObject("samplers",t)}getImage(t){return this.getObject("images",t)}getBufferView(t){return this.getObject("bufferViews",t)}getBuffer(t){return this.getObject("buffers",t)}getObject(t,r){if(typeof r=="object")return r;let n=this.json[t]&&this.json[t][r];if(!n)throw new Error(`glTF file error: Could not find ${t}[${r}]`);return n}getTypedArrayForBufferView(t){t=this.getBufferView(t);let r=t.buffer,n=this.gltf.buffers[r];ot(n);let s=(t.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,s,t.byteLength)}getTypedArrayForAccessor(t){let r=this.getAccessor(t);return hl(this.gltf.json,this.gltf.buffers,r)}getTypedArrayForImageData(t){t=this.getAccessor(t);let r=this.getBufferView(t.bufferView),s=this.getBuffer(r.buffer).data,o=r.byteOffset||0;return new Uint8Array(s,o,r.byteLength)}addApplicationData(t,r){return this.json[t]=r,this}addExtraData(t,r){return this.json.extras=this.json.extras||{},this.json.extras[t]=r,this}addObjectExtension(t,r,n){return t.extensions=t.extensions||{},t.extensions[r]=n,this.registerUsedExtension(r),this}setObjectExtension(t,r,n){let s=t.extensions||{};s[r]=n}removeObjectExtension(t,r){let n=t?.extensions||{};if(n[r]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let s=this.json.extensionsRemoved;s.includes(r)||s.push(r)}delete n[r]}addExtension(t,r={}){return ot(r),this.json.extensions=this.json.extensions||{},this.json.extensions[t]=r,this.registerUsedExtension(t),r}addRequiredExtension(t,r={}){return ot(r),this.addExtension(t,r),this.registerRequiredExtension(t),r}registerUsedExtension(t){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(r=>r===t)||this.json.extensionsUsed.push(t)}registerRequiredExtension(t){this.registerUsedExtension(t),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(r=>r===t)||this.json.extensionsRequired.push(t)}removeExtension(t){if(this.json.extensions?.[t]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];let r=this.json.extensionsRemoved;r.includes(t)||r.push(t)}this.json.extensions&&delete this.json.extensions[t],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,t),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,t)}setDefaultScene(t){this.json.scene=t}addScene(t){let{nodeIndices:r}=t;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:r}),this.json.scenes.length-1}addNode(t){let{meshIndex:r,matrix:n}=t;this.json.nodes=this.json.nodes||[];let s={mesh:r};return n&&(s.matrix=n),this.json.nodes.push(s),this.json.nodes.length-1}addMesh(t){let{attributes:r,indices:n,material:s,mode:o=4}=t,a={primitives:[{attributes:this._addAttributes(r),mode:o}]};if(n){let f=this._addIndices(n);a.primitives[0].indices=f}return Number.isFinite(s)&&(a.primitives[0].material=s),this.json.meshes=this.json.meshes||[],this.json.meshes.push(a),this.json.meshes.length-1}addPointCloud(t){let n={primitives:[{attributes:this._addAttributes(t),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(n),this.json.meshes.length-1}addImage(t,r){let n=Ke(t),s=r||n?.mimeType,i={bufferView:this.addBufferView(t),mimeType:s};return this.json.images=this.json.images||[],this.json.images.push(i),this.json.images.length-1}addBufferView(t,r=0,n=this.byteLength){let s=t.byteLength;ot(Number.isFinite(s)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(t);let o={buffer:r,byteOffset:n,byteLength:s};return this.byteLength+=bt(s,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(o),this.json.bufferViews.length-1}addAccessor(t,r){let n={bufferView:t,type:Qs(r.size),componentType:r.componentType,count:r.count,max:r.max,min:r.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(n),this.json.accessors.length-1}addBinaryBuffer(t,r={size:3}){let n=this.addBufferView(t),s={min:r.min,max:r.max};(!s.min||!s.max)&&(s=this._getAccessorMinMax(t,r.size));let o={size:r.size,componentType:Pr(t),count:Math.round(t.length/r.size),min:s.min,max:s.max};return this.addAccessor(n,Object.assign(o,r))}addTexture(t){let{imageIndex:r}=t,n={source:r};return this.json.textures=this.json.textures||[],this.json.textures.push(n),this.json.textures.length-1}addMaterial(t){return this.json.materials=this.json.materials||[],this.json.materials.push(t),this.json.materials.length-1}createBinaryChunk(){this.gltf.buffers=[];let t=this.byteLength,r=new ArrayBuffer(t),n=new Uint8Array(r),s=0;for(let o of this.sourceBuffers||[])s=Ko(o,n,s);this.json?.buffers?.[0]?this.json.buffers[0].byteLength=t:this.json.buffers=[{byteLength:t}],this.gltf.binary=r,this.sourceBuffers=[r]}_removeStringFromArray(t,r){let n=!0;for(;n;){let s=t.indexOf(r);s>-1?t.splice(s,1):n=!1}}_addAttributes(t={}){let r={};for(let n in t){let s=t[n],o=this._getGltfAttributeName(n),i=this.addBinaryBuffer(s.value,s);r[o]=i}return r}_addIndices(t){return this.addBinaryBuffer(t,{size:1})}_getGltfAttributeName(t){switch(t.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return t}}_getAccessorMinMax(t,r){let n={min:null,max:null};if(t.length<r)return n;n.min=[],n.max=[];let s=t.subarray(0,r);for(let o of s)n.min.push(o),n.max.push(o);for(let o=r;o<t.length;o+=r)for(let i=0;i<r;i++)n.min[0+i]=Math.min(n.min[0+i],t[o+i]),n.max[0+i]=Math.max(n.max[0+i],t[o+i]);return n}};function ll(e){return(e%1+1)%1}var ul={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},Hp={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},dl={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function Gn(e,t){return dl[t]*ul[e]}function kr(e,t,r,n){if(r!=="UINT8"&&r!=="UINT16"&&r!=="UINT32"&&r!=="UINT64")return null;let s=e.getTypedArrayForBufferView(t),o=Jr(s,"SCALAR",r,n+1);return o instanceof BigInt64Array||o instanceof BigUint64Array?null:o}function Jr(e,t,r,n=1){let s=ul[t],o=Hp[r],i=dl[r],a=n*s,f=a*i,c=e.buffer,h=e.byteOffset;return h%i!==0&&(c=new Uint8Array(c).slice(h,h+f).buffer,h=0),new o(c,h,a)}function zr(e,t,r){let n=`TEXCOORD_${t.texCoord||0}`,s=r.attributes[n],o=e.getTypedArrayForAccessor(s),i=e.gltf.json,a=t.index,f=i.textures?.[a]?.source;if(typeof f<"u"){let c=i.images?.[f]?.mimeType,h=e.gltf.images?.[f];if(h&&typeof h.width<"u"){let l=[];for(let u=0;u<o.length;u+=2){let d=kp(h,c,o,u,t.channels);l.push(d)}return l}}return[]}function Vs(e,t,r,n,s){if(!r?.length)return;let o=[];for(let h of r){let l=n.findIndex(u=>u===h);l===-1&&(l=n.push(h)-1),o.push(l)}let i=new Uint32Array(o),a=e.gltf.buffers.push({arrayBuffer:i.buffer,byteOffset:i.byteOffset,byteLength:i.byteLength})-1,f=e.addBufferView(i,a,0),c=e.addAccessor(f,{size:1,componentType:Pr(i),count:i.length});s.attributes[t]=c}function kp(e,t,r,n,s=[0]){let o={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},i=r[n],a=r[n+1],f=1;t&&(t.indexOf("image/jpeg")!==-1||t.indexOf("image/png")!==-1)&&(f=4);let c=Jp(i,a,e,f),h=0;for(let l of s){let u=typeof l=="number"?Object.values(o)[l]:o[l],d=c+u.offset,A=Ln(e);if(A.data.length<=d)throw new Error(`${A.data.length} <= ${d}`);let m=A.data[d];h|=m<<u.shift}return h}function Jp(e,t,r,n=1){let s=r.width,o=ll(e)*(s-1),i=Math.round(o),a=r.height,f=ll(t)*(a-1),c=Math.round(f),h=r.components?r.components:n;return(c*s+i)*h}function js(e,t,r,n,s){let o=[];for(let i=0;i<t;i++){let a=r[i],f=r[i+1]-r[i];if(f+a>n)break;let c=a/s,h=f/s;o.push(e.slice(c,c+h))}return o}function Ks(e,t,r){let n=[];for(let s=0;s<t;s++){let o=s*r;n.push(e.slice(o,o+r))}return n}function Xs(e,t,r,n){if(r)throw new Error("Not implemented - arrayOffsets for strings is specified");if(n){let s=[],o=new TextDecoder("utf8"),i=0;for(let a=0;a<e;a++){let f=n[a+1]-n[a];if(f+i<=t.length){let c=t.subarray(i,f+i),h=o.decode(c);s.push(h),i+=f}}return s}return[]}var Al="EXT_mesh_features",zp=Al;async function Qp(e,t){let r=new K(e);Vp(r,t)}function Vp(e,t){let r=e.gltf.json;if(r.meshes)for(let n of r.meshes)for(let s of n.primitives)jp(e,s,t)}function jp(e,t,r){if(!r?.gltf?.loadBuffers)return;let s=t.extensions?.[Al]?.featureIds;if(s)for(let o of s){let i;if(typeof o.attribute<"u"){let a=`_FEATURE_ID_${o.attribute}`,f=t.attributes[a];i=e.getTypedArrayForAccessor(f)}else typeof o.texture<"u"&&r?.gltf?.loadImages?i=zr(e,o.texture,t):i=[];o.data=i}}var sa={};ut(sa,{decode:()=>Xp,name:()=>Kp});var ra="EXT_structural_metadata",Kp=ra;async function Xp(e,t){let r=new K(e);Yp(r,t)}function Yp(e,t){if(!t.gltf?.loadBuffers)return;let r=e.getExtension(ra);r&&(t.gltf?.loadImages&&Zp(e,r),qp(e,r))}function Zp(e,t){let r=t.propertyTextures,n=e.gltf.json;if(r&&n.meshes)for(let s of n.meshes)for(let o of s.primitives)$p(e,r,o,t)}function qp(e,t){let r=t.schema;if(!r)return;let n=r.classes,s=t.propertyTables;if(n&&s)for(let o in n){let i=Wp(s,o);i&&eg(e,r,i)}}function Wp(e,t){for(let r of e)if(r.class===t)return r;return null}function $p(e,t,r,n){if(!t)return;let o=r.extensions?.[ra]?.propertyTextures;if(o)for(let i of o){let a=t[i];tg(e,a,r,n)}}function tg(e,t,r,n){if(!t.properties)return;n.dataAttributeNames||(n.dataAttributeNames=[]);let s=t.class;for(let o in t.properties){let i=`${s}_${o}`,a=t.properties?.[o];if(!a)continue;a.data||(a.data=[]);let f=a.data,c=zr(e,a,r);c!==null&&(Vs(e,i,c,f,r),a.data=f,n.dataAttributeNames.push(i))}}function eg(e,t,r){let n=t.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let s=r.count;for(let o in n.properties){let i=n.properties[o],a=r.properties?.[o];if(a){let f=rg(e,t,i,s,a);a.data=f}}}function rg(e,t,r,n,s){let o=[],i=s.values,a=e.getTypedArrayForBufferView(i),f=ng(e,r,s,n),c=sg(e,s,n);switch(r.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{o=og(r,n,a,f);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${r.type}`);case"STRING":{o=Xs(n,a,f,c);break}case"ENUM":{o=ig(t,r,n,a,f);break}default:throw new Error(`Unknown classProperty type ${r.type}`)}return o}function ng(e,t,r,n){return t.array&&typeof t.count>"u"&&typeof r.arrayOffsets<"u"?kr(e,r.arrayOffsets,r.arrayOffsetType||"UINT32",n):null}function sg(e,t,r){return typeof t.stringOffsets<"u"?kr(e,t.stringOffsets,t.stringOffsetType||"UINT32",r):null}function og(e,t,r,n){let s=e.array,o=e.count,i=Gn(e.type,e.componentType),a=r.byteLength/i,f;return e.componentType?f=Jr(r,e.type,e.componentType,a):f=r,s?n?js(f,t,n,r.length,i):o?Ks(f,t,o):[]:f}function ig(e,t,r,n,s){let o=t.enumType;if(!o)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");let i=e.enums?.[o];if(!i)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${o}`);let a=i.valueType||"UINT16",f=Gn(t.type,a),c=n.byteLength/f,h=Jr(n,t.type,a,c);if(h||(h=n),t.array){if(s)return ag({valuesData:h,numberOfElements:r,arrayOffsets:s,valuesDataBytesLength:n.length,elementSize:f,enumEntry:i});let l=t.count;return l?cg(h,r,l,i):[]}return na(h,0,r,i)}function ag(e){let{valuesData:t,numberOfElements:r,arrayOffsets:n,valuesDataBytesLength:s,elementSize:o,enumEntry:i}=e,a=[];for(let f=0;f<r;f++){let c=n[f],h=n[f+1]-n[f];if(h+c>s)break;let l=c/o,u=h/o,d=na(t,l,u,i);a.push(d)}return a}function cg(e,t,r,n){let s=[];for(let o=0;o<t;o++){let i=r*o,a=na(e,i,r,n);s.push(a)}return s}function na(e,t,r,n){let s=[];for(let o=0;o<r;o++)if(e instanceof BigInt64Array||e instanceof BigUint64Array)s.push("");else{let i=e[t+o],a=fg(n,i);a?s.push(a.name):s.push("")}return s}function fg(e,t){for(let r of e.values)if(r.value===t)return r;return null}var oa={};ut(oa,{decode:()=>lg,name:()=>hg});var ml="EXT_feature_metadata",hg=ml;async function lg(e,t){let r=new K(e);ug(r,t)}function ug(e,t){if(!t.gltf?.loadBuffers)return;let r=e.getExtension(ml);r&&(t.gltf?.loadImages&&dg(e,r),Ag(e,r))}function dg(e,t){let r=t.schema;if(!r)return;let n=r.classes,{featureTextures:s}=t;if(n&&s)for(let o in n){let i=n[o],a=pg(s,o);a&&xg(e,a,i)}}function Ag(e,t){let r=t.schema;if(!r)return;let n=r.classes,s=t.featureTables;if(n&&s)for(let o in n){let i=mg(s,o);i&&gg(e,r,i)}}function mg(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function pg(e,t){for(let r in e){let n=e[r];if(n.class===t)return n}return null}function gg(e,t,r){if(!r.class)return;let n=t.classes?.[r.class];if(!n)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${r.class}`);let s=r.count;for(let o in n.properties){let i=n.properties[o],a=r.properties?.[o];if(a){let f=Bg(e,t,i,s,a);a.data=f}}}function xg(e,t,r){let n=t.class;for(let s in r.properties){let o=t?.properties?.[s];if(o){let i=Cg(e,o,n);o.data=i}}}function Bg(e,t,r,n,s){let o=[],i=s.bufferView,a=e.getTypedArrayForBufferView(i),f=Eg(e,r,s,n),c=_g(e,r,s,n);return r.type==="STRING"||r.componentType==="STRING"?o=Xs(n,a,f,c):yg(r)&&(o=Tg(r,n,a,f)),o}function Eg(e,t,r,n){return t.type==="ARRAY"&&typeof t.componentCount>"u"&&typeof r.arrayOffsetBufferView<"u"?kr(e,r.arrayOffsetBufferView,r.offsetType||"UINT32",n):null}function _g(e,t,r,n){return typeof r.stringOffsetBufferView<"u"?kr(e,r.stringOffsetBufferView,r.offsetType||"UINT32",n):null}function yg(e){let t=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return t.includes(e.type)||typeof e.componentType<"u"&&t.includes(e.componentType)}function Tg(e,t,r,n){let s=e.type==="ARRAY",o=e.componentCount,i="SCALAR",a=e.componentType||e.type,f=Gn(i,a),c=r.byteLength/f,h=Jr(r,i,a,c);return s?n?js(h,t,n,r.length,f):o?Ks(h,t,o):[]:h}function Cg(e,t,r){let n=e.gltf.json;if(!n.meshes)return[];let s=[];for(let o of n.meshes)for(let i of o.primitives)Mg(e,r,t,s,i);return s}function Mg(e,t,r,n,s){let o={channels:r.channels,...r.texture},i=zr(e,o,s);i&&Vs(e,t,i,n,s)}var pl="4.2.0-alpha.6";var gl="4.2.0-alpha.6";var Ys={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"},xl;async function aa(e){gn(e.modules);let t=Qo("basis");return t||(xl||=bg(e),await xl)}async function bg(e){let t=null,r=null;return[t,r]=await Promise.all([await qt(Ys.TRANSCODER,"textures",e),await qt(Ys.TRANSCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await wg(t,r)}function wg(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(s=>{let{BasisFile:o,initializeBasis:i}=s;i(),n({BasisFile:o})})})}var ia;async function ca(e){let t=e.modules||{};return t.basisEncoder?t.basisEncoder:(ia=ia||Ig(e),await ia)}async function Ig(e){let t=null,r=null;return[t,r]=await Promise.all([await qt(Ys.ENCODER,"textures",e),await qt(Ys.ENCODER_WASM,"textures",e)]),t=t||globalThis.BASIS,await Sg(t,r)}function Sg(e,t){let r={};return t&&(r.wasmBinary=t),new Promise(n=>{e(r).then(s=>{let{BasisFile:o,KTX2File:i,initializeBasis:a,BasisEncoder:f}=s;a(),n({BasisFile:o,KTX2File:i,BasisEncoder:f})})})}var Xe={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_RGBA8_ETC2_EAC:37493,COMPRESSED_SRGB8_ETC2:37494,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37495,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37496,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37497,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGB_ATC_WEBGL:35986,COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:35987,COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:34798,COMPRESSED_RGBA_ASTC_4X4_KHR:37808,COMPRESSED_RGBA_ASTC_5X4_KHR:37809,COMPRESSED_RGBA_ASTC_5X5_KHR:37810,COMPRESSED_RGBA_ASTC_6X5_KHR:37811,COMPRESSED_RGBA_ASTC_6X6_KHR:37812,COMPRESSED_RGBA_ASTC_8X5_KHR:37813,COMPRESSED_RGBA_ASTC_8X6_KHR:37814,COMPRESSED_RGBA_ASTC_8X8_KHR:37815,COMPRESSED_RGBA_ASTC_10X5_KHR:37816,COMPRESSED_RGBA_ASTC_10X6_KHR:37817,COMPRESSED_RGBA_ASTC_10X8_KHR:37818,COMPRESSED_RGBA_ASTC_10X10_KHR:37819,COMPRESSED_RGBA_ASTC_12X10_KHR:37820,COMPRESSED_RGBA_ASTC_12X12_KHR:37821,COMPRESSED_SRGB8_ALPHA8_ASTC_4X4_KHR:37840,COMPRESSED_SRGB8_ALPHA8_ASTC_5X4_KHR:37841,COMPRESSED_SRGB8_ALPHA8_ASTC_5X5_KHR:37842,COMPRESSED_SRGB8_ALPHA8_ASTC_6X5_KHR:37843,COMPRESSED_SRGB8_ALPHA8_ASTC_6X6_KHR:37844,COMPRESSED_SRGB8_ALPHA8_ASTC_8X5_KHR:37845,COMPRESSED_SRGB8_ALPHA8_ASTC_8X6_KHR:37846,COMPRESSED_SRGB8_ALPHA8_ASTC_8X8_KHR:37847,COMPRESSED_SRGB8_ALPHA8_ASTC_10X5_KHR:37848,COMPRESSED_SRGB8_ALPHA8_ASTC_10X6_KHR:37849,COMPRESSED_SRGB8_ALPHA8_ASTC_10X8_KHR:37850,COMPRESSED_SRGB8_ALPHA8_ASTC_10X10_KHR:37851,COMPRESSED_SRGB8_ALPHA8_ASTC_12X10_KHR:37852,COMPRESSED_SRGB8_ALPHA8_ASTC_12X12_KHR:37853,COMPRESSED_RED_RGTC1_EXT:36283,COMPRESSED_SIGNED_RED_RGTC1_EXT:36284,COMPRESSED_RED_GREEN_RGTC2_EXT:36285,COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT:36286,COMPRESSED_SRGB_S3TC_DXT1_EXT:35916,COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:35917,COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:35918,COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT:35919};var Rg=["","WEBKIT_","MOZ_"],Bl={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"},Zs=null;function El(e){if(!Zs){e=e||Fg()||void 0,Zs=new Set;for(let t of Rg)for(let r in Bl)if(e&&e.getExtension(`${t}${r}`)){let n=Bl[r];Zs.add(n)}}return Zs}function Fg(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}var N3=new Uint8Array([0]);var _l,yl,Tl,Cl,Ml,bl,wl,Il;(function(e){e[e.NONE=0]="NONE",e[e.BASISLZ=1]="BASISLZ",e[e.ZSTD=2]="ZSTD",e[e.ZLIB=3]="ZLIB"})(_l||(_l={})),function(e){e[e.BASICFORMAT=0]="BASICFORMAT"}(yl||(yl={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.ETC1S=163]="ETC1S",e[e.UASTC=166]="UASTC"}(Tl||(Tl={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.SRGB=1]="SRGB"}(Cl||(Cl={})),function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.LINEAR=1]="LINEAR",e[e.SRGB=2]="SRGB",e[e.ITU=3]="ITU",e[e.NTSC=4]="NTSC",e[e.SLOG=5]="SLOG",e[e.SLOG2=6]="SLOG2"}(Ml||(Ml={})),function(e){e[e.ALPHA_STRAIGHT=0]="ALPHA_STRAIGHT",e[e.ALPHA_PREMULTIPLIED=1]="ALPHA_PREMULTIPLIED"}(bl||(bl={})),function(e){e[e.RGB=0]="RGB",e[e.RRR=3]="RRR",e[e.GGG=4]="GGG",e[e.AAA=15]="AAA"}(wl||(wl={})),function(e){e[e.RGB=0]="RGB",e[e.RGBA=3]="RGBA",e[e.RRR=4]="RRR",e[e.RRRG=5]="RRRG"}(Il||(Il={}));var It=[171,75,84,88,32,50,48,187,13,10,26,10];function Sl(e){let t=new Uint8Array(e);return!(t.byteLength<It.length||t[0]!==It[0]||t[1]!==It[1]||t[2]!==It[2]||t[3]!==It[3]||t[4]!==It[4]||t[5]!==It[5]||t[6]!==It[6]||t[7]!==It[7]||t[8]!==It[8]||t[9]!==It[9]||t[10]!==It[10]||t[11]!==It[11])}var Dg={etc1:{basisFormat:0,compressed:!0,format:Xe.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:Xe.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:Xe.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:Xe.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:Xe.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:Xe.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function ha(e,t){if(t.basis.containerFormat==="auto"){if(Sl(e)){let n=await ca(t);return Rl(n.KTX2File,e,t)}let{BasisFile:r}=await aa(t);return fa(r,e,t)}switch(t.basis.module){case"encoder":let r=await ca(t);switch(t.basis.containerFormat){case"ktx2":return Rl(r.KTX2File,e,t);case"basis":default:return fa(r.BasisFile,e,t)}case"transcoder":default:let{BasisFile:n}=await aa(t);return fa(n,e,t)}}function fa(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("Failed to start basis transcoding");let s=n.getNumImages(),o=[];for(let i=0;i<s;i++){let a=n.getNumLevels(i),f=[];for(let c=0;c<a;c++)f.push(Lg(n,i,c,r));o.push(f)}return o}finally{n.close(),n.delete()}}function Lg(e,t,r,n){let s=e.getImageWidth(t,r),o=e.getImageHeight(t,r),i=e.getHasAlpha(),{compressed:a,format:f,basisFormat:c}=Fl(n,i),h=e.getImageTranscodedSizeInBytes(t,r,c),l=new Uint8Array(h);if(!e.transcodeImage(l,t,r,c,0,0))throw new Error("failed to start Basis transcoding");return{width:s,height:o,data:l,compressed:a,format:f,hasAlpha:i}}function Rl(e,t,r){let n=new e(new Uint8Array(t));try{if(!n.startTranscoding())throw new Error("failed to start KTX2 transcoding");let s=n.getLevels(),o=[];for(let i=0;i<s;i++){o.push(Og(n,i,r));break}return[o]}finally{n.close(),n.delete()}}function Og(e,t,r){let{alphaFlag:n,height:s,width:o}=e.getImageLevelInfo(t,0,0),{compressed:i,format:a,basisFormat:f}=Fl(r,n),c=e.getImageTranscodedSizeInBytes(t,0,0,f),h=new Uint8Array(c);if(!e.transcodeImage(h,t,0,0,f,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:o,height:s,data:h,compressed:i,levelSize:c,hasAlpha:n,format:a}}function Fl(e,t){let r=e&&e.basis&&e.basis.format;return r==="auto"&&(r=qs()),typeof r=="object"&&(r=t?r.alpha:r.noAlpha),r=r.toLowerCase(),Dg[r]}function qs(){let e=El();return e.has("astc")?"astc-4x4":e.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:e.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:e.has("etc1")?"etc1":e.has("etc2")?"etc2":"rgb565"}var Dl={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:gl,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},la={...Dl,parse:ha};var Qr=!0,Ll=1735152710,Aa=12,Ws=8,vg=1313821514,Ng=5130562,Gg=0,Ug=0,Pg=1;function Hg(e,t=0){return`${String.fromCharCode(e.getUint8(t+0))}${String.fromCharCode(e.getUint8(t+1))}${String.fromCharCode(e.getUint8(t+2))}${String.fromCharCode(e.getUint8(t+3))}`}function Ol(e,t=0,r={}){let n=new DataView(e),{magic:s=Ll}=r,o=n.getUint32(t,!1);return o===s||o===Ll}function vl(e,t,r=0,n={}){let s=new DataView(t),o=Hg(s,r+0),i=s.getUint32(r+4,Qr),a=s.getUint32(r+8,Qr);switch(Object.assign(e,{header:{byteOffset:r,byteLength:a,hasBinChunk:!1},type:o,version:i,json:{},binChunks:[]}),r+=Aa,e.version){case 1:return kg(e,s,r);case 2:return Jg(e,s,r,n={});default:throw new Error(`Invalid GLB version ${e.version}. Only supports version 1 and 2.`)}}function kg(e,t,r){J(e.header.byteLength>Aa+Ws);let n=t.getUint32(r+0,Qr),s=t.getUint32(r+4,Qr);return r+=Ws,J(s===Gg),ua(e,t,r,n),r+=n,r+=da(e,t,r,e.header.byteLength),r}function Jg(e,t,r,n){return J(e.header.byteLength>Aa+Ws),zg(e,t,r,n),r+e.header.byteLength}function zg(e,t,r,n){for(;r+8<=e.header.byteLength;){let s=t.getUint32(r+0,Qr),o=t.getUint32(r+4,Qr);switch(r+=Ws,o){case vg:ua(e,t,r,s);break;case Ng:da(e,t,r,s);break;case Ug:n.strict||ua(e,t,r,s);break;case Pg:n.strict||da(e,t,r,s);break;default:break}r+=bt(s,4)}return r}function ua(e,t,r,n){let s=new Uint8Array(t.buffer,r,n),i=new TextDecoder("utf8").decode(s);return e.json=JSON.parse(i),bt(n,4)}function da(e,t,r,n){return e.header.hasBinChunk=!0,e.binChunks.push({byteOffset:r,byteLength:n,arrayBuffer:t.buffer}),bt(n,4)}function ma(e,t){if(e.startsWith("data:")||e.startsWith("http:")||e.startsWith("https:"))return e;let n=t.baseUri||t.uri;if(!n)throw new Error(`'baseUri' must be provided to resolve relative url ${e}`);return n.substr(0,n.lastIndexOf("/")+1)+e}var ga={};ut(ga,{decode:()=>ex,name:()=>tx});var Qg="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/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DQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+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",jg=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),Kg=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),Xg={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},Yg={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function Nl(e,t,r,n,s,o="NONE"){let i=await Zg();$g(i,i.exports[Yg[s]],e,t,r,n,i.exports[Xg[o||"NONE"]])}var pa;async function Zg(){return pa||(pa=qg()),pa}async function qg(){let e=Qg;WebAssembly.validate(jg)&&(e=Vg,console.log("Warning: meshopt_decoder is using experimental SIMD support"));let t=await WebAssembly.instantiate(Wg(e),{});return await t.instance.exports.__wasm_call_ctors(),t.instance}function Wg(e){let t=new Uint8Array(e.length);for(let n=0;n<e.length;++n){let s=e.charCodeAt(n);t[n]=s>96?s-71:s>64?s-65:s>47?s+4:s>46?63:62}let r=0;for(let n=0;n<e.length;++n)t[r++]=t[n]<60?Kg[t[n]]:(t[n]-60)*64+t[++n];return t.buffer.slice(0,r)}function $g(e,t,r,n,s,o,i){let a=e.exports.sbrk,f=n+3&-4,c=a(f*s),h=a(o.length),l=new Uint8Array(e.exports.memory.buffer);l.set(o,h);let u=t(c,n,s,h,o.length);if(u===0&&i&&i(c,f,s),r.set(l.subarray(c,c+n*s)),a(c-a(0)),u!==0)throw new Error(`Malformed buffer data: ${u}`)}var $s="EXT_meshopt_compression",tx=$s;async function ex(e,t){let r=new K(e);if(!t?.gltf?.decompressMeshes||!t.gltf?.loadBuffers)return;let n=[];for(let s of e.json.bufferViews||[])n.push(rx(r,s));await Promise.all(n),r.removeExtension($s)}async function rx(e,t){let r=e.getObjectExtension(t,$s);if(r){let{byteOffset:n=0,byteLength:s=0,byteStride:o,count:i,mode:a,filter:f="NONE",buffer:c}=r,h=e.gltf.buffers[c],l=new Uint8Array(h.arrayBuffer,h.byteOffset+n,s),u=new Uint8Array(e.gltf.buffers[t.buffer].arrayBuffer,t.byteOffset,t.byteLength);await Nl(u,i,o,l,a,f),e.removeObjectExtension(t,$s)}}var xa={};ut(xa,{name:()=>nx,preprocess:()=>sx});var Vr="EXT_texture_webp",nx=Vr;function sx(e,t){let r=new K(e);if(!ta("image/webp")){if(r.getRequiredExtensions().includes(Vr))throw new Error(`gltf: Required extension ${Vr} not supported by browser`);return}let{json:n}=r;for(let s of n.textures||[]){let o=r.getObjectExtension(s,Vr);o&&(s.source=o.source),r.removeObjectExtension(s,Vr)}r.removeExtension(Vr)}var Ba={};ut(Ba,{name:()=>ox,preprocess:()=>ix});var to="KHR_texture_basisu",ox=to;function ix(e,t){let r=new K(e),{json:n}=r;for(let s of n.textures||[]){let o=r.getObjectExtension(s,to);o&&(s.source=o.source,r.removeObjectExtension(s,to))}r.removeExtension(to)}var _a={};ut(_a,{decode:()=>lx,encode:()=>ux,name:()=>fx,preprocess:()=>hx});function Gl(e){let t={};for(let r in e){let n=e[r];if(r!=="indices"){let s=Ea(n);t[r]=s}}return t}function Ea(e){let{buffer:t,size:r,count:n}=ax(e);return{value:t,size:r,byteOffset:0,count:n,type:Qs(r),componentType:Pr(t)}}function ax(e){let t=e,r=1,n=0;return e&&e.value&&(t=e.value,r=e.size||1),t&&(ArrayBuffer.isView(t)||(t=cx(t,Float32Array)),n=t.length/r),{buffer:t,size:r,count:n}}function cx(e,t,r=!1){return e?Array.isArray(e)?new t(e):r&&!(e instanceof t)?new t(e):e:null}var Re="KHR_draco_mesh_compression",fx=Re;function hx(e,t,r){let n=new K(e);for(let s of Ul(n))n.getObjectExtension(s,Re)}async function lx(e,t,r){if(!t?.gltf?.decompressMeshes)return;let n=new K(e),s=[];for(let o of Ul(n))n.getObjectExtension(o,Re)&&s.push(dx(n,o,t,r));await Promise.all(s),n.removeExtension(Re)}function ux(e,t={}){let r=new K(e);for(let n of r.json.meshes||[])Ax(n,t),r.addRequiredExtension(Re)}async function dx(e,t,r,n){let s=e.getObjectExtension(t,Re);if(!s)return;let o=e.getTypedArrayForBufferView(s.bufferView),i=Je(o.buffer,o.byteOffset),a={...r};delete a["3d-tiles"];let f=await Pt(i,Is,a,n),c=Gl(f.attributes);for(let[h,l]of Object.entries(c))if(h in t.attributes){let u=t.attributes[h],d=e.getAccessor(u);d?.min&&d?.max&&(l.min=d.min,l.max=d.max)}t.attributes=c,f.indices&&(t.indices=Ea(f.indices)),e.removeObjectExtension(t,Re),mx(t)}function Ax(e,t,r=4,n,s){if(!n.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");let o=n.DracoWriter.encodeSync({attributes:e}),i=s?.parseSync?.({attributes:e}),a=n._addFauxAttributes(i.attributes),f=n.addBufferView(o);return{primitives:[{attributes:a,mode:r,extensions:{[Re]:{bufferView:f,attributes:a}}}]}}function mx(e){if(!e.attributes&&Object.keys(e.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Ul(e){for(let t of e.json.meshes||[])for(let r of t.primitives)yield r}var ya={};ut(ya,{decode:()=>Bx,name:()=>px});var ro="KHR_texture_transform",px=ro,eo=new fe,gx=new he,xx=new he;async function Bx(e,t){if(!new K(e).hasExtension(ro)||!t.gltf?.loadBuffers)return;let s=e.json.materials||[];for(let o=0;o<s.length;o++)Ex(o,e)}function Ex(e,t){let r=t.json.materials?.[e],n=[r?.pbrMetallicRoughness?.baseColorTexture,r?.emissiveTexture,r?.normalTexture,r?.occlusionTexture,r?.pbrMetallicRoughness?.metallicRoughnessTexture],s=[];for(let o of n)o&&o?.extensions?.[ro]&&_x(t,e,o,s)}function _x(e,t,r,n){let s=yx(r,n);if(!s)return;let o=e.json.meshes||[];for(let i of o)for(let a of i.primitives){let f=a.material;Number.isFinite(f)&&t===f&&Tx(e,a,s)}}function yx(e,t){let r=e.extensions?.[ro],{texCoord:n=0}=e,{texCoord:s=n}=r;if(!(t.findIndex(([i,a])=>i===n&&a===s)!==-1)){let i=bx(r);return n!==s&&(e.texCoord=s),t.push([n,s]),{originalTexCoord:n,texCoord:s,matrix:i}}return null}function Tx(e,t,r){let{originalTexCoord:n,texCoord:s,matrix:o}=r,i=t.attributes[`TEXCOORD_${n}`];if(Number.isFinite(i)){let a=e.json.accessors?.[i];if(a&&a.bufferView){let f=e.json.bufferViews?.[a.bufferView];if(f){let{arrayBuffer:c,byteOffset:h}=e.buffers[f.buffer],l=(h||0)+(a.byteOffset||0)+(f.byteOffset||0),{ArrayType:u,length:d}=Hr(a,f),A=zs[a.componentType],m=Js[a.type],p=f.byteStride||A*m,E=new Float32Array(d);for(let y=0;y<a.count;y++){let C=new u(c,l+y*p,2);eo.set(C[0],C[1],1),eo.transformByMatrix3(o),E.set([eo[0],eo[1]],y*m)}n===s?Cx(a,f,e.buffers,E):Mx(s,a,t,e,E)}}}}function Cx(e,t,r,n){e.componentType=5126,r.push({arrayBuffer:n.buffer,byteOffset:0,byteLength:n.buffer.byteLength}),t.buffer=r.length-1,t.byteLength=n.buffer.byteLength,t.byteOffset=0,delete t.byteStride}function Mx(e,t,r,n,s){n.buffers.push({arrayBuffer:s.buffer,byteOffset:0,byteLength:s.buffer.byteLength});let o=n.json.bufferViews;if(!o)return;o.push({buffer:n.buffers.length-1,byteLength:s.buffer.byteLength,byteOffset:0});let i=n.json.accessors;i&&(i.push({bufferView:o?.length-1,byteOffset:0,componentType:5126,count:t.count,type:"VEC2"}),r.attributes[`TEXCOORD_${e}`]=i.length-1)}function bx(e){let{offset:t=[0,0],rotation:r=0,scale:n=[1,1]}=e,s=new he().set(1,0,0,0,1,0,t[0],t[1],1),o=gx.set(Math.cos(r),Math.sin(r),0,-Math.sin(r),Math.cos(r),0,0,0,1),i=xx.set(n[0],0,0,0,n[1],0,0,0,1);return s.multiplyRight(o).multiplyRight(i)}var Ta={};ut(Ta,{decode:()=>Ix,encode:()=>Sx,name:()=>wx});var Ye="KHR_lights_punctual",wx=Ye;async function Ix(e){let t=new K(e),{json:r}=t,n=t.getExtension(Ye);n&&(t.json.lights=n.lights,t.removeExtension(Ye));for(let s of r.nodes||[]){let o=t.getObjectExtension(s,Ye);o&&(s.light=o.light),t.removeObjectExtension(s,Ye)}}async function Sx(e){let t=new K(e),{json:r}=t;if(r.lights){let n=t.addExtension(Ye);ot(!n.lights),n.lights=r.lights,delete r.lights}if(t.json.lights){for(let n of t.json.lights){let s=n.node;t.addObjectExtension(s,Ye,n)}delete t.json.lights}}var Ca={};ut(Ca,{decode:()=>Fx,encode:()=>Dx,name:()=>Rx});var Un="KHR_materials_unlit",Rx=Un;async function Fx(e){let t=new K(e),{json:r}=t;for(let n of r.materials||[])n.extensions&&n.extensions.KHR_materials_unlit&&(n.unlit=!0),t.removeObjectExtension(n,Un);t.removeExtension(Un)}function Dx(e){let t=new K(e),{json:r}=t;if(t.materials)for(let n of r.materials||[])n.unlit&&(delete n.unlit,t.addObjectExtension(n,Un,{}),t.addExtension(Un))}var Ma={};ut(Ma,{decode:()=>Ox,encode:()=>vx,name:()=>Lx});var Pn="KHR_techniques_webgl",Lx=Pn;async function Ox(e){let t=new K(e),{json:r}=t,n=t.getExtension(Pn);if(n){let s=Nx(n,t);for(let o of r.materials||[]){let i=t.getObjectExtension(o,Pn);i&&(o.technique=Object.assign({},i,s[i.technique]),o.technique.values=Gx(o.technique,t)),t.removeObjectExtension(o,Pn)}t.removeExtension(Pn)}}async function vx(e,t){}function Nx(e,t){let{programs:r=[],shaders:n=[],techniques:s=[]}=e,o=new TextDecoder;return n.forEach(i=>{if(Number.isFinite(i.bufferView))i.code=o.decode(t.getTypedArrayForBufferView(i.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),r.forEach(i=>{i.fragmentShader=n[i.fragmentShader],i.vertexShader=n[i.vertexShader]}),s.forEach(i=>{i.program=r[i.program]}),s}function Gx(e,t){let r=Object.assign({},e.values);return Object.keys(e.uniforms||{}).forEach(n=>{e.uniforms[n].value&&!(n in r)&&(r[n]=e.uniforms[n].value)}),Object.keys(r).forEach(n=>{typeof r[n]=="object"&&r[n].index!==void 0&&(r[n].texture=t.getTexture(r[n].index))}),r}var Pl=[sa,ea,ga,xa,Ba,_a,Ta,Ca,Ma,ya,oa];function Hl(e,t={},r){let n=Pl.filter(s=>Jl(s.name,t));for(let s of n)s.preprocess?.(e,t,r)}async function kl(e,t={},r){let n=Pl.filter(s=>Jl(s.name,t));for(let s of n)await s.decode?.(e,t,r)}function Jl(e,t){let r=t?.gltf?.excludeExtensions||{};return!(e in r&&!r[e])}var ba="KHR_binary_glTF";function zl(e){let t=new K(e),{json:r}=t;for(let n of r.images||[]){let s=t.getObjectExtension(n,ba);s&&Object.assign(n,s),t.removeObjectExtension(n,ba)}r.buffers&&r.buffers[0]&&delete r.buffers[0].uri,t.removeExtension(ba)}var Ql={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},Px={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"},wa=class{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(t,r){this.json=t.json;let n=t.json;switch(n.asset&&n.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${n.asset.version}`);return}if(!r.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(n),this._convertTopLevelObjectsToArrays(n),zl(t),this._convertObjectIdsToArrayIndices(n),this._updateObjects(n),this._updateMaterial(n)}_addAsset(t){t.asset=t.asset||{},t.asset.version="2.0",t.asset.generator=t.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(t){for(let r in Ql)this._convertTopLevelObjectToArray(t,r)}_convertTopLevelObjectToArray(t,r){let n=t[r];if(!(!n||Array.isArray(n))){t[r]=[];for(let s in n){let o=n[s];o.id=o.id||s;let i=t[r].length;t[r].push(o),this.idToIndexMap[r][s]=i}}}_convertObjectIdsToArrayIndices(t){for(let r in Ql)this._convertIdsToIndices(t,r);"scene"in t&&(t.scene=this._convertIdToIndex(t.scene,"scene"));for(let r of t.textures)this._convertTextureIds(r);for(let r of t.meshes)this._convertMeshIds(r);for(let r of t.nodes)this._convertNodeIds(r);for(let r of t.scenes)this._convertSceneIds(r)}_convertTextureIds(t){t.source&&(t.source=this._convertIdToIndex(t.source,"image"))}_convertMeshIds(t){for(let r of t.primitives){let{attributes:n,indices:s,material:o}=r;for(let i in n)n[i]=this._convertIdToIndex(n[i],"accessor");s&&(r.indices=this._convertIdToIndex(s,"accessor")),o&&(r.material=this._convertIdToIndex(o,"material"))}}_convertNodeIds(t){t.children&&(t.children=t.children.map(r=>this._convertIdToIndex(r,"node"))),t.meshes&&(t.meshes=t.meshes.map(r=>this._convertIdToIndex(r,"mesh")))}_convertSceneIds(t){t.nodes&&(t.nodes=t.nodes.map(r=>this._convertIdToIndex(r,"node")))}_convertIdsToIndices(t,r){t[r]||(console.warn(`gltf v1: json doesn't contain attribute ${r}`),t[r]=[]);for(let n of t[r])for(let s in n){let o=n[s],i=this._convertIdToIndex(o,s);n[s]=i}}_convertIdToIndex(t,r){let n=Px[r];if(n in this.idToIndexMap){let s=this.idToIndexMap[n][t];if(!Number.isFinite(s))throw new Error(`gltf v1: failed to resolve ${r} with id ${t}`);return s}return t}_updateObjects(t){for(let r of this.json.buffers)delete r.type}_updateMaterial(t){for(let r of t.materials){r.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};let n=r.values?.tex||r.values?.texture2d_0||r.values?.diffuseTex,s=t.textures.findIndex(o=>o.id===n);s!==-1&&(r.pbrMetallicRoughness.baseColorTexture={index:s})}}};function Vl(e,t={}){return new wa().normalize(e,t)}async function jl(e,t,r=0,n,s){return Hx(e,t,r,n),Vl(e,{normalize:n?.gltf?.normalize}),Hl(e,n,s),n?.gltf?.loadBuffers&&e.json.buffers&&await kx(e,n,s),n?.gltf?.loadImages&&await Jx(e,n,s),await kl(e,n,s),e}function Hx(e,t,r,n){if(n.uri&&(e.baseUri=n.uri),t instanceof ArrayBuffer&&!Ol(t,r,n)&&(t=new TextDecoder().decode(t)),typeof t=="string")e.json=jo(t);else if(t instanceof ArrayBuffer){let i={};r=vl(i,t,r,n.glb),ot(i.type==="glTF",`Invalid GLB magic string ${i.type}`),e._glb=i,e.json=i.json}else ot(!1,"GLTF: must be ArrayBuffer or string");let s=e.json.buffers||[];if(e.buffers=new Array(s.length).fill(null),e._glb&&e._glb.header.hasBinChunk){let{binChunks:i}=e._glb;e.buffers[0]={arrayBuffer:i[0].arrayBuffer,byteOffset:i[0].byteOffset,byteLength:i[0].byteLength}}let o=e.json.images||[];e.images=new Array(o.length).fill({})}async function kx(e,t,r){let n=e.json.buffers||[];for(let s=0;s<n.length;++s){let o=n[s];if(o.uri){let{fetch:i}=r;ot(i);let a=ma(o.uri,t),c=await(await r?.fetch?.(a))?.arrayBuffer?.();e.buffers[s]={arrayBuffer:c,byteOffset:0,byteLength:c.byteLength},delete o.uri}else e.buffers[s]===null&&(e.buffers[s]={arrayBuffer:new ArrayBuffer(o.byteLength),byteOffset:0,byteLength:o.byteLength})}}async function Jx(e,t,r){let n=zx(e),s=e.json.images||[],o=[];for(let i of n)o.push(Qx(e,s[i],i,t,r));return await Promise.all(o)}function zx(e){let t=new Set,r=e.json.textures||[];for(let n of r)n.source!==void 0&&t.add(n.source);return Array.from(t).sort()}async function Qx(e,t,r,n,s){let o;if(t.uri&&!t.hasOwnProperty("bufferView")){let a=ma(t.uri,n),{fetch:f}=s;o=await(await f(a)).arrayBuffer(),t.bufferView={data:o}}if(Number.isFinite(t.bufferView)){let a=fl(e.json,e.buffers,t.bufferView);o=Je(a.buffer,a.byteOffset,a.byteLength)}ot(o,"glTF image has no data");let i=await Pt(o,[Wi,la],{...n,mimeType:t.mimeType,basis:n.basis||{format:qs()}},s);i&&i[0]&&(i={compressed:!0,mipmaps:!1,width:i[0].width,height:i[0].height,data:i[0]}),e.images=e.images||[],e.images[r]=i}var Ze={dataType:null,batchType:null,name:"glTF",id:"gltf",module:"gltf",version:pl,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:Vx,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function Vx(e,t={},r){t={...Ze.options,...t},t.gltf={...Ze.options.gltf,...t.gltf};let{byteOffset:n=0}=t;return await jl({},e,n,t,r)}var jx={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},Kx={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Ft={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},Xx={magFilter:Ft.TEXTURE_MAG_FILTER,minFilter:Ft.TEXTURE_MIN_FILTER,wrapS:Ft.TEXTURE_WRAP_S,wrapT:Ft.TEXTURE_WRAP_T},Yx={[Ft.TEXTURE_MAG_FILTER]:Ft.LINEAR,[Ft.TEXTURE_MIN_FILTER]:Ft.NEAREST_MIPMAP_LINEAR,[Ft.TEXTURE_WRAP_S]:Ft.REPEAT,[Ft.TEXTURE_WRAP_T]:Ft.REPEAT};function Zx(){return{id:"default-sampler",parameters:Yx}}function qx(e){return Kx[e]}function Wx(e){return jx[e]}var Ia=class{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(t,r={}){let{json:n,buffers:s=[],images:o=[]}=t,{baseUri:i=""}=t;return ot(n),this.baseUri=i,this.buffers=s,this.images=o,this.jsonUnprocessed=n,this.json=this._resolveTree(t.json,r),this.json}_resolveTree(t,r={}){let n={...t};return this.json=n,t.bufferViews&&(n.bufferViews=t.bufferViews.map((s,o)=>this._resolveBufferView(s,o))),t.images&&(n.images=t.images.map((s,o)=>this._resolveImage(s,o))),t.samplers&&(n.samplers=t.samplers.map((s,o)=>this._resolveSampler(s,o))),t.textures&&(n.textures=t.textures.map((s,o)=>this._resolveTexture(s,o))),t.accessors&&(n.accessors=t.accessors.map((s,o)=>this._resolveAccessor(s,o))),t.materials&&(n.materials=t.materials.map((s,o)=>this._resolveMaterial(s,o))),t.meshes&&(n.meshes=t.meshes.map((s,o)=>this._resolveMesh(s,o))),t.nodes&&(n.nodes=t.nodes.map((s,o)=>this._resolveNode(s,o)),n.nodes=n.nodes.map((s,o)=>this._resolveNodeChildren(s))),t.skins&&(n.skins=t.skins.map((s,o)=>this._resolveSkin(s,o))),t.scenes&&(n.scenes=t.scenes.map((s,o)=>this._resolveScene(s,o))),typeof this.json.scene=="number"&&n.scenes&&(n.scene=n.scenes[this.json.scene]),n}getScene(t){return this._get(this.json.scenes,t)}getNode(t){return this._get(this.json.nodes,t)}getSkin(t){return this._get(this.json.skins,t)}getMesh(t){return this._get(this.json.meshes,t)}getMaterial(t){return this._get(this.json.materials,t)}getAccessor(t){return this._get(this.json.accessors,t)}getCamera(t){return this._get(this.json.cameras,t)}getTexture(t){return this._get(this.json.textures,t)}getSampler(t){return this._get(this.json.samplers,t)}getImage(t){return this._get(this.json.images,t)}getBufferView(t){return this._get(this.json.bufferViews,t)}getBuffer(t){return this._get(this.json.buffers,t)}_get(t,r){if(typeof r=="object")return r;let n=t&&t[r];return n||console.warn(`glTF file error: Could not find ${t}[${r}]`),n}_resolveScene(t,r){return{...t,id:t.id||`scene-${r}`,nodes:(t.nodes||[]).map(n=>this.getNode(n))}}_resolveNode(t,r){let n={...t,id:t?.id||`node-${r}`};return t.mesh!==void 0&&(n.mesh=this.getMesh(t.mesh)),t.camera!==void 0&&(n.camera=this.getCamera(t.camera)),t.skin!==void 0&&(n.skin=this.getSkin(t.skin)),t.meshes!==void 0&&t.meshes.length&&(n.mesh=t.meshes.reduce((s,o)=>{let i=this.getMesh(o);return s.id=i.id,s.primitives=s.primitives.concat(i.primitives),s},{primitives:[]})),n}_resolveNodeChildren(t){return t.children&&(t.children=t.children.map(r=>this.getNode(r))),t}_resolveSkin(t,r){let n=typeof t.inverseBindMatrices=="number"?this.getAccessor(t.inverseBindMatrices):void 0;return{...t,id:t.id||`skin-${r}`,inverseBindMatrices:n}}_resolveMesh(t,r){let n={...t,id:t.id||`mesh-${r}`,primitives:[]};return t.primitives&&(n.primitives=t.primitives.map(s=>{let o={...s,attributes:{},indices:void 0,material:void 0},i=s.attributes;for(let a in i)o.attributes[a]=this.getAccessor(i[a]);return s.indices!==void 0&&(o.indices=this.getAccessor(s.indices)),s.material!==void 0&&(o.material=this.getMaterial(s.material)),o})),n}_resolveMaterial(t,r){let n={...t,id:t.id||`material-${r}`};if(n.normalTexture&&(n.normalTexture={...n.normalTexture},n.normalTexture.texture=this.getTexture(n.normalTexture.index)),n.occlusionTexture&&(n.occlusionTexture={...n.occlusionTexture},n.occlusionTexture.texture=this.getTexture(n.occlusionTexture.index)),n.emissiveTexture&&(n.emissiveTexture={...n.emissiveTexture},n.emissiveTexture.texture=this.getTexture(n.emissiveTexture.index)),n.emissiveFactor||(n.emissiveFactor=n.emissiveTexture?[1,1,1]:[0,0,0]),n.pbrMetallicRoughness){n.pbrMetallicRoughness={...n.pbrMetallicRoughness};let s=n.pbrMetallicRoughness;s.baseColorTexture&&(s.baseColorTexture={...s.baseColorTexture},s.baseColorTexture.texture=this.getTexture(s.baseColorTexture.index)),s.metallicRoughnessTexture&&(s.metallicRoughnessTexture={...s.metallicRoughnessTexture},s.metallicRoughnessTexture.texture=this.getTexture(s.metallicRoughnessTexture.index))}return n}_resolveAccessor(t,r){let n=qx(t.componentType),s=Wx(t.type),o=n*s,i={...t,id:t.id||`accessor-${r}`,bytesPerComponent:n,components:s,bytesPerElement:o,value:void 0,bufferView:void 0,sparse:void 0};if(t.bufferView!==void 0&&(i.bufferView=this.getBufferView(t.bufferView)),i.bufferView){let a=i.bufferView.buffer,{ArrayType:f,byteLength:c}=Hr(i,i.bufferView),h=(i.bufferView.byteOffset||0)+(i.byteOffset||0)+a.byteOffset,l=a.arrayBuffer.slice(h,h+c);i.bufferView.byteStride&&(l=this._getValueFromInterleavedBuffer(a,h,i.bufferView.byteStride,i.bytesPerElement,i.count)),i.value=new f(l)}return i}_getValueFromInterleavedBuffer(t,r,n,s,o){let i=new Uint8Array(o*s);for(let a=0;a<o;a++){let f=r+a*n;i.set(new Uint8Array(t.arrayBuffer.slice(f,f+s)),a*s)}return i.buffer}_resolveTexture(t,r){return{...t,id:t.id||`texture-${r}`,sampler:typeof t.sampler=="number"?this.getSampler(t.sampler):Zx(),source:typeof t.source=="number"?this.getImage(t.source):void 0}}_resolveSampler(t,r){let n={id:t.id||`sampler-${r}`,...t,parameters:{}};for(let s in n){let o=this._enumSamplerParameter(s);o!==void 0&&(n.parameters[o]=n[s])}return n}_enumSamplerParameter(t){return Xx[t]}_resolveImage(t,r){let n={...t,id:t.id||`image-${r}`,image:null,bufferView:t.bufferView!==void 0?this.getBufferView(t.bufferView):void 0},s=this.images[r];return s&&(n.image=s),n}_resolveBufferView(t,r){let n=t.buffer,s=this.buffers[n].arrayBuffer,o=this.buffers[n].byteOffset||0;return t.byteOffset&&(o+=t.byteOffset),{id:`bufferView-${r}`,...t,buffer:this.buffers[n],data:new Uint8Array(s,o,t.byteLength)}}_resolveCamera(t,r){let n={...t,id:t.id||`camera-${r}`};return n.perspective,n.orthographic,n}};function Hn(e,t){return new Ia().postProcess(e,t)}var no={URI:0,EMBEDDED:1};function so(e,t,r,n){e.rotateYtoZ=!0;let s=(e.byteOffset||0)+(e.byteLength||0)-r;if(s===0)throw new Error("glTF byte length must be greater than 0.");return e.gltfUpAxis=n?.["3d-tiles"]&&n["3d-tiles"].assetGltfUpAxis?n["3d-tiles"].assetGltfUpAxis:"Y",e.gltfArrayBuffer=Je(t,r,s),e.gltfByteOffset=0,e.gltfByteLength=s,r%4===0||console.warn(`${e.type}: embedded glb is not aligned to a 4-byte boundary.`),(e.byteOffset||0)+(e.byteLength||0)}async function oo(e,t,r,n){let s=r?.["3d-tiles"]||{};if($x(e,t,r),s.loadGLTF){if(!n)return;if(e.gltfUrl){let{fetch:o}=n,i=await o(e.gltfUrl,r);e.gltfArrayBuffer=await i.arrayBuffer(),e.gltfByteOffset=0}if(e.gltfArrayBuffer){let o=await Pt(e.gltfArrayBuffer,Ze,r,n);e.gltf=Hn(o),e.gpuMemoryUsageInBytes=Nn(e.gltf),delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength}}}function $x(e,t,r){switch(t){case no.URI:if(e.gltfArrayBuffer){let n=new Uint8Array(e.gltfArrayBuffer,e.gltfByteOffset),o=new TextDecoder().decode(n);e.gltfUrl=o.replace(/[\s\0]+$/,"")}delete e.gltfArrayBuffer,delete e.gltfByteOffset,delete e.gltfByteLength;break;case no.EMBEDDED:break;default:throw new Error("b3dm: Illegal glTF format field")}}async function Kl(e,t,r,n,s){r=tB(e,t,r,n,s),await oo(e,no.EMBEDDED,n,s);let o=e?.gltf?.extensions;return o&&o.CESIUM_RTC&&(e.rtcCenter=o.CESIUM_RTC.center),r}function tB(e,t,r,n,s){r=Se(e,t,r),r=Gr(e,t,r),r=Ur(e,t,r,n),r=so(e,t,r,n);let o=new kt(e.featureTableJson,e.featureTableBinary);return e.rtcCenter=o.getGlobalProperty("RTC_CENTER",H.FLOAT,3),r}var de=6356752314245179e-9,eB={radii:[6378137,6378137,de],radiiSquared:[6378137*6378137,6378137*6378137,de*de],oneOverRadii:[1/6378137,1/6378137,1/de],oneOverRadiiSquared:[1/(6378137*6378137),1/(6378137*6378137),1/(de*de)],maximumRadius:Math.max(6378137,6378137,de),centerToleranceSquared:.1};function io(e){return e}var rS=new b;function rB(e,t=[],r=io){return"longitude"in e?(t[0]=r(e.longitude),t[1]=r(e.latitude),t[2]=e.height):"x"in e?(t[0]=r(e.x),t[1]=r(e.y),t[2]=e.z):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function Xl(e,t=[]){return rB(e,t,q._cartographicRadians?io:mi)}function nB(e,t,r=io){return"longitude"in t?(t.longitude=r(e[0]),t.latitude=r(e[1]),t.height=e[2]):"x"in t?(t.x=r(e[0]),t.y=r(e[1]),t.z=e[2]):(t[0]=r(e[0]),t[1]=r(e[1]),t[2]=e[2]),t}function Yl(e,t){return nB(e,t,q._cartographicRadians?io:pi)}var Zl=1e-14,sB=new b,ql={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},Sa={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},kn={east:new b,north:new b,up:new b,west:new b,south:new b,down:new b},oB=new b,iB=new b,aB=new b;function Ra(e,t,r,n,s,o){let i=ql[t]&&ql[t][r];ft(i&&(!n||n===i));let a,f,c,h=sB.copy(s);if(wt(h.x,0,Zl)&&wt(h.y,0,Zl)){let u=Math.sign(h.z);a=oB.fromArray(Sa[t]),t!=="east"&&t!=="west"&&a.scale(u),f=iB.fromArray(Sa[r]),r!=="east"&&r!=="west"&&f.scale(u),c=aB.fromArray(Sa[n]),n!=="east"&&n!=="west"&&c.scale(u)}else{let{up:u,east:d,north:A}=kn;d.set(-h.y,h.x,0).normalize(),e.geodeticSurfaceNormal(h,u),A.copy(u).cross(d);let{down:m,west:p,south:E}=kn;m.copy(u).scale(-1),p.copy(d).scale(-1),E.copy(A).scale(-1),a=kn[t],f=kn[r],c=kn[n]}return o[0]=a.x,o[1]=a.y,o[2]=a.z,o[3]=0,o[4]=f.x,o[5]=f.y,o[6]=f.z,o[7]=0,o[8]=c.x,o[9]=c.y,o[10]=c.z,o[11]=0,o[12]=h.x,o[13]=h.y,o[14]=h.z,o[15]=1,o}var jr=new b,cB=new b,fB=new b;function Wl(e,t,r=[]){let{oneOverRadii:n,oneOverRadiiSquared:s,centerToleranceSquared:o}=t;jr.from(e);let i=jr.x,a=jr.y,f=jr.z,c=n.x,h=n.y,l=n.z,u=i*i*c*c,d=a*a*h*h,A=f*f*l*l,m=u+d+A,p=Math.sqrt(1/m);if(!Number.isFinite(p))return;let E=cB;if(E.copy(e).scale(p),m<o)return E.to(r);let y=s.x,C=s.y,M=s.z,T=fB;T.set(E.x*y*2,E.y*C*2,E.z*M*2);let I=(1-p)*jr.len()/(.5*T.len()),w=0,L,x,g,B;do{I-=w,L=1/(1+I*y),x=1/(1+I*C),g=1/(1+I*M);let _=L*L,U=x*x,G=g*g,P=_*L,v=U*x,at=G*g;B=u*_+d*U+A*G-1;let X=-2*(u*P*y+d*v*C+A*at*M);w=B/X}while(Math.abs(B)>Ht.EPSILON12);return jr.scale([L,x,g]).to(r)}var ao=new b,$l=new b,uB=new b,Jt=new b,dB=new b,co=new b,Ae=class{constructor(t=0,r=0,n=0){this.centerToleranceSquared=Ht.EPSILON1,ft(t>=0),ft(r>=0),ft(n>=0),this.radii=new b(t,r,n),this.radiiSquared=new b(t*t,r*r,n*n),this.radiiToTheFourth=new b(t*t*t*t,r*r*r*r,n*n*n*n),this.oneOverRadii=new b(t===0?0:1/t,r===0?0:1/r,n===0?0:1/n),this.oneOverRadiiSquared=new b(t===0?0:1/(t*t),r===0?0:1/(r*r),n===0?0:1/(n*n)),this.minimumRadius=Math.min(t,r,n),this.maximumRadius=Math.max(t,r,n),this.radiiSquared.z!==0&&(this.squaredXOverSquaredZ=this.radiiSquared.x/this.radiiSquared.z),Object.freeze(this)}equals(t){return this===t||Boolean(t&&this.radii.equals(t.radii))}toString(){return this.radii.toString()}cartographicToCartesian(t,r=[0,0,0]){let n=$l,s=uB,[,,o]=t;this.geodeticSurfaceNormalCartographic(t,n),s.copy(this.radiiSquared).scale(n);let i=Math.sqrt(n.dot(s));return s.scale(1/i),n.scale(o),s.add(n),s.to(r)}cartesianToCartographic(t,r=[0,0,0]){co.from(t);let n=this.scaleToGeodeticSurface(co,Jt);if(!n)return;let s=this.geodeticSurfaceNormal(n,$l),o=dB;o.copy(co).subtract(n);let i=Math.atan2(s.y,s.x),a=Math.asin(s.z),f=Math.sign(je.dot(o,co))*je.length(o);return Yl([i,a,f],r)}eastNorthUpToFixedFrame(t,r=new Rt){return Ra(this,"east","north","up",t,r)}localFrameToFixedFrame(t,r,n,s,o=new Rt){return Ra(this,t,r,n,s,o)}geocentricSurfaceNormal(t,r=[0,0,0]){return ao.from(t).normalize().to(r)}geodeticSurfaceNormalCartographic(t,r=[0,0,0]){let n=Xl(t),s=n[0],o=n[1],i=Math.cos(o);return ao.set(i*Math.cos(s),i*Math.sin(s),Math.sin(o)).normalize(),ao.to(r)}geodeticSurfaceNormal(t,r=[0,0,0]){return ao.from(t).scale(this.oneOverRadiiSquared).normalize().to(r)}scaleToGeodeticSurface(t,r){return Wl(t,this,r)}scaleToGeocentricSurface(t,r=[0,0,0]){Jt.from(t);let n=Jt.x,s=Jt.y,o=Jt.z,i=this.oneOverRadiiSquared,a=1/Math.sqrt(n*n*i.x+s*s*i.y+o*o*i.z);return Jt.multiplyScalar(a).to(r)}transformPositionToScaledSpace(t,r=[0,0,0]){return Jt.from(t).scale(this.oneOverRadii).to(r)}transformPositionFromScaledSpace(t,r=[0,0,0]){return Jt.from(t).scale(this.radii).to(r)}getSurfaceNormalIntersectionWithZAxis(t,r=0,n=[0,0,0]){ft(wt(this.radii.x,this.radii.y,Ht.EPSILON15)),ft(this.radii.z>0),Jt.from(t);let s=Jt.z*(1-this.squaredXOverSquaredZ);if(!(Math.abs(s)>=this.radii.z-r))return Jt.set(0,0,s).to(n)}};Ae.WGS84=new Ae(6378137,6378137,de);async function tu(e,t,r,n,s){return r=AB(e,t,r,n,s),await oo(e,e.gltfFormat||0,n,s),r}function AB(e,t,r,n,s){if(r=Se(e,t,r),e.version!==1)throw new Error(`Instanced 3D Model version ${e.version} is not supported`);r=Gr(e,t,r);let o=new DataView(t);if(e.gltfFormat=o.getUint32(r,!0),r+=4,r=Ur(e,t,r,n),r=so(e,t,r,n),!e?.header?.featureTableJsonByteLength||e.header.featureTableJsonByteLength===0)throw new Error("i3dm parser: featureTableJsonByteLength is zero.");let i=new kt(e.featureTableJson,e.featureTableBinary),a=i.getGlobalProperty("INSTANCES_LENGTH");if(i.featuresLength=a,!Number.isFinite(a))throw new Error("i3dm parser: INSTANCES_LENGTH must be defined");e.eastNorthUp=i.getGlobalProperty("EAST_NORTH_UP"),e.rtcCenter=i.getGlobalProperty("RTC_CENTER",H.FLOAT,3);let f=new ue(e.batchTableJson,e.batchTableBinary,a);return mB(e,i,f,a),r}function mB(e,t,r,n){let s=new Array(n),o=new b,i=new b,a=new b,f=new b,c=new Z,h=new Ie,l=new b,u={},d=new Rt,A=[],m=[],p=[],E=[];for(let y=0;y<n;y++){let C;if(t.hasProperty("POSITION"))C=t.getProperty("POSITION",H.FLOAT,3,y,o);else if(t.hasProperty("POSITION_QUANTIZED")){C=t.getProperty("POSITION_QUANTIZED",H.UNSIGNED_SHORT,3,y,o);let g=t.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",H.FLOAT,3);if(!g)throw new Error("i3dm parser: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let B=t.getGlobalProperty("QUANTIZED_VOLUME_SCALE",H.FLOAT,3);if(!B)throw new Error("i3dm parser: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let _=65535;for(let U=0;U<3;U++)C[U]=C[U]/_*B[U]+g[U]}if(!C)throw new Error("i3dm: POSITION or POSITION_QUANTIZED must be defined for each instance.");o.copy(C),u.translation=o,e.normalUp=t.getProperty("NORMAL_UP",H.FLOAT,3,y,A),e.normalRight=t.getProperty("NORMAL_RIGHT",H.FLOAT,3,y,m);let M=!1;if(e.normalUp){if(!e.normalRight)throw new Error("i3dm: Custom orientation requires both NORMAL_UP and NORMAL_RIGHT.");e.hasCustomOrientation=!0}else{if(e.octNormalUp=t.getProperty("NORMAL_UP_OCT32P",H.UNSIGNED_SHORT,2,y,A),e.octNormalRight=t.getProperty("NORMAL_RIGHT_OCT32P",H.UNSIGNED_SHORT,2,y,m),e.octNormalUp)throw e.octNormalRight?new Error("i3dm: oct-encoded orientation not implemented"):new Error("i3dm: oct-encoded orientation requires NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P");e.eastNorthUp?(Ae.WGS84.eastNorthUpToFixedFrame(o,d),d.getRotationMatrix3(c)):c.identity()}M&&(f.copy(i).cross(a).normalize(),c.setColumn(0,i),c.setColumn(1,a),c.setColumn(2,f)),h.fromMatrix3(c),u.rotation=h,l.set(1,1,1);let T=t.getProperty("SCALE",H.FLOAT,1,y,p);Number.isFinite(T)&&l.multiplyByScalar(T);let I=t.getProperty("SCALE_NON_UNIFORM",H.FLOAT,3,y,A);I&&l.scale(I),u.scale=l;let w=t.getProperty("BATCH_ID",H.UNSIGNED_SHORT,1,y,E);w===void 0&&(w=y);let L=new Rt().fromQuaternion(u.rotation);d.identity(),d.translate(u.translation),d.multiplyRight(L),d.scale(u.scale);let x=d.clone();s[y]={modelMatrix:x,batchId:w}}e.instances=s}async function eu(e,t,r,n,s,o){r=Se(e,t,r);let i=new DataView(t);for(e.tilesLength=i.getUint32(r,!0),r+=4,e.tiles=[];e.tiles.length<e.tilesLength&&(e.byteLength||0)-r>12;){let a={shape:"tile3d"};e.tiles.push(a),r=await o(t,r,n,s,a)}return r}async function ru(e,t,r,n){if(e.rotateYtoZ=!0,e.gltfUpAxis=r?.["3d-tiles"]?.assetGltfUpAxis?r["3d-tiles"].assetGltfUpAxis:"Y",r?.["3d-tiles"]?.loadGLTF){if(!n)return t.byteLength;let s=await Pt(t,Ze,r,n);e.gltf=Hn(s),e.gpuMemoryUsageInBytes=Nn(e.gltf)}else e.gltfArrayBuffer=t;return t.byteLength}async function Fa(e,t=0,r,n,s={shape:"tile3d"}){switch(s.byteOffset=t,s.type=Rf(e,t),s.type){case _t.COMPOSITE:return await eu(s,e,t,r,n,Fa);case _t.BATCHED_3D_MODEL:return await Kl(s,e,t,r,n);case _t.GLTF:return await ru(s,e,r,n);case _t.INSTANCED_3D_MODEL:return await tu(s,e,t,r,n);case _t.POINT_CLOUD:return await qh(s,e,t,r,n);default:throw new Error(`3DTileLoader: unknown type ${s.type}`)}}async function Da(e,t,r){if(new Uint32Array(e.slice(0,4))[0]!==1952609651)throw new Error("Wrong subtree file magic number");if(new Uint32Array(e.slice(4,8))[0]!==1)throw new Error("Wrong subtree file verson, must be 1");let o=nu(e.slice(8,16)),i=new Uint8Array(e,24,o),f=new TextDecoder("utf8").decode(i),c=JSON.parse(f),h=nu(e.slice(16,24)),l=new ArrayBuffer(0);if(h&&(l=e.slice(24+o)),await fo(c,c.tileAvailability,l,r),Array.isArray(c.contentAvailability))for(let u of c.contentAvailability)await fo(c,u,l,r);else await fo(c,c.contentAvailability,l,r);return await fo(c,c.childSubtreeAvailability,l,r),c}async function fo(e,t,r,n){let s=Number.isFinite(t.bitstream)?t.bitstream:t.bufferView;if(typeof s!="number")return;let o=e.bufferViews[s],i=e.buffers[o.buffer];if(!n?.baseUrl)throw new Error("Url is not provided");if(!n.fetch)throw new Error("fetch is not provided");if(i.uri){let f=`${n?.baseUrl||""}/${i.uri}`,h=await(await n.fetch(f)).arrayBuffer();t.explicitBitstream=new Uint8Array(h,o.byteOffset,o.byteLength);return}let a=e.buffers.slice(0,o.buffer).reduce((f,c)=>f+c.byteLength,0);t.explicitBitstream=new Uint8Array(r.slice(a,a+i.byteLength),o.byteOffset,o.byteLength)}function nu(e){let t=new DataView(e),r=t.getUint32(0,!0),n=t.getUint32(4,!0);return r+2**32*n}var Kr={dataType:null,batchType:null,id:"3d-tiles-subtree",name:"3D Tiles Subtree",module:"3d-tiles",version:Sr,extensions:["subtree"],mimeTypes:["application/octet-stream"],tests:["subtree"],parse:Da,options:{}};var Hu=gr(pn(),1);var Nu=gr(pn(),1);function La(e){if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&Boolean(process.versions.electron))return!0;let t=typeof navigator=="object"&&typeof navigator.userAgent=="string"&&navigator.userAgent,r=e||t;return!!(r&&r.indexOf("Electron")>=0)}function zt(){return!(typeof process=="object"&&String(process)==="[object process]"&&!process.browser)||La()}var pB=globalThis.self||globalThis.window||globalThis.global,Xr=globalThis.window||globalThis.self||globalThis.global,gB=globalThis.document||{},qe=globalThis.process||{},xB=globalThis.console,KS=globalThis.navigator||{};var ho=typeof __VERSION__<"u"?__VERSION__:"untranspiled source",ZS=zt();function BB(e){try{let t=window[e],r="__storage_test__";return t.setItem(r,r),t.removeItem(r),t}catch{return null}}var lo=class{constructor(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"sessionStorage";this.storage=void 0,this.id=void 0,this.config=void 0,this.storage=BB(n),this.id=t,this.config=r,this._loadConfiguration()}getConfiguration(){return this.config}setConfiguration(t){if(Object.assign(this.config,t),this.storage){let r=JSON.stringify(this.config);this.storage.setItem(this.id,r)}}_loadConfiguration(){let t={};if(this.storage){let r=this.storage.getItem(this.id);t=r?JSON.parse(r):{}}return Object.assign(this.config,t),this}};function su(e){let t;return e<10?t="".concat(e.toFixed(2),"ms"):e<100?t="".concat(e.toFixed(1),"ms"):e<1e3?t="".concat(e.toFixed(0),"ms"):t="".concat((e/1e3).toFixed(2),"s"),t}function ou(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:8,r=Math.max(t-e.length,0);return"".concat(" ".repeat(r)).concat(e)}function uo(e,t,r){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:600,s=e.src.replace(/\(/g,"%28").replace(/\)/g,"%29");e.width>n&&(r=Math.min(r,n/e.width));let o=e.width*r,i=e.height*r,a=["font-size:1px;","padding:".concat(Math.floor(i/2),"px ").concat(Math.floor(o/2),"px;"),"line-height:".concat(i,"px;"),"background:url(".concat(s,");"),"background-size:".concat(o,"px ").concat(i,"px;"),"color:transparent;"].join("");return["".concat(t," %c+"),a]}var Ao;(function(e){e[e.BLACK=30]="BLACK",e[e.RED=31]="RED",e[e.GREEN=32]="GREEN",e[e.YELLOW=33]="YELLOW",e[e.BLUE=34]="BLUE",e[e.MAGENTA=35]="MAGENTA",e[e.CYAN=36]="CYAN",e[e.WHITE=37]="WHITE",e[e.BRIGHT_BLACK=90]="BRIGHT_BLACK",e[e.BRIGHT_RED=91]="BRIGHT_RED",e[e.BRIGHT_GREEN=92]="BRIGHT_GREEN",e[e.BRIGHT_YELLOW=93]="BRIGHT_YELLOW",e[e.BRIGHT_BLUE=94]="BRIGHT_BLUE",e[e.BRIGHT_MAGENTA=95]="BRIGHT_MAGENTA",e[e.BRIGHT_CYAN=96]="BRIGHT_CYAN",e[e.BRIGHT_WHITE=97]="BRIGHT_WHITE"})(Ao||(Ao={}));var EB=10;function iu(e){return typeof e!="string"?e:(e=e.toUpperCase(),Ao[e]||Ao.WHITE)}function au(e,t,r){if(!zt&&typeof e=="string"){if(t){let n=iu(t);e="\x1B[".concat(n,"m").concat(e,"\x1B[39m")}if(r){let n=iu(r);e="\x1B[".concat(n+EB,"m").concat(e,"\x1B[49m")}}return e}function cu(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:["constructor"],r=Object.getPrototypeOf(e),n=Object.getOwnPropertyNames(r),s=e;for(let o of n){let i=s[o];typeof i=="function"&&(t.find(a=>o===a)||(s[o]=i.bind(e)))}}function Yr(e,t){if(!e)throw new Error(t||"Assertion failed")}function We(){let e;if(zt()&&Xr.performance){var t,r;e=Xr===null||Xr===void 0||(t=Xr.performance)===null||t===void 0||(r=t.now)===null||r===void 0?void 0:r.call(t)}else if("hrtime"in qe){var n;let s=qe===null||qe===void 0||(n=qe.hrtime)===null||n===void 0?void 0:n.call(qe);e=s[0]*1e3+s[1]/1e6}else e=Date.now();return e}var Zr={debug:zt()&&console.debug||console.log,log:console.log,info:console.info,warn:console.warn,error:console.error},_B={enabled:!0,level:0};function Dt(){}var fu={},hu={once:!0},Jn=class{constructor(){let{id:t}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{id:""};this.id=void 0,this.VERSION=ho,this._startTs=We(),this._deltaTs=We(),this._storage=void 0,this.userData={},this.LOG_THROTTLE_TIMEOUT=0,this.id=t,this.userData={},this._storage=new lo("__probe-".concat(this.id,"__"),_B),this.timeStamp("".concat(this.id," started")),cu(this),Object.seal(this)}set level(t){this.setLevel(t)}get level(){return this.getLevel()}isEnabled(){return this._storage.config.enabled}getLevel(){return this._storage.config.level}getTotal(){return Number((We()-this._startTs).toPrecision(10))}getDelta(){return Number((We()-this._deltaTs).toPrecision(10))}set priority(t){this.level=t}get priority(){return this.level}getPriority(){return this.level}enable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;return this._storage.setConfiguration({enabled:t}),this}setLevel(t){return this._storage.setConfiguration({level:t}),this}get(t){return this._storage.config[t]}set(t,r){this._storage.setConfiguration({[t]:r})}settings(){console.table?console.table(this._storage.config):console.log(this._storage.config)}assert(t,r){Yr(t,r)}warn(t){return this._getLogFunction(0,t,Zr.warn,arguments,hu)}error(t){return this._getLogFunction(0,t,Zr.error,arguments)}deprecated(t,r){return this.warn("`".concat(t,"` is deprecated and will be removed in a later version. Use `").concat(r,"` instead"))}removed(t,r){return this.error("`".concat(t,"` has been removed. Use `").concat(r,"` instead"))}probe(t,r){return this._getLogFunction(t,r,Zr.log,arguments,{time:!0,once:!0})}log(t,r){return this._getLogFunction(t,r,Zr.debug,arguments)}info(t,r){return this._getLogFunction(t,r,console.info,arguments)}once(t,r){return this._getLogFunction(t,r,Zr.debug||Zr.info,arguments,hu)}table(t,r,n){return r?this._getLogFunction(t,r,console.table||Dt,n&&[n],{tag:MB(r)}):Dt}image(t){let{logLevel:r,priority:n,image:s,message:o="",scale:i=1}=t;return this._shouldLog(r||n)?zt()?CB({image:s,message:o,scale:i}):TB({image:s,message:o,scale:i}):Dt}time(t,r){return this._getLogFunction(t,r,console.time?console.time:console.info)}timeEnd(t,r){return this._getLogFunction(t,r,console.timeEnd?console.timeEnd:console.info)}timeStamp(t,r){return this._getLogFunction(t,r,console.timeStamp||Dt)}group(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{collapsed:!1},s=lu({logLevel:t,message:r,opts:n}),{collapsed:o}=n;return s.method=(o?console.groupCollapsed:console.group)||console.info,this._getLogFunction(s)}groupCollapsed(t,r){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.group(t,r,Object.assign({},n,{collapsed:!0}))}groupEnd(t){return this._getLogFunction(t,"",console.groupEnd||Dt)}withGroup(t,r,n){this.group(t,r)();try{n()}finally{this.groupEnd(t)()}}trace(){console.trace&&console.trace()}_shouldLog(t){return this.isEnabled()&&this.getLevel()>=uu(t)}_getLogFunction(t,r,n,s,o){if(this._shouldLog(t)){o=lu({logLevel:t,message:r,args:s,opts:o}),n=n||o.method,Yr(n),o.total=this.getTotal(),o.delta=this.getDelta(),this._deltaTs=We();let i=o.tag||o.message;if(o.once&&i)if(!fu[i])fu[i]=We();else return Dt;return r=yB(this.id,o.message,o),n.bind(console,r,...o.args)}return Dt}};Jn.VERSION=ho;function uu(e){if(!e)return 0;let t;switch(typeof e){case"number":t=e;break;case"object":t=e.logLevel||e.priority||0;break;default:return 0}return Yr(Number.isFinite(t)&&t>=0),t}function lu(e){let{logLevel:t,message:r}=e;e.logLevel=uu(t);let n=e.args?Array.from(e.args):[];for(;n.length&&n.shift()!==r;);switch(typeof t){case"string":case"function":r!==void 0&&n.unshift(r),e.message=t;break;case"object":Object.assign(e,t);break;default:}typeof e.message=="function"&&(e.message=e.message());let s=typeof e.message;return Yr(s==="string"||s==="object"),Object.assign(e,{args:n},e.opts)}function yB(e,t,r){if(typeof t=="string"){let n=r.time?ou(su(r.total)):"";t=r.time?"".concat(e,": ").concat(n," ").concat(t):"".concat(e,": ").concat(t),t=au(t,r.color,r.background)}return t}function TB(e){let{image:t,message:r="",scale:n=1}=e;return console.warn("removed"),Dt}function CB(e){let{image:t,message:r="",scale:n=1}=e;if(typeof t=="string"){let o=new Image;return o.onload=()=>{let i=uo(o,r,n);console.log(...i)},o.src=t,Dt}let s=t.nodeName||"";if(s.toLowerCase()==="img")return console.log(...uo(t,r,n)),Dt;if(s.toLowerCase()==="canvas"){let o=new Image;return o.onload=()=>console.log(...uo(o,r,n)),o.src=t.toDataURL(),Dt}return Dt}function MB(e){for(let t in e)for(let r in e[t])return r||"untitled";return"empty"}var Oa=new Jn({id:"@probe.gl/log"});var Lt=null;try{Lt=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Y(e,t,r){this.low=e|0,this.high=t|0,this.unsigned=!!r}Y.prototype.__isLong__;Object.defineProperty(Y.prototype,"__isLong__",{value:!0});function At(e){return(e&&e.__isLong__)===!0}function du(e){var t=Math.clz32(e&-e);return e?31-t:t}Y.isLong=At;var Au={},mu={};function $e(e,t){var r,n,s;return t?(e>>>=0,(s=0<=e&&e<256)&&(n=mu[e],n)?n:(r=Q(e,0,!0),s&&(mu[e]=r),r)):(e|=0,(s=-128<=e&&e<128)&&(n=Au[e],n)?n:(r=Q(e,e<0?-1:0,!1),s&&(Au[e]=r),r))}Y.fromInt=$e;function Ot(e,t){if(isNaN(e))return t?me:Qt;if(t){if(e<0)return me;if(e>=Bu)return yu}else{if(e<=-gu)return Ct;if(e+1>=gu)return _u}return e<0?Ot(-e,t).neg():Q(e%Wr|0,e/Wr|0,t)}Y.fromNumber=Ot;function Q(e,t,r){return new Y(e,t,r)}Y.fromBits=Q;var mo=Math.pow;function Na(e,t,r){if(e.length===0)throw Error("empty string");if(typeof t=="number"?(r=t,t=!1):t=!!t,e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t?me:Qt;if(r=r||10,r<2||36<r)throw RangeError("radix");var n;if((n=e.indexOf("-"))>0)throw Error("interior hyphen");if(n===0)return Na(e.substring(1),t,r).neg();for(var s=Ot(mo(r,8)),o=Qt,i=0;i<e.length;i+=8){var a=Math.min(8,e.length-i),f=parseInt(e.substring(i,i+a),r);if(a<8){var c=Ot(mo(r,a));o=o.mul(c).add(Ot(f))}else o=o.mul(s),o=o.add(Ot(f))}return o.unsigned=t,o}Y.fromString=Na;function Vt(e,t){return typeof e=="number"?Ot(e,t):typeof e=="string"?Na(e,t):Q(e.low,e.high,typeof t=="boolean"?t:e.unsigned)}Y.fromValue=Vt;var pu=1<<16,bB=1<<24,Wr=pu*pu,Bu=Wr*Wr,gu=Bu/2,xu=$e(bB),Qt=$e(0);Y.ZERO=Qt;var me=$e(0,!0);Y.UZERO=me;var qr=$e(1);Y.ONE=qr;var Eu=$e(1,!0);Y.UONE=Eu;var va=$e(-1);Y.NEG_ONE=va;var _u=Q(-1,2147483647,!1);Y.MAX_VALUE=_u;var yu=Q(-1,-1,!0);Y.MAX_UNSIGNED_VALUE=yu;var Ct=Q(0,-2147483648,!1);Y.MIN_VALUE=Ct;var O=Y.prototype;O.toInt=function(){return this.unsigned?this.low>>>0:this.low};O.toNumber=function(){return this.unsigned?(this.high>>>0)*Wr+(this.low>>>0):this.high*Wr+(this.low>>>0)};O.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(Ct)){var r=Ot(t),n=this.div(r),s=n.mul(r).sub(this);return n.toString(t)+s.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var o=Ot(mo(t,6),this.unsigned),i=this,a="";;){var f=i.div(o),c=i.sub(f.mul(o)).toInt()>>>0,h=c.toString(t);if(i=f,i.isZero())return h+a;for(;h.length<6;)h="0"+h;a=""+h+a}};O.getHighBits=function(){return this.high};O.getHighBitsUnsigned=function(){return this.high>>>0};O.getLowBits=function(){return this.low};O.getLowBitsUnsigned=function(){return this.low>>>0};O.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Ct)?64:this.neg().getNumBitsAbs();for(var t=this.high!=0?this.high:this.low,r=31;r>0&&!(t&1<<r);r--);return this.high!=0?r+33:r+1};O.isZero=function(){return this.high===0&&this.low===0};O.eqz=O.isZero;O.isNegative=function(){return!this.unsigned&&this.high<0};O.isPositive=function(){return this.unsigned||this.high>=0};O.isOdd=function(){return(this.low&1)===1};O.isEven=function(){return(this.low&1)===0};O.equals=function(t){return At(t)||(t=Vt(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low};O.eq=O.equals;O.notEquals=function(t){return!this.eq(t)};O.neq=O.notEquals;O.ne=O.notEquals;O.lessThan=function(t){return this.comp(t)<0};O.lt=O.lessThan;O.lessThanOrEqual=function(t){return this.comp(t)<=0};O.lte=O.lessThanOrEqual;O.le=O.lessThanOrEqual;O.greaterThan=function(t){return this.comp(t)>0};O.gt=O.greaterThan;O.greaterThanOrEqual=function(t){return this.comp(t)>=0};O.gte=O.greaterThanOrEqual;O.ge=O.greaterThanOrEqual;O.compare=function(t){if(At(t)||(t=Vt(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1};O.comp=O.compare;O.negate=function(){return!this.unsigned&&this.eq(Ct)?Ct:this.not().add(qr)};O.neg=O.negate;O.add=function(t){At(t)||(t=Vt(t));var r=this.high>>>16,n=this.high&65535,s=this.low>>>16,o=this.low&65535,i=t.high>>>16,a=t.high&65535,f=t.low>>>16,c=t.low&65535,h=0,l=0,u=0,d=0;return d+=o+c,u+=d>>>16,d&=65535,u+=s+f,l+=u>>>16,u&=65535,l+=n+a,h+=l>>>16,l&=65535,h+=r+i,h&=65535,Q(u<<16|d,h<<16|l,this.unsigned)};O.subtract=function(t){return At(t)||(t=Vt(t)),this.add(t.neg())};O.sub=O.subtract;O.multiply=function(t){if(this.isZero())return this;if(At(t)||(t=Vt(t)),Lt){var r=Lt.mul(this.low,this.high,t.low,t.high);return Q(r,Lt.get_high(),this.unsigned)}if(t.isZero())return this.unsigned?me:Qt;if(this.eq(Ct))return t.isOdd()?Ct:Qt;if(t.eq(Ct))return this.isOdd()?Ct:Qt;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(xu)&&t.lt(xu))return Ot(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,s=this.high&65535,o=this.low>>>16,i=this.low&65535,a=t.high>>>16,f=t.high&65535,c=t.low>>>16,h=t.low&65535,l=0,u=0,d=0,A=0;return A+=i*h,d+=A>>>16,A&=65535,d+=o*h,u+=d>>>16,d&=65535,d+=i*c,u+=d>>>16,d&=65535,u+=s*h,l+=u>>>16,u&=65535,u+=o*c,l+=u>>>16,u&=65535,u+=i*f,l+=u>>>16,u&=65535,l+=n*h+s*c+o*f+i*a,l&=65535,Q(d<<16|A,l<<16|u,this.unsigned)};O.mul=O.multiply;O.divide=function(t){if(At(t)||(t=Vt(t)),t.isZero())throw Error("division by zero");if(Lt){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?Lt.div_u:Lt.div_s)(this.low,this.high,t.low,t.high);return Q(r,Lt.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?me:Qt;var n,s,o;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return me;if(t.gt(this.shru(1)))return Eu;o=me}else{if(this.eq(Ct)){if(t.eq(qr)||t.eq(va))return Ct;if(t.eq(Ct))return qr;var i=this.shr(1);return n=i.div(t).shl(1),n.eq(Qt)?t.isNegative()?qr:va:(s=this.sub(t.mul(n)),o=n.add(s.div(t)),o)}else if(t.eq(Ct))return this.unsigned?me:Qt;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=Qt}for(s=this;s.gte(t);){n=Math.max(1,Math.floor(s.toNumber()/t.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),f=a<=48?1:mo(2,a-48),c=Ot(n),h=c.mul(t);h.isNegative()||h.gt(s);)n-=f,c=Ot(n,this.unsigned),h=c.mul(t);c.isZero()&&(c=qr),o=o.add(c),s=s.sub(h)}return o};O.div=O.divide;O.modulo=function(t){if(At(t)||(t=Vt(t)),Lt){var r=(this.unsigned?Lt.rem_u:Lt.rem_s)(this.low,this.high,t.low,t.high);return Q(r,Lt.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))};O.mod=O.modulo;O.rem=O.modulo;O.not=function(){return Q(~this.low,~this.high,this.unsigned)};O.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32};O.clz=O.countLeadingZeros;O.countTrailingZeros=function(){return this.low?du(this.low):du(this.high)+32};O.ctz=O.countTrailingZeros;O.and=function(t){return At(t)||(t=Vt(t)),Q(this.low&t.low,this.high&t.high,this.unsigned)};O.or=function(t){return At(t)||(t=Vt(t)),Q(this.low|t.low,this.high|t.high,this.unsigned)};O.xor=function(t){return At(t)||(t=Vt(t)),Q(this.low^t.low,this.high^t.high,this.unsigned)};O.shiftLeft=function(t){return At(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Q(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):Q(0,this.low<<t-32,this.unsigned)};O.shl=O.shiftLeft;O.shiftRight=function(t){return At(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Q(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):Q(this.high>>t-32,this.high>=0?0:-1,this.unsigned)};O.shr=O.shiftRight;O.shiftRightUnsigned=function(t){return At(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?Q(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):t===32?Q(this.high,0,this.unsigned):Q(this.high>>>t-32,0,this.unsigned)};O.shru=O.shiftRightUnsigned;O.shr_u=O.shiftRightUnsigned;O.rotateLeft=function(t){var r;return At(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Q(this.high,this.low,this.unsigned):t<32?(r=32-t,Q(this.low<<t|this.high>>>r,this.high<<t|this.low>>>r,this.unsigned)):(t-=32,r=32-t,Q(this.high<<t|this.low>>>r,this.low<<t|this.high>>>r,this.unsigned))};O.rotl=O.rotateLeft;O.rotateRight=function(t){var r;return At(t)&&(t=t.toInt()),(t&=63)===0?this:t===32?Q(this.high,this.low,this.unsigned):t<32?(r=32-t,Q(this.high<<r|this.low>>>t,this.low<<r|this.high>>>t,this.unsigned)):(t-=32,r=32-t,Q(this.low<<r|this.high>>>t,this.high<<r|this.low>>>t,this.unsigned))};O.rotr=O.rotateRight;O.toSigned=function(){return this.unsigned?Q(this.low,this.high,!1):this};O.toUnsigned=function(){return this.unsigned?this:Q(this.low,this.high,!0)};O.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()};O.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]};O.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]};Y.fromBytes=function(t,r,n){return n?Y.fromBytesLE(t,r):Y.fromBytesBE(t,r)};Y.fromBytesLE=function(t,r){return new Y(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)};Y.fromBytesBE=function(t,r){return new Y(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)};var $r=Y;var wB=16;function zn(e){e==="X"&&(e="");let t=e.padEnd(wB,"0");return $r.fromString(t,!0,16)}function Ga(e){if(e.isZero())return"X";let t=e.countTrailingZeros(),r=t%4;t=(t-r)/4;let n=t;t*=4;let o=e.shiftRightUnsigned(t).toString(16).replace(/0+$/,"");return Array(17-n-o.length).join("0")+o}function Ua(e,t){let r=IB(e).shiftRightUnsigned(2);return e.add($r.fromNumber(2*t+1-4).multiply(r))}function IB(e){return e.and(e.not().add(1))}var SB=3,RB=30,FB=2*RB+1,Tu=180/Math.PI;function Mu(e){if(e.length===0)throw new Error(`Invalid Hilbert quad key ${e}`);let t=e.split("/"),r=parseInt(t[0],10),n=t[1],s=n.length,o=0,i=[0,0];for(let a=s-1;a>=0;a--){o=s-a;let f=n[a],c=0,h=0;f==="1"?h=1:f==="2"?(c=1,h=1):f==="3"&&(c=1);let l=Math.pow(2,o-1);DB(l,i,c,h),i[0]+=l*c,i[1]+=l*h}if(r%2===1){let a=i[0];i[0]=i[1],i[1]=a}return{face:r,ij:i,level:o}}function bu(e){if(e.isZero())return"";let t=e.toString(2);for(;t.length<SB+FB;)t="0"+t;let r=t.lastIndexOf("1"),n=t.substring(0,3),s=t.substring(3,r),o=s.length/2,i=$r.fromString(n,!0,2).toString(10),a="";if(o!==0)for(a=$r.fromString(s,!0,2).toString(4);a.length<o;)a="0"+a;return`${i}/${a}`}function Pa(e,t,r){let n=1<<t;return[(e[0]+r[0])/n,(e[1]+r[1])/n]}function Cu(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Ha(e){return[Cu(e[0]),Cu(e[1])]}function ka(e,[t,r]){switch(e){case 0:return[1,t,r];case 1:return[-t,1,r];case 2:return[-t,-r,1];case 3:return[-1,-r,-t];case 4:return[r,-1,-t];case 5:return[r,t,-1];default:throw new Error("Invalid face")}}function Ja([e,t,r]){let n=Math.atan2(r,Math.sqrt(e*e+t*t));return[Math.atan2(t,e)*Tu,n*Tu]}function DB(e,t,r,n){if(n===0){r===1&&(t[0]=e-1-t[0],t[1]=e-1-t[1]);let s=t[0];t[0]=t[1],t[1]=s}}function wu(e){let t=Pa(e.ij,e.level,[.5,.5]),r=Ha(t),n=ka(e.face,r);return Ja(n)}var LB=100;function za(e){let{face:t,ij:r,level:n}=e,s=[[0,0],[0,1],[1,1],[1,0],[0,0]],o=Math.max(1,Math.ceil(LB*Math.pow(2,-n))),i=new Float64Array(4*o*2+2),a=0,f=0;for(let c=0;c<4;c++){let h=s[c].slice(0),l=s[c+1],u=(l[0]-h[0])/o,d=(l[1]-h[1])/o;for(let A=0;A<o;A++){h[0]+=u,h[1]+=d;let m=Pa(r,n,h),p=Ha(m),E=ka(t,p),y=Ja(E);Math.abs(y[1])>89.999&&(y[0]=f);let C=y[0]-f;y[0]+=C>180?-360:C<-180?360:0,i[a++]=y[0],i[a++]=y[1],f=y[0]}}return i[a++]=i[0],i[a++]=i[1],i}function tn(e){let t=OB(e);return Mu(t)}function OB(e){if(e.indexOf("/")>0)return e;let t=zn(e);return bu(t)}function Qa(e){let t=tn(e);return wu(t)}function Su(e){let t;if(e.face===2||e.face===5){let r=null,n=0;for(let s=0;s<4;s++){let o=`${e.face}/${s}`,i=tn(o),a=za(i);(typeof r>"u"||r===null)&&(r=new Float64Array(4*a.length)),r.set(a,n),n+=a.length}t=Iu(r)}else{let r=za(e);t=Iu(r)}return t}function Iu(e){if(e.length%2!==0)throw new Error("Invalid corners");let t=[],r=[];for(let n=0;n<e.length;n+=2)t.push(e[n]),r.push(e[n+1]);return t.sort((n,s)=>n-s),r.sort((n,s)=>n-s),{west:t[0],east:t[t.length-1],north:r[r.length-1],south:r[0]}}function Va(e,t){let r=t?.minimumHeight||0,n=t?.maximumHeight||0,s=tn(e),o=Su(s),i=o.west,a=o.south,f=o.east,c=o.north,h=[];return h.push(new b(i,c,r)),h.push(new b(f,c,r)),h.push(new b(f,a,r)),h.push(new b(i,a,r)),h.push(new b(i,c,n)),h.push(new b(f,c,n)),h.push(new b(f,a,n)),h.push(new b(i,a,n)),h}var ht={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};var ZR=new b,qR=new b;var Qn=new b,Ru=new b,Fe=class{constructor(t=[0,0,0],r=0){this.radius=-0,this.center=new b,this.fromCenterRadius(t,r)}fromCenterRadius(t,r){return this.center.from(t),this.radius=r,this}fromCornerPoints(t,r){return r=Qn.from(r),this.center=new b().from(t).add(r).scale(.5),this.radius=this.center.distance(r),this}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.radius===t.radius}clone(){return new Fe(this.center,this.radius)}union(t){let r=this.center,n=this.radius,s=t.center,o=t.radius,i=Qn.copy(s).subtract(r),a=i.magnitude();if(n>=a+o)return this.clone();if(o>=a+n)return t.clone();let f=(n+a+o)*.5;return Ru.copy(i).scale((-n+f)/a).add(r),this.center.copy(Ru),this.radius=f,this}expand(t){let n=Qn.from(t).subtract(this.center).magnitude();return n>this.radius&&(this.radius=n),this}transform(t){this.center.transform(t);let r=Fn.getScaling(Qn,t);return this.radius=Math.max(r[0],Math.max(r[1],r[2]))*this.radius,this}distanceSquaredTo(t){let r=this.distanceTo(t);return r*r}distanceTo(t){let n=Qn.from(t).subtract(this.center);return Math.max(0,n.len()-this.radius)}intersectPlane(t){let r=this.center,n=this.radius,o=t.normal.dot(r)+t.distance;return o<-n?ht.OUTSIDE:o<n?ht.INTERSECTING:ht.INSIDE}};var vB=new b,NB=new b,po=new b,go=new b,xo=new b,GB=new b,UB=new b,pe={COLUMN0ROW0:0,COLUMN0ROW1:1,COLUMN0ROW2:2,COLUMN1ROW0:3,COLUMN1ROW1:4,COLUMN1ROW2:5,COLUMN2ROW0:6,COLUMN2ROW1:7,COLUMN2ROW2:8},tr=class{constructor(t=[0,0,0],r=[0,0,0,0,0,0,0,0,0]){this.center=new b().from(t),this.halfAxes=new Z(r)}get halfSize(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2);return[new b(t).len(),new b(r).len(),new b(n).len()]}get quaternion(){let t=this.halfAxes.getColumn(0),r=this.halfAxes.getColumn(1),n=this.halfAxes.getColumn(2),s=new b(t).normalize(),o=new b(r).normalize(),i=new b(n).normalize();return new Ie().fromMatrix3(new Z([...s,...o,...i]))}fromCenterHalfSizeQuaternion(t,r,n){let s=new Ie(n),o=new Z().fromQuaternion(s);return o[0]=o[0]*r[0],o[1]=o[1]*r[0],o[2]=o[2]*r[0],o[3]=o[3]*r[1],o[4]=o[4]*r[1],o[5]=o[5]*r[1],o[6]=o[6]*r[2],o[7]=o[7]*r[2],o[8]=o[8]*r[2],this.center=new b().from(t),this.halfAxes=o,this}clone(){return new tr(this.center,this.halfAxes)}equals(t){return this===t||Boolean(t)&&this.center.equals(t.center)&&this.halfAxes.equals(t.halfAxes)}getBoundingSphere(t=new Fe){let r=this.halfAxes,n=r.getColumn(0,po),s=r.getColumn(1,go),o=r.getColumn(2,xo),i=vB.copy(n).add(s).add(o);return t.center.copy(this.center),t.radius=i.magnitude(),t}intersectPlane(t){let r=this.center,n=t.normal,s=this.halfAxes,o=n.x,i=n.y,a=n.z,f=Math.abs(o*s[pe.COLUMN0ROW0]+i*s[pe.COLUMN0ROW1]+a*s[pe.COLUMN0ROW2])+Math.abs(o*s[pe.COLUMN1ROW0]+i*s[pe.COLUMN1ROW1]+a*s[pe.COLUMN1ROW2])+Math.abs(o*s[pe.COLUMN2ROW0]+i*s[pe.COLUMN2ROW1]+a*s[pe.COLUMN2ROW2]),c=n.dot(r)+t.distance;return c<=-f?ht.OUTSIDE:c>=f?ht.INSIDE:ht.INTERSECTING}distanceTo(t){return Math.sqrt(this.distanceSquaredTo(t))}distanceSquaredTo(t){let r=NB.from(t).subtract(this.center),n=this.halfAxes,s=n.getColumn(0,po),o=n.getColumn(1,go),i=n.getColumn(2,xo),a=s.magnitude(),f=o.magnitude(),c=i.magnitude();s.normalize(),o.normalize(),i.normalize();let h=0,l;return l=Math.abs(r.dot(s))-a,l>0&&(h+=l*l),l=Math.abs(r.dot(o))-f,l>0&&(h+=l*l),l=Math.abs(r.dot(i))-c,l>0&&(h+=l*l),h}computePlaneDistances(t,r,n=[-0,-0]){let s=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,i=this.center,a=this.halfAxes,f=a.getColumn(0,po),c=a.getColumn(1,go),h=a.getColumn(2,xo),l=GB.copy(f).add(c).add(h).add(i),u=UB.copy(l).subtract(t),d=r.dot(u);return s=Math.min(d,s),o=Math.max(d,o),l.copy(i).add(f).add(c).subtract(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),l.copy(i).add(f).subtract(c).add(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),l.copy(i).add(f).subtract(c).subtract(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),i.copy(l).subtract(f).add(c).add(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),i.copy(l).subtract(f).add(c).subtract(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),i.copy(l).subtract(f).subtract(c).add(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),i.copy(l).subtract(f).subtract(c).subtract(h),u.copy(l).subtract(t),d=r.dot(u),s=Math.min(d,s),o=Math.max(d,o),n[0]=s,n[1]=o,n}transform(t){this.center.transformAsPoint(t);let r=this.halfAxes.getColumn(0,po);r.transformAsPoint(t);let n=this.halfAxes.getColumn(1,go);n.transformAsPoint(t);let s=this.halfAxes.getColumn(2,xo);return s.transformAsPoint(t),this.halfAxes=new Z([...r,...n,...s]),this}getTransform(){throw new Error("not implemented")}};var Fu=new b,Du=new b,ge=class{constructor(t=[0,0,1],r=0){this.normal=new b,this.distance=-0,this.fromNormalDistance(t,r)}fromNormalDistance(t,r){return ft(Number.isFinite(r)),this.normal.from(t).normalize(),this.distance=r,this}fromPointNormal(t,r){t=Fu.from(t),this.normal.from(r).normalize();let n=-this.normal.dot(t);return this.distance=n,this}fromCoefficients(t,r,n,s){return this.normal.set(t,r,n),ft(wt(this.normal.len(),1)),this.distance=s,this}clone(){return new ge(this.normal,this.distance)}equals(t){return wt(this.distance,t.distance)&&wt(this.normal,t.normal)}getPointDistance(t){return this.normal.dot(t)+this.distance}transform(t){let r=Du.copy(this.normal).transformAsVector(t).normalize(),n=this.normal.scale(-this.distance).transform(t);return this.fromPointNormal(n,r)}projectPointOntoPlane(t,r=[0,0,0]){let n=Fu.from(t),s=this.getPointDistance(n),o=Du.copy(this.normal).scale(s);return n.subtract(o).to(r)}};var Lu=[new b([1,0,0]),new b([0,1,0]),new b([0,0,1])],Ou=new b,PB=new b,vt=class{constructor(t=[]){this.planes=t}fromBoundingSphere(t){this.planes.length=2*Lu.length;let r=t.center,n=t.radius,s=0;for(let o of Lu){let i=this.planes[s],a=this.planes[s+1];i||(i=this.planes[s]=new ge),a||(a=this.planes[s+1]=new ge);let f=Ou.copy(o).scale(-n).add(r);i.fromPointNormal(f,o);let c=Ou.copy(o).scale(n).add(r),h=PB.copy(o).negate();a.fromPointNormal(c,h),s+=2}return this}computeVisibility(t){let r=ht.INSIDE;for(let n of this.planes)switch(t.intersectPlane(n)){case ht.OUTSIDE:return ht.OUTSIDE;case ht.INTERSECTING:r=ht.INTERSECTING;break;default:}return r}computeVisibilityWithPlaneMask(t,r){if(ft(Number.isFinite(r),"parentPlaneMask is required."),r===vt.MASK_OUTSIDE||r===vt.MASK_INSIDE)return r;let n=vt.MASK_INSIDE,s=this.planes;for(let o=0;o<this.planes.length;++o){let i=o<31?1<<o:0;if(o<31&&!(r&i))continue;let a=s[o],f=t.intersectPlane(a);if(f===ht.OUTSIDE)return vt.MASK_OUTSIDE;f===ht.INTERSECTING&&(n|=i)}return n}};vt.MASK_OUTSIDE=4294967295;vt.MASK_INSIDE=0;vt.MASK_INDETERMINATE=2147483647;var mF=new b,pF=new b,gF=new b,xF=new b,BF=new b;var MF=new b,bF=new b,wF=new b,IF=new b,SF=new b,RF=new b,FF=new b,DF=new b,LF=new b,OF=new b,vF=new b,NF=new b;var re=new Z,kB=new Z,JB=new Z,Bo=new Z,vu=new Z;function Xa(e,t={}){let r=Ht.EPSILON20,n=10,s=0,o=0,i=kB,a=JB;i.identity(),a.copy(e);let f=r*zB(a);for(;o<n&&QB(a)>f;)VB(a,Bo),vu.copy(Bo).transpose(),a.multiplyRight(Bo),a.multiplyLeft(vu),i.multiplyRight(Bo),++s>2&&(++o,s=0);return t.unitary=i.toTarget(t.unitary),t.diagonal=a.toTarget(t.diagonal),t}function zB(e){let t=0;for(let r=0;r<9;++r){let n=e[r];t+=n*n}return Math.sqrt(t)}var ja=[1,0,0],Ka=[2,2,1];function QB(e){let t=0;for(let r=0;r<3;++r){let n=e[re.getElementIndex(Ka[r],ja[r])];t+=2*n*n}return Math.sqrt(t)}function VB(e,t){let r=Ht.EPSILON15,n=0,s=1;for(let c=0;c<3;++c){let h=Math.abs(e[re.getElementIndex(Ka[c],ja[c])]);h>n&&(s=c,n=h)}let o=ja[s],i=Ka[s],a=1,f=0;if(Math.abs(e[re.getElementIndex(i,o)])>r){let c=e[re.getElementIndex(i,i)],h=e[re.getElementIndex(o,o)],l=e[re.getElementIndex(i,o)],u=(c-h)/2/l,d;u<0?d=-1/(-u+Math.sqrt(1+u*u)):d=1/(u+Math.sqrt(1+u*u)),a=1/Math.sqrt(1+d*d),f=d*a}return Z.IDENTITY.to(t),t[re.getElementIndex(o,o)]=t[re.getElementIndex(i,i)]=a,t[re.getElementIndex(i,o)]=f,t[re.getElementIndex(o,i)]=-f,t}var De=new b,KB=new b,XB=new b,YB=new b,ZB=new b,qB=new Z,WB={diagonal:new Z,unitary:new Z};function Ya(e,t=new tr){if(!e||e.length===0)return t.halfAxes=new Z([0,0,0,0,0,0,0,0,0]),t.center=new b,t;let r=e.length,n=new b(0,0,0);for(let x of e)n.add(x);let s=1/r;n.multiplyByScalar(s);let o=0,i=0,a=0,f=0,c=0,h=0;for(let x of e){let g=De.copy(x).subtract(n);o+=g.x*g.x,i+=g.x*g.y,a+=g.x*g.z,f+=g.y*g.y,c+=g.y*g.z,h+=g.z*g.z}o*=s,i*=s,a*=s,f*=s,c*=s,h*=s;let l=qB;l[0]=o,l[1]=i,l[2]=a,l[3]=i,l[4]=f,l[5]=c,l[6]=a,l[7]=c,l[8]=h;let{unitary:u}=Xa(l,WB),d=t.halfAxes.copy(u),A=d.getColumn(0,XB),m=d.getColumn(1,YB),p=d.getColumn(2,ZB),E=-Number.MAX_VALUE,y=-Number.MAX_VALUE,C=-Number.MAX_VALUE,M=Number.MAX_VALUE,T=Number.MAX_VALUE,I=Number.MAX_VALUE;for(let x of e)De.copy(x),E=Math.max(De.dot(A),E),y=Math.max(De.dot(m),y),C=Math.max(De.dot(p),C),M=Math.min(De.dot(A),M),T=Math.min(De.dot(m),T),I=Math.min(De.dot(p),I);A=A.multiplyByScalar(.5*(M+E)),m=m.multiplyByScalar(.5*(T+y)),p=p.multiplyByScalar(.5*(I+C)),t.center.copy(A).add(m).add(p);let w=KB.set(E-M,y-T,C-I).multiplyByScalar(.5),L=new Z([w[0],0,0,0,w[1],0,0,0,w[2]]);return t.halfAxes.multiplyRight(L),t}function Eo(e){let t=e.token,r={minimumHeight:e.minimumHeight,maximumHeight:e.maximumHeight},n=Va(t,r),s=Qa(t),o=s[0],i=s[1],a=Ae.WGS84.cartographicToCartesian([o,i,r.maximumHeight]),f=new b(a[0],a[1],a[2]);n.push(f);let c=Ya(n);return[...c.center,...c.halfAxes]}var $B=4,t2=8,e2={QUADTREE:$B,OCTREE:t2};function r2(e,t,r){if(e?.box){let n=zn(e.s2VolumeInfo.token),s=Ua(n,t),o=Ga(s),i={...e.s2VolumeInfo};switch(i.token=o,r){case"OCTREE":let c=e.s2VolumeInfo,h=c.maximumHeight-c.minimumHeight,l=h/2,u=c.minimumHeight+h/2;c.minimumHeight=u-l,c.maximumHeight=u+l;break;default:break}return{box:Eo(i),s2VolumeInfo:i}}}async function qa(e){let{implicitOptions:t,parentData:r={mortonIndex:0,x:0,y:0,z:0},childIndex:n=0,s2VolumeBox:s,loaderOptions:o}=e,{subtree:i,level:a=0,globalData:f={level:0,mortonIndex:0,x:0,y:0,z:0}}=e,{subdivisionScheme:c,subtreeLevels:h,maximumLevel:l,contentUrlTemplate:u,subtreesUriTemplate:d,basePath:A}=t,m={children:[],lodMetricValue:0,contentUrl:""};if(!l)return Oa.once(`Missing 'maximumLevel' or 'availableLevels' property. The subtree ${u} won't be loaded...`),m;let p=a+f.level;if(p>l)return m;let E=e2[c],y=Math.log2(E),C=n&1,M=n>>1&1,T=n>>2&1,I=(E**a-1)/(E-1),w=er(r.mortonIndex,n,y),L=I+w,x=er(r.x,C,1),g=er(r.y,M,1),B=er(r.z,T,1),_=!1;a>=h&&(_=Za(i.childSubtreeAvailability,w));let U=er(f.x,x,a),G=er(f.y,g,a),P=er(f.z,B,a);if(_){let ke=`${A}/${d}`,us=_o(ke,p,U,G,P);i=await(0,Nu.load)(us,Kr,o),f={mortonIndex:w,x,y:g,z:B,level:a},w=0,L=0,x=0,g=0,B=0,a=0}if(!Za(i.tileAvailability,L))return m;Za(i.contentAvailability,L)&&(m.contentUrl=_o(u,p,U,G,P));let mt=a+1,X={mortonIndex:w,x,y:g,z:B};for(let ke=0;ke<E;ke++){let us=r2(s,ke,c),pr=await qa({subtree:i,implicitOptions:t,loaderOptions:o,parentData:X,childIndex:ke,level:mt,globalData:{...f},s2VolumeBox:us});if(pr.contentUrl||pr.children.length){let S=p+1,R=n2(pr,S,{childTileX:x,childTileY:g,childTileZ:B},t,s);m.children.push(R)}}return m}function Za(e,t){let r;return Array.isArray(e)?(r=e[0],e.length>1&&Oa.once('Not supported extension "3DTILES_multiple_contents" has been detected')):r=e,"constant"in r?Boolean(r.constant):r.explicitBitstream?i2(t,r.explicitBitstream):!1}function n2(e,t,r,n,s){let{basePath:o,refine:i,getRefine:a,lodMetricType:f,getTileType:c,rootLodMetricValue:h,rootBoundingVolume:l}=n,u=e.contentUrl&&e.contentUrl.replace(`${o}/`,""),d=h/2**t,A=s?.box?{box:s.box}:l,m=s2(t,A,r);return{children:e.children,contentUrl:e.contentUrl,content:{uri:u},id:e.contentUrl,refine:a(i),type:c(e),lodMetricType:f,lodMetricValue:d,geometricError:d,transform:e.transform,boundingVolume:m}}function s2(e,t,r){if(t.region){let{childTileX:n,childTileY:s,childTileZ:o}=r,[i,a,f,c,h,l]=t.region,u=2**e,d=(f-i)/u,A=(c-a)/u,m=(l-h)/u,[p,E]=[i+d*n,i+d*(n+1)],[y,C]=[a+A*s,a+A*(s+1)],[M,T]=[h+m*o,h+m*(o+1)];return{region:[p,y,E,C,M,T]}}if(t.box)return t;throw new Error(`Unsupported bounding volume type ${JSON.stringify(t)}`)}function er(e,t,r){return(e<<r)+t}function _o(e,t,r,n,s){let o=o2({level:t,x:r,y:n,z:s});return e.replace(/{level}|{x}|{y}|{z}/gi,i=>o[i])}function o2(e){let t={};for(let r in e)t[`{${r}}`]=e[r];return t}function i2(e,t){let r=Math.floor(e/8),n=e%8;return(t[r]>>n&1)===1}function $a(e,t=""){if(!t)return Ce.EMPTY;let n=t.split("?")[0].split(".").pop();switch(n){case"pnts":return Ce.POINTCLOUD;case"i3dm":case"b3dm":case"glb":case"gltf":return Ce.SCENEGRAPH;default:return n||Ce.EMPTY}}function tc(e){switch(e){case"REPLACE":case"replace":return Ir.REPLACE;case"ADD":case"add":return Ir.ADD;default:return e}}function Wa(e,t){if(/^[a-z][0-9a-z+.-]*:/i.test(t)){let n=new URL(e,`${t}/`);return decodeURI(n.toString())}else if(e.startsWith("/"))return e;return Tr.resolve(t,e)}function Gu(e,t){if(!e)return null;let r;if(e.content){let s=e.content.uri||e.content?.url;typeof s<"u"&&(r=Wa(s,t))}return{...e,id:r,contentUrl:r,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:$a(e,r),refine:tc(e.refine)}}async function ku(e,t,r){let n=null,s=Pu(e.root);s&&e.root?n=await Uu(e.root,e,t,s,r):n=Gu(e.root,t);let o=[];for(o.push(n);o.length>0;){let i=o.pop()||{},a=i.children||[],f=[];for(let c of a){let h=Pu(c),l;h?l=await Uu(c,e,t,h,r):l=Gu(c,t),l&&(f.push(l),o.push(l))}i.children=f}return n}async function Uu(e,t,r,n,s){let{subdivisionScheme:o,maximumLevel:i,availableLevels:a,subtreeLevels:f,subtrees:{uri:c}}=n,h=_o(c,0,0,0,0),l=Wa(h,r),u=await(0,Hu.load)(l,Kr,s),d=e.content?.uri,A=d?Wa(d,r):"",m=t?.root?.refine,p=e.geometricError,E=e.boundingVolume.extensions?.["3DTILES_bounding_volume_S2"];if(E){let T={box:Eo(E),s2VolumeInfo:E};e.boundingVolume=T}let y=e.boundingVolume,C={contentUrlTemplate:A,subtreesUriTemplate:c,subdivisionScheme:o,subtreeLevels:f,maximumLevel:Number.isFinite(a)?a-1:i,refine:m,basePath:r,lodMetricType:le.GEOMETRIC_ERROR,rootLodMetricValue:p,rootBoundingVolume:y,getTileType:$a,getRefine:tc};return await a2(e,r,u,C,s)}async function a2(e,t,r,n,s){if(!e)return null;let{children:o,contentUrl:i}=await qa({subtree:r,implicitOptions:n,loaderOptions:s}),a,f=null;return i&&(a=i,f={uri:i.replace(`${t}/`,"")}),{...e,id:a,contentUrl:a,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:e.geometricError,transformMatrix:e.transform,type:$a(e,a),refine:tc(e.refine),content:f||e.content,children:o}}function Pu(e){return e?.extensions?.["3DTILES_implicit_tiling"]||e?.implicitTiling}var rr={dataType:null,batchType:null,id:"3d-tiles",name:"3D Tiles",module:"3d-tiles",version:Sr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],tests:["cmpt","pnts","b3dm","i3dm"],parse:c2,options:{"3d-tiles":{loadGLTF:!0,decodeQuantizedPositions:!1,isTileset:"auto",assetGltfUpAxis:null}}};async function c2(e,t={},r){let n=t["3d-tiles"]||{},s;return n.isTileset==="auto"?s=r?.url&&r.url.indexOf(".json")!==-1:s=n.isTileset,s?f2(e,t,r):h2(e,t,r)}async function f2(e,t,r){let n=JSON.parse(new TextDecoder().decode(e)),s=r?.url||"",o=l2(s),i=await ku(n,o,t||{});return{...n,shape:"tileset3d",loader:rr,url:s,queryString:r?.queryString||"",basePath:o,root:i||n.root,type:Cn.TILES3D,lodMetricType:le.GEOMETRIC_ERROR,lodMetricValue:n.root?.geometricError||0}}async function h2(e,t,r){let n={content:{shape:"tile3d",featureIds:null}};return await Fa(e,0,t,r,n.content),n.content}function l2(e){return Tr.dirname(e)}var yo=gr(pn(),1);var Ju="https://api.cesium.com/v1/assets";async function To(e,t){if(!t){let o=await u2(e);for(let i of o.items)i.type==="3DTILES"&&(t=i.id)}let r=await d2(e,t),{type:n,url:s}=r;return J(n==="3DTILES"&&s),r.headers={Authorization:`Bearer ${r.accessToken}`},r}async function u2(e){J(e);let t=Ju,r={Authorization:`Bearer ${e}`},n=await(0,yo.fetchFile)(t,{headers:r});if(!n.ok)throw new Error(n.statusText);return await n.json()}async function d2(e,t){J(e,t);let r={Authorization:`Bearer ${e}`},n=`${Ju}/${t}`,s=await(0,yo.fetchFile)(`${n}`,{headers:r});if(!s.ok)throw new Error(s.statusText);let o=await s.json();if(s=await(0,yo.fetchFile)(`${n}/endpoint`,{headers:r}),!s.ok)throw new Error(s.statusText);let i=await s.json();return o={...o,...i},o}async function A2(e,t={}){t=t["cesium-ion"]||{};let{accessToken:r}=t,n=t.assetId;if(!Number.isFinite(n)){let s=e.match(/\/([0-9]+)\/tileset.json/);n=s&&s[1]}return To(r,n)}var ec={...rr,id:"cesium-ion",name:"Cesium Ion",preload:A2,parse:async(e,t,r)=>(t={...t},t["3d-tiles"]=t["cesium-ion"],t.loader=ec,rr.parse(e,t,r)),options:{"cesium-ion":{...rr.options["3d-tiles"],accessToken:null}}};var Vn=async(e,t)=>{let r=[await e.getUint8(e.length-1n),await e.getUint8(e.length-2n),await e.getUint8(e.length-3n),void 0],n=0n;for(let s=e.length-4n;s>-1;s--)if(r[3]=r[2],r[2]=r[1],r[1]=r[0],r[0]=await e.getUint8(s),r.every((o,i)=>o===t[i])){n=s;break}return n};var zu=new Uint8Array([80,75,5,6]),Qu=new Uint8Array([80,75,6,7]),Vu=new Uint8Array([80,75,6,6]),m2=8n;var p2=16n;var g2=8n,x2=24n;var B2=48n;var ju=async e=>{let t=await Vn(e,zu),r=BigInt(await e.getUint16(t+m2)),n=BigInt(await e.getUint32(t+p2)),s=t-20n,o=0n,i=await e.slice(s,s+4n);if(Te(i,Qu)){o=await e.getBigUint64(s+g2);let a=await e.slice(o,o+4n);if(!Te(a,Vu.buffer))throw new Error("zip64 EoCD not found");r=await e.getBigUint64(o+x2),n=await e.getBigUint64(o+B2)}else s=0n;return{cdRecordsNumber:r,cdStartOffset:n,offsets:{zip64EoCDOffset:o,zip64EoCDLocatorOffset:s,zipEoCDOffset:t}}};var GD=[{offset:0,size:4,default:new DataView(zu.buffer).getUint32(0,!0)},{offset:4,size:2,default:0},{offset:6,size:2,default:0},{offset:8,size:2,name:"recordsNumber"},{offset:10,size:2,name:"recordsNumber"},{offset:12,size:4,name:"cdSize"},{offset:16,size:4,name:"cdOffset"},{offset:20,size:2,default:0}];var UD=[{offset:0,size:4,default:new DataView(Qu.buffer).getUint32(0,!0)},{offset:4,size:4,default:0},{offset:8,size:8,name:"eoCDStart"},{offset:16,size:4,default:1}],PD=[{offset:0,size:4,default:new DataView(Vu.buffer).getUint32(0,!0)},{offset:4,size:8,default:44},{offset:12,size:2,default:45},{offset:14,size:2,default:45},{offset:16,size:4,default:0},{offset:20,size:4,default:0},{offset:24,size:8,name:"recordsNumber"},{offset:32,size:8,name:"recordsNumber"},{offset:40,size:8,name:"cdSize"},{offset:48,size:8,name:"cdOffset"}];var E2=20n,_2=24n,y2=28n,T2=30n,C2=32n,M2=42n,rc=46n,Kn=new Uint8Array([80,75,1,2]),jn=async(e,t)=>{let r=await t.slice(e,e+4n);if(!Te(r,Kn.buffer))return null;let n=BigInt(await t.getUint32(e+E2)),s=BigInt(await t.getUint32(e+_2)),o=await t.getUint16(e+T2),i=BigInt(await t.getUint16(e+C2)),a=await t.getUint16(e+y2),f=await t.slice(e+rc,e+rc+BigInt(a)),c=new TextDecoder().decode(f),h=e+rc+BigInt(a),l=await t.getUint32(e+M2),u=BigInt(l),d=new DataView(await t.slice(h,h+BigInt(o))),A={uncompressedSize:s,compressedSize:n,localHeaderOffset:u,startDisk:i},m=b2(A,d);return{...A,...m,extraFieldLength:o,fileNameLength:a,fileName:c,extraOffset:h}};async function*en(e){let{cdStartOffset:t}=await ju(e),r=await jn(t,e);for(;r;)yield r,r=await jn(r.extraOffset+BigInt(r.extraFieldLength),e)}var Ku=(...e)=>e[0]+e[1]*16,b2=(e,t)=>{let r=w2(e),n={};if(r.length>0){let s=r.reduce((a,f)=>a+f.length,0),o=new Uint8Array(t.buffer).findIndex((a,f,c)=>Ku(c[f],c[f+1])===1&&Ku(c[f+2],c[f+3])===s),i=0;for(let a of r){let f=i;n[a.name]=t.getBigUint64(o+4+f,!0),i=f+a.length}}return n},w2=e=>{let t=[];return e.uncompressedSize===BigInt(4294967295)&&t.push({name:"uncompressedSize",length:8}),e.compressedSize===BigInt(4294967295)&&t.push({name:"compressedSize",length:8}),e.localHeaderOffset===BigInt(4294967295)&&t.push({name:"localHeaderOffset",length:8}),e.startDisk===BigInt(4294967295)&&t.push({name:"startDisk",length:4}),t};var zD=[{offset:0,size:4,default:new DataView(Kn.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:45},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:2,default:0},{offset:16,size:4,name:"crc32"},{offset:20,size:4,name:"length"},{offset:24,size:4,name:"length"},{offset:28,size:2,name:"fnlength"},{offset:30,size:2,default:0,name:"extraLength"},{offset:32,size:2,default:0},{offset:34,size:2,default:0},{offset:36,size:2,default:0},{offset:38,size:4,default:0},{offset:42,size:4,name:"offset"}];var I2=8n,S2=18n,R2=22n,F2=26n,D2=28n,Co=30n,nc=new Uint8Array([80,75,3,4]),nr=async(e,t)=>{let r=await t.slice(e,e+4n);if(!Te(r,nc))return null;let n=await t.getUint16(e+F2),s=new TextDecoder().decode(await t.slice(e+Co,e+Co+BigInt(n))).split("\\").join("/"),o=await t.getUint16(e+D2),i=e+Co+BigInt(n+o),a=await t.getUint16(e+I2),f=BigInt(await t.getUint32(e+S2)),c=BigInt(await t.getUint32(e+R2)),h=e+Co+BigInt(n),l=4n;return c===BigInt(4294967295)&&(c=await t.getBigUint64(h+l),l+=8n),f===BigInt(4294967295)&&(f=await t.getBigUint64(h+l),l+=8n),i===BigInt(4294967295)&&(i=await t.getBigUint64(h+l)),{fileNameLength:n,fileName:s,extraFieldLength:o,fileDataOffset:i,compressedSize:f,compressionMethod:a}};var jD=[{offset:0,size:4,default:new DataView(nc.buffer).getUint32(0,!0)},{offset:4,size:2,default:45},{offset:6,size:2,default:0},{offset:8,size:2,default:0},{offset:10,size:2,default:0},{offset:12,size:2,default:0},{offset:14,size:4,name:"crc32"},{offset:18,size:4,name:"length"},{offset:22,size:4,name:"length"},{offset:26,size:2,name:"fnlength"},{offset:28,size:2,default:0,name:"extraLength"}];var Mo=class{constructor(t={}){this.hashBatches=this.hashBatches.bind(this)}async preload(){}async*hashBatches(t,r="base64"){let n=[];for await(let i of t)n.push(i),yield i;let s=await this.concatenate(n),o=await this.hash(s,r);this.options.crypto?.onEnd?.({hash:o})}async concatenate(t){return await Bn(t)}};function Xu(e){e=`${e}`;for(let r=0;r<e.length;r++)if(e.charCodeAt(r)>255)return null;let t="";for(let r=0;r<e.length;r+=3){let n=[void 0,void 0,void 0,void 0];n[0]=e.charCodeAt(r)>>2,n[1]=(e.charCodeAt(r)&3)<<4,e.length>r+1&&(n[1]|=e.charCodeAt(r+1)>>4,n[2]=(e.charCodeAt(r+1)&15)<<2),e.length>r+2&&(n[2]|=e.charCodeAt(r+2)>>6,n[3]=e.charCodeAt(r+2)&63);for(let s=0;s<n.length;s++)typeof n[s]>"u"?t+="=":t+=L2(n[s])}return t}function L2(e){if(e<26)return String.fromCharCode(e+"A".charCodeAt(0));if(e<52)return String.fromCharCode(e-26+"a".charCodeAt(0));if(e<62)return String.fromCharCode(e-52+"0".charCodeAt(0));if(e===62)return"+";if(e===63)return"/"}function Yu(e,t){switch(t){case"hex":return e;case"base64":return O2(e);default:throw new Error(t)}}function O2(e){e.length%2!==0&&(e=`0${e}`);let r=(e.match(/\w{2}/g)||[]).map(n=>String.fromCharCode(parseInt(n,16))).join("");return Xu(r)||""}var qu=typeof atob=="function"?atob:typeof Buffer=="function"?k2:$u,v2=qu("AGFzbQEAAAABDANgAX8AYAAAYAABfwIeAgdpbXBvcnRzA2xvZwAAB2ltcG9ydHMDbWVtAgABAzIxAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEAAAAAAAAAAAAAAAAAAAAAAgICAgIAAAAAAAaYARt/AUGBxpS6Bgt/AUGJ17b+fgt/AUH+uevFeQt/AUH2qMmBAQt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALfwFBAAt/AUEAC38BQQALB7oCJQhvbmVGdWxsQQAYCG9uZUZ1bGxCABkIb25lRnVsbEMAGghvbmVGdWxsRAAbBWxvb3BzAAEEbG9vcAACBXByaW1lAAMFbG9vcEEABAZsb29wQTEABQZsb29wQTIABgZsb29wQTMABwZsb29wQTQACAVsb29wQgAJBmxvb3BCMQAKBmxvb3BCMgALBmxvb3BCMwAMBmxvb3BCNAANBWxvb3BDA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W4fAgAAAQFuIAIAAAEBbiECAAABAW4iAgAAAQFuIwIAAAEBbiQCAAABAW4lAgAAAQFuJgIAAAEBbicCAAABAW4oACkAKgArACwALQEAAC4BAAAvAQAAMAEAADEBAAA="),sc=WebAssembly&&qu!==$u?H2(v2).buffer:!1,ne=J2(),oc=240*16*16,Wu=Math.floor(oc*16*1.066666667),N2=268435456-65536,Zu="Parameter must be Buffer, ArrayBuffer or Uint8Array",G2="Parameter exceeds max size of 255.9 Mbytes";sc||console.log("WebAssembly not available or WASM module could not be decoded; md5WASM will fall back to JavaScript");function ic(e){var t,r,n,s,o,i,a,f,c,h;let l=P2(),u=U2(),d={},A=new Date().getTime();return d.then=function(y){return a=y,p(),d},d.catch=function(y){return f=y,d},e&&typeof e=="object"?typeof Buffer=="function"&&e.constructor===Buffer?i=e:e.constructor===Uint8Array||e.constructor===ArrayBuffer?i=e.constructor===ArrayBuffer?new Uint8Array(e):e:E(new TypeError(Zu)):E(new TypeError(Zu)),i&&(o=i.length,sc&&o>Wu?o>N2?E(new Error(G2)):(t=new WebAssembly.Memory({initial:o>32e6?o>64e6?o>128e6?4096:2048:1024:512}),r=new Uint32Array(t.buffer),s={mem:t,log:console.log},n={imports:s},WebAssembly.instantiate(sc,n).then(m)):p(l(i))),d;function m(y){p(u(i,y.instance.exports,r))}function p(y){var C=Boolean(y)?y:c;Boolean(y)&&(h=new Date().getTime()),typeof a=="function"?Boolean(C)&&(a(C,h-A),a=f=null):Boolean(y)&&(c=y)}function E(y){typeof f=="function"&&f(y)}}function U2(){var e,t,r,n,s,o,i,a,f,c,h,l,u,d=function(A){var m,p,E,y,C,M,T,I,w,L,x,g,B,_,U,G,P,v,at,mt,X,ke,us=new Date().getTime(),pr=0,S=1732584193,F=-271733879,R=-1732584194,D=271733878,tt=0,mn=A.length*8,ds;for(ds=Zd(A,u),u[mn>>>5]|=128<<mn%32,u[(mn+64>>>9<<4)+14]=mn,ds=(mn+64>>>9<<4)+15,X=u;tt<ds;)ds>tt+Wu?(n(S),o(F),a(R),c(D),t(oc),tt=tt+oc*16,S=r(),F=s(),R=i(),D=f(),pr++):(P=S,v=F,at=R,mt=D,m=X[tt+0]>>>0,p=X[tt+1]>>>0,E=X[tt+2]>>>0,y=X[tt+3]>>>0,C=X[tt+4]>>>0,M=X[tt+5]>>>0,T=X[tt+6]>>>0,I=X[tt+7]>>>0,w=X[tt+8]>>>0,L=X[tt+9]>>>0,x=X[tt+10]>>>0,g=X[tt+11]>>>0,B=X[tt+12]>>>0,_=X[tt+13]>>>0,U=X[tt+14]>>>0,G=X[tt+15]>>>0,S=N(7,25,S+(F&R|~F&D)+m-680876936)+F,D=N(12,20,D+(S&F|~S&R)+p-389564586)+S,R=N(17,15,R+(D&S|~D&F)+E+606105819)+D,F=N(22,10,F+(R&D|~R&S)+y-1044525330)+R,S=N(7,25,S+(F&R|~F&D)+C-176418897)+F,D=N(12,20,D+(S&F|~S&R)+M+1200080426)+S,R=N(17,15,R+(D&S|~D&F)+T-1473231341)+D,F=N(22,10,F+(R&D|~R&S)+I-45705983)+R,S=N(7,25,S+(F&R|~F&D)+w+1770035416)+F,D=N(12,20,D+(S&F|~S&R)+L-1958414417)+S,R=N(17,15,R+(D&S|~D&F)+x-42063)+D,F=N(22,10,F+(R&D|~R&S)+g-1990404162)+R,S=N(7,25,S+(F&R|~F&D)+B+1804603682)+F,D=N(12,20,D+(S&F|~S&R)+_-40341101)+S,R=N(17,15,R+(D&S|~D&F)+U-1502002290)+D,F=N(22,10,F+(R&D|~R&S)+G+1236535329)+R,S=N(5,27,S+(F&D|R&~D)+p-165796510)+F,D=N(9,23,D+(S&R|F&~R)+T-1069501632)+S,R=N(14,18,R+(D&F|S&~F)+g+643717713)+D,F=N(20,12,F+(R&S|D&~S)+m-373897302)+R,S=N(5,27,S+(F&D|R&~D)+M-701558691)+F,D=N(9,23,D+(S&R|F&~R)+x+38016083)+S,R=N(14,18,R+(D&F|S&~F)+G-660478335)+D,F=N(20,12,F+(R&S|D&~S)+C-405537848)+R,S=N(5,27,S+(F&D|R&~D)+L+568446438)+F,D=N(9,23,D+(S&R|F&~R)+U-1019803690)+S,R=N(14,18,R+(D&F|S&~F)+y-187363961)+D,F=N(20,12,F+(R&S|D&~S)+w+1163531501)+R,S=N(5,27,S+(F&D|R&~D)+_-1444681467)+F,D=N(9,23,D+(S&R|F&~R)+E-51403784)+S,R=N(14,18,R+(D&F|S&~F)+I+1735328473)+D,F=N(20,12,F+(R&S|D&~S)+B-1926607734)+R,S=N(4,28,S+(F^R^D)+M-378558)+F,D=N(11,21,D+(S^F^R)+w-2022574463)+S,R=N(16,16,R+(D^S^F)+g+1839030562)+D,F=N(23,9,F+(R^D^S)+U-35309556)+R,S=N(4,28,S+(F^R^D)+p-1530992060)+F,D=N(11,21,D+(S^F^R)+C+1272893353)+S,R=N(16,16,R+(D^S^F)+I-155497632)+D,F=N(23,9,F+(R^D^S)+x-1094730640)+R,S=N(4,28,S+(F^R^D)+_+681279174)+F,D=N(11,21,D+(S^F^R)+m-358537222)+S,R=N(16,16,R+(D^S^F)+y-722521979)+D,F=N(23,9,F+(R^D^S)+T+76029189)+R,S=N(4,28,S+(F^R^D)+L-640364487)+F,D=N(11,21,D+(S^F^R)+B-421815835)+S,R=N(16,16,R+(D^S^F)+G+530742520)+D,F=N(23,9,F+(R^D^S)+E-995338651)+R,S=N(6,26,S+(R^(F|~D))+m-198630844)+F,D=N(10,22,D+(F^(S|~R))+I+1126891415)+S,R=N(15,17,R+(S^(D|~F))+U-1416354905)+D,F=N(21,11,F+(D^(R|~S))+M-57434055)+R,S=N(6,26,S+(R^(F|~D))+B+1700485571)+F,D=N(10,22,D+(F^(S|~R))+y-1894986606)+S,R=N(15,17,R+(S^(D|~F))+x-1051523)+D,F=N(21,11,F+(D^(R|~S))+p-2054922799)+R,S=N(6,26,S+(R^(F|~D))+w+1873313359)+F,D=N(10,22,D+(F^(S|~R))+G-30611744)+S,R=N(15,17,R+(S^(D|~F))+T-1560198380)+D,F=N(21,11,F+(D^(R|~S))+_+1309151649)+R,S=N(6,26,S+(R^(F|~D))+C-145523070)+F,D=N(10,22,D+(F^(S|~R))+g-1120210379)+S,R=N(15,17,R+(S^(D|~F))+E+718787259)+D,F=N(21,11,F+(D^(R|~S))+L-343485551)+R,tt=tt+16,S=S+P>>>0,F=F+v>>>0,R=R+at>>>0,D=D+mt>>>0);return ne.endian([S,F,R,D]);function N(pt,As,Xt){return Xt<<pt|Xt>>>As}function Zd(pt,As){for(var Xt=-1,zo=Math.floor((pt.length-1)/4),Bt=0,Vc,jc,Kc,Xc;zo-8>Xt++;)Bt=Xt<<2,As[Xt]=pt[Bt+0]|pt[Bt+1]<<8|pt[Bt+2]<<16|pt[Bt+3]<<24;for(Xt--;zo>Xt++;)Bt=Xt<<2,Vc=typeof pt[Bt+0]>"u"?0:pt[Bt+0],jc=typeof pt[Bt+1]>"u"?0:pt[Bt+1],Kc=typeof pt[Bt+2]>"u"?0:pt[Bt+2],Xc=typeof pt[Bt+3]>"u"?0:pt[Bt+3],As[Xt]=Vc|jc<<8|Kc<<16|Xc<<24;return zo+1}};return function(A,m,p,E){var y;return t=m.loops,e=m.loop,r=m.getA,s=m.getB,i=m.getC,f=m.getD,h=m.getX,n=m.setA,o=m.setB,a=m.setC,c=m.setD,l=m.setX,u=p,y=ne.wordsToBytes(d(A)),E&&E.asBytes?y:ne.bytesconvertNumberToHex(y)}}function P2(){var e=function(t,r){var n,s,o,i,a,f,c,h,l,u,d,A,m,p,E,y,C,M,T,I,w,L=new Date().getTime(),x=1732584193,g=-271733879,B=-1732584194,_=271733878,U=t.length*8;w=ne.bytesToWords(t);for(var G=0;G<w.length;G++)w[G]=(w[G]<<8|w[G]>>>24)&16711935|(w[G]<<24|w[G]>>>8)&4278255360;w[U>>>5]|=128<<U%32,w[(U+64>>>9<<4)+14]=U;for(var P=0;P<w.length;P+=16)C=x,M=g,T=B,I=_,n=w[P+0]>>>0,s=w[P+1]>>>0,o=w[P+2]>>>0,i=w[P+3]>>>0,a=w[P+4]>>>0,f=w[P+5]>>>0,c=w[P+6]>>>0,h=w[P+7]>>>0,l=w[P+8]>>>0,u=w[P+9]>>>0,d=w[P+10]>>>0,A=w[P+11]>>>0,m=w[P+12]>>>0,p=w[P+13]>>>0,E=w[P+14]>>>0,y=w[P+15]>>>0,x=v(7,25,x+(g&B|~g&_)+n-680876936)+g,_=v(12,20,_+(x&g|~x&B)+s-389564586)+x,B=v(17,15,B+(_&x|~_&g)+o+606105819)+_,g=v(22,10,g+(B&_|~B&x)+i-1044525330)+B,x=v(7,25,x+(g&B|~g&_)+a-176418897)+g,_=v(12,20,_+(x&g|~x&B)+f+1200080426)+x,B=v(17,15,B+(_&x|~_&g)+c-1473231341)+_,g=v(22,10,g+(B&_|~B&x)+h-45705983)+B,x=v(7,25,x+(g&B|~g&_)+l+1770035416)+g,_=v(12,20,_+(x&g|~x&B)+u-1958414417)+x,B=v(17,15,B+(_&x|~_&g)+d-42063)+_,g=v(22,10,g+(B&_|~B&x)+A-1990404162)+B,x=v(7,25,x+(g&B|~g&_)+m+1804603682)+g,_=v(12,20,_+(x&g|~x&B)+p-40341101)+x,B=v(17,15,B+(_&x|~_&g)+E-1502002290)+_,g=v(22,10,g+(B&_|~B&x)+y+1236535329)+B,x=v(5,27,x+(g&_|B&~_)+s-165796510)+g,_=v(9,23,_+(x&B|g&~B)+c-1069501632)+x,B=v(14,18,B+(_&g|x&~g)+A+643717713)+_,g=v(20,12,g+(B&x|_&~x)+n-373897302)+B,x=v(5,27,x+(g&_|B&~_)+f-701558691)+g,_=v(9,23,_+(x&B|g&~B)+d+38016083)+x,B=v(14,18,B+(_&g|x&~g)+y-660478335)+_,g=v(20,12,g+(B&x|_&~x)+a-405537848)+B,x=v(5,27,x+(g&_|B&~_)+u+568446438)+g,_=v(9,23,_+(x&B|g&~B)+E-1019803690)+x,B=v(14,18,B+(_&g|x&~g)+i-187363961)+_,g=v(20,12,g+(B&x|_&~x)+l+1163531501)+B,x=v(5,27,x+(g&_|B&~_)+p-1444681467)+g,_=v(9,23,_+(x&B|g&~B)+o-51403784)+x,B=v(14,18,B+(_&g|x&~g)+h+1735328473)+_,g=v(20,12,g+(B&x|_&~x)+m-1926607734)+B,x=v(4,28,x+(g^B^_)+f-378558)+g,_=v(11,21,_+(x^g^B)+l-2022574463)+x,B=v(16,16,B+(_^x^g)+A+1839030562)+_,g=v(23,9,g+(B^_^x)+E-35309556)+B,x=v(4,28,x+(g^B^_)+s-1530992060)+g,_=v(11,21,_+(x^g^B)+a+1272893353)+x,B=v(16,16,B+(_^x^g)+h-155497632)+_,g=v(23,9,g+(B^_^x)+d-1094730640)+B,x=v(4,28,x+(g^B^_)+p+681279174)+g,_=v(11,21,_+(x^g^B)+n-358537222)+x,B=v(16,16,B+(_^x^g)+i-722521979)+_,g=v(23,9,g+(B^_^x)+c+76029189)+B,x=v(4,28,x+(g^B^_)+u-640364487)+g,_=v(11,21,_+(x^g^B)+m-421815835)+x,B=v(16,16,B+(_^x^g)+y+530742520)+_,g=v(23,9,g+(B^_^x)+o-995338651)+B,x=v(6,26,x+(B^(g|~_))+n-198630844)+g,_=v(10,22,_+(g^(x|~B))+h+1126891415)+x,B=v(15,17,B+(x^(_|~g))+E-1416354905)+_,g=v(21,11,g+(_^(B|~x))+f-57434055)+B,x=v(6,26,x+(B^(g|~_))+m+1700485571)+g,_=v(10,22,_+(g^(x|~B))+i-1894986606)+x,B=v(15,17,B+(x^(_|~g))+d-1051523)+_,g=v(21,11,g+(_^(B|~x))+s-2054922799)+B,x=v(6,26,x+(B^(g|~_))+l+1873313359)+g,_=v(10,22,_+(g^(x|~B))+y-30611744)+x,B=v(15,17,B+(x^(_|~g))+c-1560198380)+_,g=v(21,11,g+(_^(B|~x))+p+1309151649)+B,x=v(6,26,x+(B^(g|~_))+a-145523070)+g,_=v(10,22,_+(g^(x|~B))+A-1120210379)+x,B=v(15,17,B+(x^(_|~g))+o+718787259)+_,g=v(21,11,g+(_^(B|~x))+u-343485551)+B,x=x+C>>>0,g=g+M>>>0,B=B+T>>>0,_=_+I>>>0;return ne.endian([x,g,B,_]);function v(at,mt,X){return X<<at|X>>>mt}};return function(t,r){var n=ne.wordsToBytes(e(t,r)),s=r&&r.asBytes?n:ne.bytesconvertNumberToHex(n);return s}}function H2(e){var t,r,n,s=-1;for(t=e.length-1,r=new ArrayBuffer(e.length),n=new Uint8Array(r);t>s++;)n[s]=e.charCodeAt(s);return n}function k2(e){return Buffer.from(e,"base64").toString("binary")}function $u(e){return e}function J2(){var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";return{rotl:function(t,r){return t<<r|t>>>32-r},endian:function(t){if(t.constructor==Number)return ne.rotl(t,8)&16711935|ne.rotl(t,24)&4278255360;for(var r=0;r<t.length;r++)t[r]=ne.endian(t[r]);return t},bytesToWords:function(t){for(var r=[],n=0,s=0;n<t.length;n++,s+=8)r[s>>>5]|=t[n]<<24-s%32;return r},wordsToBytes:function(t){for(var r=[],n=0;n<t.length*32;n+=8)r.push(t[n>>>5]>>>24-n%32&255);return r},bytesconvertNumberToHex:function(t){for(var r=[],n=0;n<t.length;n++)r.push((t[n]>>>4).toString(16)),r.push((t[n]&15).toString(16));return r.join("")}}}var sr=class extends Mo{name="md5";options;constructor(t={}){super(),this.options=t}async hash(t,r){let s=await new Promise((o,i)=>ic(t).then(o).catch(i));return Yu(s,r)}};var rn=class{constructor(t){this.compressBatches=this.compressBatches.bind(this),this.decompressBatches=this.decompressBatches.bind(this)}async preload(t={}){gn(t)}async compress(t){return await this.preload(),this.compressSync(t)}async decompress(t,r){return await this.preload(),this.decompressSync(t,r)}compressSync(t){throw new Error(`${this.name}: sync compression not supported`)}decompressSync(t,r){throw new Error(`${this.name}: sync decompression not supported`)}async*compressBatches(t){let r=await this.concatenate(t);yield this.compress(r)}async*decompressBatches(t){let r=await this.concatenate(t);yield this.decompress(r)}concatenate(t){return Bn(t)}improveError(t){return t.message.includes(this.name)||(t.message=`${this.name} ${t.message}`),t}};var Xn=class extends rn{name="uncompressed";extensions=[];contentEncodings=[];isSupported=!0;options;constructor(t){super(t),this.options=t||{}}compressSync(t){return t}decompressSync(t){return t}async*compressBatches(t){return yield*t}async*decompressBatches(t){return yield*t}};var dr=gr(Hd(),1),ye=gr(kd(),1);var Ar=class extends rn{name="deflate";extensions=[];contentEncodings=["deflate"];isSupported=!0;options;_chunks=[];constructor(t={}){super(t),this.options=t}async compress(t){if(!Et&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await yr(ye.default.gzip)(t):await yr(ye.default.deflate)(t);return _r(r)}return this.compressSync(t)}async decompress(t){if(!Et&&this.options.deflate?.useZlib){let r=this.options.deflate?.gzip?await yr(ye.default.gunzip)(t):await yr(ye.default.inflate)(t);return _r(r)}return this.decompressSync(t)}compressSync(t){if(!Et&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?ye.default.gzipSync(t):ye.default.deflateSync(t);return _r(o)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?dr.default.deflateRaw:dr.default.deflate)(n,r).buffer}decompressSync(t){if(!Et&&this.options.deflate?.useZlib){let o=this.options.deflate?.gzip?ye.default.gunzipSync(t):ye.default.inflateSync(t);return _r(o)}let r=this.options?.deflate||{},n=new Uint8Array(t);return(this.options?.raw?dr.default.inflateRaw:dr.default.inflate)(n,r).buffer}async*compressBatches(t){let r=this.options?.deflate||{},n=new dr.default.Deflate(r);yield*this.transformBatches(n,t)}async*decompressBatches(t){let r=this.options?.deflate||{},n=new dr.default.Inflate(r);yield*this.transformBatches(n,t)}async*transformBatches(t,r){t.onData=this._onData.bind(this),t.onEnd=this._onEnd.bind(this);for await(let i of r){let a=new Uint8Array(i);if(!t.push(a,!1))throw new Error(`${this._getError()}write`);yield*this._getChunks()}let n=new Uint8Array(0),s=t.push(n,!0);yield*this._getChunks()}_onData(t){this._chunks.push(t)}_onEnd(t){if(t!==0)throw new Error(this._getError(t)+this._chunks.length)}_getChunks(){let t=this._chunks;return this._chunks=[],t}_getError(t=0){let r={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"};return`${this.name}: ${r[t]}`}};var v_={0:async e=>e,8:async e=>await new Ar({raw:!0}).decompress(e)},Jo=class{fileProvider=null;fileName;archive=null;constructor(t){if(typeof t=="string")if(this.fileName=t,!Et)this.fileProvider=new yn(t);else throw new Error("Cannot open file for random access in a WEB browser");else t instanceof mr?(this.fileProvider=t.fileProvider,this.archive=t,this.fileName=t.fileName):Zo(t)&&(this.fileProvider=t)}async destroy(){this.fileProvider&&await this.fileProvider.destroy()}async readdir(){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let t=[],r=en(this.fileProvider);for await(let n of r)t.push(n.fileName);return t}async stat(t){let r=await this.getCDFileHeader(t);return{...r,size:Number(r.uncompressedSize)}}async fetch(t){this.fileName&&t.indexOf(this.fileName)===0&&(t=t.substring(this.fileName.length+1));let r;if(this.archive)r=await this.archive.getFile(t,"http");else{if(!this.fileProvider)throw new Error("No data detected in the zip archive");let s=await this.getCDFileHeader(t),o=await nr(s.localHeaderOffset,this.fileProvider);if(!o)throw new Error("Local file header has not been found in the zip archive`");let i=v_[o.compressionMethod.toString()];if(!i)throw Error("Only Deflation compression is supported");let a=await this.fileProvider.slice(o.fileDataOffset,o.fileDataOffset+o.compressedSize);r=await i(a)}let n=new Response(r);return Object.defineProperty(n,"url",{value:t?`${this.fileName||""}/${t}`:this.fileName||""}),n}async getCDFileHeader(t){if(!this.fileProvider)throw new Error("No data detected in the zip archive");let r=en(this.fileProvider),n=null;for await(let s of r)if(s.fileName===t){n=s;break}if(!n)throw new Error("File has not been found in the zip archive");return n}};var mr=class{fileProvider;fileName;constructor(t,r,n){this.fileProvider=t,this.fileName=n}async getFileWithoutHash(t){return await(await new Jo(this.fileProvider).fetch(t)).arrayBuffer()}};function kc(e){let t=new DataView(e),r={};for(let n=0;n<e.byteLength;n=n+24){let s=t.getBigUint64(n+16,!0),o=N_(e,n,16);r[o]=s}return r}function N_(e,t,r){return[...new Uint8Array(e,t,r)].map(n=>n.toString(16).padStart(2,"0")).join("")}async function Jc(e){let t=en(e);return G_(t)}async function G_(e){let t=new sr,r=new TextEncoder,n={};for await(let s of e){let o=s.fileName.split("\\").join("/").toLocaleLowerCase(),i=r.encode(o).buffer,a=await t.hash(i,"hex");n[a]=s.localHeaderOffset}return n}var U_={0:e=>new Xn().decompress(e),8:e=>new Ar({raw:!0}).decompress(e)},An=class extends mr{hashTable;constructor(t,r,n){super(t,r,n),this.hashTable=r}async getFile(t){let r=await this.getFileBytes(t.toLocaleLowerCase());if(r||(r=await this.getFileBytes(t)),!r)throw new Error(`No such file in the archive: ${t}`);return r}async getFileBytes(t){let r;if(this.hashTable){let n=new TextEncoder().encode(t).buffer,s=await new sr().hash(n,"hex"),o=this.hashTable[s];if(o===void 0)return null;let i=await nr(o,this.fileProvider);if(!i)return null;let a=await this.fileProvider.slice(i.fileDataOffset,i.fileDataOffset+i.compressedSize),f=U_[i.compressionMethod];if(!f)throw Error("Only Deflation compression is supported");r=await f(a)}else r=await this.getFileWithoutHash(t);return r}};var Jd=async(e,t)=>{let r=await Vn(e,Kn),n=await jn(r,e),s;if(n?.fileName!=="@3dtilesIndex1@")s=await Jc(e),t?.("3tz doesnt contain hash file, hash info has been composed according to zip archive headers");else{let o=await nr(n.localHeaderOffset,e);if(!o)throw new Error("corrupted 3tz zip archive");let i=o.fileDataOffset,a=await e.slice(i,i+o.compressedSize);s=kc(a)}return new An(e,s)};var P_="4.2.0-alpha.6",zd={dataType:null,batchType:null,name:"3tz",id:"3tz",module:"3d-tiles",version:P_,mimeTypes:["application/octet-stream","application/vnd.maxar.archive.3tz+zip"],parse:H_,extensions:["3tz"],options:{}};async function H_(e,t={}){return(await Jd(new Tn(new DataView(e)))).getFile(t["3d-tiles-archive"]?.path??"")}function Pe(e,t,r){if(!t)return r+12;let{magic:s,version:o=1,byteLength:i=12}=e;return J(Array.isArray(s)&&Number.isFinite(o)&&Number.isFinite(i)),t.setUint8(r+0,s[0]),t.setUint8(r+1,s[1]),t.setUint8(r+2,s[2]),t.setUint8(r+3,s[3]),t.setUint32(r+4,o,!0),t.setUint32(r+8,i,!0),r+=12,r}function He(e,t,r){e&&e.setUint32(t+8,r,!0)}function Qd(e,t,r,n,s){e={magic:Me.COMPOSITE,tiles:[],...e};let o=r;r+=Pe(e,t,r),t&&t.setUint32(r,e.tiles.length,!0),r+=4;for(let i=0;i<e.tiles.length;++i)r+=s(e.tiles[i],t,r,n);return He(t,o,r-o),r}function Vd(e,t,r,n){let{featuresLength:s=0,batchTable:o}=e,a=JSON.stringify({BATCH_LENGTH:s}),f=o?JSON.stringify(o):"",c=bt(a.length,8),h=f?bt(f.length,8):0;e={magic:Me.BATCHED_MODEL,...e};let l=r;r=Pe(e,t,r),t&&(t.setUint32(12,c,!0),t.setUint32(16,0,!0),t.setUint32(20,h,!0),t.setUint32(24,0,!0)),r+=16,r=Bs(t,r,a,8),o&&(r=Bs(t,r,f,8));let u=e.gltfEncoded;return u&&(r=xn(t,r,u,u.byteLength)),He(t,l,r-l),r}function jd(e,t,r,n){let{featuresLength:s=1,gltfFormat:o=1,gltfUri:i=""}=e,a=i.length,f={INSTANCES_LENGTH:s,POSITION:new Array(s*3).fill(0)},c=JSON.stringify(f),h=c.length;e={magic:Me.INSTANCED_MODEL,...e};let l=r;return r=Pe(e,t,0),t&&(t.setUint32(12,h,!0),t.setUint32(16,0,!0),t.setUint32(20,0,!0),t.setUint32(24,0,!0),t.setUint32(28,o,!0)),r+=20,r+=Er(t,r,c,h),r+=Er(t,r,i,a),He(t,l,r-l),r}var k_={POINTS_LENGTH:1,POSITIONS:{byteOffset:0}};function Kd(e,t,r,n){let{featureTableJson:s=k_}=e,o=JSON.stringify(s);o=Xo(o,4);let{featureTableJsonByteLength:i=o.length}=e,a=new ArrayBuffer(12),f=a.byteLength;e={magic:Me.POINT_CLOUD,...e};let c=r;return r+=Pe(e,t,0),t&&(t.setUint32(r+0,i,!0),t.setUint32(r+4,f,!0),t.setUint32(r+8,0,!0),t.setUint32(r+12,0,!0)),r+=16,r+=Er(t,r,o,i),r+=xn(t,r,a,f),He(t,c,r-c),r}function Qc(e,t){let r=zc(e,null,0,t),n=new ArrayBuffer(r),s=new DataView(n);return zc(e,s,0,t),n}function zc(e,t,r,n){switch(J(typeof e.type=="string"),e.type){case _t.COMPOSITE:return Qd(e,t,r,n,zc);case _t.POINT_CLOUD:return Kd(e,t,r,n);case _t.BATCHED_3D_MODEL:return Vd(e,t,r,n);case _t.INSTANCED_3D_MODEL:return jd(e,t,r,n);default:throw new Error("3D Tiles: unknown tile type")}}var Yd={name:"3D Tile",id:"3d-tiles",module:"3d-tiles",version:Sr,extensions:["cmpt","pnts","b3dm","i3dm"],mimeTypes:["application/octet-stream"],binary:!0,options:{["3d-tiles"]:{}},encode:async(e,t)=>Xd(e,t),encodeSync:Xd};function Xd(e,t){return Qc(e,t)}return r1(ls);})();
|
|
8
8
|
/*! Bundled license information:
|
|
9
9
|
|
|
10
10
|
long/index.js:
|