1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2025-11-26 10:03:15 -05:00
2025-06-09 10:14:12 +01:00

10985 lines
3.8 MiB
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* @license
* Cesium - https://github.com/CesiumGS/cesium
* Version 1.129
*
* Copyright 2011-2022 Cesium Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* Columbus View (Pat. Pend.)
*
* Portions licensed separately.
* See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details.
*/
var cEe=Object.create;var eZ=Object.defineProperty;var lEe=Object.getOwnPropertyDescriptor;var uEe=Object.getOwnPropertyNames;var fEe=Object.getPrototypeOf,dEe=Object.prototype.hasOwnProperty;var cO=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Wu=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var hEe=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of uEe(t))!dEe.call(e,o)&&o!==n&&eZ(e,o,{get:()=>t[o],enumerable:!(i=lEe(t,o))||i.enumerable});return e};var jr=(e,t,n)=>(n=e!=null?cEe(fEe(e)):{},hEe(t||!e||!e.__esModule?eZ(n,"default",{value:e,enumerable:!0}):n,e));var lO=Wu((YSt,tZ)=>{var np=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};np.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};np.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};np.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};np.prototype.random_int31=function(){return this.random_int()>>>1};np.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};np.prototype.random=function(){return this.random_int()*(1/4294967296)};np.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};np.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};tZ.exports=np});var wZ=Wu((cT,lT)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof cT=="object"&&cT&&!cT.nodeType&&cT,n=typeof lT=="object"&&lT&&!lT.nodeType&&lT,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,l=26,u=38,f=700,h=72,p=128,g="-",m=/^xn--/,y=/[^\x20-\x7E]/,b=/[\x2E\u3002\uFF0E\uFF61]/g,x={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},A=s-a,E=Math.floor,S=String.fromCharCode,v;function P(V){throw new RangeError(x[V])}function M(V,j){for(var U=V.length,q=[];U--;)q[U]=j(V[U]);return q}function R(V,j){var U=V.split("@"),q="";U.length>1&&(q=U[0]+"@",V=U[1]),V=V.replace(b,".");var X=V.split("."),te=M(X,j).join(".");return q+te}function L(V){for(var j=[],U=0,q=V.length,X,te;U<q;)X=V.charCodeAt(U++),X>=55296&&X<=56319&&U<q?(te=V.charCodeAt(U++),(te&64512)==56320?j.push(((X&1023)<<10)+(te&1023)+65536):(j.push(X),U--)):j.push(X);return j}function B(V){return M(V,function(j){var U="";return j>65535&&(j-=65536,U+=S(j>>>10&1023|55296),j=56320|j&1023),U+=S(j),U}).join("")}function _(V){return V-48<10?V-22:V-65<26?V-65:V-97<26?V-97:s}function w(V,j){return V+22+75*(V<26)-((j!=0)<<5)}function D(V,j,U){var q=0;for(V=U?E(V/f):V>>1,V+=E(V/j);V>A*l>>1;q+=s)V=E(V/A);return E(q+(A+1)*V/(V+u))}function I(V){var j=[],U=V.length,q,X=0,te=p,K=h,Z,ee,me,xe,ue,ye,Ae,Pe,Ee;for(Z=V.lastIndexOf(g),Z<0&&(Z=0),ee=0;ee<Z;++ee)V.charCodeAt(ee)>=128&&P("not-basic"),j.push(V.charCodeAt(ee));for(me=Z>0?Z+1:0;me<U;){for(xe=X,ue=1,ye=s;me>=U&&P("invalid-input"),Ae=_(V.charCodeAt(me++)),(Ae>=s||Ae>E((r-X)/ue))&&P("overflow"),X+=Ae*ue,Pe=ye<=K?a:ye>=K+l?l:ye-K,!(Ae<Pe);ye+=s)Ee=s-Pe,ue>E(r/Ee)&&P("overflow"),ue*=Ee;q=j.length+1,K=D(X-xe,q,xe==0),E(X/q)>r-te&&P("overflow"),te+=E(X/q),X%=q,j.splice(X++,0,te)}return B(j)}function N(V){var j,U,q,X,te,K,Z,ee,me,xe,ue,ye=[],Ae,Pe,Ee,Ve;for(V=L(V),Ae=V.length,j=p,U=0,te=h,K=0;K<Ae;++K)ue=V[K],ue<128&&ye.push(S(ue));for(q=X=ye.length,X&&ye.push(g);q<Ae;){for(Z=r,K=0;K<Ae;++K)ue=V[K],ue>=j&&ue<Z&&(Z=ue);for(Pe=q+1,Z-j>E((r-U)/Pe)&&P("overflow"),U+=(Z-j)*Pe,j=Z,K=0;K<Ae;++K)if(ue=V[K],ue<j&&++U>r&&P("overflow"),ue==j){for(ee=U,me=s;xe=me<=te?a:me>=te+l?l:me-te,!(ee<xe);me+=s)Ve=ee-xe,Ee=s-xe,ye.push(S(w(xe+Ve%Ee,0))),ee=E(Ve/Ee);ye.push(S(w(ee,0))),te=D(U,Pe,q==X),U=0,++q}++U,++j}return ye.join("")}function k(V){return R(V,function(j){return m.test(j)?I(j.slice(4).toLowerCase()):j})}function H(V){return R(V,function(j){return y.test(j)?"xn--"+N(j):j})}if(o={version:"1.3.2",ucs2:{decode:L,encode:B},decode:I,encode:N,toASCII:H,toUnicode:k},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(lT.exports==t)n.exports=o;else for(v in o)o.hasOwnProperty(v)&&(t[v]=o[v]);else e.punycode=o})(cT)});var DZ=Wu((vZ,OO)=>{/*!
* URI.js - Mutating URLs
* IPv6 Support
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/(function(e,t){"use strict";typeof OO=="object"&&OO.exports?OO.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(vZ,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,l=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(l=7);var u;for(u=0;u<a&&s[u]!=="";u++);if(u<l)for(s.splice(u,1,"0000");s.length<l;)s.splice(u,0,"0000");for(var f,h=0;h<l;h++){f=s[h].split("");for(var p=0;p<3&&(f[0]==="0"&&f.length>1);p++)f.splice(0,1);s[h]=f.join("")}var g=-1,m=0,y=0,b=-1,x=!1;for(h=0;h<l;h++)x?s[h]==="0"?y+=1:(x=!1,y>m&&(g=b,m=y)):s[h]==="0"&&(x=!0,b=h,y=1);y>m&&(g=b,m=y),m>1&&s.splice(g,m,""),a=s.length;var A="";for(s[0]===""&&(A=":"),h=0;h<a&&(A+=s[h],h!==a-1);h++)A+=":";return s[a-1]===""&&(A+=":"),A}function i(){return e.IPv6===this&&(e.IPv6=t),this}return{best:n,noConflict:i}})});var IZ=Wu((PZ,RO)=>{/*!
* URI.js - Mutating URLs
* Second Level Domain (SLD) Support
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/(function(e,t){"use strict";typeof RO=="object"&&RO.exports?RO.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(PZ,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var ql=Wu((OZ,MO)=>{/*!
* URI.js - Mutating URLs
*
* Version: 1.19.11
*
* Author: Rodney Rehm
* Web: http://medialize.github.io/URI.js/
*
* Licensed under
* MIT License http://www.opensource.org/licenses/mit-license
*
*/(function(e,t){"use strict";typeof MO=="object"&&MO.exports?MO.exports=t(wZ(),DZ(),IZ()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(OZ,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(w,D){var I=arguments.length>=1,N=arguments.length>=2;if(!(this instanceof r))return I?N?new r(w,D):new r(w):new r;if(w===void 0){if(I)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?w=location.href+"":w=""}if(w===null&&I)throw new TypeError("null is not a valid argument for URI");return this.href(w),D!==void 0?this.absoluteTo(D):this}function s(w){return/^[0-9]+$/.test(w)}r.version="1.19.11";var a=r.prototype,l=Object.prototype.hasOwnProperty;function u(w){return w.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(w){return w===void 0?"Undefined":String(Object.prototype.toString.call(w)).slice(8,-1)}function h(w){return f(w)==="Array"}function p(w,D){var I={},N,k;if(f(D)==="RegExp")I=null;else if(h(D))for(N=0,k=D.length;N<k;N++)I[D[N]]=!0;else I[D]=!0;for(N=0,k=w.length;N<k;N++){var H=I&&I[w[N]]!==void 0||!I&&D.test(w[N]);H&&(w.splice(N,1),k--,N--)}return w}function g(w,D){var I,N;if(h(D)){for(I=0,N=D.length;I<N;I++)if(!g(w,D[I]))return!1;return!0}var k=f(D);for(I=0,N=w.length;I<N;I++)if(k==="RegExp"){if(typeof w[I]=="string"&&w[I].match(D))return!0}else if(w[I]===D)return!0;return!1}function m(w,D){if(!h(w)||!h(D)||w.length!==D.length)return!1;w.sort(),D.sort();for(var I=0,N=w.length;I<N;I++)if(w[I]!==D[I])return!1;return!0}function y(w){var D=/^\/+|\/+$/g;return w.replace(D,"")}r._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:r.preventInvalidHostname,duplicateQueryParameters:r.duplicateQueryParameters,escapeQuerySpace:r.escapeQuerySpace}},r.preventInvalidHostname=!1,r.duplicateQueryParameters=!1,r.escapeQuerySpace=!0,r.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,r.idn_expression=/[^a-z0-9\._-]/i,r.punycode_expression=/(xn--)/i,r.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,r.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(w){if(!(!w||!w.nodeName)){var D=w.nodeName.toLowerCase();if(!(D==="input"&&w.type!=="image"))return r.domAttributes[D]}};function b(w){return escape(w)}function x(w){return encodeURIComponent(w).replace(/[!'()*]/g,b).replace(/\*/g,"%2A")}r.encode=x,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=x,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(w,D){var I=r.encode(w+"");return D===void 0&&(D=r.escapeQuerySpace),D?I.replace(/%20/g,"+"):I},r.decodeQuery=function(w,D){w+="",D===void 0&&(D=r.escapeQuerySpace);try{return r.decode(D?w.replace(/\+/g,"%20"):w)}catch{return w}};var A={encode:"encode",decode:"decode"},E,S=function(w,D){return function(I){try{return r[D](I+"").replace(r.characters[w][D].expression,function(N){return r.characters[w][D].map[N]})}catch{return I}}};for(E in A)r[E+"PathSegment"]=S("pathname",A[E]),r[E+"UrnPathSegment"]=S("urnpath",A[E]);var v=function(w,D,I){return function(N){var k;I?k=function(U){return r[D](r[I](U))}:k=r[D];for(var H=(N+"").split(w),V=0,j=H.length;V<j;V++)H[V]=k(H[V]);return H.join(w)}};r.decodePath=v("/","decodePathSegment"),r.decodeUrnPath=v(":","decodeUrnPathSegment"),r.recodePath=v("/","encodePathSegment","decode"),r.recodeUrnPath=v(":","encodeUrnPathSegment","decode"),r.encodeReserved=S("reserved","encode"),r.parse=function(w,D){var I;return D||(D={preventInvalidHostname:r.preventInvalidHostname}),w=w.replace(r.leading_whitespace_expression,""),w=w.replace(r.ascii_tab_whitespace,""),I=w.indexOf("#"),I>-1&&(D.fragment=w.substring(I+1)||null,w=w.substring(0,I)),I=w.indexOf("?"),I>-1&&(D.query=w.substring(I+1)||null,w=w.substring(0,I)),w=w.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),w=w.replace(/^[/\\]{2,}/i,"//"),w.substring(0,2)==="//"?(D.protocol=null,w=w.substring(2),w=r.parseAuthority(w,D)):(I=w.indexOf(":"),I>-1&&(D.protocol=w.substring(0,I)||null,D.protocol&&!D.protocol.match(r.protocol_expression)?D.protocol=void 0:w.substring(I+1,I+3).replace(/\\/g,"/")==="//"?(w=w.substring(I+3),w=r.parseAuthority(w,D)):(w=w.substring(I+1),D.urn=!0))),D.path=w,D},r.parseHost=function(w,D){w||(w=""),w=w.replace(/\\/g,"/");var I=w.indexOf("/"),N,k;if(I===-1&&(I=w.length),w.charAt(0)==="[")N=w.indexOf("]"),D.hostname=w.substring(1,N)||null,D.port=w.substring(N+2,I)||null,D.port==="/"&&(D.port=null);else{var H=w.indexOf(":"),V=w.indexOf("/"),j=w.indexOf(":",H+1);j!==-1&&(V===-1||j<V)?(D.hostname=w.substring(0,I)||null,D.port=null):(k=w.substring(0,I).split(":"),D.hostname=k[0]||null,D.port=k[1]||null)}return D.hostname&&w.substring(I).charAt(0)!=="/"&&(I++,w="/"+w),D.preventInvalidHostname&&r.ensureValidHostname(D.hostname,D.protocol),D.port&&r.ensureValidPort(D.port),w.substring(I)||"/"},r.parseAuthority=function(w,D){return w=r.parseUserinfo(w,D),r.parseHost(w,D)},r.parseUserinfo=function(w,D){var I=w,N=w.indexOf("\\");N!==-1&&(w=w.replace(/\\/g,"/"));var k=w.indexOf("/"),H=w.lastIndexOf("@",k>-1?k:w.length-1),V;return H>-1&&(k===-1||H<k)?(V=w.substring(0,H).split(":"),D.username=V[0]?r.decode(V[0]):null,V.shift(),D.password=V[0]?r.decode(V.join(":")):null,w=I.substring(H+1)):(D.username=null,D.password=null),w},r.parseQuery=function(w,D){if(!w)return{};if(w=w.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!w)return{};for(var I={},N=w.split("&"),k=N.length,H,V,j,U=0;U<k;U++)H=N[U].split("="),V=r.decodeQuery(H.shift(),D),j=H.length?r.decodeQuery(H.join("="),D):null,V!=="__proto__"&&(l.call(I,V)?((typeof I[V]=="string"||I[V]===null)&&(I[V]=[I[V]]),I[V].push(j)):I[V]=j);return I},r.build=function(w){var D="",I=!1;return w.protocol&&(D+=w.protocol+":"),!w.urn&&(D||w.hostname)&&(D+="//",I=!0),D+=r.buildAuthority(w)||"",typeof w.path=="string"&&(w.path.charAt(0)!=="/"&&I&&(D+="/"),D+=w.path),typeof w.query=="string"&&w.query&&(D+="?"+w.query),typeof w.fragment=="string"&&w.fragment&&(D+="#"+w.fragment),D},r.buildHost=function(w){var D="";if(w.hostname)r.ip6_expression.test(w.hostname)?D+="["+w.hostname+"]":D+=w.hostname;else return"";return w.port&&(D+=":"+w.port),D},r.buildAuthority=function(w){return r.buildUserinfo(w)+r.buildHost(w)},r.buildUserinfo=function(w){var D="";return w.username&&(D+=r.encode(w.username)),w.password&&(D+=":"+r.encode(w.password)),D&&(D+="@"),D},r.buildQuery=function(w,D,I){var N="",k,H,V,j;for(H in w)if(H!=="__proto__"&&l.call(w,H))if(h(w[H]))for(k={},V=0,j=w[H].length;V<j;V++)w[H][V]!==void 0&&k[w[H][V]+""]===void 0&&(N+="&"+r.buildQueryParameter(H,w[H][V],I),D!==!0&&(k[w[H][V]+""]=!0));else w[H]!==void 0&&(N+="&"+r.buildQueryParameter(H,w[H],I));return N.substring(1)},r.buildQueryParameter=function(w,D,I){return r.encodeQuery(w,I)+(D!==null?"="+r.encodeQuery(D,I):"")},r.addQuery=function(w,D,I){if(typeof D=="object")for(var N in D)l.call(D,N)&&r.addQuery(w,N,D[N]);else if(typeof D=="string"){if(w[D]===void 0){w[D]=I;return}else typeof w[D]=="string"&&(w[D]=[w[D]]);h(I)||(I=[I]),w[D]=(w[D]||[]).concat(I)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},r.setQuery=function(w,D,I){if(typeof D=="object")for(var N in D)l.call(D,N)&&r.setQuery(w,N,D[N]);else if(typeof D=="string")w[D]=I===void 0?null:I;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},r.removeQuery=function(w,D,I){var N,k,H;if(h(D))for(N=0,k=D.length;N<k;N++)w[D[N]]=void 0;else if(f(D)==="RegExp")for(H in w)D.test(H)&&(w[H]=void 0);else if(typeof D=="object")for(H in D)l.call(D,H)&&r.removeQuery(w,H,D[H]);else if(typeof D=="string")I!==void 0?f(I)==="RegExp"?!h(w[D])&&I.test(w[D])?w[D]=void 0:w[D]=p(w[D],I):w[D]===String(I)&&(!h(I)||I.length===1)?w[D]=void 0:h(w[D])&&(w[D]=p(w[D],I)):w[D]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},r.hasQuery=function(w,D,I,N){switch(f(D)){case"String":break;case"RegExp":for(var k in w)if(l.call(w,k)&&D.test(k)&&(I===void 0||r.hasQuery(w,k,I)))return!0;return!1;case"Object":for(var H in D)if(l.call(D,H)&&!r.hasQuery(w,H,D[H]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(I)){case"Undefined":return D in w;case"Boolean":var V=!!(h(w[D])?w[D].length:w[D]);return I===V;case"Function":return!!I(w[D],D,w);case"Array":if(!h(w[D]))return!1;var j=N?g:m;return j(w[D],I);case"RegExp":return h(w[D])?N?g(w[D],I):!1:!!(w[D]&&w[D].match(I));case"Number":I=String(I);case"String":return h(w[D])?N?g(w[D],I):!1:w[D]===I;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},r.joinPaths=function(){for(var w=[],D=[],I=0,N=0;N<arguments.length;N++){var k=new r(arguments[N]);w.push(k);for(var H=k.segment(),V=0;V<H.length;V++)typeof H[V]=="string"&&D.push(H[V]),H[V]&&I++}if(!D.length||!I)return new r("");var j=new r("").segment(D);return(w[0].path()===""||w[0].path().slice(0,1)==="/")&&j.path("/"+j.path()),j.normalize()},r.commonPath=function(w,D){var I=Math.min(w.length,D.length),N;for(N=0;N<I;N++)if(w.charAt(N)!==D.charAt(N)){N--;break}return N<1?w.charAt(0)===D.charAt(0)&&w.charAt(0)==="/"?"/":"":((w.charAt(N)!=="/"||D.charAt(N)!=="/")&&(N=w.substring(0,N).lastIndexOf("/")),w.substring(0,N+1))},r.withinString=function(w,D,I){I||(I={});var N=I.start||r.findUri.start,k=I.end||r.findUri.end,H=I.trim||r.findUri.trim,V=I.parens||r.findUri.parens,j=/[a-z0-9-]=["']?$/i;for(N.lastIndex=0;;){var U=N.exec(w);if(!U)break;var q=U.index;if(I.ignoreHtml){var X=w.slice(Math.max(q-3,0),q);if(X&&j.test(X))continue}for(var te=q+w.slice(q).search(k),K=w.slice(q,te),Z=-1;;){var ee=V.exec(K);if(!ee)break;var me=ee.index+ee[0].length;Z=Math.max(Z,me)}if(Z>-1?K=K.slice(0,Z)+K.slice(Z).replace(H,""):K=K.replace(H,""),!(K.length<=U[0].length)&&!(I.ignore&&I.ignore.test(K))){te=q+K.length;var xe=D(K,q,te,w);if(xe===void 0){N.lastIndex=te;continue}xe=String(xe),w=w.slice(0,q)+xe+w.slice(te),N.lastIndex=q+xe.length}}return N.lastIndex=0,w},r.ensureValidHostname=function(w,D){var I=!!w,N=!!D,k=!1;if(N&&(k=g(r.hostProtocols,D)),k&&!I)throw new TypeError("Hostname cannot be empty, if protocol is "+D);if(w&&w.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(w).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(w){if(w){var D=Number(w);if(!(s(D)&&D>0&&D<65536))throw new TypeError('Port "'+w+'" is not a valid port')}},r.noConflict=function(w){if(w){var D={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(D.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(D.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(D.SecondLevelDomains=i.SecondLevelDomains.noConflict()),D}else i.URI===this&&(i.URI=o);return this},a.build=function(w){return w===!0?this._deferred_build=!0:(w===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function P(w){return function(D,I){return D===void 0?this._parts[w]||"":(this._parts[w]=D||null,this.build(!I),this)}}function M(w,D){return function(I,N){return I===void 0?this._parts[w]||"":(I!==null&&(I=I+"",I.charAt(0)===D&&(I=I.substring(1))),this._parts[w]=I,this.build(!N),this)}}a.protocol=P("protocol"),a.username=P("username"),a.password=P("password"),a.hostname=P("hostname"),a.port=P("port"),a.query=M("query","?"),a.fragment=M("fragment","#"),a.search=function(w,D){var I=this.query(w,D);return typeof I=="string"&&I.length?"?"+I:I},a.hash=function(w,D){var I=this.fragment(w,D);return typeof I=="string"&&I.length?"#"+I:I},a.pathname=function(w,D){if(w===void 0||w===!0){var I=this._parts.path||(this._parts.hostname?"/":"");return w?(this._parts.urn?r.decodeUrnPath:r.decodePath)(I):I}else return this._parts.urn?this._parts.path=w?r.recodeUrnPath(w):"":this._parts.path=w?r.recodePath(w):"/",this.build(!D),this},a.path=a.pathname,a.href=function(w,D){var I;if(w===void 0)return this.toString();this._string="",this._parts=r._parts();var N=w instanceof r,k=typeof w=="object"&&(w.hostname||w.path||w.pathname);if(w.nodeName){var H=r.getDomAttribute(w);w=w[H]||"",k=!1}if(!N&&k&&w.pathname!==void 0&&(w=w.toString()),typeof w=="string"||w instanceof String)this._parts=r.parse(String(w),this._parts);else if(N||k){var V=N?w._parts:w;for(I in V)I!=="query"&&l.call(this._parts,I)&&(this._parts[I]=V[I]);V.query&&this.query(V.query,!1)}else throw new TypeError("invalid input");return this.build(!D),this},a.is=function(w){var D=!1,I=!1,N=!1,k=!1,H=!1,V=!1,j=!1,U=!this._parts.urn;switch(this._parts.hostname&&(U=!1,I=r.ip4_expression.test(this._parts.hostname),N=r.ip6_expression.test(this._parts.hostname),D=I||N,k=!D,H=k&&n&&n.has(this._parts.hostname),V=k&&r.idn_expression.test(this._parts.hostname),j=k&&r.punycode_expression.test(this._parts.hostname)),w.toLowerCase()){case"relative":return U;case"absolute":return!U;case"domain":case"name":return k;case"sld":return H;case"ip":return D;case"ip4":case"ipv4":case"inet4":return I;case"ip6":case"ipv6":case"inet6":return N;case"idn":return V;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return j}return null};var R=a.protocol,L=a.port,B=a.hostname;a.protocol=function(w,D){if(w&&(w=w.replace(/:(\/\/)?$/,""),!w.match(r.protocol_expression)))throw new TypeError('Protocol "'+w+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,w,D)},a.scheme=a.protocol,a.port=function(w,D){return this._parts.urn?w===void 0?"":this:(w!==void 0&&(w===0&&(w=null),w&&(w+="",w.charAt(0)===":"&&(w=w.substring(1)),r.ensureValidPort(w))),L.call(this,w,D))},a.hostname=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w!==void 0){var I={preventInvalidHostname:this._parts.preventInvalidHostname},N=r.parseHost(w,I);if(N!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');w=I.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(w,this._parts.protocol)}return B.call(this,w,D)},a.origin=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){var I=this.protocol(),N=this.authority();return N?(I?I+"://":"")+this.authority():""}else{var k=r(w);return this.protocol(k.protocol()).authority(k.authority()).build(!D),this}},a.host=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var I=r.parseHost(w,this._parts);if(I!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');return this.build(!D),this},a.authority=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var I=r.parseAuthority(w,this._parts);if(I!=="/")throw new TypeError('Hostname "'+w+'" contains characters other than [A-Z0-9.-]');return this.build(!D),this},a.userinfo=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){var I=r.buildUserinfo(this._parts);return I&&I.substring(0,I.length-1)}else return w[w.length-1]!=="@"&&(w+="@"),r.parseUserinfo(w,this._parts),this.build(!D),this},a.resource=function(w,D){var I;return w===void 0?this.path()+this.search()+this.hash():(I=r.parse(w),this._parts.path=I.path,this._parts.query=I.query,this._parts.fragment=I.fragment,this.build(!D),this)},a.subdomain=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,I)||""}else{var N=this._parts.hostname.length-this.domain().length,k=this._parts.hostname.substring(0,N),H=new RegExp("^"+u(k));if(w&&w.charAt(w.length-1)!=="."&&(w+="."),w.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return w&&r.ensureValidHostname(w,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(H,w),this.build(!D),this}},a.domain=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(typeof w=="boolean"&&(D=w,w=void 0),w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.match(/\./g);if(I&&I.length<2)return this._parts.hostname;var N=this._parts.hostname.length-this.tld(D).length-1;return N=this._parts.hostname.lastIndexOf(".",N-1)+1,this._parts.hostname.substring(N)||""}else{if(!w)throw new TypeError("cannot set domain empty");if(w.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(w,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=w;else{var k=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(k,w)}return this.build(!D),this}},a.tld=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(typeof w=="boolean"&&(D=w,w=void 0),w===void 0){if(!this._parts.hostname||this.is("IP"))return"";var I=this._parts.hostname.lastIndexOf("."),N=this._parts.hostname.substring(I+1);return D!==!0&&n&&n.list[N.toLowerCase()]&&n.get(this._parts.hostname)||N}else{var k;if(w)if(w.match(/[^a-zA-Z0-9-]/))if(n&&n.is(w))k=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(k,w);else throw new TypeError('TLD "'+w+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");k=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(k,w)}else throw new TypeError("cannot set TLD empty");return this.build(!D),this}},a.directory=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0||w===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var I=this._parts.path.length-this.filename().length-1,N=this._parts.path.substring(0,I)||(this._parts.hostname?"/":"");return w?r.decodePath(N):N}else{var k=this._parts.path.length-this.filename().length,H=this._parts.path.substring(0,k),V=new RegExp("^"+u(H));return this.is("relative")||(w||(w="/"),w.charAt(0)!=="/"&&(w="/"+w)),w&&w.charAt(w.length-1)!=="/"&&(w+="/"),w=r.recodePath(w),this._parts.path=this._parts.path.replace(V,w),this.build(!D),this}},a.filename=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(typeof w!="string"){if(!this._parts.path||this._parts.path==="/")return"";var I=this._parts.path.lastIndexOf("/"),N=this._parts.path.substring(I+1);return w?r.decodePathSegment(N):N}else{var k=!1;w.charAt(0)==="/"&&(w=w.substring(1)),w.match(/\.?\//)&&(k=!0);var H=new RegExp(u(this.filename())+"$");return w=r.recodePath(w),this._parts.path=this._parts.path.replace(H,w),k?this.normalizePath(D):this.build(!D),this}},a.suffix=function(w,D){if(this._parts.urn)return w===void 0?"":this;if(w===void 0||w===!0){if(!this._parts.path||this._parts.path==="/")return"";var I=this.filename(),N=I.lastIndexOf("."),k,H;return N===-1?"":(k=I.substring(N+1),H=/^[a-z0-9%]+$/i.test(k)?k:"",w?r.decodePathSegment(H):H)}else{w.charAt(0)==="."&&(w=w.substring(1));var V=this.suffix(),j;if(V)w?j=new RegExp(u(V)+"$"):j=new RegExp(u("."+V)+"$");else{if(!w)return this;this._parts.path+="."+r.recodePath(w)}return j&&(w=r.recodePath(w),this._parts.path=this._parts.path.replace(j,w)),this.build(!D),this}},a.segment=function(w,D,I){var N=this._parts.urn?":":"/",k=this.path(),H=k.substring(0,1)==="/",V=k.split(N);if(w!==void 0&&typeof w!="number"&&(I=D,D=w,w=void 0),w!==void 0&&typeof w!="number")throw new Error('Bad segment "'+w+'", must be 0-based integer');if(H&&V.shift(),w<0&&(w=Math.max(V.length+w,0)),D===void 0)return w===void 0?V:V[w];if(w===null||V[w]===void 0)if(h(D)){V=[];for(var j=0,U=D.length;j<U;j++)!D[j].length&&(!V.length||!V[V.length-1].length)||(V.length&&!V[V.length-1].length&&V.pop(),V.push(y(D[j])))}else(D||typeof D=="string")&&(D=y(D),V[V.length-1]===""?V[V.length-1]=D:V.push(D));else D?V[w]=y(D):V.splice(w,1);return H&&V.unshift(""),this.path(V.join(N),I)},a.segmentCoded=function(w,D,I){var N,k,H;if(typeof w!="number"&&(I=D,D=w,w=void 0),D===void 0){if(N=this.segment(w,D,I),!h(N))N=N!==void 0?r.decode(N):void 0;else for(k=0,H=N.length;k<H;k++)N[k]=r.decode(N[k]);return N}if(!h(D))D=typeof D=="string"||D instanceof String?r.encode(D):D;else for(k=0,H=D.length;k<H;k++)D[k]=r.encode(D[k]);return this.segment(w,D,I)};var _=a.query;return a.query=function(w,D){if(w===!0)return r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof w=="function"){var I=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace),N=w.call(this,I);return this._parts.query=r.buildQuery(N||I,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!D),this}else return w!==void 0&&typeof w!="string"?(this._parts.query=r.buildQuery(w,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!D),this):_.call(this,w,D)},a.setQuery=function(w,D,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof w=="string"||w instanceof String)N[w]=D!==void 0?D:null;else if(typeof w=="object")for(var k in w)l.call(w,k)&&(N[k]=w[k]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof w!="string"&&(I=D),this.build(!I),this},a.addQuery=function(w,D,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.addQuery(N,w,D===void 0?null:D),this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof w!="string"&&(I=D),this.build(!I),this},a.removeQuery=function(w,D,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.removeQuery(N,w,D),this._parts.query=r.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof w!="string"&&(I=D),this.build(!I),this},a.hasQuery=function(w,D,I){var N=r.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return r.hasQuery(N,w,D,I)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(w){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!w)),this},a.normalizeHostname=function(w){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!w)),this},a.normalizePort=function(w){return typeof this._parts.protocol=="string"&&this._parts.port===r.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!w)),this},a.normalizePath=function(w){var D=this._parts.path;if(!D)return this;if(this._parts.urn)return this._parts.path=r.recodeUrnPath(this._parts.path),this.build(!w),this;if(this._parts.path==="/")return this;D=r.recodePath(D);var I,N="",k,H;for(D.charAt(0)!=="/"&&(I=!0,D="/"+D),(D.slice(-3)==="/.."||D.slice(-2)==="/.")&&(D+="/"),D=D.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),I&&(N=D.substring(1).match(/^(\.\.\/)+/)||"",N&&(N=N[0]));k=D.search(/\/\.\.(\/|$)/),k!==-1;){if(k===0){D=D.substring(3);continue}H=D.substring(0,k).lastIndexOf("/"),H===-1&&(H=k),D=D.substring(0,H)+D.substring(k+3)}return I&&this.is("relative")&&(D=N+D.substring(1)),this._parts.path=D,this.build(!w),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(w){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(r.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!w)),this},a.normalizeFragment=function(w){return this._parts.fragment||(this._parts.fragment=null,this.build(!w)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var w=r.encode,D=r.decode;r.encode=escape,r.decode=decodeURIComponent;try{this.normalize()}finally{r.encode=w,r.decode=D}return this},a.unicode=function(){var w=r.encode,D=r.decode;r.encode=x,r.decode=unescape;try{this.normalize()}finally{r.encode=w,r.decode=D}return this},a.readable=function(){var w=this.clone();w.username("").password("").normalize();var D="";if(w._parts.protocol&&(D+=w._parts.protocol+"://"),w._parts.hostname&&(w.is("punycode")&&e?(D+=e.toUnicode(w._parts.hostname),w._parts.port&&(D+=":"+w._parts.port)):D+=w.host()),w._parts.hostname&&w._parts.path&&w._parts.path.charAt(0)!=="/"&&(D+="/"),D+=w.path(!0),w._parts.query){for(var I="",N=0,k=w._parts.query.split("&"),H=k.length;N<H;N++){var V=(k[N]||"").split("=");I+="&"+r.decodeQuery(V[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),V[1]!==void 0&&(I+="="+r.decodeQuery(V[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}D+="?"+I.substring(1)}return D+=r.decodeQuery(w.hash(),!0),D},a.absoluteTo=function(w){var D=this.clone(),I=["protocol","username","password","hostname","port"],N,k,H;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(w instanceof r||(w=new r(w)),D._parts.protocol||(D._parts.protocol=w._parts.protocol,this._parts.hostname))return D;for(k=0;H=I[k];k++)D._parts[H]=w._parts[H];return D._parts.path?(D._parts.path.substring(-2)===".."&&(D._parts.path+="/"),D.path().charAt(0)!=="/"&&(N=w.directory(),N=N||(w.path().indexOf("/")===0?"/":""),D._parts.path=(N?N+"/":"")+D._parts.path,D.normalizePath())):(D._parts.path=w._parts.path,D._parts.query||(D._parts.query=w._parts.query)),D.build(),D},a.relativeTo=function(w){var D=this.clone().normalize(),I,N,k,H,V;if(D._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(w=new r(w).normalize(),I=D._parts,N=w._parts,H=D.path(),V=w.path(),H.charAt(0)!=="/")throw new Error("URI is already relative");if(V.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(I.protocol===N.protocol&&(I.protocol=null),I.username!==N.username||I.password!==N.password||I.protocol!==null||I.username!==null||I.password!==null)return D.build();if(I.hostname===N.hostname&&I.port===N.port)I.hostname=null,I.port=null;else return D.build();if(H===V)return I.path="",D.build();if(k=r.commonPath(H,V),!k)return D.build();var j=N.path.substring(k.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return I.path=j+I.path.substring(k.length)||"./",D.build()},a.equals=function(w){var D=this.clone(),I=new r(w),N={},k={},H={},V,j,U;if(D.normalize(),I.normalize(),D.toString()===I.toString())return!0;if(V=D.query(),j=I.query(),D.query(""),I.query(""),D.toString()!==I.toString()||V.length!==j.length)return!1;N=r.parseQuery(V,this._parts.escapeQuerySpace),k=r.parseQuery(j,this._parts.escapeQuerySpace);for(U in N)if(l.call(N,U)){if(h(N[U])){if(!m(N[U],k[U]))return!1}else if(N[U]!==k[U])return!1;H[U]=!0}for(U in k)if(l.call(k,U)&&!H[U])return!1;return!0},a.preventInvalidHostname=function(w){return this._parts.preventInvalidHostname=!!w,this},a.duplicateQueryParameters=function(w){return this._parts.duplicateQueryParameters=!!w,this},a.escapeQuerySpace=function(w){return this._parts.escapeQuerySpace=!!w,this},r})});var Wae=Wu((FOn,jae)=>{"use strict";jae.exports=cWe;var Zv=1e20;function cWe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,l,u,f,h,p,g,m,y;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,l=e,t.stride?f=t.stride:f=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,h=p.getContext("2d"),r=p.width,s=p.height,g=h.getImageData(0,0,r,s),l=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,h=e,r=p.width,s=p.height,g=h.getImageData(0,0,r,s),l=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,r=e.width,s=e.height,l=g.data,f=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&l instanceof window.Uint8ClampedArray||window.Uint8Array&&l instanceof window.Uint8Array)for(u=l,l=Array(r*s),m=0,y=Math.floor(u.length/f);m<y;m++)l[m]=u[m*f+o]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var b=Array(r*s),x=Array(r*s),A=Array(a),E=Array(a),S=Array(a+1),v=Array(a);for(m=0,y=r*s;m<y;m++){var P=l[m];b[m]=P===1?0:P===0?Zv:Math.pow(Math.max(0,.5-P),2),x[m]=P===1?Zv:P===0?0:Math.pow(Math.max(0,P-.5),2)}Hae(b,r,s,A,E,v,S),Hae(x,r,s,A,E,v,S);var M=window.Float32Array?new Float32Array(r*s):new Array(r*s);for(m=0,y=r*s;m<y;m++)M[m]=Math.min(Math.max(1-((b[m]-x[m])/i+n),0),1);return M}function Hae(e,t,n,i,o,r,s){for(var a=0;a<t;a++){for(var l=0;l<n;l++)i[l]=e[l*t+a];for(Gae(i,o,r,s,n),l=0;l<n;l++)e[l*t+a]=o[l]}for(l=0;l<n;l++){for(a=0;a<t;a++)i[a]=e[l*t+a];for(Gae(i,o,r,s,t),a=0;a<t;a++)e[l*t+a]=Math.sqrt(o[a])}}function Gae(e,t,n,i,o){n[0]=0,i[0]=-Zv,i[1]=+Zv;for(var r=1,s=0;r<o;r++){for(var a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);a<=i[s];)s--,a=(e[r]+r*r-(e[n[s]]+n[s]*n[s]))/(2*r-2*n[s]);s++,n[s]=r,i[s]=a,i[s+1]=+Zv}for(r=0,s=0;r<o;r++){for(;i[s+1]<r;)s++;t[r]=(r-n[s])*(r-n[s])+e[n[s]]}}});var $ae=Wu((e1n,OB)=>{function bWe(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,l=8,u=9,f=10,h=11,p=12,g=13,m=14,y=15,b=16,x=17,A=0,E=1,S=2,v=3,P=4;function M(_,w){return 55296<=_.charCodeAt(w)&&_.charCodeAt(w)<=56319&&56320<=_.charCodeAt(w+1)&&_.charCodeAt(w+1)<=57343}function R(_,w){w===void 0&&(w=0);var D=_.charCodeAt(w);if(55296<=D&&D<=56319&&w<_.length-1){var I=D,N=_.charCodeAt(w+1);return 56320<=N&&N<=57343?(I-55296)*1024+(N-56320)+65536:I}if(56320<=D&&D<=57343&&w>=1){var I=_.charCodeAt(w-1),N=D;return 55296<=I&&I<=56319?(I-55296)*1024+(N-56320)+65536:N}return D}function L(_,w,D){var I=[_].concat(w).concat([D]),N=I[I.length-2],k=D,H=I.lastIndexOf(m);if(H>1&&I.slice(1,H).every(function(U){return U==i})&&[i,g,x].indexOf(_)==-1)return S;var V=I.lastIndexOf(o);if(V>0&&I.slice(1,V).every(function(U){return U==o})&&[p,o].indexOf(N)==-1)return I.filter(function(U){return U==o}).length%2==1?v:P;if(N==e&&k==t)return A;if(N==n||N==e||N==t)return k==m&&w.every(function(U){return U==i})?S:E;if(k==n||k==e||k==t)return E;if(N==s&&(k==s||k==a||k==u||k==f))return A;if((N==u||N==a)&&(k==a||k==l))return A;if((N==f||N==l)&&k==l)return A;if(k==i||k==y)return A;if(k==r)return A;if(N==p)return A;var j=I.indexOf(i)!=-1?I.lastIndexOf(i)-1:I.length-2;return[g,x].indexOf(I[j])!=-1&&I.slice(j+1,-1).every(function(U){return U==i})&&k==m||N==y&&[b,x].indexOf(k)!=-1?A:w.indexOf(o)!=-1?S:N==o&&k==o?A:E}this.nextBreak=function(_,w){if(w===void 0&&(w=0),w<0)return 0;if(w>=_.length-1)return _.length;for(var D=B(R(_,w)),I=[],N=w+1;N<_.length;N++)if(!M(_,N-1)){var k=B(R(_,N));if(L(D,I,k))return N;I.push(k)}return _.length},this.splitGraphemes=function(_){for(var w=[],D=0,I;(I=this.nextBreak(_,D))<_.length;)w.push(_.slice(D,I)),D=I;return D<_.length&&w.push(_.slice(D)),w},this.iterateGraphemes=function(_){var w=0,D={next:function(){var I,N;return(N=this.nextBreak(_,w))<_.length?(I=_.slice(w,N),w=N,{value:I,done:!1}):w<_.length?(I=_.slice(w),w=_.length,{value:I,done:!1}):{value:void 0,done:!0}}.bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(D[Symbol.iterator]=function(){return D}),D},this.countGraphemes=function(_){for(var w=0,D=0,I;(I=this.nextBreak(_,D))<_.length;)D=I,w++;return D<_.length&&w++,w};function B(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?o:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?r:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?l:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?m:_==8205?y:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?b:128102<=_&&_<=128105?x:h}return this}typeof OB<"u"&&OB.exports&&(OB.exports=bWe)});var Ude=Wu((Fq,Bq)=>{(function(e,t){typeof Fq=="object"&&typeof Bq<"u"?Bq.exports=t():typeof define=="function"&&define.amd?define(t):(e=e||self).RBush=t()})(Fq,function(){"use strict";function e(b,x,A,E,S){(function v(P,M,R,L,B){for(;L>R;){if(L-R>600){var _=L-R+1,w=M-R+1,D=Math.log(_),I=.5*Math.exp(2*D/3),N=.5*Math.sqrt(D*I*(_-I)/_)*(w-_/2<0?-1:1),k=Math.max(R,Math.floor(M-w*I/_+N)),H=Math.min(L,Math.floor(M+(_-w)*I/_+N));v(P,M,k,H,B)}var V=P[M],j=R,U=L;for(t(P,R,M),B(P[L],V)>0&&t(P,R,L);j<U;){for(t(P,j,U),j++,U--;B(P[j],V)<0;)j++;for(;B(P[U],V)>0;)U--}B(P[R],V)===0?t(P,R,U):t(P,++U,L),U<=M&&(R=U+1),M<=U&&(L=U-1)}})(b,x,A||0,E||b.length-1,S||n)}function t(b,x,A){var E=b[x];b[x]=b[A],b[A]=E}function n(b,x){return b<x?-1:b>x?1:0}var i=function(b){b===void 0&&(b=9),this._maxEntries=Math.max(4,b),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()};function o(b,x,A){if(!A)return x.indexOf(b);for(var E=0;E<x.length;E++)if(A(b,x[E]))return E;return-1}function r(b,x){s(b,0,b.children.length,x,b)}function s(b,x,A,E,S){S||(S=m(null)),S.minX=1/0,S.minY=1/0,S.maxX=-1/0,S.maxY=-1/0;for(var v=x;v<A;v++){var P=b.children[v];a(S,b.leaf?E(P):P)}return S}function a(b,x){return b.minX=Math.min(b.minX,x.minX),b.minY=Math.min(b.minY,x.minY),b.maxX=Math.max(b.maxX,x.maxX),b.maxY=Math.max(b.maxY,x.maxY),b}function l(b,x){return b.minX-x.minX}function u(b,x){return b.minY-x.minY}function f(b){return(b.maxX-b.minX)*(b.maxY-b.minY)}function h(b){return b.maxX-b.minX+(b.maxY-b.minY)}function p(b,x){return b.minX<=x.minX&&b.minY<=x.minY&&x.maxX<=b.maxX&&x.maxY<=b.maxY}function g(b,x){return x.minX<=b.maxX&&x.minY<=b.maxY&&x.maxX>=b.minX&&x.maxY>=b.minY}function m(b){return{children:b,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function y(b,x,A,E,S){for(var v=[x,A];v.length;)if(!((A=v.pop())-(x=v.pop())<=E)){var P=x+Math.ceil((A-x)/E/2)*E;e(b,P,x,A,S),v.push(x,P,P,A)}}return i.prototype.all=function(){return this._all(this.data,[])},i.prototype.search=function(b){var x=this.data,A=[];if(!g(b,x))return A;for(var E=this.toBBox,S=[];x;){for(var v=0;v<x.children.length;v++){var P=x.children[v],M=x.leaf?E(P):P;g(b,M)&&(x.leaf?A.push(P):p(b,M)?this._all(P,A):S.push(P))}x=S.pop()}return A},i.prototype.collides=function(b){var x=this.data;if(!g(b,x))return!1;for(var A=[];x;){for(var E=0;E<x.children.length;E++){var S=x.children[E],v=x.leaf?this.toBBox(S):S;if(g(b,v)){if(x.leaf||p(b,v))return!0;A.push(S)}}x=A.pop()}return!1},i.prototype.load=function(b){if(!b||!b.length)return this;if(b.length<this._minEntries){for(var x=0;x<b.length;x++)this.insert(b[x]);return this}var A=this._build(b.slice(),0,b.length-1,0);if(this.data.children.length)if(this.data.height===A.height)this._splitRoot(this.data,A);else{if(this.data.height<A.height){var E=this.data;this.data=A,A=E}this._insert(A,this.data.height-A.height-1,!0)}else this.data=A;return this},i.prototype.insert=function(b){return b&&this._insert(b,this.data.height-1),this},i.prototype.clear=function(){return this.data=m([]),this},i.prototype.remove=function(b,x){if(!b)return this;for(var A,E,S,v=this.data,P=this.toBBox(b),M=[],R=[];v||M.length;){if(v||(v=M.pop(),E=M[M.length-1],A=R.pop(),S=!0),v.leaf){var L=o(b,v.children,x);if(L!==-1)return v.children.splice(L,1),M.push(v),this._condense(M),this}S||v.leaf||!p(v,P)?E?(A++,v=E.children[A],S=!1):v=null:(M.push(v),R.push(A),A=0,E=v,v=v.children[0])}return this},i.prototype.toBBox=function(b){return b},i.prototype.compareMinX=function(b,x){return b.minX-x.minX},i.prototype.compareMinY=function(b,x){return b.minY-x.minY},i.prototype.toJSON=function(){return this.data},i.prototype.fromJSON=function(b){return this.data=b,this},i.prototype._all=function(b,x){for(var A=[];b;)b.leaf?x.push.apply(x,b.children):A.push.apply(A,b.children),b=A.pop();return x},i.prototype._build=function(b,x,A,E){var S,v=A-x+1,P=this._maxEntries;if(v<=P)return r(S=m(b.slice(x,A+1)),this.toBBox),S;E||(E=Math.ceil(Math.log(v)/Math.log(P)),P=Math.ceil(v/Math.pow(P,E-1))),(S=m([])).leaf=!1,S.height=E;var M=Math.ceil(v/P),R=M*Math.ceil(Math.sqrt(P));y(b,x,A,R,this.compareMinX);for(var L=x;L<=A;L+=R){var B=Math.min(L+R-1,A);y(b,L,B,M,this.compareMinY);for(var _=L;_<=B;_+=M){var w=Math.min(_+M-1,B);S.children.push(this._build(b,_,w,E-1))}}return r(S,this.toBBox),S},i.prototype._chooseSubtree=function(b,x,A,E){for(;E.push(x),!x.leaf&&E.length-1!==A;){for(var S=1/0,v=1/0,P=void 0,M=0;M<x.children.length;M++){var R=x.children[M],L=f(R),B=(_=b,w=R,(Math.max(w.maxX,_.maxX)-Math.min(w.minX,_.minX))*(Math.max(w.maxY,_.maxY)-Math.min(w.minY,_.minY))-L);B<v?(v=B,S=L<S?L:S,P=R):B===v&&L<S&&(S=L,P=R)}x=P||x.children[0]}var _,w;return x},i.prototype._insert=function(b,x,A){var E=A?b:this.toBBox(b),S=[],v=this._chooseSubtree(E,this.data,x,S);for(v.children.push(b),a(v,E);x>=0&&S[x].children.length>this._maxEntries;)this._split(S,x),x--;this._adjustParentBBoxes(E,S,x)},i.prototype._split=function(b,x){var A=b[x],E=A.children.length,S=this._minEntries;this._chooseSplitAxis(A,S,E);var v=this._chooseSplitIndex(A,S,E),P=m(A.children.splice(v,A.children.length-v));P.height=A.height,P.leaf=A.leaf,r(A,this.toBBox),r(P,this.toBBox),x?b[x-1].children.push(P):this._splitRoot(A,P)},i.prototype._splitRoot=function(b,x){this.data=m([b,x]),this.data.height=b.height+1,this.data.leaf=!1,r(this.data,this.toBBox)},i.prototype._chooseSplitIndex=function(b,x,A){for(var E,S,v,P,M,R,L,B=1/0,_=1/0,w=x;w<=A-x;w++){var D=s(b,0,w,this.toBBox),I=s(b,w,A,this.toBBox),N=(S=D,v=I,P=void 0,M=void 0,R=void 0,L=void 0,P=Math.max(S.minX,v.minX),M=Math.max(S.minY,v.minY),R=Math.min(S.maxX,v.maxX),L=Math.min(S.maxY,v.maxY),Math.max(0,R-P)*Math.max(0,L-M)),k=f(D)+f(I);N<B?(B=N,E=w,_=k<_?k:_):N===B&&k<_&&(_=k,E=w)}return E||A-x},i.prototype._chooseSplitAxis=function(b,x,A){var E=b.leaf?this.compareMinX:l,S=b.leaf?this.compareMinY:u;this._allDistMargin(b,x,A,E)<this._allDistMargin(b,x,A,S)&&b.children.sort(E)},i.prototype._allDistMargin=function(b,x,A,E){b.children.sort(E);for(var S=this.toBBox,v=s(b,0,x,S),P=s(b,A-x,A,S),M=h(v)+h(P),R=x;R<A-x;R++){var L=b.children[R];a(v,b.leaf?S(L):L),M+=h(v)}for(var B=A-x-1;B>=x;B--){var _=b.children[B];a(P,b.leaf?S(_):_),M+=h(P)}return M},i.prototype._adjustParentBBoxes=function(b,x,A){for(var E=A;E>=0;E--)a(x[E],b)},i.prototype._condense=function(b){for(var x=b.length-1,A=void 0;x>=0;x--)b[x].children.length===0?x>0?(A=b[x-1].children).splice(A.indexOf(b[x]),1):this.clear():r(b[x],this.toBBox)},i})});var r$=Wu((exports,module)=>{/*!
* protobuf.js v7.4.0 (c) 2016, daniel wirtz
* compiled thu, 22 aug 2024 20:30:39 utc
* licensed under the bsd-3-clause license
* see: https://github.com/dcodeio/protobuf.js for details
*/(function(undefined){"use strict";(function(t,n,i){function o(s){var a=n[s];return a||t[s][0].call(a=n[s]={exports:{}},o,a,a.exports),a.exports}var r=o(i[0]);r.util.global.protobuf=r,typeof define=="function"&&define.amd&&define(["long"],function(s){return s&&s.isLong&&(r.util.Long=s,r.configure()),r}),typeof module=="object"&&module&&module.exports&&(module.exports=r)})({1:[function(e,t,n){"use strict";t.exports=i;function i(o,r){for(var s=new Array(arguments.length-1),a=0,l=2,u=!0;l<arguments.length;)s[a++]=arguments[l++];return new Promise(function(h,p){s[a]=function(m){if(u)if(u=!1,m)p(m);else{for(var y=new Array(arguments.length-1),b=0;b<y.length;)y[b++]=arguments[b];h.apply(null,y)}};try{o.apply(r||null,s)}catch(g){u&&(u=!1,p(g))}})}},{}],2:[function(e,t,n){"use strict";var i=n;i.length=function(u){var f=u.length;if(!f)return 0;for(var h=0;--f%4>1&&u.charAt(f)==="=";)++h;return Math.ceil(u.length*3)/4-h};for(var o=new Array(64),r=new Array(123),s=0;s<64;)r[o[s]=s<26?s+65:s<52?s+71:s<62?s-4:s-59|43]=s++;i.encode=function(u,f,h){for(var p=null,g=[],m=0,y=0,b;f<h;){var x=u[f++];switch(y){case 0:g[m++]=o[x>>2],b=(x&3)<<4,y=1;break;case 1:g[m++]=o[b|x>>4],b=(x&15)<<2,y=2;break;case 2:g[m++]=o[b|x>>6],g[m++]=o[x&63],y=0;break}m>8191&&((p||(p=[])).push(String.fromCharCode.apply(String,g)),m=0)}return y&&(g[m++]=o[b],g[m++]=61,y===1&&(g[m++]=61)),p?(m&&p.push(String.fromCharCode.apply(String,g.slice(0,m))),p.join("")):String.fromCharCode.apply(String,g.slice(0,m))};var a="invalid encoding";i.decode=function(u,f,h){for(var p=h,g=0,m,y=0;y<u.length;){var b=u.charCodeAt(y++);if(b===61&&g>1)break;if((b=r[b])===undefined)throw Error(a);switch(g){case 0:m=b,g=1;break;case 1:f[h++]=m<<2|(b&48)>>4,m=b,g=2;break;case 2:f[h++]=(m&15)<<4|(b&60)>>2,m=b,g=3;break;case 3:f[h++]=(m&3)<<6|b,g=0;break}}if(g===1)throw Error(a);return h-p},i.test=function(u){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(u)}},{}],3:[function(e,t,n){"use strict";t.exports=i;function i(){this._listeners={}}i.prototype.on=function(r,s,a){return(this._listeners[r]||(this._listeners[r]=[])).push({fn:s,ctx:a||this}),this},i.prototype.off=function(r,s){if(r===undefined)this._listeners={};else if(s===undefined)this._listeners[r]=[];else for(var a=this._listeners[r],l=0;l<a.length;)a[l].fn===s?a.splice(l,1):++l;return this},i.prototype.emit=function(r){var s=this._listeners[r];if(s){for(var a=[],l=1;l<arguments.length;)a.push(arguments[l++]);for(l=0;l<s.length;)s[l].fn.apply(s[l++].ctx,a)}return this}},{}],4:[function(e,t,n){"use strict";t.exports=i(i);function i(l){return typeof Float32Array<"u"?function(){var u=new Float32Array([-0]),f=new Uint8Array(u.buffer),h=f[3]===128;function p(b,x,A){u[0]=b,x[A]=f[0],x[A+1]=f[1],x[A+2]=f[2],x[A+3]=f[3]}function g(b,x,A){u[0]=b,x[A]=f[3],x[A+1]=f[2],x[A+2]=f[1],x[A+3]=f[0]}l.writeFloatLE=h?p:g,l.writeFloatBE=h?g:p;function m(b,x){return f[0]=b[x],f[1]=b[x+1],f[2]=b[x+2],f[3]=b[x+3],u[0]}function y(b,x){return f[3]=b[x],f[2]=b[x+1],f[1]=b[x+2],f[0]=b[x+3],u[0]}l.readFloatLE=h?m:y,l.readFloatBE=h?y:m}():function(){function u(h,p,g,m){var y=p<0?1:0;if(y&&(p=-p),p===0)h(1/p>0?0:2147483648,g,m);else if(isNaN(p))h(2143289344,g,m);else if(p>34028234663852886e22)h((y<<31|2139095040)>>>0,g,m);else if(p<11754943508222875e-54)h((y<<31|Math.round(p/1401298464324817e-60))>>>0,g,m);else{var b=Math.floor(Math.log(p)/Math.LN2),x=Math.round(p*Math.pow(2,-b)*8388608)&8388607;h((y<<31|b+127<<23|x)>>>0,g,m)}}l.writeFloatLE=u.bind(null,o),l.writeFloatBE=u.bind(null,r);function f(h,p,g){var m=h(p,g),y=(m>>31)*2+1,b=m>>>23&255,x=m&8388607;return b===255?x?NaN:y*(1/0):b===0?y*1401298464324817e-60*x:y*Math.pow(2,b-150)*(x+8388608)}l.readFloatLE=f.bind(null,s),l.readFloatBE=f.bind(null,a)}(),typeof Float64Array<"u"?function(){var u=new Float64Array([-0]),f=new Uint8Array(u.buffer),h=f[7]===128;function p(b,x,A){u[0]=b,x[A]=f[0],x[A+1]=f[1],x[A+2]=f[2],x[A+3]=f[3],x[A+4]=f[4],x[A+5]=f[5],x[A+6]=f[6],x[A+7]=f[7]}function g(b,x,A){u[0]=b,x[A]=f[7],x[A+1]=f[6],x[A+2]=f[5],x[A+3]=f[4],x[A+4]=f[3],x[A+5]=f[2],x[A+6]=f[1],x[A+7]=f[0]}l.writeDoubleLE=h?p:g,l.writeDoubleBE=h?g:p;function m(b,x){return f[0]=b[x],f[1]=b[x+1],f[2]=b[x+2],f[3]=b[x+3],f[4]=b[x+4],f[5]=b[x+5],f[6]=b[x+6],f[7]=b[x+7],u[0]}function y(b,x){return f[7]=b[x],f[6]=b[x+1],f[5]=b[x+2],f[4]=b[x+3],f[3]=b[x+4],f[2]=b[x+5],f[1]=b[x+6],f[0]=b[x+7],u[0]}l.readDoubleLE=h?m:y,l.readDoubleBE=h?y:m}():function(){function u(h,p,g,m,y,b){var x=m<0?1:0;if(x&&(m=-m),m===0)h(0,y,b+p),h(1/m>0?0:2147483648,y,b+g);else if(isNaN(m))h(0,y,b+p),h(2146959360,y,b+g);else if(m>17976931348623157e292)h(0,y,b+p),h((x<<31|2146435072)>>>0,y,b+g);else{var A;if(m<22250738585072014e-324)A=m/5e-324,h(A>>>0,y,b+p),h((x<<31|A/4294967296)>>>0,y,b+g);else{var E=Math.floor(Math.log(m)/Math.LN2);E===1024&&(E=1023),A=m*Math.pow(2,-E),h(A*4503599627370496>>>0,y,b+p),h((x<<31|E+1023<<20|A*1048576&1048575)>>>0,y,b+g)}}}l.writeDoubleLE=u.bind(null,o,0,4),l.writeDoubleBE=u.bind(null,r,4,0);function f(h,p,g,m,y){var b=h(m,y+p),x=h(m,y+g),A=(x>>31)*2+1,E=x>>>20&2047,S=4294967296*(x&1048575)+b;return E===2047?S?NaN:A*(1/0):E===0?A*5e-324*S:A*Math.pow(2,E-1075)*(S+4503599627370496)}l.readDoubleLE=f.bind(null,s,0,4),l.readDoubleBE=f.bind(null,a,4,0)}(),l}function o(l,u,f){u[f]=l&255,u[f+1]=l>>>8&255,u[f+2]=l>>>16&255,u[f+3]=l>>>24}function r(l,u,f){u[f]=l>>>24,u[f+1]=l>>>16&255,u[f+2]=l>>>8&255,u[f+3]=l&255}function s(l,u){return(l[u]|l[u+1]<<8|l[u+2]<<16|l[u+3]<<24)>>>0}function a(l,u){return(l[u]<<24|l[u+1]<<16|l[u+2]<<8|l[u+3])>>>0}},{}],5:[function(require,module,exports){"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}},{}],6:[function(e,t,n){"use strict";t.exports=i;function i(o,r,s){var a=s||8192,l=a>>>1,u=null,f=a;return function(p){if(p<1||p>l)return o(p);f+p>a&&(u=o(a),f=0);var g=r.call(u,f,f+=p);return f&7&&(f=(f|7)+1),g}}},{}],7:[function(e,t,n){"use strict";var i=n;i.length=function(r){for(var s=0,a=0,l=0;l<r.length;++l)a=r.charCodeAt(l),a<128?s+=1:a<2048?s+=2:(a&64512)===55296&&(r.charCodeAt(l+1)&64512)===56320?(++l,s+=4):s+=3;return s},i.read=function(r,s,a){var l=a-s;if(l<1)return"";for(var u=null,f=[],h=0,p;s<a;)p=r[s++],p<128?f[h++]=p:p>191&&p<224?f[h++]=(p&31)<<6|r[s++]&63:p>239&&p<365?(p=((p&7)<<18|(r[s++]&63)<<12|(r[s++]&63)<<6|r[s++]&63)-65536,f[h++]=55296+(p>>10),f[h++]=56320+(p&1023)):f[h++]=(p&15)<<12|(r[s++]&63)<<6|r[s++]&63,h>8191&&((u||(u=[])).push(String.fromCharCode.apply(String,f)),h=0);return u?(h&&u.push(String.fromCharCode.apply(String,f.slice(0,h))),u.join("")):String.fromCharCode.apply(String,f.slice(0,h))},i.write=function(r,s,a){for(var l=a,u,f,h=0;h<r.length;++h)u=r.charCodeAt(h),u<128?s[a++]=u:u<2048?(s[a++]=u>>6|192,s[a++]=u&63|128):(u&64512)===55296&&((f=r.charCodeAt(h+1))&64512)===56320?(u=65536+((u&1023)<<10)+(f&1023),++h,s[a++]=u>>18|240,s[a++]=u>>12&63|128,s[a++]=u>>6&63|128,s[a++]=u&63|128):(s[a++]=u>>12|224,s[a++]=u>>6&63|128,s[a++]=u&63|128);return a-l}},{}],8:[function(e,t,n){"use strict";var i=n;i.build="minimal",i.Writer=e(16),i.BufferWriter=e(17),i.Reader=e(9),i.BufferReader=e(10),i.util=e(15),i.rpc=e(12),i.roots=e(11),i.configure=o;function o(){i.util._configure(),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{10:10,11:11,12:12,15:15,16:16,17:17,9:9}],9:[function(e,t,n){"use strict";t.exports=l;var i=e(15),o,r=i.LongBits,s=i.utf8;function a(m,y){return RangeError("index out of range: "+m.pos+" + "+(y||1)+" > "+m.len)}function l(m){this.buf=m,this.pos=0,this.len=m.length}var u=typeof Uint8Array<"u"?function(y){if(y instanceof Uint8Array||Array.isArray(y))return new l(y);throw Error("illegal buffer")}:function(y){if(Array.isArray(y))return new l(y);throw Error("illegal buffer")},f=function(){return i.Buffer?function(b){return(l.create=function(A){return i.Buffer.isBuffer(A)?new o(A):u(A)})(b)}:u};l.create=f(),l.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,l.prototype.uint32=function(){var y=4294967295;return function(){if(y=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(y=(y|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(y=(y|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(y=(y|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(y=(y|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return y;if((this.pos+=5)>this.len)throw this.pos=this.len,a(this,10);return y}}(),l.prototype.int32=function(){return this.uint32()|0},l.prototype.sint32=function(){var y=this.uint32();return y>>>1^-(y&1)|0};function h(){var m=new r(0,0),y=0;if(this.len-this.pos>4){for(;y<4;++y)if(m.lo=(m.lo|(this.buf[this.pos]&127)<<y*7)>>>0,this.buf[this.pos++]<128)return m;if(m.lo=(m.lo|(this.buf[this.pos]&127)<<28)>>>0,m.hi=(m.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return m;y=0}else{for(;y<3;++y){if(this.pos>=this.len)throw a(this);if(m.lo=(m.lo|(this.buf[this.pos]&127)<<y*7)>>>0,this.buf[this.pos++]<128)return m}return m.lo=(m.lo|(this.buf[this.pos++]&127)<<y*7)>>>0,m}if(this.len-this.pos>4){for(;y<5;++y)if(m.hi=(m.hi|(this.buf[this.pos]&127)<<y*7+3)>>>0,this.buf[this.pos++]<128)return m}else for(;y<5;++y){if(this.pos>=this.len)throw a(this);if(m.hi=(m.hi|(this.buf[this.pos]&127)<<y*7+3)>>>0,this.buf[this.pos++]<128)return m}throw Error("invalid varint encoding")}l.prototype.bool=function(){return this.uint32()!==0};function p(m,y){return(m[y-4]|m[y-3]<<8|m[y-2]<<16|m[y-1]<<24)>>>0}l.prototype.fixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)},l.prototype.sfixed32=function(){if(this.pos+4>this.len)throw a(this,4);return p(this.buf,this.pos+=4)|0};function g(){if(this.pos+8>this.len)throw a(this,8);return new r(p(this.buf,this.pos+=4),p(this.buf,this.pos+=4))}l.prototype.float=function(){if(this.pos+4>this.len)throw a(this,4);var y=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,y},l.prototype.double=function(){if(this.pos+8>this.len)throw a(this,4);var y=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,y},l.prototype.bytes=function(){var y=this.uint32(),b=this.pos,x=this.pos+y;if(x>this.len)throw a(this,y);if(this.pos+=y,Array.isArray(this.buf))return this.buf.slice(b,x);if(b===x){var A=i.Buffer;return A?A.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,b,x)},l.prototype.string=function(){var y=this.bytes();return s.read(y,0,y.length)},l.prototype.skip=function(y){if(typeof y=="number"){if(this.pos+y>this.len)throw a(this,y);this.pos+=y}else do if(this.pos>=this.len)throw a(this);while(this.buf[this.pos++]&128);return this},l.prototype.skipType=function(m){switch(m){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(m=this.uint32()&7)!==4;)this.skipType(m);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+m+" at offset "+this.pos)}return this},l._configure=function(m){o=m,l.create=f(),o._configure();var y=i.Long?"toLong":"toNumber";i.merge(l.prototype,{int64:function(){return h.call(this)[y](!1)},uint64:function(){return h.call(this)[y](!0)},sint64:function(){return h.call(this).zzDecode()[y](!1)},fixed64:function(){return g.call(this)[y](!0)},sfixed64:function(){return g.call(this)[y](!1)}})}},{15:15}],10:[function(e,t,n){"use strict";t.exports=r;var i=e(9);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(s){i.call(this,s)}r._configure=function(){o.Buffer&&(r.prototype._slice=o.Buffer.prototype.slice)},r.prototype.string=function(){var a=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+a,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+a,this.len))},r._configure()},{15:15,9:9}],11:[function(e,t,n){"use strict";t.exports={}},{}],12:[function(e,t,n){"use strict";var i=n;i.Service=e(13)},{13:13}],13:[function(e,t,n){"use strict";t.exports=o;var i=e(15);(o.prototype=Object.create(i.EventEmitter.prototype)).constructor=o;function o(r,s,a){if(typeof r!="function")throw TypeError("rpcImpl must be a function");i.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!s,this.responseDelimited=!!a}o.prototype.rpcCall=function r(s,a,l,u,f){if(!u)throw TypeError("request must be specified");var h=this;if(!f)return i.asPromise(r,h,s,a,l,u);if(!h.rpcImpl)return setTimeout(function(){f(Error("already ended"))},0),undefined;try{return h.rpcImpl(s,a[h.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(g,m){if(g)return h.emit("error",g,s),f(g);if(m===null)return h.end(!0),undefined;if(!(m instanceof l))try{m=l[h.responseDelimited?"decodeDelimited":"decode"](m)}catch(y){return h.emit("error",y,s),f(y)}return h.emit("data",m,s),f(null,m)})}catch(p){return h.emit("error",p,s),setTimeout(function(){f(p)},0),undefined}},o.prototype.end=function(s){return this.rpcImpl&&(s||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{15:15}],14:[function(e,t,n){"use strict";t.exports=o;var i=e(15);function o(l,u){this.lo=l>>>0,this.hi=u>>>0}var r=o.zero=new o(0,0);r.toNumber=function(){return 0},r.zzEncode=r.zzDecode=function(){return this},r.length=function(){return 1};var s=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(u){if(u===0)return r;var f=u<0;f&&(u=-u);var h=u>>>0,p=(u-h)/4294967296>>>0;return f&&(p=~p>>>0,h=~h>>>0,++h>4294967295&&(h=0,++p>4294967295&&(p=0))),new o(h,p)},o.from=function(u){if(typeof u=="number")return o.fromNumber(u);if(i.isString(u))if(i.Long)u=i.Long.fromString(u);else return o.fromNumber(parseInt(u,10));return u.low||u.high?new o(u.low>>>0,u.high>>>0):r},o.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var f=~this.lo+1>>>0,h=~this.hi>>>0;return f||(h=h+1>>>0),-(f+h*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(u){return i.Long?new i.Long(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var a=String.prototype.charCodeAt;o.fromHash=function(u){return u===s?r:new o((a.call(u,0)|a.call(u,1)<<8|a.call(u,2)<<16|a.call(u,3)<<24)>>>0,(a.call(u,4)|a.call(u,5)<<8|a.call(u,6)<<16|a.call(u,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},o.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},o.prototype.length=function(){var u=this.lo,f=(this.lo>>>28|this.hi<<4)>>>0,h=this.hi>>>24;return h===0?f===0?u<16384?u<128?1:2:u<2097152?3:4:f<16384?f<128?5:6:f<2097152?7:8:h<128?9:10}},{15:15}],15:[function(e,t,n){"use strict";var i=n;i.asPromise=e(1),i.base64=e(2),i.EventEmitter=e(3),i.float=e(4),i.inquire=e(5),i.utf8=e(7),i.pool=e(6),i.LongBits=e(14),i.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),i.global=i.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||this,i.emptyArray=Object.freeze?Object.freeze([]):[],i.emptyObject=Object.freeze?Object.freeze({}):{},i.isInteger=Number.isInteger||function(a){return typeof a=="number"&&isFinite(a)&&Math.floor(a)===a},i.isString=function(a){return typeof a=="string"||a instanceof String},i.isObject=function(a){return a&&typeof a=="object"},i.isset=i.isSet=function(a,l){var u=a[l];return u!=null&&a.hasOwnProperty(l)?typeof u!="object"||(Array.isArray(u)?u.length:Object.keys(u).length)>0:!1},i.Buffer=function(){try{var s=i.inquire("buffer").Buffer;return s.prototype.utf8Write?s:null}catch{return null}}(),i._Buffer_from=null,i._Buffer_allocUnsafe=null,i.newBuffer=function(a){return typeof a=="number"?i.Buffer?i._Buffer_allocUnsafe(a):new i.Array(a):i.Buffer?i._Buffer_from(a):typeof Uint8Array>"u"?a:new Uint8Array(a)},i.Array=typeof Uint8Array<"u"?Uint8Array:Array,i.Long=i.global.dcodeIO&&i.global.dcodeIO.Long||i.global.Long||i.inquire("long"),i.key2Re=/^true|false|0|1$/,i.key32Re=/^-?(?:0|[1-9][0-9]*)$/,i.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,i.longToHash=function(a){return a?i.LongBits.from(a).toHash():i.LongBits.zeroHash},i.longFromHash=function(a,l){var u=i.LongBits.fromHash(a);return i.Long?i.Long.fromBits(u.lo,u.hi,l):u.toNumber(!!l)};function o(s,a,l){for(var u=Object.keys(a),f=0;f<u.length;++f)(s[u[f]]===undefined||!l)&&(s[u[f]]=a[u[f]]);return s}i.merge=o,i.lcFirst=function(a){return a.charAt(0).toLowerCase()+a.substring(1)};function r(s){function a(l,u){if(!(this instanceof a))return new a(l,u);Object.defineProperty(this,"message",{get:function(){return l}}),Error.captureStackTrace?Error.captureStackTrace(this,a):Object.defineProperty(this,"stack",{value:new Error().stack||""}),u&&o(this,u)}return a.prototype=Object.create(Error.prototype,{constructor:{value:a,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return s},set:undefined,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),a}i.newError=r,i.ProtocolError=r("ProtocolError"),i.oneOfGetter=function(a){for(var l={},u=0;u<a.length;++u)l[a[u]]=1;return function(){for(var f=Object.keys(this),h=f.length-1;h>-1;--h)if(l[f[h]]===1&&this[f[h]]!==undefined&&this[f[h]]!==null)return f[h]}},i.oneOfSetter=function(a){return function(l){for(var u=0;u<a.length;++u)a[u]!==l&&delete this[a[u]]}},i.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},i._configure=function(){var s=i.Buffer;if(!s){i._Buffer_from=i._Buffer_allocUnsafe=null;return}i._Buffer_from=s.from!==Uint8Array.from&&s.from||function(l,u){return new s(l,u)},i._Buffer_allocUnsafe=s.allocUnsafe||function(l){return new s(l)}}},{1:1,14:14,2:2,3:3,4:4,5:5,6:6,7:7}],16:[function(e,t,n){"use strict";t.exports=h;var i=e(15),o,r=i.LongBits,s=i.base64,a=i.utf8;function l(E,S,v){this.fn=E,this.len=S,this.next=undefined,this.val=v}function u(){}function f(E){this.head=E.head,this.tail=E.tail,this.len=E.len,this.next=E.states}function h(){this.len=0,this.head=new l(u,0,0),this.tail=this.head,this.states=null}var p=function(){return i.Buffer?function(){return(h.create=function(){return new o})()}:function(){return new h}};h.create=p(),h.alloc=function(S){return new i.Array(S)},i.Array!==Array&&(h.alloc=i.pool(h.alloc,i.Array.prototype.subarray)),h.prototype._push=function(S,v,P){return this.tail=this.tail.next=new l(S,v,P),this.len+=v,this};function g(E,S,v){S[v]=E&255}function m(E,S,v){for(;E>127;)S[v++]=E&127|128,E>>>=7;S[v]=E}function y(E,S){this.len=E,this.next=undefined,this.val=S}y.prototype=Object.create(l.prototype),y.prototype.fn=m,h.prototype.uint32=function(S){return this.len+=(this.tail=this.tail.next=new y((S=S>>>0)<128?1:S<16384?2:S<2097152?3:S<268435456?4:5,S)).len,this},h.prototype.int32=function(S){return S<0?this._push(b,10,r.fromNumber(S)):this.uint32(S)},h.prototype.sint32=function(S){return this.uint32((S<<1^S>>31)>>>0)};function b(E,S,v){for(;E.hi;)S[v++]=E.lo&127|128,E.lo=(E.lo>>>7|E.hi<<25)>>>0,E.hi>>>=7;for(;E.lo>127;)S[v++]=E.lo&127|128,E.lo=E.lo>>>7;S[v++]=E.lo}h.prototype.uint64=function(S){var v=r.from(S);return this._push(b,v.length(),v)},h.prototype.int64=h.prototype.uint64,h.prototype.sint64=function(S){var v=r.from(S).zzEncode();return this._push(b,v.length(),v)},h.prototype.bool=function(S){return this._push(g,1,S?1:0)};function x(E,S,v){S[v]=E&255,S[v+1]=E>>>8&255,S[v+2]=E>>>16&255,S[v+3]=E>>>24}h.prototype.fixed32=function(S){return this._push(x,4,S>>>0)},h.prototype.sfixed32=h.prototype.fixed32,h.prototype.fixed64=function(S){var v=r.from(S);return this._push(x,4,v.lo)._push(x,4,v.hi)},h.prototype.sfixed64=h.prototype.fixed64,h.prototype.float=function(S){return this._push(i.float.writeFloatLE,4,S)},h.prototype.double=function(S){return this._push(i.float.writeDoubleLE,8,S)};var A=i.Array.prototype.set?function(S,v,P){v.set(S,P)}:function(S,v,P){for(var M=0;M<S.length;++M)v[P+M]=S[M]};h.prototype.bytes=function(S){var v=S.length>>>0;if(!v)return this._push(g,1,0);if(i.isString(S)){var P=h.alloc(v=s.length(S));s.decode(S,P,0),S=P}return this.uint32(v)._push(A,v,S)},h.prototype.string=function(S){var v=a.length(S);return v?this.uint32(v)._push(a.write,v,S):this._push(g,1,0)},h.prototype.fork=function(){return this.states=new f(this),this.head=this.tail=new l(u,0,0),this.len=0,this},h.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new l(u,0,0),this.len=0),this},h.prototype.ldelim=function(){var S=this.head,v=this.tail,P=this.len;return this.reset().uint32(P),P&&(this.tail.next=S.next,this.tail=v,this.len+=P),this},h.prototype.finish=function(){for(var S=this.head.next,v=this.constructor.alloc(this.len),P=0;S;)S.fn(S.val,v,P),P+=S.len,S=S.next;return v},h._configure=function(E){o=E,h.create=p(),o._configure()}},{15:15}],17:[function(e,t,n){"use strict";t.exports=r;var i=e(16);(r.prototype=Object.create(i.prototype)).constructor=r;var o=e(15);function r(){i.call(this)}r._configure=function(){r.alloc=o._Buffer_allocUnsafe,r.writeBytesBuffer=o.Buffer&&o.Buffer.prototype instanceof Uint8Array&&o.Buffer.prototype.set.name==="set"?function(l,u,f){u.set(l,f)}:function(l,u,f){if(l.copy)l.copy(u,f,0,l.length);else for(var h=0;h<l.length;)u[f++]=l[h++]}},r.prototype.bytes=function(l){o.isString(l)&&(l=o._Buffer_from(l,"base64"));var u=l.length>>>0;return this.uint32(u),u&&this._push(r.writeBytesBuffer,u,l),this};function s(a,l,u){a.length<40?o.utf8.write(a,l,u):l.utf8Write?l.utf8Write(a,u):l.write(a,u)}r.prototype.string=function(l){var u=o.Buffer.byteLength(l);return this.uint32(u),u&&this._push(s,u,l),this},r._configure()},{15:15,16:16}]},{},[8])})()});var BAe=Wu((A9i,OH)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(f,h){h=h||{};var p=h.encodedMaskData||h.encodedMaskData===null,g=l(f,h.inputOffset||0,p),m=h.noDataValue!==null?h.noDataValue:o.defaultNoDataValue,y=r(g,h.pixelType||Float32Array,h.encodedMaskData,m,h.returnMask),b={width:g.width,height:g.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:g.pixels.maxValue,noDataValue:m};return y.resultMask&&(b.maskData=y.resultMask),h.returnEncodedMask&&g.mask&&(b.encodedMaskData=g.mask.bitset?g.mask.bitset:null),h.returnFileInfo&&(b.fileInfo=s(g),h.computeUsedBitDepths&&(b.fileInfo.bitDepths=a(g))),b};var r=function(f,h,p,g,m){var y=0,b=f.pixels.numBlocksX,x=f.pixels.numBlocksY,A=Math.floor(f.width/b),E=Math.floor(f.height/x),S=2*f.maxZError,v=Number.MAX_VALUE,P;p=p||(f.mask?f.mask.bitset:null);var M,R;M=new h(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var L=new Float32Array(A*E),B,_,w=0;w<=x;w++){var D=w!==x?E:f.height%x;if(D!==0)for(var I=0;I<=b;I++){var N=I!==b?A:f.width%b;if(N!==0){var k=w*f.width*E+I*A,H=f.width-N,V=f.pixels.blocks[y],j,U,q;V.encoding<2?(V.encoding===0?j=V.rawData:(u(V.stuffedData,V.bitsPerPixel,V.numValidPixels,V.offset,S,L,f.pixels.maxValue),j=L),U=0):V.encoding===2?q=0:q=V.offset;var X;if(p)for(_=0;_<D;_++){for(k&7&&(X=p[k>>3],X<<=k&7),B=0;B<N;B++)k&7||(X=p[k>>3]),X&128?(R&&(R[k]=1),P=V.encoding<2?j[U++]:q,v=v>P?P:v,M[k++]=P):(R&&(R[k]=0),M[k++]=g),X<<=1;k+=H}else if(V.encoding<2)for(_=0;_<D;_++){for(B=0;B<N;B++)P=j[U++],v=v>P?P:v,M[k++]=P;k+=H}else for(v=v>q?q:v,_=0;_<D;_++){for(B=0;B<N;B++)M[k++]=q;k+=H}if(V.encoding===1&&U!==V.numValidPixels)throw"Block and Mask do not match";y++}}}return{resultPixels:M,resultMask:R,minValue:v}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var h=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<h;g++){var m=f.pixels.blocks[g];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},l=function(f,h,p){var g={},m=new Uint8Array(f,h,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,m),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;h+=10;var y=new DataView(f,h,24);if(g.fileVersion=y.getInt32(0,!0),g.imageType=y.getInt32(4,!0),g.height=y.getUint32(8,!0),g.width=y.getUint32(12,!0),g.maxZError=y.getFloat64(16,!0),h+=24,!p)if(y=new DataView(f,h,16),g.mask={},g.mask.numBlocksY=y.getUint32(0,!0),g.mask.numBlocksX=y.getUint32(4,!0),g.mask.numBytes=y.getUint32(8,!0),g.mask.maxValue=y.getFloat32(12,!0),h+=16,g.mask.numBytes>0){var b=new Uint8Array(Math.ceil(g.width*g.height/8));y=new DataView(f,h,g.mask.numBytes);var x=y.getInt16(0,!0),A=2,E=0;do{if(x>0)for(;x--;)b[E++]=y.getUint8(A++);else{var S=y.getUint8(A++);for(x=-x;x--;)b[E++]=S}x=y.getInt16(A,!0),A+=2}while(A<g.mask.numBytes);if(x!==-32768||E<b.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=b,h+=g.mask.numBytes}else g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue||(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));y=new DataView(f,h,16),g.pixels={},g.pixels.numBlocksY=y.getUint32(0,!0),g.pixels.numBlocksX=y.getUint32(4,!0),g.pixels.numBytes=y.getUint32(8,!0),g.pixels.maxValue=y.getFloat32(12,!0),h+=16;var v=g.pixels.numBlocksX,P=g.pixels.numBlocksY,M=v+(g.width%v>0?1:0),R=P+(g.height%P>0?1:0);g.pixels.blocks=new Array(M*R);for(var L=0,B=0;B<R;B++)for(var _=0;_<M;_++){var w=0,D=f.byteLength-h;y=new DataView(f,h,Math.min(10,D));var I={};g.pixels.blocks[L++]=I;var N=y.getUint8(0);if(w++,I.encoding=N&63,I.encoding>3)throw"Invalid block encoding ("+I.encoding+")";if(I.encoding===2){h++;continue}if(N!==0&&N!==2){if(N>>=6,I.offsetType=N,N===2)I.offset=y.getInt8(1),w++;else if(N===1)I.offset=y.getInt16(1,!0),w+=2;else if(N===0)I.offset=y.getFloat32(1,!0),w+=4;else throw"Invalid block offset type";if(I.encoding===1)if(N=y.getUint8(w),w++,I.bitsPerPixel=N&63,N>>=6,I.numValidPixelsType=N,N===2)I.numValidPixels=y.getUint8(w),w++;else if(N===1)I.numValidPixels=y.getUint16(w,!0),w+=2;else if(N===0)I.numValidPixels=y.getUint32(w,!0),w+=4;else throw"Invalid valid pixel count type"}if(h+=w,I.encoding!==3){var k,H;if(I.encoding===0){var V=(g.pixels.numBytes-1)/4;if(V!==Math.floor(V))throw"uncompressed block has invalid length";k=new ArrayBuffer(V*4),H=new Uint8Array(k),H.set(new Uint8Array(f,h,V*4));var j=new Float32Array(k);I.rawData=j,h+=V*4}else if(I.encoding===1){var U=Math.ceil(I.numValidPixels*I.bitsPerPixel/8),q=Math.ceil(U/4);k=new ArrayBuffer(q*4),H=new Uint8Array(k),H.set(new Uint8Array(f,h,U)),I.stuffedData=new Uint32Array(k),h+=U}}}return g.eofOffset=h,g},u=function(f,h,p,g,m,y,b){var x=(1<<h)-1,A=0,E,S=0,v,P,M=Math.ceil((b-g)/m),R=f.length*4-Math.ceil(h*p/8);for(f[f.length-1]<<=8*R,E=0;E<p;E++){if(S===0&&(P=f[A++],S=32),S>=h)v=P>>>S-h&x,S-=h;else{var L=h-S;v=(P&x)<<L&x,P=f[A++],S=32-L,v+=P>>>S}y[E]=v<M?g+v*m:b}return y};return o}(),t=function(){"use strict";var o={unstuff:function(l,u,f,h,p,g,m,y){var b=(1<<f)-1,x=0,A,E=0,S,v,P,M,R=l.length*4-Math.ceil(f*h/8);if(l[l.length-1]<<=8*R,p)for(A=0;A<h;A++)E===0&&(v=l[x++],E=32),E>=f?(S=v>>>E-f&b,E-=f):(P=f-E,S=(v&b)<<P&b,v=l[x++],E=32-P,S+=v>>>E),u[A]=p[S];else for(M=Math.ceil((y-g)/m),A=0;A<h;A++)E===0&&(v=l[x++],E=32),E>=f?(S=v>>>E-f&b,E-=f):(P=f-E,S=(v&b)<<P&b,v=l[x++],E=32-P,S+=v>>>E),u[A]=S<M?g+S*m:y},unstuffLUT:function(l,u,f,h,p,g){var m=(1<<u)-1,y=0,b=0,x=0,A=0,E=0,S,v=[],P=l.length*4-Math.ceil(u*f/8);l[l.length-1]<<=8*P;var M=Math.ceil((g-h)/p);for(b=0;b<f;b++)A===0&&(S=l[y++],A=32),A>=u?(E=S>>>A-u&m,A-=u):(x=u-A,E=(S&m)<<x&m,S=l[y++],A=32-x,E+=S>>>A),v[b]=E<M?h+E*p:g;return v.unshift(h),v},unstuff2:function(l,u,f,h,p,g,m,y){var b=(1<<f)-1,x=0,A,E=0,S=0,v,P,M;if(p)for(A=0;A<h;A++)E===0&&(P=l[x++],E=32,S=0),E>=f?(v=P>>>S&b,E-=f,S+=f):(M=f-E,v=P>>>S&b,P=l[x++],E=32-M,v|=(P&(1<<M)-1)<<f-M,S=M),u[A]=p[v];else{var R=Math.ceil((y-g)/m);for(A=0;A<h;A++)E===0&&(P=l[x++],E=32,S=0),E>=f?(v=P>>>S&b,E-=f,S+=f):(M=f-E,v=P>>>S&b,P=l[x++],E=32-M,v|=(P&(1<<M)-1)<<f-M,S=M),u[A]=v<R?g+v*m:y}return u},unstuffLUT2:function(l,u,f,h,p,g){var m=(1<<u)-1,y=0,b=0,x=0,A=0,E=0,S=0,v,P=[],M=Math.ceil((g-h)/p);for(b=0;b<f;b++)A===0&&(v=l[y++],A=32,S=0),A>=u?(E=v>>>S&m,A-=u,S+=u):(x=u-A,E=v>>>S&m,v=l[y++],A=32-x,E|=(v&(1<<x)-1)<<u-x,S=x),P[b]=E<M?h+E*p:g;return P.unshift(h),P},originalUnstuff:function(l,u,f,h){var p=(1<<f)-1,g=0,m,y=0,b,x,A,E=l.length*4-Math.ceil(f*h/8);for(l[l.length-1]<<=8*E,m=0;m<h;m++)y===0&&(x=l[g++],y=32),y>=f?(b=x>>>y-f&p,y-=f):(A=f-y,b=(x&p)<<A&p,x=l[g++],y=32-A,b+=x>>>y),u[m]=b;return u},originalUnstuff2:function(l,u,f,h){var p=(1<<f)-1,g=0,m,y=0,b=0,x,A,E;for(m=0;m<h;m++)y===0&&(A=l[g++],y=32,b=0),y>=f?(x=A>>>b&p,y-=f,b+=f):(E=f-y,x=A>>>b&p,A=l[g++],y=32-E,x|=(A&(1<<E)-1)<<f-E,b=E),u[m]=x;return u}},r={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(l){for(var u=65535,f=65535,h=l.length,p=Math.floor(h/2),g=0;p;){var m=p>=359?359:p;p-=m;do u+=l[g++]<<8,f+=u+=l[g++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return h&1&&(f+=u+=l[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(l,u){var f=u.ptr,h=new Uint8Array(l,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,h),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(l,f,8),m=g.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(l,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,m>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(l,f,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var y,b;if(m>=3&&(b=m>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(l,f-b,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(l,u){var f=u.headerInfo,h=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(l,u.ptr,h,p),m=this.readSubArray(l,u.ptr+p,h,p);u.ptr+=2*p;var y,b=!0;for(y=0;y<f.numDims;y++)if(g[y]!==m[y]){b=!1;break}return f.minValues=g,f.maxValues=m,b},readSubArray:function(l,u,f,h){var p;if(f===Uint8Array)p=new Uint8Array(l,u,h);else{var g=new ArrayBuffer(h),m=new Uint8Array(g);m.set(new Uint8Array(l,u,h)),p=new f(g)}return p},readMask:function(l,u){var f=u.ptr,h=u.headerInfo,p=h.width*h.height,g=h.numValidPixel,m=new DataView(l,f,4),y={};if(y.numBytes=m.getUint32(0,!0),f+=4,(g===0||p===g)&&y.numBytes!==0)throw"invalid mask";var b,x;if(g===0)b=new Uint8Array(Math.ceil(p/8)),y.bitset=b,x=new Uint8Array(p),u.pixels.resultMask=x,f+=y.numBytes;else if(y.numBytes>0){b=new Uint8Array(Math.ceil(p/8)),m=new DataView(l,f,y.numBytes);var A=m.getInt16(0,!0),E=2,S=0,v=0;do{if(A>0)for(;A--;)b[S++]=m.getUint8(E++);else for(v=m.getUint8(E++),A=-A;A--;)b[S++]=v;A=m.getInt16(E,!0),E+=2}while(E<y.numBytes);if(A!==-32768||S<b.length)throw"Unexpected end of mask RLE encoding";x=new Uint8Array(p);var P=0,M=0;for(M=0;M<p;M++)M&7?(P=b[M>>3],P<<=M&7):P=b[M>>3],P&128&&(x[M]=1);u.pixels.resultMask=x,y.bitset=b,f+=y.numBytes}return u.ptr=f,u.mask=y,!0},readDataOneSweep:function(l,u,f){var h=u.ptr,p=u.headerInfo,g=p.numDims,m=p.width*p.height,y=p.imageType,b=p.numValidPixel*r.getDataTypeSize(y)*g,x,A=u.pixels.resultMask;if(f===Uint8Array)x=new Uint8Array(l,h,b);else{var E=new ArrayBuffer(b),S=new Uint8Array(E);S.set(new Uint8Array(l,h,b)),x=new f(E)}if(x.length===m*g)u.pixels.resultPixels=x;else{u.pixels.resultPixels=new f(m*g);var v=0,P=0,M=0,R=0;if(g>1)for(M=0;M<g;M++)for(R=M*m,P=0;P<m;P++)A[P]&&(u.pixels.resultPixels[R+P]=x[v++]);else for(P=0;P<m;P++)A[P]&&(u.pixels.resultPixels[P]=x[v++])}return h+=b,u.ptr=h,!0},readHuffmanTree:function(l,u){var f=this.HUFFMAN_LUT_BITS_MAX,h=new DataView(l,u.ptr,16);u.ptr+=16;var p=h.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=h.getInt32(4,!0),m=h.getInt32(8,!0),y=h.getInt32(12,!0);if(m>=y)return!1;var b=new Uint32Array(y-m);r.decodeBits(l,u,b);var x=[],A,E,S,v;for(A=m;A<y;A++)E=A-(A<g?0:g),x[E]={first:b[A-m],second:null};var P=l.byteLength-u.ptr,M=Math.ceil(P/4),R=new ArrayBuffer(M*4),L=new Uint8Array(R);L.set(new Uint8Array(l,u.ptr,P));var B=new Uint32Array(R),_=0,w,D=0;for(w=B[0],A=m;A<y;A++)E=A-(A<g?0:g),v=x[E].first,v>0&&(x[E].second=w<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,D++,w=B[D])):(_+=v-32,D++,w=B[D],x[E].second|=w>>>32-_));var I=0,N=0,k=new s;for(A=0;A<x.length;A++)x[A]!==void 0&&(I=Math.max(I,x[A].first));I>=f?N=f:N=I,I>=30&&console.log("WARning, large NUM LUT BITS IS "+I);var H=[],V,j,U,q,X,te;for(A=m;A<y;A++)if(E=A-(A<g?0:g),v=x[E].first,v>0)if(V=[v,E],v<=N)for(j=x[E].second<<N-v,U=1<<N-v,S=0;S<U;S++)H[j|S]=V;else for(j=x[E].second,te=k,q=v-1;q>=0;q--)X=j>>>q&1,X?(te.right||(te.right=new s),te=te.right):(te.left||(te.left=new s),te=te.left),q===0&&!te.val&&(te.val=V[1]);return{decodeLut:H,numBitsLUTQick:N,numBitsLUT:I,tree:k,stuffedData:B,srcPtr:D,bitPos:_}},readHuffman:function(l,u,f){var h=u.headerInfo,p=h.numDims,g=u.headerInfo.height,m=u.headerInfo.width,y=m*g,b=this.readHuffmanTree(l,u),x=b.decodeLut,A=b.tree,E=b.stuffedData,S=b.srcPtr,v=b.bitPos,P=b.numBitsLUTQick,M=b.numBitsLUT,R=u.headerInfo.imageType===0?128:0,L,B,_,w=u.pixels.resultMask,D,I,N,k,H,V,j,U=0;v>0&&(S++,v=0);var q=E[S],X=u.encodeMode===1,te=new f(y*p),K=te,Z;for(Z=0;Z<h.numDims;Z++){if(p>1&&(K=new f(te.buffer,y*Z,y),U=0),u.headerInfo.numValidPixel===m*g)for(V=0,k=0;k<g;k++)for(H=0;H<m;H++,V++){if(B=0,D=q<<v>>>32-P,I=D,32-v<P&&(D|=E[S+1]>>>64-v-P,I=D),x[I])B=x[I][1],v+=x[I][0];else for(D=q<<v>>>32-M,I=D,32-v<M&&(D|=E[S+1]>>>64-v-M,I=D),L=A,j=0;j<M;j++)if(N=D>>>M-j-1&1,L=N?L.right:L.left,!(L.left||L.right)){B=L.val,v=v+j+1;break}v>=32&&(v-=32,S++,q=E[S]),_=B-R,X?(H>0?_+=U:k>0?_+=K[V-m]:_+=U,_&=255,K[V]=_,U=_):K[V]=_}else for(V=0,k=0;k<g;k++)for(H=0;H<m;H++,V++)if(w[V]){if(B=0,D=q<<v>>>32-P,I=D,32-v<P&&(D|=E[S+1]>>>64-v-P,I=D),x[I])B=x[I][1],v+=x[I][0];else for(D=q<<v>>>32-M,I=D,32-v<M&&(D|=E[S+1]>>>64-v-M,I=D),L=A,j=0;j<M;j++)if(N=D>>>M-j-1&1,L=N?L.right:L.left,!(L.left||L.right)){B=L.val,v=v+j+1;break}v>=32&&(v-=32,S++,q=E[S]),_=B-R,X?(H>0&&w[V-1]?_+=U:k>0&&w[V-m]?_+=K[V-m]:_+=U,_&=255,K[V]=_,U=_):K[V]=_}u.ptr=u.ptr+(S+1)*4+(v>0?4:0)}u.pixels.resultPixels=te},decodeBits:function(l,u,f,h,p){{var g=u.headerInfo,m=g.fileVersion,y=0,b=new DataView(l,u.ptr,5),x=b.getUint8(0);y++;var A=x>>6,E=A===0?4:3-A,S=(x&32)>0,v=x&31,P=0;if(E===1)P=b.getUint8(y),y++;else if(E===2)P=b.getUint16(y,!0),y+=2;else if(E===4)P=b.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var M=2*g.maxZError,R,L,B,_,w,D,I,N,k,H,V=g.numDims>1?g.maxValues[p]:g.zMax;if(S){for(u.counter.lut++,N=b.getUint8(y),k=v,y++,_=Math.ceil((N-1)*v/8),w=Math.ceil(_/4),L=new ArrayBuffer(w*4),B=new Uint8Array(L),u.ptr+=y,B.set(new Uint8Array(l,u.ptr,_)),I=new Uint32Array(L),u.ptr+=_,H=0;N-1>>>H;)H++;_=Math.ceil(P*H/8),w=Math.ceil(_/4),L=new ArrayBuffer(w*4),B=new Uint8Array(L),B.set(new Uint8Array(l,u.ptr,_)),R=new Uint32Array(L),u.ptr+=_,m>=3?D=o.unstuffLUT2(I,v,N-1,h,M,V):D=o.unstuffLUT(I,v,N-1,h,M,V),m>=3?o.unstuff2(R,f,H,P,D):o.unstuff(R,f,H,P,D)}else u.counter.bitstuffer++,H=v,u.ptr+=y,H>0&&(_=Math.ceil(P*H/8),w=Math.ceil(_/4),L=new ArrayBuffer(w*4),B=new Uint8Array(L),B.set(new Uint8Array(l,u.ptr,_)),R=new Uint32Array(L),u.ptr+=_,m>=3?h==null?o.originalUnstuff2(R,f,H,P):o.unstuff2(R,f,H,P,!1,h,M,V):h==null?o.originalUnstuff(R,f,H,P):o.unstuff(R,f,H,P,!1,h,M,V))}},readTiles:function(l,u,f){var h=u.headerInfo,p=h.width,g=h.height,m=h.microBlockSize,y=h.imageType,b=r.getDataTypeSize(y),x=Math.ceil(p/m),A=Math.ceil(g/m);u.pixels.numBlocksY=A,u.pixels.numBlocksX=x,u.pixels.ptr=0;var E=0,S=0,v=0,P=0,M=0,R=0,L=0,B=0,_=0,w=0,D=0,I=0,N=0,k=0,H=0,V=0,j,U,q,X,te,K,Z=new f(m*m),ee=g%m||m,me=p%m||m,xe,ue,ye=h.numDims,Ae,Pe=u.pixels.resultMask,Ee=u.pixels.resultPixels;for(v=0;v<A;v++)for(M=v!==A-1?m:ee,P=0;P<x;P++)for(R=P!==x-1?m:me,D=v*p*m+P*m,I=p-R,Ae=0;Ae<ye;Ae++){if(ye>1&&(Ee=new f(u.pixels.resultPixels.buffer,p*g*Ae*b,p*g)),L=l.byteLength-u.ptr,j=new DataView(l,u.ptr,Math.min(10,L)),U={},V=0,B=j.getUint8(0),V++,_=B>>6&255,w=B>>2&15,w!==(P*m>>3&15))throw"integrity issue";if(K=B&3,K>3)throw u.ptr+=V,"Invalid block encoding ("+K+")";if(K===2){u.counter.constant++,u.ptr+=V;continue}else if(K===0){if(u.counter.uncompressed++,u.ptr+=V,N=M*R*b,k=l.byteLength-u.ptr,N=N<k?N:k,q=new ArrayBuffer(N%b===0?N:N+b-N%b),X=new Uint8Array(q),X.set(new Uint8Array(l,u.ptr,N)),te=new f(q),H=0,Pe)for(E=0;E<M;E++){for(S=0;S<R;S++)Pe[D]&&(Ee[D]=te[H++]),D++;D+=I}else for(E=0;E<M;E++){for(S=0;S<R;S++)Ee[D++]=te[H++];D+=I}u.ptr+=H*b}else if(xe=r.getDataTypeUsed(y,_),ue=r.getOnePixel(U,V,xe,j),V+=r.getDataTypeSize(xe),K===3)if(u.ptr+=V,u.counter.constantoffset++,Pe)for(E=0;E<M;E++){for(S=0;S<R;S++)Pe[D]&&(Ee[D]=ue),D++;D+=I}else for(E=0;E<M;E++){for(S=0;S<R;S++)Ee[D++]=ue;D+=I}else if(u.ptr+=V,r.decodeBits(l,u,Z,ue,Ae),V=0,Pe)for(E=0;E<M;E++){for(S=0;S<R;S++)Pe[D]&&(Ee[D]=Z[V++]),D++;D+=I}else for(E=0;E<M;E++){for(S=0;S<R;S++)Ee[D++]=Z[V++];D+=I}}},formatFileInfo:function(l){return{fileIdentifierString:l.headerInfo.fileIdentifierString,fileVersion:l.headerInfo.fileVersion,imageType:l.headerInfo.imageType,height:l.headerInfo.height,width:l.headerInfo.width,numValidPixel:l.headerInfo.numValidPixel,microBlockSize:l.headerInfo.microBlockSize,blobSize:l.headerInfo.blobSize,maxZError:l.headerInfo.maxZError,pixelType:r.getPixelType(l.headerInfo.imageType),eofOffset:l.eofOffset,mask:l.mask?{numBytes:l.mask.numBytes}:null,pixels:{numBlocksX:l.pixels.numBlocksX,numBlocksY:l.pixels.numBlocksY,maxValue:l.headerInfo.zMax,minValue:l.headerInfo.zMin,noDataValue:l.noDataValue}}},constructConstantSurface:function(l){var u=l.headerInfo.zMax,f=l.headerInfo.numDims,h=l.headerInfo.height*l.headerInfo.width,p=h*f,g=0,m=0,y=0,b=l.pixels.resultMask;if(b)if(f>1)for(g=0;g<f;g++)for(y=g*h,m=0;m<h;m++)b[m]&&(l.pixels.resultPixels[y+m]=u);else for(m=0;m<h;m++)b[m]&&(l.pixels.resultPixels[m]=u);else if(l.pixels.resultPixels.fill)l.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)l.pixels.resultPixels[m]=u},getDataTypeArray:function(l){var u;switch(l){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(l){var u;switch(l){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(l,u){if(u==null)return!1;var f;switch(l){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(l){var u=0;switch(l){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=l}return u},getDataTypeUsed:function(l,u){var f=l;switch(l){case 2:case 4:f=l-u;break;case 3:case 5:f=l-2*u;break;case 6:u===0?f=l:u===1?f=2:f=1;break;case 7:u===0?f=l:f=l-2*u+1;break;default:f=l;break}return f},getOnePixel:function(l,u,f,h){var p=0;switch(f){case 0:p=h.getInt8(u);break;case 1:p=h.getUint8(u);break;case 2:p=h.getInt16(u,!0);break;case 3:p=h.getUint16(u,!0);break;case 4:p=h.getInt32(u,!0);break;case 5:p=h.getUInt32(u,!0);break;case 6:p=h.getFloat32(u,!0);break;case 7:p=h.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(l,u,f){this.val=l,this.left=u,this.right=f},a={decode:function(l,u){u=u||{};var f=u.noDataValue,h=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!r.readHeaderInfo(l,p)){var g=p.headerInfo,m=g.fileVersion,y=r.getDataTypeArray(g.imageType);r.readMask(l,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var b=g.width*g.height;if(p.pixels.resultPixels=new y(b*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)r.constructConstantSurface(p);else if(m>=4&&r.checkMinMaxRanges(l,p))r.constructConstantSurface(p);else{var x=new DataView(l,p.ptr,2),A=x.getUint8(0);if(p.ptr++,A)r.readDataOneSweep(l,p,y);else if(m>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var E=x.getUint8(1);if(p.ptr++,p.encodeMode=E,E>2||m<4&&E>1)throw"Invalid Huffman flag "+E;E?r.readHuffman(l,p,y):r.readTiles(l,p,y)}else r.readTiles(l,p,y)}p.eofOffset=p.ptr;var S;u.inputOffset?(S=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(S)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(S=p.headerInfo.blobSize-p.ptr,Math.abs(S)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(g.imageType,f)){var P=p.pixels.resultMask;for(h=0;h<b;h++)P[h]||(v.pixelData[h]=f);v.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(v.fileInfo=r.formatFileInfo(p)),v}},getBandCount:function(l){var u=0,f=0,h={};for(h.ptr=0,h.pixels={};f<l.byteLength-58;)r.readHeaderInfo(l,h),f+=h.headerInfo.blobSize,u++,h.ptr=f;return u}};return a}(),n=function(){var o=new ArrayBuffer(4),r=new Uint8Array(o),s=new Uint32Array(o);return s[0]=1,r[0]===1}(),i={decode:function(o,r){if(!n)throw"Big endian system is not supported.";r=r||{};var s=r.inputOffset||0,a=new Uint8Array(o,s,10),l=String.fromCharCode.apply(null,a),u,f;if(l.trim()==="CntZImage")u=e,f=1;else if(l.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+l;for(var h=0,p=o.byteLength-10,g,m=[],y,b,x={width:0,height:0,pixels:[],pixelType:r.pixelType,mask:null,statistics:[]};s<p;){var A=u.decode(o,{inputOffset:s,encodedMaskData:g,maskData:b,returnMask:h===0,returnEncodedMask:h===0,returnFileInfo:!0,pixelType:r.pixelType||null,noDataValue:r.noDataValue||null});s=A.fileInfo.eofOffset,h===0&&(g=A.encodedMaskData,b=A.maskData,x.width=A.width,x.height=A.height,x.dimCount=A.dimCount||1,x.pixelType=A.pixelType||A.fileInfo.pixelType,x.mask=A.maskData),f>1&&A.fileInfo.mask&&A.fileInfo.mask.numBytes>0&&m.push(A.maskData),h++,x.pixels.push(A.pixelData),x.statistics.push({minValue:A.minValue,maxValue:A.maxValue,noDataValue:A.noDataValue,dimStats:A.dimStats})}var E,S,v;if(f>1&&m.length>1){for(v=x.width*x.height,x.bandMasks=m,b=new Uint8Array(v),b.set(m[0]),E=1;E<m.length;E++)for(y=m[E],S=0;S<v;S++)b[S]=b[S]&y[S];x.maskData=b}return x}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof OH<"u"&&OH.exports?OH.exports=i:this.Lerc=i})()});var qCe=Wu((M_o,WCe)=>{WCe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eBAnPFgQKcgQAitZyDdW5khohBX1ZPUkJJU4OBAuEBAAAAAAAAEZ+BArWIQOdwAAAAAABiZIEgY6JPbwIeVgF2b3JiaXMAAAAAAoC7AAAAAAAAgLUBAAAAAAC4AQN2b3JiaXMtAAAAWGlwaC5PcmcgbGliVm9yYmlzIEkgMjAxMDExMDEgKFNjaGF1ZmVudWdnZXQpAQAAABUAAABlbmNvZGVyPUxhdmM1NS41Mi4xMDIBBXZvcmJpcyVCQ1YBAEAAACRzGCpGpXMWhBAaQlAZ4xxCzmvsGUJMEYIcMkxbyyVzkCGkoEKIWyiB0JBVAABAAACHQXgUhIpBCCGEJT1YkoMnPQghhIg5eBSEaUEIIYQQQgghhBBCCCGERTlokoMnQQgdhOMwOAyD5Tj4HIRFOVgQgydB6CCED0K4moOsOQghhCQ1SFCDBjnoHITCLCiKgsQwuBaEBDUojILkMMjUgwtCiJqDSTX4GoRnQXgWhGlBCCGEJEFIkIMGQcgYhEZBWJKDBjm4FITLQagahCo5CB+EIDRkFQCQAACgoiiKoigKEBqyCgDIAAAQQFEUx3EcyZEcybEcCwgNWQUAAAEACAAAoEiKpEiO5EiSJFmSJVmSJVmS5omqLMuyLMuyLMsyEBqyCgBIAABQUQxFcRQHCA1ZBQBkAAAIoDiKpViKpWiK54iOCISGrAIAgAAABAAAEDRDUzxHlETPVFXXtm3btm3btm3btm3btm1blmUZCA1ZBQBAAAAQ0mlmqQaIMAMZBkJDVgEACAAAgBGKMMSA0JBVAABAAACAGEoOogmtOd+c46BZDppKsTkdnEi1eZKbirk555xzzsnmnDHOOeecopxZDJoJrTnnnMSgWQqaCa0555wnsXnQmiqtOeeccc7pYJwRxjnnnCateZCajbU555wFrWmOmkuxOeecSLl5UptLtTnnnHPOOeecc84555zqxekcnBPOOeecqL25lpvQxTnnnE/G6d6cEM4555xzzjnnnHPOOeecIDRkFQAABABAEIaNYdwpCNLnaCBGEWIaMulB9+gwCRqDnELq0ehopJQ6CCWVcVJKJwgNWQUAAAIAQAghhRRSSCGFFFJIIYUUYoghhhhyyimnoIJKKqmooowyyyyzzDLLLLPMOuyssw47DDHEEEMrrcRSU2011lhr7jnnmoO0VlprrbVSSimllFIKQkNWAQAgAAAEQgYZZJBRSCGFFGKIKaeccgoqqIDQkFUAACAAgAAAAABP8hzRER3RER3RER3RER3R8RzPESVREiVREi3TMjXTU0VVdWXXlnVZt31b2IVd933d933d+HVhWJZlWZZlWZZlWZZlWZZlWZYgNGQVAAACAAAghBBCSCGFFFJIKcYYc8w56CSUEAgNWQUAAAIACAAAAHAUR3EcyZEcSbIkS9IkzdIsT/M0TxM9URRF0zRV0RVdUTdtUTZl0zVdUzZdVVZtV5ZtW7Z125dl2/d93/d93/d93/d93/d9XQdCQ1YBABIAADqSIymSIimS4ziOJElAaMgqAEAGAEAAAIriKI7jOJIkSZIlaZJneZaomZrpmZ4qqkBoyCoAABAAQAAAAAAAAIqmeIqpeIqoeI7oiJJomZaoqZoryqbsuq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq7ruq4LhIasAgAkAAB0JEdyJEdSJEVSJEdygNCQVQCADACAAAAcwzEkRXIsy9I0T/M0TxM90RM901NFV3SB0JBVAAAgAIAAAAAAAAAMybAUy9EcTRIl1VItVVMt1VJF1VNVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVN0zRNEwgNWQkAkAEAkBBTLS3GmgmLJGLSaqugYwxS7KWxSCpntbfKMYUYtV4ah5RREHupJGOKQcwtpNApJq3WVEKFFKSYYyoVUg5SIDRkhQAQmgHgcBxAsixAsiwAAAAAAAAAkDQN0DwPsDQPAAAAAAAAACRNAyxPAzTPAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAA0DwP8DwR8EQRAAAAAAAAACzPAzTRAzxRBAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABA0jRA8zxA8zwAAAAAAAAAsDwP8EQR0DwRAAAAAAAAACzPAzxRBDzRAwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAEOAAABBgIRQasiIAiBMAcEgSJAmSBM0DSJYFTYOmwTQBkmVB06BpME0AAAAAAAAAAAAAJE2DpkHTIIoASdOgadA0iCIAAAAAAAAAAAAAkqZB06BpEEWApGnQNGgaRBEAAAAAAAAAAAAAzzQhihBFmCbAM02IIkQRpgkAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAGHAAAAgwoQwUGrIiAIgTAHA4imUBAIDjOJYFAACO41gWAABYliWKAABgWZooAgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAYcAAACDChDBQashIAiAIAcCiKZQHHsSzgOJYFJMmyAJYF0DyApgFEEQAIAAAocAAACLBBU2JxgEJDVgIAUQAABsWxLE0TRZKkaZoniiRJ0zxPFGma53meacLzPM80IYqiaJoQRVE0TZimaaoqME1VFQAAUOAAABBgg6bE4gCFhqwEAEICAByKYlma5nmeJ4qmqZokSdM8TxRF0TRNU1VJkqZ5niiKommapqqyLE3zPFEURdNUVVWFpnmeKIqiaaqq6sLzPE8URdE0VdV14XmeJ4qiaJqq6roQRVE0TdNUTVV1XSCKpmmaqqqqrgtETxRNU1Vd13WB54miaaqqq7ouEE3TVFVVdV1ZBpimaaqq68oyQFVV1XVdV5YBqqqqruu6sgxQVdd1XVmWZQCu67qyLMsCAAAOHAAAAoygk4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiIyQBAIAAAgAAAAAggAAEBAQAAAAAAAIAAAAEBB9DtnUBAAAAAAAEPueBAKOFggAAgACjzoEAA4BwBwCdASqwAJAAAEcIhYWIhYSIAgIABhwJ7kPfbJyHvtk5D32ych77ZOQ99snIe+2TkPfbJyHvtk5D32ych77ZOQ99YAD+/6tQgKOFggADgAqjhYIAD4AOo4WCACSADqOZgQArADECAAEQEAAYABhYL/QACIBDmAYAAKOFggA6gA6jhYIAT4AOo5mBAFMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAGSADqOFggB6gA6jmYEAewAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAj4AOo5mBAKMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAKSADqOFggC6gA6jmYEAywAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIAz4AOo4WCAOSADqOZgQDzADECAAEQEAAYABhYL/QACIBDmAYAAKOFggD6gA6jhYIBD4AOo5iBARsAEQIAARAQFGAAYWC/0AAiAQ5gGACjhYIBJIAOo4WCATqADqOZgQFDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggFPgA6jhYIBZIAOo5mBAWsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAXqADqOFggGPgA6jmYEBkwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIBpIAOo4WCAbqADqOZgQG7ADECAAEQEAAYABhYL/QACIBDmAYAAKOFggHPgA6jmYEB4wAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIB5IAOo4WCAfqADqOZgQILADECAAEQEAAYABhYL/QACIBDmAYAAKOFggIPgA6jhYICJIAOo5mBAjMAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAjqADqOFggJPgA6jmYECWwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYICZIAOo4WCAnqADqOZgQKDADECAAEQEAAYABhYL/QACIBDmAYAAKOFggKPgA6jhYICpIAOo5mBAqsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCArqADqOFggLPgA6jmIEC0wARAgABEBAUYABhYL/QACIBDmAYAKOFggLkgA6jhYIC+oAOo5mBAvsAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCAw+ADqOZgQMjADECAAEQEAAYABhYL/QACIBDmAYAAKOFggMkgA6jhYIDOoAOo5mBA0sAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA0+ADqOFggNkgA6jmYEDcwAxAgABEBAAGAAYWC/0AAiAQ5gGAACjhYIDeoAOo4WCA4+ADqOZgQObADECAAEQEAAYABhYL/QACIBDmAYAAKOFggOkgA6jhYIDuoAOo5mBA8MAMQIAARAQABgAGFgv9AAIgEOYBgAAo4WCA8+ADqOFggPkgA6jhYID+oAOo4WCBA+ADhxTu2sBAAAAAAAAEbuPs4EDt4r3gQHxghEr8IEK",mp4:"data:video/mp4;base64,AAAAHGZ0eXBNNFYgAAACAGlzb21pc28yYXZjMQAAAAhmcmVlAAAGF21kYXTeBAAAbGliZmFhYyAxLjI4AABCAJMgBDIARwAAArEGBf//rdxF6b3m2Ui3lizYINkj7u94MjY0IC0gY29yZSAxNDIgcjIgOTU2YzhkOCAtIEguMjY0L01QRUctNCBBVkMgY29kZWMgLSBDb3B5bGVmdCAyMDAzLTIwMTQgLSBodHRwOi8vd3d3LnZpZGVvbGFuLm9yZy94MjY0Lmh0bWwgLSBvcHRpb25zOiBjYWJhYz0wIHJlZj0zIGRlYmxvY2s9MTowOjAgYW5hbHlzZT0weDE6MHgxMTEgbWU9aGV4IHN1Ym1lPTcgcHN5PTEgcHN5X3JkPTEuMDA6MC4wMCBtaXhlZF9yZWY9MSBtZV9yYW5nZT0xNiBjaHJvbWFfbWU9MSB0cmVsbGlzPTEgOHg4ZGN0PTAgY3FtPTAgZGVhZHpvbmU9MjEsMTEgZmFzdF9wc2tpcD0xIGNocm9tYV9xcF9vZmZzZXQ9LTIgdGhyZWFkcz02IGxvb2thaGVhZF90aHJlYWRzPTEgc2xpY2VkX3RocmVhZHM9MCBucj0wIGRlY2ltYXRlPTEgaW50ZXJsYWNlZD0wIGJsdXJheV9jb21wYXQ9MCBjb25zdHJhaW5lZF9pbnRyYT0wIGJmcmFtZXM9MCB3ZWlnaHRwPTAga2V5aW50PTI1MCBrZXlpbnRfbWluPTI1IHNjZW5lY3V0PTQwIGludHJhX3JlZnJlc2g9MCByY19sb29rYWhlYWQ9NDAgcmM9Y3JmIG1idHJlZT0xIGNyZj0yMy4wIHFjb21wPTAuNjAgcXBtaW49MCBxcG1heD02OSBxcHN0ZXA9NCB2YnZfbWF4cmF0ZT03NjggdmJ2X2J1ZnNpemU9MzAwMCBjcmZfbWF4PTAuMCBuYWxfaHJkPW5vbmUgZmlsbGVyPTAgaXBfcmF0aW89MS40MCBhcT0xOjEuMDAAgAAAAFZliIQL8mKAAKvMnJycnJycnJycnXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXiEASZACGQAjgCEASZACGQAjgAAAAAdBmjgX4GSAIQBJkAIZACOAAAAAB0GaVAX4GSAhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGagC/AySEASZACGQAjgAAAAAZBmqAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZrAL8DJIQBJkAIZACOAAAAABkGa4C/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmwAvwMkhAEmQAhkAI4AAAAAGQZsgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGbQC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm2AvwMkhAEmQAhkAI4AAAAAGQZuAL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGboC/AySEASZACGQAjgAAAAAZBm8AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZvgL8DJIQBJkAIZACOAAAAABkGaAC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmiAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZpAL8DJIQBJkAIZACOAAAAABkGaYC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBmoAvwMkhAEmQAhkAI4AAAAAGQZqgL8DJIQBJkAIZACOAIQBJkAIZACOAAAAABkGawC/AySEASZACGQAjgAAAAAZBmuAvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZsAL8DJIQBJkAIZACOAAAAABkGbIC/AySEASZACGQAjgCEASZACGQAjgAAAAAZBm0AvwMkhAEmQAhkAI4AhAEmQAhkAI4AAAAAGQZtgL8DJIQBJkAIZACOAAAAABkGbgCvAySEASZACGQAjgCEASZACGQAjgAAAAAZBm6AnwMkhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AhAEmQAhkAI4AAAAhubW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAABDcAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAwAAAzB0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAA+kAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAALAAAACQAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAPpAAAAAAABAAAAAAKobWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAB1MAAAdU5VxAAAAAAALWhkbHIAAAAAAAAAAHZpZGUAAAAAAAAAAAAAAABWaWRlb0hhbmRsZXIAAAACU21pbmYAAAAUdm1oZAAAAAEAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAhNzdGJsAAAAr3N0c2QAAAAAAAAAAQAAAJ9hdmMxAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAALAAkABIAAAASAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGP//AAAALWF2Y0MBQsAN/+EAFWdCwA3ZAsTsBEAAAPpAADqYA8UKkgEABWjLg8sgAAAAHHV1aWRraEDyXyRPxbo5pRvPAyPzAAAAAAAAABhzdHRzAAAAAAAAAAEAAAAeAAAD6QAAABRzdHNzAAAAAAAAAAEAAAABAAAAHHN0c2MAAAAAAAAAAQAAAAEAAAABAAAAAQAAAIxzdHN6AAAAAAAAAAAAAAAeAAADDwAAAAsAAAALAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAACgAAAAoAAAAKAAAAiHN0Y28AAAAAAAAAHgAAAEYAAANnAAADewAAA5gAAAO0AAADxwAAA+MAAAP2AAAEEgAABCUAAARBAAAEXQAABHAAAASMAAAEnwAABLsAAATOAAAE6gAABQYAAAUZAAAFNQAABUgAAAVkAAAFdwAABZMAAAWmAAAFwgAABd4AAAXxAAAGDQAABGh0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAACAAAAAAAABDcAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAQkAAADcAABAAAAAAPgbWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAC7gAAAykBVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAADi21pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAADT3N0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAIAEAAAAAC7gAAAAAAAM2VzZHMAAAAAA4CAgCIAAgAEgICAFEAVBbjYAAu4AAAADcoFgICAAhGQBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAADIAAAQAAAAAAQAAAkAAAAFUc3RzYwAAAAAAAAAbAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAwAAAAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var XCe=Wu((L_o,YCe)=>{var{webm:TSt,mp4:ASt}=qCe(),Y$=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,X$=()=>"wakeLock"in navigator,K$=class{constructor(){if(this.enabled=!1,X$()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else Y$()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",TSt),this._addSourceToVideo(this.noSleepVideo,"mp4",ASt),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return X$()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):Y$()?(this.disable(),console.warn(`
NoSleep enabled for older iOS devices. This can interrupt
active or long-running network requests from completing successfully.
See https://github.com/richtr/NoSleep.js/issues/15 for more details.
`),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){X$()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):Y$()?this.noSleepTimer&&(console.warn(`
NoSleep now disabled for older iOS devices.
`),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};YCe.exports=K$});function mEe(e){return e!=null}var c=mEe;function w0(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}c(Object.create)&&(w0.prototype=Object.create(Error.prototype),w0.prototype.constructor=w0);w0.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return c(this.stack)&&(e+=`
${this.stack.toString()}`),e};w0.throwInstantiationError=function(){throw new w0("This function defines an interface and should not be called directly.")};var C=w0;var _s={};_s.typeOf={};function pEe(e){return`${e} is required, actual value was undefined`}function tT(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}_s.defined=function(e,t){if(!c(t))throw new C(pEe(e))};_s.typeOf.func=function(e,t){if(typeof t!="function")throw new C(tT(typeof t,"function",e))};_s.typeOf.string=function(e,t){if(typeof t!="string")throw new C(tT(typeof t,"string",e))};_s.typeOf.number=function(e,t){if(typeof t!="number")throw new C(tT(typeof t,"number",e))};_s.typeOf.number.lessThan=function(e,t,n){if(_s.typeOf.number(e,t),t>=n)throw new C(`Expected ${e} to be less than ${n}, actual value was ${t}`)};_s.typeOf.number.lessThanOrEquals=function(e,t,n){if(_s.typeOf.number(e,t),t>n)throw new C(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};_s.typeOf.number.greaterThan=function(e,t,n){if(_s.typeOf.number(e,t),t<=n)throw new C(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};_s.typeOf.number.greaterThanOrEquals=function(e,t,n){if(_s.typeOf.number(e,t),t<n)throw new C(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};_s.typeOf.object=function(e,t){if(typeof t!="object")throw new C(tT(typeof t,"object",e))};_s.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new C(tT(typeof t,"boolean",e))};_s.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new C(tT(typeof t,"bigint",e))};_s.typeOf.number.equals=function(e,t,n,i){if(_s.typeOf.number(e,n),_s.typeOf.number(t,i),n!==i)throw new C(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var T=_s;var YG=jr(lO(),1);var st={};st.EPSILON1=.1;st.EPSILON2=.01;st.EPSILON3=.001;st.EPSILON4=1e-4;st.EPSILON5=1e-5;st.EPSILON6=1e-6;st.EPSILON7=1e-7;st.EPSILON8=1e-8;st.EPSILON9=1e-9;st.EPSILON10=1e-10;st.EPSILON11=1e-11;st.EPSILON12=1e-12;st.EPSILON13=1e-13;st.EPSILON14=1e-14;st.EPSILON15=1e-15;st.EPSILON16=1e-16;st.EPSILON17=1e-17;st.EPSILON18=1e-18;st.EPSILON19=1e-19;st.EPSILON20=1e-20;st.EPSILON21=1e-21;st.GRAVITATIONALPARAMETER=3986004418e5;st.SOLAR_RADIUS=6955e5;st.LUNAR_RADIUS=1737400;st.SIXTY_FOUR_KILOBYTES=64*1024;st.FOUR_GIGABYTES=4*1024*1024*1024;st.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};st.signNotZero=function(e){return e<0?-1:1};st.toSNorm=function(e,t){return t=t??255,Math.round((st.clamp(e,-1,1)*.5+.5)*t)};st.fromSNorm=function(e,t){return t=t??255,st.clamp(e,0,t)/t*2-1};st.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:st.clamp((e-t)/n,0,1)};st.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};st.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};st.lerp=function(e,t,n){return(1-n)*e+n*t};st.PI=Math.PI;st.ONE_OVER_PI=1/Math.PI;st.PI_OVER_TWO=Math.PI/2;st.PI_OVER_THREE=Math.PI/3;st.PI_OVER_FOUR=Math.PI/4;st.PI_OVER_SIX=Math.PI/6;st.THREE_PI_OVER_TWO=3*Math.PI/2;st.TWO_PI=2*Math.PI;st.ONE_OVER_TWO_PI=1/(2*Math.PI);st.RADIANS_PER_DEGREE=Math.PI/180;st.DEGREES_PER_RADIAN=180/Math.PI;st.RADIANS_PER_ARCSECOND=st.RADIANS_PER_DEGREE/3600;st.toRadians=function(e){if(!c(e))throw new C("degrees is required.");return e*st.RADIANS_PER_DEGREE};st.toDegrees=function(e){if(!c(e))throw new C("radians is required.");return e*st.DEGREES_PER_RADIAN};st.convertLongitudeRange=function(e){if(!c(e))throw new C("angle is required.");let t=st.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};st.clampToLatitudeRange=function(e){if(!c(e))throw new C("angle is required.");return st.clamp(e,-1*st.PI_OVER_TWO,st.PI_OVER_TWO)};st.negativePiToPi=function(e){if(!c(e))throw new C("angle is required.");return e>=-st.PI&&e<=st.PI?e:st.zeroToTwoPi(e+st.PI)-st.PI};st.zeroToTwoPi=function(e){if(!c(e))throw new C("angle is required.");if(e>=0&&e<=st.TWO_PI)return e;let t=st.mod(e,st.TWO_PI);return Math.abs(t)<st.EPSILON14&&Math.abs(e)>st.EPSILON14?st.TWO_PI:t};st.mod=function(e,t){if(!c(e))throw new C("m is required.");if(!c(t))throw new C("n is required.");if(t===0)throw new C("divisor cannot be 0.");return st.sign(e)===st.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};st.equalsEpsilon=function(e,t,n,i){if(!c(e))throw new C("left is required.");if(!c(t))throw new C("right is required.");n=n??0,i=i??n;let o=Math.abs(e-t);return o<=i||o<=n*Math.max(Math.abs(e),Math.abs(t))};st.lessThan=function(e,t,n){if(!c(e))throw new C("first is required.");if(!c(t))throw new C("second is required.");if(!c(n))throw new C("absoluteEpsilon is required.");return e-t<-n};st.lessThanOrEquals=function(e,t,n){if(!c(e))throw new C("first is required.");if(!c(t))throw new C("second is required.");if(!c(n))throw new C("absoluteEpsilon is required.");return e-t<n};st.greaterThan=function(e,t,n){if(!c(e))throw new C("first is required.");if(!c(t))throw new C("second is required.");if(!c(n))throw new C("absoluteEpsilon is required.");return e-t>n};st.greaterThanOrEquals=function(e,t,n){if(!c(e))throw new C("first is required.");if(!c(t))throw new C("second is required.");if(!c(n))throw new C("absoluteEpsilon is required.");return e-t>-n};var uO=[1];st.factorial=function(e){if(typeof e!="number"||e<0)throw new C("A number greater than or equal to 0 is required.");let t=uO.length;if(e>=t){let n=uO[t-1];for(let i=t;i<=e;i++){let o=n*i;uO.push(o),n=o}}return uO[e]};st.incrementWrap=function(e,t,n){if(n=n??0,!c(e))throw new C("n is required.");if(t<=n)throw new C("maximumValue must be greater than minimumValue.");return++e,e>t&&(e=n),e};st.isPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new C("A number between 0 and (2^32)-1 is required.");return e!==0&&(e&e-1)===0};st.nextPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>2147483648)throw new C("A number between 0 and 2^31 is required.");return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};st.previousPowerOfTwo=function(e){if(typeof e!="number"||e<0||e>4294967295)throw new C("A number between 0 and (2^32)-1 is required.");return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};st.clamp=function(e,t,n){return T.typeOf.number("value",e),T.typeOf.number("min",t),T.typeOf.number("max",n),e<t?t:e>n?n:e};var nZ=new YG.default;st.setRandomNumberSeed=function(e){if(!c(e))throw new C("seed is required.");nZ=new YG.default(e)};st.nextRandomNumber=function(){return nZ.random()};st.randomBetween=function(e,t){return st.nextRandomNumber()*(t-e)+e};st.acosClamped=function(e){if(!c(e))throw new C("value is required.");return Math.acos(st.clamp(e,-1,1))};st.asinClamped=function(e){if(!c(e))throw new C("value is required.");return Math.asin(st.clamp(e,-1,1))};st.chordLength=function(e,t){if(!c(e))throw new C("angle is required.");if(!c(t))throw new C("radius is required.");return 2*t*Math.sin(e*.5)};st.logBase=function(e,t){if(!c(e))throw new C("number is required.");if(!c(t))throw new C("base is required.");return Math.log(e)/Math.log(t)};st.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};st.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};st.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};st.fastApproximateAtan=function(e){return T.typeOf.number("x",e),e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};st.fastApproximateAtan2=function(e,t){T.typeOf.number("x",e),T.typeOf.number("y",t);let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;if(isNaN(r))throw new C("either x or y must be nonzero");return i=st.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?st.PI_OVER_TWO-i:i,i=e<0?st.PI-i:i,i=t<0?-i:i,i};var O=st;function Qe(e,t,n){this.x=e??0,this.y=t??0,this.z=n??0}Qe.fromSpherical=function(e,t){T.typeOf.object("spherical",e),c(t)||(t=new Qe);let n=e.clock,i=e.cone,o=e.magnitude??1,r=o*Math.sin(i);return t.x=r*Math.cos(n),t.y=r*Math.sin(n),t.z=o*Math.cos(i),t};Qe.fromElements=function(e,t,n,i){return c(i)?(i.x=e,i.y=t,i.z=n,i):new Qe(e,t,n)};Qe.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new Qe(e.x,e.y,e.z)};Qe.fromCartesian4=Qe.clone;Qe.packedLength=3;Qe.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n]=e.z,t};Qe.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Qe),n.x=e[t++],n.y=e[t++],n.z=e[t],n};Qe.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*3;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 3 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)Qe.pack(e[o],t,o*3);return t};Qe.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,3),e.length%3!==0)throw new C("array length must be a multiple of 3.");let n=e.length;c(t)?t.length=n/3:t=new Array(n/3);for(let i=0;i<n;i+=3){let o=i/3;t[o]=Qe.unpack(e,i,t[o])}return t};Qe.fromArray=Qe.unpack;Qe.maximumComponent=function(e){return T.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z)};Qe.minimumComponent=function(e){return T.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z)};Qe.minimumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n};Qe.maximumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n};Qe.clamp=function(e,t,n,i){T.typeOf.object("value",e),T.typeOf.object("min",t),T.typeOf.object("max",n),T.typeOf.object("result",i);let o=O.clamp(e.x,t.x,n.x),r=O.clamp(e.y,t.y,n.y),s=O.clamp(e.z,t.z,n.z);return i.x=o,i.y=r,i.z=s,i};Qe.magnitudeSquared=function(e){return T.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z};Qe.magnitude=function(e){return Math.sqrt(Qe.magnitudeSquared(e))};var dO=new Qe;Qe.distance=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),Qe.subtract(e,t,dO),Qe.magnitude(dO)};Qe.distanceSquared=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),Qe.subtract(e,t,dO),Qe.magnitudeSquared(dO)};Qe.normalize=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=Qe.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new C("normalized result is not a number");return t};Qe.dot=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z};Qe.multiplyComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n};Qe.divideComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n};Qe.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n};Qe.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n};Qe.multiplyByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n};Qe.divideByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n};Qe.negate=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t};Qe.abs=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t};var iZ=new Qe;Qe.lerp=function(e,t,n,i){return T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),Qe.multiplyByScalar(t,n,iZ),i=Qe.multiplyByScalar(e,1-n,i),Qe.add(iZ,i,i)};var fO=new Qe,XG=new Qe;Qe.angleBetween=function(e,t){T.typeOf.object("left",e),T.typeOf.object("right",t),Qe.normalize(e,fO),Qe.normalize(t,XG);let n=Qe.dot(fO,XG),i=Qe.magnitude(Qe.cross(fO,XG,fO));return Math.atan2(i,n)};var _Ee=new Qe;Qe.mostOrthogonalAxis=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=Qe.normalize(e,_Ee);return Qe.abs(n,n),n.x<=n.y?n.x<=n.z?t=Qe.clone(Qe.UNIT_X,t):t=Qe.clone(Qe.UNIT_Z,t):n.y<=n.z?t=Qe.clone(Qe.UNIT_Y,t):t=Qe.clone(Qe.UNIT_Z,t),t};Qe.projectVector=function(e,t,n){T.defined("a",e),T.defined("b",t),T.defined("result",n);let i=Qe.dot(e,t)/Qe.dot(t,t);return Qe.multiplyByScalar(t,i,n)};Qe.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z};Qe.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]};Qe.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(t)&&O.equalsEpsilon(e.x,t.x,n,i)&&O.equalsEpsilon(e.y,t.y,n,i)&&O.equalsEpsilon(e.z,t.z,n,i)};Qe.cross=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n);let i=e.x,o=e.y,r=e.z,s=t.x,a=t.y,l=t.z,u=o*l-r*a,f=r*s-i*l,h=i*a-o*s;return n.x=u,n.y=f,n.z=h,n};Qe.midpoint=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=(e.x+t.x)*.5,n.y=(e.y+t.y)*.5,n.z=(e.z+t.z)*.5,n};Qe.fromDegrees=function(e,t,n,i,o){return T.typeOf.number("longitude",e),T.typeOf.number("latitude",t),e=O.toRadians(e),t=O.toRadians(t),Qe.fromRadians(e,t,n,i,o)};var qu=new Qe,nT=new Qe;Qe._ellipsoidRadiiSquared=new Qe(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);Qe.fromRadians=function(e,t,n,i,o){T.typeOf.number("longitude",e),T.typeOf.number("latitude",t),n=n??0;let r=c(i)?i.radiiSquared:Qe._ellipsoidRadiiSquared,s=Math.cos(t);qu.x=s*Math.cos(e),qu.y=s*Math.sin(e),qu.z=Math.sin(t),qu=Qe.normalize(qu,qu),Qe.multiplyComponents(r,qu,nT);let a=Math.sqrt(Qe.dot(qu,nT));return nT=Qe.divideByScalar(nT,a,nT),qu=Qe.multiplyByScalar(qu,n,qu),c(o)||(o=new Qe),Qe.add(nT,qu,o)};Qe.fromDegreesArray=function(e,t,n){if(T.defined("coordinates",e),e.length<2||e.length%2!==0)throw new C("the number of coordinates must be a multiple of 2 and at least 2");let i=e.length;c(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=Qe.fromDegrees(r,s,0,t,n[a])}return n};Qe.fromRadiansArray=function(e,t,n){if(T.defined("coordinates",e),e.length<2||e.length%2!==0)throw new C("the number of coordinates must be a multiple of 2 and at least 2");let i=e.length;c(n)?n.length=i/2:n=new Array(i/2);for(let o=0;o<i;o+=2){let r=e[o],s=e[o+1],a=o/2;n[a]=Qe.fromRadians(r,s,0,t,n[a])}return n};Qe.fromDegreesArrayHeights=function(e,t,n){if(T.defined("coordinates",e),e.length<3||e.length%3!==0)throw new C("the number of coordinates must be a multiple of 3 and at least 3");let i=e.length;c(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],l=o/3;n[l]=Qe.fromDegrees(r,s,a,t,n[l])}return n};Qe.fromRadiansArrayHeights=function(e,t,n){if(T.defined("coordinates",e),e.length<3||e.length%3!==0)throw new C("the number of coordinates must be a multiple of 3 and at least 3");let i=e.length;c(n)?n.length=i/3:n=new Array(i/3);for(let o=0;o<i;o+=3){let r=e[o],s=e[o+1],a=e[o+2],l=o/3;n[l]=Qe.fromRadians(r,s,a,t,n[l])}return n};Qe.ZERO=Object.freeze(new Qe(0,0,0));Qe.ONE=Object.freeze(new Qe(1,1,1));Qe.UNIT_X=Object.freeze(new Qe(1,0,0));Qe.UNIT_Y=Object.freeze(new Qe(0,1,0));Qe.UNIT_Z=Object.freeze(new Qe(0,0,1));Qe.prototype.clone=function(e){return Qe.clone(this,e)};Qe.prototype.equals=function(e){return Qe.equals(this,e)};Qe.prototype.equalsEpsilon=function(e,t,n){return Qe.equalsEpsilon(this,e,t,n)};Qe.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z})`};var d=Qe;function yt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}yt.fromElements=function(e,t,n,i,o){return c(o)?(o.x=e,o.y=t,o.z=n,o.w=i,o):new yt(e,t,n,i)};yt.fromColor=function(e,t){return T.typeOf.object("color",e),c(t)?(t.x=e.red,t.y=e.green,t.z=e.blue,t.w=e.alpha,t):new yt(e.red,e.green,e.blue,e.alpha)};yt.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new yt(e.x,e.y,e.z,e.w)};yt.packedLength=4;yt.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};yt.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new yt),n.x=e[t++],n.y=e[t++],n.z=e[t++],n.w=e[t],n};yt.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*4;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)yt.pack(e[o],t,o*4);return t};yt.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new C("array length must be a multiple of 4.");let n=e.length;c(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=yt.unpack(e,i,t[o])}return t};yt.fromArray=yt.unpack;yt.maximumComponent=function(e){return T.typeOf.object("cartesian",e),Math.max(e.x,e.y,e.z,e.w)};yt.minimumComponent=function(e){return T.typeOf.object("cartesian",e),Math.min(e.x,e.y,e.z,e.w)};yt.minimumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n.z=Math.min(e.z,t.z),n.w=Math.min(e.w,t.w),n};yt.maximumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n.z=Math.max(e.z,t.z),n.w=Math.max(e.w,t.w),n};yt.clamp=function(e,t,n,i){T.typeOf.object("value",e),T.typeOf.object("min",t),T.typeOf.object("max",n),T.typeOf.object("result",i);let o=O.clamp(e.x,t.x,n.x),r=O.clamp(e.y,t.y,n.y),s=O.clamp(e.z,t.z,n.z),a=O.clamp(e.w,t.w,n.w);return i.x=o,i.y=r,i.z=s,i.w=a,i};yt.magnitudeSquared=function(e){return T.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};yt.magnitude=function(e){return Math.sqrt(yt.magnitudeSquared(e))};var hO=new yt;yt.distance=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),yt.subtract(e,t,hO),yt.magnitude(hO)};yt.distanceSquared=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),yt.subtract(e,t,hO),yt.magnitudeSquared(hO)};yt.normalize=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=yt.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,t.z=e.z/n,t.w=e.w/n,isNaN(t.x)||isNaN(t.y)||isNaN(t.z)||isNaN(t.w))throw new C("normalized result is not a number");return t};yt.dot=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};yt.multiplyComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n.z=e.z*t.z,n.w=e.w*t.w,n};yt.divideComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n.z=e.z/t.z,n.w=e.w/t.w,n};yt.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};yt.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};yt.multiplyByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};yt.divideByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};yt.negate=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};yt.abs=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t.z=Math.abs(e.z),t.w=Math.abs(e.w),t};var oZ=new yt;yt.lerp=function(e,t,n,i){return T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),yt.multiplyByScalar(t,n,oZ),i=yt.multiplyByScalar(e,1-n,i),yt.add(oZ,i,i)};var gEe=new yt;yt.mostOrthogonalAxis=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=yt.normalize(e,gEe);return yt.abs(n,n),n.x<=n.y?n.x<=n.z?n.x<=n.w?t=yt.clone(yt.UNIT_X,t):t=yt.clone(yt.UNIT_W,t):n.z<=n.w?t=yt.clone(yt.UNIT_Z,t):t=yt.clone(yt.UNIT_W,t):n.y<=n.z?n.y<=n.w?t=yt.clone(yt.UNIT_Y,t):t=yt.clone(yt.UNIT_W,t):n.z<=n.w?t=yt.clone(yt.UNIT_Z,t):t=yt.clone(yt.UNIT_W,t),t};yt.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};yt.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]&&e.z===t[n+2]&&e.w===t[n+3]};yt.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(t)&&O.equalsEpsilon(e.x,t.x,n,i)&&O.equalsEpsilon(e.y,t.y,n,i)&&O.equalsEpsilon(e.z,t.z,n,i)&&O.equalsEpsilon(e.w,t.w,n,i)};yt.ZERO=Object.freeze(new yt(0,0,0,0));yt.ONE=Object.freeze(new yt(1,1,1,1));yt.UNIT_X=Object.freeze(new yt(1,0,0,0));yt.UNIT_Y=Object.freeze(new yt(0,1,0,0));yt.UNIT_Z=Object.freeze(new yt(0,0,1,0));yt.UNIT_W=Object.freeze(new yt(0,0,0,1));yt.prototype.clone=function(e){return yt.clone(this,e)};yt.prototype.equals=function(e){return yt.equals(this,e)};yt.prototype.equalsEpsilon=function(e,t,n){return yt.equalsEpsilon(this,e,t,n)};yt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var KG=new Float32Array(1),Ga=new Uint8Array(KG.buffer),yEe=new Uint32Array([287454020]),bEe=new Uint8Array(yEe.buffer),rZ=bEe[0]===68;yt.packFloat=function(e,t){return T.typeOf.number("value",e),c(t)||(t=new yt),KG[0]=e,rZ?(t.x=Ga[0],t.y=Ga[1],t.z=Ga[2],t.w=Ga[3]):(t.x=Ga[3],t.y=Ga[2],t.z=Ga[1],t.w=Ga[0]),t};yt.unpackFloat=function(e){return T.typeOf.object("packedFloat",e),rZ?(Ga[0]=e.x,Ga[1]=e.y,Ga[2]=e.z,Ga[3]=e.w):(Ga[0]=e.w,Ga[1]=e.z,Ga[2]=e.y,Ga[3]=e.x),KG[0]};var se=yt;var $G={};$G.EMPTY_OBJECT=Object.freeze({});$G.EMPTY_ARRAY=Object.freeze([]);var W=$G;function tt(e,t,n,i,o,r,s,a,l){this[0]=e??0,this[1]=i??0,this[2]=s??0,this[3]=t??0,this[4]=o??0,this[5]=a??0,this[6]=n??0,this[7]=r??0,this[8]=l??0}tt.packedLength=9;tt.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t};tt.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new tt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n};tt.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*9;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 9 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)tt.pack(e[o],t,o*9);return t};tt.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,9),e.length%9!==0)throw new C("array length must be a multiple of 9.");let n=e.length;c(t)?t.length=n/9:t=new Array(n/9);for(let i=0;i<n;i+=9){let o=i/9;t[o]=tt.unpack(e,i,t[o])}return t};tt.clone=function(e,t){if(c(e))return c(t)?(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):new tt(e[0],e[3],e[6],e[1],e[4],e[7],e[2],e[5],e[8])};tt.fromArray=tt.unpack;tt.fromColumnMajorArray=function(e,t){return T.defined("values",e),tt.clone(e,t)};tt.fromRowMajorArray=function(e,t){return T.defined("values",e),c(t)?(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],t):new tt(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])};tt.fromQuaternion=function(e,t){T.typeOf.object("quaternion",e);let n=e.x*e.x,i=e.x*e.y,o=e.x*e.z,r=e.x*e.w,s=e.y*e.y,a=e.y*e.z,l=e.y*e.w,u=e.z*e.z,f=e.z*e.w,h=e.w*e.w,p=n-s-u+h,g=2*(i-f),m=2*(o+l),y=2*(i+f),b=-n+s-u+h,x=2*(a-r),A=2*(o-l),E=2*(a+r),S=-n-s+u+h;return c(t)?(t[0]=p,t[1]=y,t[2]=A,t[3]=g,t[4]=b,t[5]=E,t[6]=m,t[7]=x,t[8]=S,t):new tt(p,g,m,y,b,x,A,E,S)};tt.fromHeadingPitchRoll=function(e,t){T.typeOf.object("headingPitchRoll",e);let n=Math.cos(-e.pitch),i=Math.cos(-e.heading),o=Math.cos(e.roll),r=Math.sin(-e.pitch),s=Math.sin(-e.heading),a=Math.sin(e.roll),l=n*i,u=-o*s+a*r*i,f=a*s+o*r*i,h=n*s,p=o*i+a*r*s,g=-a*i+o*r*s,m=-r,y=a*n,b=o*n;return c(t)?(t[0]=l,t[1]=h,t[2]=m,t[3]=u,t[4]=p,t[5]=y,t[6]=f,t[7]=g,t[8]=b,t):new tt(l,u,f,h,p,g,m,y,b)};tt.fromScale=function(e,t){return T.typeOf.object("scale",e),c(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=e.y,t[5]=0,t[6]=0,t[7]=0,t[8]=e.z,t):new tt(e.x,0,0,0,e.y,0,0,0,e.z)};tt.fromUniformScale=function(e,t){return T.typeOf.number("scale",e),c(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=e,t[5]=0,t[6]=0,t[7]=0,t[8]=e,t):new tt(e,0,0,0,e,0,0,0,e)};tt.fromCrossProduct=function(e,t){return T.typeOf.object("vector",e),c(t)?(t[0]=0,t[1]=e.z,t[2]=-e.y,t[3]=-e.z,t[4]=0,t[5]=e.x,t[6]=e.y,t[7]=-e.x,t[8]=0,t):new tt(0,-e.z,e.y,e.z,0,-e.x,-e.y,e.x,0)};tt.fromRotationX=function(e,t){T.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(t)?(t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=n,t[5]=i,t[6]=0,t[7]=-i,t[8]=n,t):new tt(1,0,0,0,n,-i,0,i,n)};tt.fromRotationY=function(e,t){T.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(t)?(t[0]=n,t[1]=0,t[2]=-i,t[3]=0,t[4]=1,t[5]=0,t[6]=i,t[7]=0,t[8]=n,t):new tt(n,0,i,0,1,0,-i,0,n)};tt.fromRotationZ=function(e,t){T.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(t)?(t[0]=n,t[1]=i,t[2]=0,t[3]=-i,t[4]=n,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new tt(n,-i,0,i,n,0,0,0,1)};tt.toArray=function(e,t){return T.typeOf.object("matrix",e),c(t)?(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):[e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8]]};tt.getElementIndex=function(e,t){return T.typeOf.number.greaterThanOrEquals("row",t,0),T.typeOf.number.lessThanOrEquals("row",t,2),T.typeOf.number.greaterThanOrEquals("column",e,0),T.typeOf.number.lessThanOrEquals("column",e,2),e*3+t};tt.getColumn=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,2),T.typeOf.object("result",n);let i=t*3,o=e[i],r=e[i+1],s=e[i+2];return n.x=o,n.y=r,n.z=s,n};tt.setColumn=function(e,t,n,i){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,2),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=tt.clone(e,i);let o=t*3;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i};tt.getRow=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,2),T.typeOf.object("result",n);let i=e[t],o=e[t+3],r=e[t+6];return n.x=i,n.y=o,n.z=r,n};tt.setRow=function(e,t,n,i){return T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,2),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=tt.clone(e,i),i[t]=n.x,i[t+3]=n.y,i[t+6]=n.z,i};var xEe=new d;tt.setScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n);let i=tt.getScale(e,xEe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var TEe=new d;tt.setUniformScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n);let i=tt.getScale(e,TEe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3]*r,n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*s,n[7]=e[7]*s,n[8]=e[8]*s,n};var ZG=new d;tt.getScale=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],ZG)),t.y=d.magnitude(d.fromElements(e[3],e[4],e[5],ZG)),t.z=d.magnitude(d.fromElements(e[6],e[7],e[8],ZG)),t};var sZ=new d;tt.getMaximumScale=function(e){return tt.getScale(e,sZ),d.maximumComponent(sZ)};var AEe=new d;tt.setRotation=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("result",n);let i=tt.getScale(e,AEe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=t[3]*i.y,n[4]=t[4]*i.y,n[5]=t[5]*i.y,n[6]=t[6]*i.z,n[7]=t[7]*i.z,n[8]=t[8]*i.z,n};var CEe=new d;tt.getRotation=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=tt.getScale(e,CEe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[3]/n.y,t[4]=e[4]/n.y,t[5]=e[5]/n.y,t[6]=e[6]/n.z,t[7]=e[7]/n.z,t[8]=e[8]/n.z,t};tt.multiply=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n);let i=e[0]*t[0]+e[3]*t[1]+e[6]*t[2],o=e[1]*t[0]+e[4]*t[1]+e[7]*t[2],r=e[2]*t[0]+e[5]*t[1]+e[8]*t[2],s=e[0]*t[3]+e[3]*t[4]+e[6]*t[5],a=e[1]*t[3]+e[4]*t[4]+e[7]*t[5],l=e[2]*t[3]+e[5]*t[4]+e[8]*t[5],u=e[0]*t[6]+e[3]*t[7]+e[6]*t[8],f=e[1]*t[6]+e[4]*t[7]+e[7]*t[8],h=e[2]*t[6]+e[5]*t[7]+e[8]*t[8];return n[0]=i,n[1]=o,n[2]=r,n[3]=s,n[4]=a,n[5]=l,n[6]=u,n[7]=f,n[8]=h,n};tt.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n};tt.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n};tt.multiplyByVector=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("cartesian",t),T.typeOf.object("result",n);let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[3]*o+e[6]*r,a=e[1]*i+e[4]*o+e[7]*r,l=e[2]*i+e[5]*o+e[8]*r;return n.x=s,n.y=a,n.z=l,n};tt.multiplyByScalar=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};tt.multiplyByScale=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.x,n[3]=e[3]*t.y,n[4]=e[4]*t.y,n[5]=e[5]*t.y,n[6]=e[6]*t.z,n[7]=e[7]*t.z,n[8]=e[8]*t.z,n};tt.multiplyByUniformScale=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n};tt.negate=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),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};tt.transpose=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=e[0],i=e[3],o=e[6],r=e[1],s=e[4],a=e[7],l=e[2],u=e[5],f=e[8];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t[4]=s,t[5]=a,t[6]=l,t[7]=u,t[8]=f,t};function EEe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var QG=[1,0,0],JG=[2,2,1];function SEe(e){let t=0;for(let n=0;n<3;++n){let i=e[tt.getElementIndex(JG[n],QG[n])];t+=2*i*i}return Math.sqrt(t)}function wEe(e,t){let n=O.EPSILON15,i=0,o=1;for(let u=0;u<3;++u){let f=Math.abs(e[tt.getElementIndex(JG[u],QG[u])]);f>i&&(o=u,i=f)}let r=1,s=0,a=QG[o],l=JG[o];if(Math.abs(e[tt.getElementIndex(l,a)])>n){let u=e[tt.getElementIndex(l,l)],f=e[tt.getElementIndex(a,a)],h=e[tt.getElementIndex(l,a)],p=(u-f)/2/h,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+g*g),s=g*r}return t=tt.clone(tt.IDENTITY,t),t[tt.getElementIndex(a,a)]=t[tt.getElementIndex(l,l)]=r,t[tt.getElementIndex(l,a)]=s,t[tt.getElementIndex(a,l)]=-s,t}var mO=new tt,aZ=new tt;tt.computeEigenDecomposition=function(e,t){T.typeOf.object("matrix",e);let n=O.EPSILON20,i=10,o=0,r=0;c(t)||(t={});let s=t.unitary=tt.clone(tt.IDENTITY,t.unitary),a=t.diagonal=tt.clone(e,t.diagonal),l=n*EEe(a);for(;r<i&&SEe(a)>l;)wEe(a,mO),tt.transpose(mO,aZ),tt.multiply(a,mO,a),tt.multiply(aZ,a,a),tt.multiply(s,mO,s),++o>2&&(++r,o=0);return t};tt.abs=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t};tt.determinant=function(e){T.typeOf.object("matrix",e);let t=e[0],n=e[3],i=e[6],o=e[1],r=e[4],s=e[7],a=e[2],l=e[5],u=e[8];return t*(r*u-l*s)+o*(l*i-n*u)+a*(n*s-r*i)};tt.inverse=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=e[0],i=e[1],o=e[2],r=e[3],s=e[4],a=e[5],l=e[6],u=e[7],f=e[8],h=tt.determinant(e);if(Math.abs(h)<=O.EPSILON15)throw new C("matrix is not invertible");t[0]=s*f-u*a,t[1]=u*o-i*f,t[2]=i*a-s*o,t[3]=l*a-r*f,t[4]=n*f-l*o,t[5]=r*o-n*a,t[6]=r*u-l*s,t[7]=l*i-n*u,t[8]=n*s-r*i;let p=1/h;return tt.multiplyByScalar(t,p,t)};var vEe=new tt;tt.inverseTranspose=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),tt.inverse(tt.transpose(e,vEe),t)};tt.equals=function(e,t){return e===t||c(e)&&c(t)&&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]};tt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n};tt.IDENTITY=Object.freeze(new tt(1,0,0,0,1,0,0,0,1));tt.ZERO=Object.freeze(new tt(0,0,0,0,0,0,0,0,0));tt.COLUMN0ROW0=0;tt.COLUMN0ROW1=1;tt.COLUMN0ROW2=2;tt.COLUMN1ROW0=3;tt.COLUMN1ROW1=4;tt.COLUMN1ROW2=5;tt.COLUMN2ROW0=6;tt.COLUMN2ROW1=7;tt.COLUMN2ROW2=8;Object.defineProperties(tt.prototype,{length:{get:function(){return tt.packedLength}}});tt.prototype.clone=function(e){return tt.clone(this,e)};tt.prototype.equals=function(e){return tt.equals(this,e)};tt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]};tt.prototype.equalsEpsilon=function(e,t){return tt.equalsEpsilon(this,e,t)};tt.prototype.toString=function(){return`(${this[0]}, ${this[3]}, ${this[6]})
(${this[1]}, ${this[4]}, ${this[7]})
(${this[2]}, ${this[5]}, ${this[8]})`};var J=tt;function jS(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}c(Object.create)&&(jS.prototype=Object.create(Error.prototype),jS.prototype.constructor=jS);jS.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return c(this.stack)&&(e+=`
${this.stack.toString()}`),e};var ae=jS;function et(e,t,n,i,o,r,s,a,l,u,f,h,p,g,m,y){this[0]=e??0,this[1]=o??0,this[2]=l??0,this[3]=p??0,this[4]=t??0,this[5]=r??0,this[6]=u??0,this[7]=g??0,this[8]=n??0,this[9]=s??0,this[10]=f??0,this[11]=m??0,this[12]=i??0,this[13]=a??0,this[14]=h??0,this[15]=y??0}et.packedLength=16;et.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t[n++]=e[4],t[n++]=e[5],t[n++]=e[6],t[n++]=e[7],t[n++]=e[8],t[n++]=e[9],t[n++]=e[10],t[n++]=e[11],t[n++]=e[12],t[n++]=e[13],t[n++]=e[14],t[n]=e[15],t};et.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new et),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n[4]=e[t++],n[5]=e[t++],n[6]=e[t++],n[7]=e[t++],n[8]=e[t++],n[9]=e[t++],n[10]=e[t++],n[11]=e[t++],n[12]=e[t++],n[13]=e[t++],n[14]=e[t++],n[15]=e[t],n};et.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*16;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 16 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)et.pack(e[o],t,o*16);return t};et.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,16),e.length%16!==0)throw new C("array length must be a multiple of 16.");let n=e.length;c(t)?t.length=n/16:t=new Array(n/16);for(let i=0;i<n;i+=16){let o=i/16;t[o]=et.unpack(e,i,t[o])}return t};et.clone=function(e,t){if(c(e))return c(t)?(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):new et(e[0],e[4],e[8],e[12],e[1],e[5],e[9],e[13],e[2],e[6],e[10],e[14],e[3],e[7],e[11],e[15])};et.fromArray=et.unpack;et.fromColumnMajorArray=function(e,t){return T.defined("values",e),et.clone(e,t)};et.fromRowMajorArray=function(e,t){return T.defined("values",e),c(t)?(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],t):new et(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])};et.fromRotationTranslation=function(e,t,n){return T.typeOf.object("rotation",e),t=t??d.ZERO,c(n)?(n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=0,n[4]=e[3],n[5]=e[4],n[6]=e[5],n[7]=0,n[8]=e[6],n[9]=e[7],n[10]=e[8],n[11]=0,n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=1,n):new et(e[0],e[3],e[6],t.x,e[1],e[4],e[7],t.y,e[2],e[5],e[8],t.z,0,0,0,1)};et.fromTranslationQuaternionRotationScale=function(e,t,n,i){T.typeOf.object("translation",e),T.typeOf.object("rotation",t),T.typeOf.object("scale",n),c(i)||(i=new et);let o=n.x,r=n.y,s=n.z,a=t.x*t.x,l=t.x*t.y,u=t.x*t.z,f=t.x*t.w,h=t.y*t.y,p=t.y*t.z,g=t.y*t.w,m=t.z*t.z,y=t.z*t.w,b=t.w*t.w,x=a-h-m+b,A=2*(l-y),E=2*(u+g),S=2*(l+y),v=-a+h-m+b,P=2*(p-f),M=2*(u-g),R=2*(p+f),L=-a-h+m+b;return i[0]=x*o,i[1]=S*o,i[2]=M*o,i[3]=0,i[4]=A*r,i[5]=v*r,i[6]=R*r,i[7]=0,i[8]=E*s,i[9]=P*s,i[10]=L*s,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,i};et.fromTranslationRotationScale=function(e,t){return T.typeOf.object("translationRotationScale",e),et.fromTranslationQuaternionRotationScale(e.translation,e.rotation,e.scale,t)};et.fromTranslation=function(e,t){return T.typeOf.object("translation",e),et.fromRotationTranslation(J.IDENTITY,e,t)};et.fromScale=function(e,t){return T.typeOf.object("scale",e),c(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e.y,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e.z,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new et(e.x,0,0,0,0,e.y,0,0,0,0,e.z,0,0,0,0,1)};et.fromUniformScale=function(e,t){return T.typeOf.number("scale",e),c(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=e,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=e,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t):new et(e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1)};et.fromRotation=function(e,t){return T.typeOf.object("rotation",e),c(t)||(t=new et),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=0,t[4]=e[3],t[5]=e[4],t[6]=e[5],t[7]=0,t[8]=e[6],t[9]=e[7],t[10]=e[8],t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t};var iT=new d,oT=new d,WS=new d;et.fromCamera=function(e,t){T.typeOf.object("camera",e);let n=e.position,i=e.direction,o=e.up;T.typeOf.object("camera.position",n),T.typeOf.object("camera.direction",i),T.typeOf.object("camera.up",o),d.normalize(i,iT),d.normalize(d.cross(iT,o,oT),oT),d.normalize(d.cross(oT,iT,WS),WS);let r=oT.x,s=oT.y,a=oT.z,l=iT.x,u=iT.y,f=iT.z,h=WS.x,p=WS.y,g=WS.z,m=n.x,y=n.y,b=n.z,x=r*-m+s*-y+a*-b,A=h*-m+p*-y+g*-b,E=l*m+u*y+f*b;return c(t)?(t[0]=r,t[1]=h,t[2]=-l,t[3]=0,t[4]=s,t[5]=p,t[6]=-u,t[7]=0,t[8]=a,t[9]=g,t[10]=-f,t[11]=0,t[12]=x,t[13]=A,t[14]=E,t[15]=1,t):new et(r,s,a,x,h,p,g,A,-l,-u,-f,E,0,0,0,1)};et.computePerspectiveFieldOfView=function(e,t,n,i,o){T.typeOf.number.greaterThan("fovY",e,0),T.typeOf.number.lessThan("fovY",e,Math.PI),T.typeOf.number.greaterThan("near",n,0),T.typeOf.number.greaterThan("far",i,0),T.typeOf.object("result",o);let s=1/Math.tan(e*.5),a=s/t,l=(i+n)/(n-i),u=2*i*n/(n-i);return o[0]=a,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=s,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=l,o[11]=-1,o[12]=0,o[13]=0,o[14]=u,o[15]=0,o};et.computeOrthographicOffCenter=function(e,t,n,i,o,r,s){T.typeOf.number("left",e),T.typeOf.number("right",t),T.typeOf.number("bottom",n),T.typeOf.number("top",i),T.typeOf.number("near",o),T.typeOf.number("far",r),T.typeOf.object("result",s);let a=1/(t-e),l=1/(i-n),u=1/(r-o),f=-(t+e)*a,h=-(i+n)*l,p=-(r+o)*u;return a*=2,l*=2,u*=-2,s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=l,s[6]=0,s[7]=0,s[8]=0,s[9]=0,s[10]=u,s[11]=0,s[12]=f,s[13]=h,s[14]=p,s[15]=1,s};et.computePerspectiveOffCenter=function(e,t,n,i,o,r,s){T.typeOf.number("left",e),T.typeOf.number("right",t),T.typeOf.number("bottom",n),T.typeOf.number("top",i),T.typeOf.number("near",o),T.typeOf.number("far",r),T.typeOf.object("result",s);let a=2*o/(t-e),l=2*o/(i-n),u=(t+e)/(t-e),f=(i+n)/(i-n),h=-(r+o)/(r-o),p=-1,g=-2*r*o/(r-o);return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=l,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=h,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s};et.computeInfinitePerspectiveOffCenter=function(e,t,n,i,o,r){T.typeOf.number("left",e),T.typeOf.number("right",t),T.typeOf.number("bottom",n),T.typeOf.number("top",i),T.typeOf.number("near",o),T.typeOf.object("result",r);let s=2*o/(t-e),a=2*o/(i-n),l=(t+e)/(t-e),u=(i+n)/(i-n),f=-1,h=-1,p=-2*o;return r[0]=s,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=a,r[6]=0,r[7]=0,r[8]=l,r[9]=u,r[10]=f,r[11]=h,r[12]=0,r[13]=0,r[14]=p,r[15]=0,r};et.computeViewportTransformation=function(e,t,n,i){c(i)||(i=new et),e=e??W.EMPTY_OBJECT;let o=e.x??0,r=e.y??0,s=e.width??0,a=e.height??0;t=t??0,n=n??1;let l=s*.5,u=a*.5,f=(n-t)*.5,h=l,p=u,g=f,m=o+l,y=r+u,b=t+f,x=1;return i[0]=h,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=p,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=g,i[11]=0,i[12]=m,i[13]=y,i[14]=b,i[15]=x,i};et.computeView=function(e,t,n,i,o){return T.typeOf.object("position",e),T.typeOf.object("direction",t),T.typeOf.object("up",n),T.typeOf.object("right",i),T.typeOf.object("result",o),o[0]=i.x,o[1]=n.x,o[2]=-t.x,o[3]=0,o[4]=i.y,o[5]=n.y,o[6]=-t.y,o[7]=0,o[8]=i.z,o[9]=n.z,o[10]=-t.z,o[11]=0,o[12]=-d.dot(i,e),o[13]=-d.dot(n,e),o[14]=d.dot(t,e),o[15]=1,o};et.toArray=function(e,t){return T.typeOf.object("matrix",e),c(t)?(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):[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]]};et.getElementIndex=function(e,t){return T.typeOf.number.greaterThanOrEquals("row",t,0),T.typeOf.number.lessThanOrEquals("row",t,3),T.typeOf.number.greaterThanOrEquals("column",e,0),T.typeOf.number.lessThanOrEquals("column",e,3),e*4+t};et.getColumn=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,3),T.typeOf.object("result",n);let i=t*4,o=e[i],r=e[i+1],s=e[i+2],a=e[i+3];return n.x=o,n.y=r,n.z=s,n.w=a,n};et.setColumn=function(e,t,n,i){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,3),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=et.clone(e,i);let o=t*4;return i[o]=n.x,i[o+1]=n.y,i[o+2]=n.z,i[o+3]=n.w,i};et.getRow=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,3),T.typeOf.object("result",n);let i=e[t],o=e[t+4],r=e[t+8],s=e[t+12];return n.x=i,n.y=o,n.z=r,n.w=s,n};et.setRow=function(e,t,n,i){return T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,3),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=et.clone(e,i),i[t]=n.x,i[t+4]=n.y,i[t+8]=n.z,i[t+12]=n.w,i};et.setTranslation=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.object("translation",t),T.typeOf.object("result",n),n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=t.x,n[13]=t.y,n[14]=t.z,n[15]=e[15],n};var DEe=new d;et.setScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n);let i=et.getScale(e,DEe),o=t.x/i.x,r=t.y/i.y,s=t.z/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var PEe=new d;et.setUniformScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n);let i=et.getScale(e,PEe),o=t/i.x,r=t/i.y,s=t/i.z;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*o,n[3]=e[3],n[4]=e[4]*r,n[5]=e[5]*r,n[6]=e[6]*r,n[7]=e[7],n[8]=e[8]*s,n[9]=e[9]*s,n[10]=e[10]*s,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var e5=new d;et.getScale=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t.x=d.magnitude(d.fromElements(e[0],e[1],e[2],e5)),t.y=d.magnitude(d.fromElements(e[4],e[5],e[6],e5)),t.z=d.magnitude(d.fromElements(e[8],e[9],e[10],e5)),t};var cZ=new d;et.getMaximumScale=function(e){return et.getScale(e,cZ),d.maximumComponent(cZ)};var IEe=new d;et.setRotation=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("result",n);let i=et.getScale(e,IEe);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.x,n[3]=e[3],n[4]=t[3]*i.y,n[5]=t[4]*i.y,n[6]=t[5]*i.y,n[7]=e[7],n[8]=t[6]*i.z,n[9]=t[7]*i.z,n[10]=t[8]*i.z,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};var OEe=new d;et.getRotation=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=et.getScale(e,OEe);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.x,t[3]=e[4]/n.y,t[4]=e[5]/n.y,t[5]=e[6]/n.y,t[6]=e[8]/n.z,t[7]=e[9]/n.z,t[8]=e[10]/n.z,t};et.multiply=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n);let i=e[0],o=e[1],r=e[2],s=e[3],a=e[4],l=e[5],u=e[6],f=e[7],h=e[8],p=e[9],g=e[10],m=e[11],y=e[12],b=e[13],x=e[14],A=e[15],E=t[0],S=t[1],v=t[2],P=t[3],M=t[4],R=t[5],L=t[6],B=t[7],_=t[8],w=t[9],D=t[10],I=t[11],N=t[12],k=t[13],H=t[14],V=t[15],j=i*E+a*S+h*v+y*P,U=o*E+l*S+p*v+b*P,q=r*E+u*S+g*v+x*P,X=s*E+f*S+m*v+A*P,te=i*M+a*R+h*L+y*B,K=o*M+l*R+p*L+b*B,Z=r*M+u*R+g*L+x*B,ee=s*M+f*R+m*L+A*B,me=i*_+a*w+h*D+y*I,xe=o*_+l*w+p*D+b*I,ue=r*_+u*w+g*D+x*I,ye=s*_+f*w+m*D+A*I,Ae=i*N+a*k+h*H+y*V,Pe=o*N+l*k+p*H+b*V,Ee=r*N+u*k+g*H+x*V,Ve=s*N+f*k+m*H+A*V;return n[0]=j,n[1]=U,n[2]=q,n[3]=X,n[4]=te,n[5]=K,n[6]=Z,n[7]=ee,n[8]=me,n[9]=xe,n[10]=ue,n[11]=ye,n[12]=Ae,n[13]=Pe,n[14]=Ee,n[15]=Ve,n};et.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n[4]=e[4]+t[4],n[5]=e[5]+t[5],n[6]=e[6]+t[6],n[7]=e[7]+t[7],n[8]=e[8]+t[8],n[9]=e[9]+t[9],n[10]=e[10]+t[10],n[11]=e[11]+t[11],n[12]=e[12]+t[12],n[13]=e[13]+t[13],n[14]=e[14]+t[14],n[15]=e[15]+t[15],n};et.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n[4]=e[4]-t[4],n[5]=e[5]-t[5],n[6]=e[6]-t[6],n[7]=e[7]-t[7],n[8]=e[8]-t[8],n[9]=e[9]-t[9],n[10]=e[10]-t[10],n[11]=e[11]-t[11],n[12]=e[12]-t[12],n[13]=e[13]-t[13],n[14]=e[14]-t[14],n[15]=e[15]-t[15],n};et.multiplyTransformation=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n);let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],l=e[6],u=e[8],f=e[9],h=e[10],p=e[12],g=e[13],m=e[14],y=t[0],b=t[1],x=t[2],A=t[4],E=t[5],S=t[6],v=t[8],P=t[9],M=t[10],R=t[12],L=t[13],B=t[14],_=i*y+s*b+u*x,w=o*y+a*b+f*x,D=r*y+l*b+h*x,I=i*A+s*E+u*S,N=o*A+a*E+f*S,k=r*A+l*E+h*S,H=i*v+s*P+u*M,V=o*v+a*P+f*M,j=r*v+l*P+h*M,U=i*R+s*L+u*B+p,q=o*R+a*L+f*B+g,X=r*R+l*L+h*B+m;return n[0]=_,n[1]=w,n[2]=D,n[3]=0,n[4]=I,n[5]=N,n[6]=k,n[7]=0,n[8]=H,n[9]=V,n[10]=j,n[11]=0,n[12]=U,n[13]=q,n[14]=X,n[15]=1,n};et.multiplyByMatrix3=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("rotation",t),T.typeOf.object("result",n);let i=e[0],o=e[1],r=e[2],s=e[4],a=e[5],l=e[6],u=e[8],f=e[9],h=e[10],p=t[0],g=t[1],m=t[2],y=t[3],b=t[4],x=t[5],A=t[6],E=t[7],S=t[8],v=i*p+s*g+u*m,P=o*p+a*g+f*m,M=r*p+l*g+h*m,R=i*y+s*b+u*x,L=o*y+a*b+f*x,B=r*y+l*b+h*x,_=i*A+s*E+u*S,w=o*A+a*E+f*S,D=r*A+l*E+h*S;return n[0]=v,n[1]=P,n[2]=M,n[3]=0,n[4]=R,n[5]=L,n[6]=B,n[7]=0,n[8]=_,n[9]=w,n[10]=D,n[11]=0,n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};et.multiplyByTranslation=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("translation",t),T.typeOf.object("result",n);let i=t.x,o=t.y,r=t.z,s=i*e[0]+o*e[4]+r*e[8]+e[12],a=i*e[1]+o*e[5]+r*e[9]+e[13],l=i*e[2]+o*e[6]+r*e[10]+e[14];return n[0]=e[0],n[1]=e[1],n[2]=e[2],n[3]=e[3],n[4]=e[4],n[5]=e[5],n[6]=e[6],n[7]=e[7],n[8]=e[8],n[9]=e[9],n[10]=e[10],n[11]=e[11],n[12]=s,n[13]=a,n[14]=l,n[15]=e[15],n};et.multiplyByScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n);let i=t.x,o=t.y,r=t.z;return i===1&&o===1&&r===1?et.clone(e,n):(n[0]=i*e[0],n[1]=i*e[1],n[2]=i*e[2],n[3]=e[3],n[4]=o*e[4],n[5]=o*e[5],n[6]=o*e[6],n[7]=e[7],n[8]=r*e[8],n[9]=r*e[9],n[10]=r*e[10],n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n)};et.multiplyByUniformScale=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3],n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7],n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11],n[12]=e[12],n[13]=e[13],n[14]=e[14],n[15]=e[15],n};et.multiplyByVector=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("cartesian",t),T.typeOf.object("result",n);let i=t.x,o=t.y,r=t.z,s=t.w,a=e[0]*i+e[4]*o+e[8]*r+e[12]*s,l=e[1]*i+e[5]*o+e[9]*r+e[13]*s,u=e[2]*i+e[6]*o+e[10]*r+e[14]*s,f=e[3]*i+e[7]*o+e[11]*r+e[15]*s;return n.x=a,n.y=l,n.z=u,n.w=f,n};et.multiplyByPointAsVector=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("cartesian",t),T.typeOf.object("result",n);let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r,a=e[1]*i+e[5]*o+e[9]*r,l=e[2]*i+e[6]*o+e[10]*r;return n.x=s,n.y=a,n.z=l,n};et.multiplyByPoint=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("cartesian",t),T.typeOf.object("result",n);let i=t.x,o=t.y,r=t.z,s=e[0]*i+e[4]*o+e[8]*r+e[12],a=e[1]*i+e[5]*o+e[9]*r+e[13],l=e[2]*i+e[6]*o+e[10]*r+e[14];return n.x=s,n.y=a,n.z=l,n};et.multiplyByScalar=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n[4]=e[4]*t,n[5]=e[5]*t,n[6]=e[6]*t,n[7]=e[7]*t,n[8]=e[8]*t,n[9]=e[9]*t,n[10]=e[10]*t,n[11]=e[11]*t,n[12]=e[12]*t,n[13]=e[13]*t,n[14]=e[14]*t,n[15]=e[15]*t,n};et.negate=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),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};et.transpose=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=e[1],i=e[2],o=e[3],r=e[6],s=e[7],a=e[11];return t[0]=e[0],t[1]=e[4],t[2]=e[8],t[3]=e[12],t[4]=n,t[5]=e[5],t[6]=e[9],t[7]=e[13],t[8]=i,t[9]=r,t[10]=e[10],t[11]=e[14],t[12]=o,t[13]=s,t[14]=a,t[15]=e[15],t};et.abs=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t[4]=Math.abs(e[4]),t[5]=Math.abs(e[5]),t[6]=Math.abs(e[6]),t[7]=Math.abs(e[7]),t[8]=Math.abs(e[8]),t[9]=Math.abs(e[9]),t[10]=Math.abs(e[10]),t[11]=Math.abs(e[11]),t[12]=Math.abs(e[12]),t[13]=Math.abs(e[13]),t[14]=Math.abs(e[14]),t[15]=Math.abs(e[15]),t};et.equals=function(e,t){return e===t||c(e)&&c(t)&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[3]===t[3]&&e[7]===t[7]&&e[11]===t[11]&&e[15]===t[15]};et.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n&&Math.abs(e[4]-t[4])<=n&&Math.abs(e[5]-t[5])<=n&&Math.abs(e[6]-t[6])<=n&&Math.abs(e[7]-t[7])<=n&&Math.abs(e[8]-t[8])<=n&&Math.abs(e[9]-t[9])<=n&&Math.abs(e[10]-t[10])<=n&&Math.abs(e[11]-t[11])<=n&&Math.abs(e[12]-t[12])<=n&&Math.abs(e[13]-t[13])<=n&&Math.abs(e[14]-t[14])<=n&&Math.abs(e[15]-t[15])<=n};et.getTranslation=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t.x=e[12],t.y=e[13],t.z=e[14],t};et.getMatrix3=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[4],t[4]=e[5],t[5]=e[6],t[6]=e[8],t[7]=e[9],t[8]=e[10],t};var REe=new J,MEe=new J,LEe=new se,NEe=new se(0,0,0,1);et.inverse=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=e[0],i=e[4],o=e[8],r=e[12],s=e[1],a=e[5],l=e[9],u=e[13],f=e[2],h=e[6],p=e[10],g=e[14],m=e[3],y=e[7],b=e[11],x=e[15],A=p*x,E=g*b,S=h*x,v=g*y,P=h*b,M=p*y,R=f*x,L=g*m,B=f*b,_=p*m,w=f*y,D=h*m,I=A*a+v*l+P*u-(E*a+S*l+M*u),N=E*s+R*l+_*u-(A*s+L*l+B*u),k=S*s+L*a+w*u-(v*s+R*a+D*u),H=M*s+B*a+D*l-(P*s+_*a+w*l),V=E*i+S*o+M*r-(A*i+v*o+P*r),j=A*n+L*o+B*r-(E*n+R*o+_*r),U=v*n+R*i+D*r-(S*n+L*i+w*r),q=P*n+_*i+w*o-(M*n+B*i+D*o);A=o*u,E=r*l,S=i*u,v=r*a,P=i*l,M=o*a,R=n*u,L=r*s,B=n*l,_=o*s,w=n*a,D=i*s;let X=A*y+v*b+P*x-(E*y+S*b+M*x),te=E*m+R*b+_*x-(A*m+L*b+B*x),K=S*m+L*y+w*x-(v*m+R*y+D*x),Z=M*m+B*y+D*b-(P*m+_*y+w*b),ee=S*p+M*g+E*h-(P*g+A*h+v*p),me=B*g+A*f+L*p-(R*p+_*g+E*f),xe=R*h+D*g+v*f-(w*g+S*f+L*h),ue=w*p+P*f+_*h-(B*h+D*p+M*f),ye=n*I+i*N+o*k+r*H;if(Math.abs(ye)<O.EPSILON21){if(J.equalsEpsilon(et.getMatrix3(e,REe),MEe,O.EPSILON7)&&se.equals(et.getRow(e,3,LEe),NEe))return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=0,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=0,t[11]=0,t[12]=-e[12],t[13]=-e[13],t[14]=-e[14],t[15]=1,t;throw new ae("matrix is not invertible because its determinate is zero.")}return ye=1/ye,t[0]=I*ye,t[1]=N*ye,t[2]=k*ye,t[3]=H*ye,t[4]=V*ye,t[5]=j*ye,t[6]=U*ye,t[7]=q*ye,t[8]=X*ye,t[9]=te*ye,t[10]=K*ye,t[11]=Z*ye,t[12]=ee*ye,t[13]=me*ye,t[14]=xe*ye,t[15]=ue*ye,t};et.inverseTransformation=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=e[0],i=e[1],o=e[2],r=e[4],s=e[5],a=e[6],l=e[8],u=e[9],f=e[10],h=e[12],p=e[13],g=e[14],m=-n*h-i*p-o*g,y=-r*h-s*p-a*g,b=-l*h-u*p-f*g;return t[0]=n,t[1]=r,t[2]=l,t[3]=0,t[4]=i,t[5]=s,t[6]=u,t[7]=0,t[8]=o,t[9]=a,t[10]=f,t[11]=0,t[12]=m,t[13]=y,t[14]=b,t[15]=1,t};var FEe=new et;et.inverseTranspose=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),et.inverse(et.transpose(e,FEe),t)};et.IDENTITY=Object.freeze(new et(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1));et.ZERO=Object.freeze(new et(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));et.COLUMN0ROW0=0;et.COLUMN0ROW1=1;et.COLUMN0ROW2=2;et.COLUMN0ROW3=3;et.COLUMN1ROW0=4;et.COLUMN1ROW1=5;et.COLUMN1ROW2=6;et.COLUMN1ROW3=7;et.COLUMN2ROW0=8;et.COLUMN2ROW1=9;et.COLUMN2ROW2=10;et.COLUMN2ROW3=11;et.COLUMN3ROW0=12;et.COLUMN3ROW1=13;et.COLUMN3ROW2=14;et.COLUMN3ROW3=15;Object.defineProperties(et.prototype,{length:{get:function(){return et.packedLength}}});et.prototype.clone=function(e){return et.clone(this,e)};et.prototype.equals=function(e){return et.equals(this,e)};et.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]&&e[4]===t[n+4]&&e[5]===t[n+5]&&e[6]===t[n+6]&&e[7]===t[n+7]&&e[8]===t[n+8]&&e[9]===t[n+9]&&e[10]===t[n+10]&&e[11]===t[n+11]&&e[12]===t[n+12]&&e[13]===t[n+13]&&e[14]===t[n+14]&&e[15]===t[n+15]};et.prototype.equalsEpsilon=function(e,t){return et.equalsEpsilon(this,e,t)};et.prototype.toString=function(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]})
(${this[1]}, ${this[5]}, ${this[9]}, ${this[13]})
(${this[2]}, ${this[6]}, ${this[10]}, ${this[14]})
(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`};var F=et;var BEe={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,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_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047},ne=Object.freeze(BEe);var kEe=new d;function wt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Qs={};Qs[ne.FLOAT]="float";Qs[ne.FLOAT_VEC2]="vec2";Qs[ne.FLOAT_VEC3]="vec3";Qs[ne.FLOAT_VEC4]="vec4";Qs[ne.INT]="int";Qs[ne.INT_VEC2]="ivec2";Qs[ne.INT_VEC3]="ivec3";Qs[ne.INT_VEC4]="ivec4";Qs[ne.BOOL]="bool";Qs[ne.BOOL_VEC2]="bvec2";Qs[ne.BOOL_VEC3]="bvec3";Qs[ne.BOOL_VEC4]="bvec4";Qs[ne.FLOAT_MAT2]="mat2";Qs[ne.FLOAT_MAT3]="mat3";Qs[ne.FLOAT_MAT4]="mat4";Qs[ne.SAMPLER_2D]="sampler2D";Qs[ne.SAMPLER_CUBE]="samplerCube";wt.prototype.getDeclaration=function(e){let t=`uniform ${Qs[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var UEe={czm_viewport:new wt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new wt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_model:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeHeight2D:new wt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new wt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_modelToEnu:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new wt({size:1,datatype:ne.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new wt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new wt({size:1,datatype:ne.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new wt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return F.getTranslation(e.inverseView,kEe)}}),czm_frameNumber:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new wt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new wt({size:1,datatype:ne.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new wt({size:1,datatype:ne.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new wt({size:1,datatype:ne.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new wt({size:9,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new wt({size:1,datatype:ne.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new wt({size:1,datatype:ne.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new wt({size:1,datatype:ne.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new wt({size:1,datatype:ne.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},N_=UEe;function VEe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var jn=VEe;function zEe(){return!0}function HEe(e,t){t=t??"This object was destroyed, i.e., destroy() was called.";function n(){throw new C(t)}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=zEe}var de=HEe;var Is={UNSIGNED_BYTE:ne.UNSIGNED_BYTE,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,UNSIGNED_INT:ne.UNSIGNED_INT};Is.getSizeInBytes=function(e){switch(e){case Is.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case Is.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case Is.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}throw new C("indexDatatype is required and must be a valid IndexDatatype constant.")};Is.fromSizeInBytes=function(e){switch(e){case 2:return Is.UNSIGNED_SHORT;case 4:return Is.UNSIGNED_INT;case 1:return Is.UNSIGNED_BYTE;default:throw new C("Size in bytes cannot be mapped to an IndexDatatype")}};Is.validate=function(e){return c(e)&&(e===Is.UNSIGNED_BYTE||e===Is.UNSIGNED_SHORT||e===Is.UNSIGNED_INT)};Is.createTypedArray=function(e,t){if(!c(e))throw new C("numberOfVertices is required.");return e>=O.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};Is.createTypedArrayFromArrayBuffer=function(e,t,n,i){if(!c(e))throw new C("numberOfVertices is required.");if(!c(t))throw new C("sourceArray is required.");if(!c(n))throw new C("byteOffset is required.");return e>=O.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};Is.fromTypedArray=function(e){if(e instanceof Uint8Array)return Is.UNSIGNED_BYTE;if(e instanceof Uint16Array)return Is.UNSIGNED_SHORT;if(e instanceof Uint32Array)return Is.UNSIGNED_INT;throw new C("array must be a Uint8Array, Uint16Array, or Uint32Array.")};var Fe=Object.freeze(Is);var pO={STREAM_DRAW:ne.STREAM_DRAW,STATIC_DRAW:ne.STATIC_DRAW,DYNAMIC_DRAW:ne.DYNAMIC_DRAW,validate:function(e){return e===pO.STREAM_DRAW||e===pO.STATIC_DRAW||e===pO.DYNAMIC_DRAW}},Be=Object.freeze(pO);function Yu(e){if(e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context),!c(e.typedArray)&&!c(e.sizeInBytes))throw new C("Either options.sizeInBytes or options.typedArray is required.");if(c(e.typedArray)&&c(e.sizeInBytes))throw new C("Cannot pass in both options.sizeInBytes and options.typedArray.");if(c(e.typedArray)&&(T.typeOf.object("options.typedArray",e.typedArray),T.typeOf.number("options.typedArray.byteLength",e.typedArray.byteLength)),!Be.validate(e.usage))throw new C("usage is invalid.");let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=c(i);s&&(o=i.byteLength),T.typeOf.number.greaterThan("sizeInBytes",o,0);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=jn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}Yu.createVertexBuffer=function(e){return T.defined("options.context",e.context),new Yu({context:e.context,bufferTarget:ne.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Yu.createIndexBuffer=function(e){if(T.defined("options.context",e.context),!Fe.validate(e.indexDatatype))throw new C("Invalid indexDatatype.");if(e.indexDatatype===Fe.UNSIGNED_INT&&!e.context.elementIndexUint)throw new C("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system. Check context.elementIndexUint.");let t=e.context,n=e.indexDatatype,i=Fe.getSizeInBytes(n),o=new Yu({context:t,bufferTarget:ne.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(Yu.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Yu.prototype._getBuffer=function(){return this._buffer};Yu.prototype.copyFromArrayView=function(e,t){t=t??0,T.defined("arrayView",e),T.typeOf.number.lessThanOrEquals("offsetInBytes + arrayView.byteLength",t+e.byteLength,this._sizeInBytes);let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Yu.prototype.copyFromBuffer=function(e,t,n,i){if(!this._webgl2)throw new C("A WebGL 2 context is required.");if(!c(e))throw new C("readBuffer must be defined.");if(!c(i)||i<=0)throw new C("sizeInBytes must be defined and be greater than zero.");if(!c(t)||t<0||t+i>e._sizeInBytes)throw new C("readOffset must be greater than or equal to zero and readOffset + sizeInBytes must be less than of equal to readBuffer.sizeInBytes.");if(!c(n)||n<0||n+i>this._sizeInBytes)throw new C("writeOffset must be greater than or equal to zero and writeOffset + sizeInBytes must be less than of equal to this.sizeInBytes.");if(this._buffer===e._buffer&&(n>=t&&n<t+i||t>n&&t<n+i))throw new C("When readBuffer is equal to this, the ranges [readOffset + sizeInBytes) and [writeOffset, writeOffset + sizeInBytes) must not overlap.");if(this._bufferTarget===ne.ELEMENT_ARRAY_BUFFER&&e._bufferTarget!==ne.ELEMENT_ARRAY_BUFFER||this._bufferTarget!==ne.ELEMENT_ARRAY_BUFFER&&e._bufferTarget===ne.ELEMENT_ARRAY_BUFFER)throw new C("Can not copy an index buffer into another buffer type.");let o=ne.COPY_READ_BUFFER,r=ne.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};Yu.prototype.getBufferData=function(e,t,n,i){if(t=t??0,n=n??0,!this._webgl2)throw new C("A WebGL 2 context is required.");if(!c(e))throw new C("arrayView is required.");let o,r,s=e.byteLength;if(c(i)?(o=i,c(s)?r=1:(s=e.length,r=e.BYTES_PER_ELEMENT)):c(s)?(o=s-n,r=1):(s=e.length,o=s-n,r=e.BYTES_PER_ELEMENT),n<0||n>s)throw new C("destinationOffset must be greater than zero and less than the arrayView length.");if(n+o>s)throw new C("destinationOffset + length must be less than or equal to the arrayViewLength.");if(t<0||t>this._sizeInBytes)throw new C("sourceOffset must be greater than zero and less than the buffers size.");if(t+o*r>this._sizeInBytes)throw new C("sourceOffset + length must be less than the buffers size.");let a=this._gl,l=ne.COPY_READ_BUFFER;a.bindBuffer(l,this._buffer),a.getBufferSubData(l,t,e,n,i),a.bindBuffer(l,null)};Yu.prototype.isDestroyed=function(){return!1};Yu.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),de(this)};var bt=Yu;var F_,Pr={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},al={};Object.defineProperties(al,{element:{get:function(){if(al.supportsFullscreen())return document[Pr.fullscreenElement]}},changeEventName:{get:function(){if(al.supportsFullscreen())return Pr.fullscreenchange}},errorEventName:{get:function(){if(al.supportsFullscreen())return Pr.fullscreenerror}},enabled:{get:function(){if(al.supportsFullscreen())return document[Pr.fullscreenEnabled]}},fullscreen:{get:function(){if(al.supportsFullscreen())return al.element!==null}}});al.supportsFullscreen=function(){if(c(F_))return F_;F_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return Pr.requestFullscreen="requestFullscreen",Pr.exitFullscreen="exitFullscreen",Pr.fullscreenEnabled="fullscreenEnabled",Pr.fullscreenElement="fullscreenElement",Pr.fullscreenchange="fullscreenchange",Pr.fullscreenerror="fullscreenerror",F_=!0,F_;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i<o;++i){let r=t[i];n=`${r}RequestFullscreen`,typeof e[n]=="function"?(Pr.requestFullscreen=n,F_=!0):(n=`${r}RequestFullScreen`,typeof e[n]=="function"&&(Pr.requestFullscreen=n,F_=!0)),n=`${r}ExitFullscreen`,typeof document[n]=="function"?Pr.exitFullscreen=n:(n=`${r}CancelFullScreen`,typeof document[n]=="function"&&(Pr.exitFullscreen=n)),n=`${r}FullscreenEnabled`,document[n]!==void 0?Pr.fullscreenEnabled=n:(n=`${r}FullScreenEnabled`,document[n]!==void 0&&(Pr.fullscreenEnabled=n)),n=`${r}FullscreenElement`,document[n]!==void 0?Pr.fullscreenElement=n:(n=`${r}FullScreenElement`,document[n]!==void 0&&(Pr.fullscreenElement=n)),n=`${r}fullscreenchange`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenChange"),Pr.fullscreenchange=n),n=`${r}fullscreenerror`,document[`on${n}`]!==void 0&&(r==="ms"&&(n="MSFullscreenError"),Pr.fullscreenerror=n)}return F_};al.requestFullscreen=function(e,t){al.supportsFullscreen()&&e[Pr.requestFullscreen]({vrDisplay:t})};al.exitFullscreen=function(){al.supportsFullscreen()&&document[Pr.exitFullscreen]()};al._names=Pr;var Ir=al;var Wa;typeof navigator<"u"?Wa=navigator:Wa={};function v0(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var _O,lZ;function s5(){if(!c(_O)&&(_O=!1,!AO())){let e=/ Chrome\/([\.0-9]+)/.exec(Wa.userAgent);e!==null&&(_O=!0,lZ=v0(e[1]))}return _O}function GEe(){return s5()&&lZ}var gO,uZ;function fZ(){if(!c(gO)&&(gO=!1,!s5()&&!AO()&&/ Safari\/[\.0-9]+/.test(Wa.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Wa.userAgent);e!==null&&(gO=!0,uZ=v0(e[1]))}return gO}function jEe(){return fZ()&&uZ}var yO,o5;function dZ(){if(!c(yO)){yO=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Wa.userAgent);e!==null&&(yO=!0,o5=v0(e[1]),o5.isNightly=!!e[2])}return yO}function WEe(){return dZ()&&o5}var qS,r5;function hZ(){if(!c(qS)){qS=!1;let e;Wa.appName==="Microsoft Internet Explorer"?(e=/MSIE ([0-9]{1,}[\.0-9]{0,})/.exec(Wa.userAgent),e!==null&&(qS=!0,r5=v0(e[1]))):Wa.appName==="Netscape"&&(e=/Trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.exec(Wa.userAgent),e!==null&&(qS=!0,r5=v0(e[1])))}return qS}function qEe(){return hZ()&&r5}var bO,mZ;function AO(){if(!c(bO)){bO=!1;let e=/ Edg\/([\.0-9]+)/.exec(Wa.userAgent);e!==null&&(bO=!0,mZ=v0(e[1]))}return bO}function YEe(){return AO()&&mZ}var xO,a5;function CO(){if(!c(xO)){xO=!1;let e=/Firefox\/([\.0-9]+)/.exec(Wa.userAgent);e!==null&&(xO=!0,a5=v0(e[1]))}return xO}var t5;function XEe(){return c(t5)||(t5=/Windows/i.test(Wa.appVersion)),t5}var n5;function KEe(){return c(n5)||(n5=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),n5}function $Ee(){return CO()&&a5}var i5;function ZEe(){return c(i5)||(i5=!CO()&&typeof PointerEvent<"u"&&(!c(Wa.pointerEnabled)||Wa.pointerEnabled)),i5}var pZ,TO;function _Z(){if(!c(TO)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;TO=c(t)&&t!=="",TO&&(pZ=t)}return TO}function QEe(){return _Z()?pZ:void 0}function ja(){if(!ja.initialized)throw new C("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");return ja._result}ja._promise=void 0;ja._result=void 0;ja.initialize=function(){return c(ja._promise)||(ja._promise=new Promise(e=>{let t=new Image;t.onload=function(){ja._result=t.width>0&&t.height>0,e(ja._result)},t.onerror=function(){ja._result=!1,e(ja._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),ja._promise};Object.defineProperties(ja,{initialized:{get:function(){return c(ja._result)}}});var rT=[];typeof ArrayBuffer<"u"&&(rT.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&rT.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&rT.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&rT.push(BigInt64Array),typeof BigUint64Array<"u"&&rT.push(BigUint64Array));var Xu={isChrome:s5,chromeVersion:GEe,isSafari:fZ,safariVersion:jEe,isWebkit:dZ,webkitVersion:WEe,isInternetExplorer:hZ,internetExplorerVersion:qEe,isEdge:AO,edgeVersion:YEe,isFirefox:CO,firefoxVersion:$Ee,isWindows:XEe,isIPadOrIOS:KEe,hardwareConcurrency:Wa.hardwareConcurrency??3,supportsPointerEvents:ZEe,supportsImageRenderingPixelated:_Z,supportsWebP:ja,imageRenderingValue:QEe,typedArrayTypes:rT};Xu.supportsBasis=function(e){return Xu.supportsWebAssembly()&&e.context.supportsBasis};Xu.supportsFullscreen=function(){return Ir.supportsFullscreen()};Xu.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Xu.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Xu.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Xu.supportsBigInt=function(){return typeof BigInt<"u"};Xu.supportsWebWorkers=function(){return typeof Worker<"u"};Xu.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Xu.supportsWebgl2=function(e){return T.defined("scene",e),e.context.webgl2};Xu.supportsEsmWebWorkers=function(){return!CO()||parseInt(a5)>=114};var zt=Xu;function c5(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function re(e,t,n,i){this.red=e??1,this.green=t??1,this.blue=n??1,this.alpha=i??1}re.fromCartesian4=function(e,t){return T.typeOf.object("cartesian",e),c(t)?(t.red=e.x,t.green=e.y,t.blue=e.z,t.alpha=e.w,t):new re(e.x,e.y,e.z,e.w)};re.fromBytes=function(e,t,n,i,o){return e=re.byteToFloat(e??255),t=re.byteToFloat(t??255),n=re.byteToFloat(n??255),i=re.byteToFloat(i??255),c(o)?(o.red=e,o.green=t,o.blue=n,o.alpha=i,o):new re(e,t,n,i)};re.fromAlpha=function(e,t,n){return T.typeOf.object("color",e),T.typeOf.number("alpha",t),c(n)?(n.red=e.red,n.green=e.green,n.blue=e.blue,n.alpha=t,n):new re(e.red,e.green,e.blue,t)};var l5,u5,ip;zt.supportsTypedArrays()&&(l5=new ArrayBuffer(4),u5=new Uint32Array(l5),ip=new Uint8Array(l5));re.fromRgba=function(e,t){return u5[0]=e,re.fromBytes(ip[0],ip[1],ip[2],ip[3],t)};re.fromHsl=function(e,t,n,i,o){e=(e??0)%1,t=t??0,n=n??0,i=i??1;let r=n,s=n,a=n;if(t!==0){let l;n<.5?l=n*(1+t):l=n+t-n*t;let u=2*n-l;r=c5(u,l,e+1/3),s=c5(u,l,e),a=c5(u,l,e-1/3)}return c(o)?(o.red=r,o.green=s,o.blue=a,o.alpha=i,o):new re(r,s,a,i)};re.fromRandom=function(e,t){e=e??W.EMPTY_OBJECT;let n=e.red;if(!c(n)){let s=e.minimumRed??0,a=e.maximumRed??1;T.typeOf.number.lessThanOrEquals("minimumRed",s,a),n=s+O.nextRandomNumber()*(a-s)}let i=e.green;if(!c(i)){let s=e.minimumGreen??0,a=e.maximumGreen??1;T.typeOf.number.lessThanOrEquals("minimumGreen",s,a),i=s+O.nextRandomNumber()*(a-s)}let o=e.blue;if(!c(o)){let s=e.minimumBlue??0,a=e.maximumBlue??1;T.typeOf.number.lessThanOrEquals("minimumBlue",s,a),o=s+O.nextRandomNumber()*(a-s)}let r=e.alpha;if(!c(r)){let s=e.minimumAlpha??0,a=e.maximumAlpha??1;T.typeOf.number.lessThanOrEquals("minimumAlpha",s,a),r=s+O.nextRandomNumber()*(a-s)}return c(t)?(t.red=n,t.green=i,t.blue=o,t.alpha=r,t):new re(n,i,o,r)};var JEe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,eSe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,tSe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,nSe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;re.fromCssColorString=function(e,t){T.typeOf.string("color",e),c(t)||(t=new re),e=e.trim();let n=re[e.toUpperCase()];if(c(n))return re.clone(n,t),t;let i=JEe.exec(e);return i!==null?(t.red=parseInt(i[1],16)/15,t.green=parseInt(i[2],16)/15,t.blue=parseInt(i[3],16)/15,t.alpha=parseInt(i[4]??"f",16)/15,t):(i=eSe.exec(e),i!==null?(t.red=parseInt(i[1],16)/255,t.green=parseInt(i[2],16)/255,t.blue=parseInt(i[3],16)/255,t.alpha=parseInt(i[4]??"ff",16)/255,t):(i=tSe.exec(e),i!==null?(t.red=parseFloat(i[1])/(i[1].substr(-1)==="%"?100:255),t.green=parseFloat(i[2])/(i[2].substr(-1)==="%"?100:255),t.blue=parseFloat(i[3])/(i[3].substr(-1)==="%"?100:255),t.alpha=parseFloat(i[4]??"1.0"),t):(i=nSe.exec(e),i!==null?re.fromHsl(parseFloat(i[1])/360,parseFloat(i[2])/100,parseFloat(i[3])/100,parseFloat(i[4]??"1.0"),t):(t=void 0,t))))};re.packedLength=4;re.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.red,t[n++]=e.green,t[n++]=e.blue,t[n]=e.alpha,t};re.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new re),n.red=e[t++],n.green=e[t++],n.blue=e[t++],n.alpha=e[t],n};re.byteToFloat=function(e){return e/255};re.floatToByte=function(e){return e===1?255:e*256|0};re.clone=function(e,t){if(c(e))return c(t)?(t.red=e.red,t.green=e.green,t.blue=e.blue,t.alpha=e.alpha,t):new re(e.red,e.green,e.blue,e.alpha)};re.equals=function(e,t){return e===t||c(e)&&c(t)&&e.red===t.red&&e.green===t.green&&e.blue===t.blue&&e.alpha===t.alpha};re.equalsArray=function(e,t,n){return e.red===t[n]&&e.green===t[n+1]&&e.blue===t[n+2]&&e.alpha===t[n+3]};re.prototype.clone=function(e){return re.clone(this,e)};re.prototype.equals=function(e){return re.equals(this,e)};re.prototype.equalsEpsilon=function(e,t){return this===e||c(e)&&Math.abs(this.red-e.red)<=t&&Math.abs(this.green-e.green)<=t&&Math.abs(this.blue-e.blue)<=t&&Math.abs(this.alpha-e.alpha)<=t};re.prototype.toString=function(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`};re.prototype.toCssColorString=function(){let e=re.floatToByte(this.red),t=re.floatToByte(this.green),n=re.floatToByte(this.blue);return this.alpha===1?`rgb(${e},${t},${n})`:`rgba(${e},${t},${n},${this.alpha})`};re.prototype.toCssHexString=function(){let e=re.floatToByte(this.red).toString(16);e.length<2&&(e=`0${e}`);let t=re.floatToByte(this.green).toString(16);t.length<2&&(t=`0${t}`);let n=re.floatToByte(this.blue).toString(16);if(n.length<2&&(n=`0${n}`),this.alpha<1){let i=re.floatToByte(this.alpha).toString(16);return i.length<2&&(i=`0${i}`),`#${e}${t}${n}${i}`}return`#${e}${t}${n}`};re.prototype.toBytes=function(e){let t=re.floatToByte(this.red),n=re.floatToByte(this.green),i=re.floatToByte(this.blue),o=re.floatToByte(this.alpha);return c(e)?(e[0]=t,e[1]=n,e[2]=i,e[3]=o,e):[t,n,i,o]};re.prototype.toRgba=function(){return ip[0]=re.floatToByte(this.red),ip[1]=re.floatToByte(this.green),ip[2]=re.floatToByte(this.blue),ip[3]=re.floatToByte(this.alpha),u5[0]};re.prototype.brighten=function(e,t){return T.typeOf.number("magnitude",e),T.typeOf.number.greaterThanOrEquals("magnitude",e,0),T.typeOf.object("result",t),e=1-e,t.red=1-(1-this.red)*e,t.green=1-(1-this.green)*e,t.blue=1-(1-this.blue)*e,t.alpha=this.alpha,t};re.prototype.darken=function(e,t){return T.typeOf.number("magnitude",e),T.typeOf.number.greaterThanOrEquals("magnitude",e,0),T.typeOf.object("result",t),e=1-e,t.red=this.red*e,t.green=this.green*e,t.blue=this.blue*e,t.alpha=this.alpha,t};re.prototype.withAlpha=function(e,t){return re.fromAlpha(this,e,t)};re.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.red=e.red+t.red,n.green=e.green+t.green,n.blue=e.blue+t.blue,n.alpha=e.alpha+t.alpha,n};re.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.red=e.red-t.red,n.green=e.green-t.green,n.blue=e.blue-t.blue,n.alpha=e.alpha-t.alpha,n};re.multiply=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.red=e.red*t.red,n.green=e.green*t.green,n.blue=e.blue*t.blue,n.alpha=e.alpha*t.alpha,n};re.divide=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.red=e.red/t.red,n.green=e.green/t.green,n.blue=e.blue/t.blue,n.alpha=e.alpha/t.alpha,n};re.mod=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.red=e.red%t.red,n.green=e.green%t.green,n.blue=e.blue%t.blue,n.alpha=e.alpha%t.alpha,n};re.lerp=function(e,t,n,i){return T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),i.red=O.lerp(e.red,t.red,n),i.green=O.lerp(e.green,t.green,n),i.blue=O.lerp(e.blue,t.blue,n),i.alpha=O.lerp(e.alpha,t.alpha,n),i};re.multiplyByScalar=function(e,t,n){return T.typeOf.object("color",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.red=e.red*t,n.green=e.green*t,n.blue=e.blue*t,n.alpha=e.alpha*t,n};re.divideByScalar=function(e,t,n){return T.typeOf.object("color",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.red=e.red/t,n.green=e.green/t,n.blue=e.blue/t,n.alpha=e.alpha/t,n};re.ALICEBLUE=Object.freeze(re.fromCssColorString("#F0F8FF"));re.ANTIQUEWHITE=Object.freeze(re.fromCssColorString("#FAEBD7"));re.AQUA=Object.freeze(re.fromCssColorString("#00FFFF"));re.AQUAMARINE=Object.freeze(re.fromCssColorString("#7FFFD4"));re.AZURE=Object.freeze(re.fromCssColorString("#F0FFFF"));re.BEIGE=Object.freeze(re.fromCssColorString("#F5F5DC"));re.BISQUE=Object.freeze(re.fromCssColorString("#FFE4C4"));re.BLACK=Object.freeze(re.fromCssColorString("#000000"));re.BLANCHEDALMOND=Object.freeze(re.fromCssColorString("#FFEBCD"));re.BLUE=Object.freeze(re.fromCssColorString("#0000FF"));re.BLUEVIOLET=Object.freeze(re.fromCssColorString("#8A2BE2"));re.BROWN=Object.freeze(re.fromCssColorString("#A52A2A"));re.BURLYWOOD=Object.freeze(re.fromCssColorString("#DEB887"));re.CADETBLUE=Object.freeze(re.fromCssColorString("#5F9EA0"));re.CHARTREUSE=Object.freeze(re.fromCssColorString("#7FFF00"));re.CHOCOLATE=Object.freeze(re.fromCssColorString("#D2691E"));re.CORAL=Object.freeze(re.fromCssColorString("#FF7F50"));re.CORNFLOWERBLUE=Object.freeze(re.fromCssColorString("#6495ED"));re.CORNSILK=Object.freeze(re.fromCssColorString("#FFF8DC"));re.CRIMSON=Object.freeze(re.fromCssColorString("#DC143C"));re.CYAN=Object.freeze(re.fromCssColorString("#00FFFF"));re.DARKBLUE=Object.freeze(re.fromCssColorString("#00008B"));re.DARKCYAN=Object.freeze(re.fromCssColorString("#008B8B"));re.DARKGOLDENROD=Object.freeze(re.fromCssColorString("#B8860B"));re.DARKGRAY=Object.freeze(re.fromCssColorString("#A9A9A9"));re.DARKGREEN=Object.freeze(re.fromCssColorString("#006400"));re.DARKGREY=re.DARKGRAY;re.DARKKHAKI=Object.freeze(re.fromCssColorString("#BDB76B"));re.DARKMAGENTA=Object.freeze(re.fromCssColorString("#8B008B"));re.DARKOLIVEGREEN=Object.freeze(re.fromCssColorString("#556B2F"));re.DARKORANGE=Object.freeze(re.fromCssColorString("#FF8C00"));re.DARKORCHID=Object.freeze(re.fromCssColorString("#9932CC"));re.DARKRED=Object.freeze(re.fromCssColorString("#8B0000"));re.DARKSALMON=Object.freeze(re.fromCssColorString("#E9967A"));re.DARKSEAGREEN=Object.freeze(re.fromCssColorString("#8FBC8F"));re.DARKSLATEBLUE=Object.freeze(re.fromCssColorString("#483D8B"));re.DARKSLATEGRAY=Object.freeze(re.fromCssColorString("#2F4F4F"));re.DARKSLATEGREY=re.DARKSLATEGRAY;re.DARKTURQUOISE=Object.freeze(re.fromCssColorString("#00CED1"));re.DARKVIOLET=Object.freeze(re.fromCssColorString("#9400D3"));re.DEEPPINK=Object.freeze(re.fromCssColorString("#FF1493"));re.DEEPSKYBLUE=Object.freeze(re.fromCssColorString("#00BFFF"));re.DIMGRAY=Object.freeze(re.fromCssColorString("#696969"));re.DIMGREY=re.DIMGRAY;re.DODGERBLUE=Object.freeze(re.fromCssColorString("#1E90FF"));re.FIREBRICK=Object.freeze(re.fromCssColorString("#B22222"));re.FLORALWHITE=Object.freeze(re.fromCssColorString("#FFFAF0"));re.FORESTGREEN=Object.freeze(re.fromCssColorString("#228B22"));re.FUCHSIA=Object.freeze(re.fromCssColorString("#FF00FF"));re.GAINSBORO=Object.freeze(re.fromCssColorString("#DCDCDC"));re.GHOSTWHITE=Object.freeze(re.fromCssColorString("#F8F8FF"));re.GOLD=Object.freeze(re.fromCssColorString("#FFD700"));re.GOLDENROD=Object.freeze(re.fromCssColorString("#DAA520"));re.GRAY=Object.freeze(re.fromCssColorString("#808080"));re.GREEN=Object.freeze(re.fromCssColorString("#008000"));re.GREENYELLOW=Object.freeze(re.fromCssColorString("#ADFF2F"));re.GREY=re.GRAY;re.HONEYDEW=Object.freeze(re.fromCssColorString("#F0FFF0"));re.HOTPINK=Object.freeze(re.fromCssColorString("#FF69B4"));re.INDIANRED=Object.freeze(re.fromCssColorString("#CD5C5C"));re.INDIGO=Object.freeze(re.fromCssColorString("#4B0082"));re.IVORY=Object.freeze(re.fromCssColorString("#FFFFF0"));re.KHAKI=Object.freeze(re.fromCssColorString("#F0E68C"));re.LAVENDER=Object.freeze(re.fromCssColorString("#E6E6FA"));re.LAVENDAR_BLUSH=Object.freeze(re.fromCssColorString("#FFF0F5"));re.LAWNGREEN=Object.freeze(re.fromCssColorString("#7CFC00"));re.LEMONCHIFFON=Object.freeze(re.fromCssColorString("#FFFACD"));re.LIGHTBLUE=Object.freeze(re.fromCssColorString("#ADD8E6"));re.LIGHTCORAL=Object.freeze(re.fromCssColorString("#F08080"));re.LIGHTCYAN=Object.freeze(re.fromCssColorString("#E0FFFF"));re.LIGHTGOLDENRODYELLOW=Object.freeze(re.fromCssColorString("#FAFAD2"));re.LIGHTGRAY=Object.freeze(re.fromCssColorString("#D3D3D3"));re.LIGHTGREEN=Object.freeze(re.fromCssColorString("#90EE90"));re.LIGHTGREY=re.LIGHTGRAY;re.LIGHTPINK=Object.freeze(re.fromCssColorString("#FFB6C1"));re.LIGHTSEAGREEN=Object.freeze(re.fromCssColorString("#20B2AA"));re.LIGHTSKYBLUE=Object.freeze(re.fromCssColorString("#87CEFA"));re.LIGHTSLATEGRAY=Object.freeze(re.fromCssColorString("#778899"));re.LIGHTSLATEGREY=re.LIGHTSLATEGRAY;re.LIGHTSTEELBLUE=Object.freeze(re.fromCssColorString("#B0C4DE"));re.LIGHTYELLOW=Object.freeze(re.fromCssColorString("#FFFFE0"));re.LIME=Object.freeze(re.fromCssColorString("#00FF00"));re.LIMEGREEN=Object.freeze(re.fromCssColorString("#32CD32"));re.LINEN=Object.freeze(re.fromCssColorString("#FAF0E6"));re.MAGENTA=Object.freeze(re.fromCssColorString("#FF00FF"));re.MAROON=Object.freeze(re.fromCssColorString("#800000"));re.MEDIUMAQUAMARINE=Object.freeze(re.fromCssColorString("#66CDAA"));re.MEDIUMBLUE=Object.freeze(re.fromCssColorString("#0000CD"));re.MEDIUMORCHID=Object.freeze(re.fromCssColorString("#BA55D3"));re.MEDIUMPURPLE=Object.freeze(re.fromCssColorString("#9370DB"));re.MEDIUMSEAGREEN=Object.freeze(re.fromCssColorString("#3CB371"));re.MEDIUMSLATEBLUE=Object.freeze(re.fromCssColorString("#7B68EE"));re.MEDIUMSPRINGGREEN=Object.freeze(re.fromCssColorString("#00FA9A"));re.MEDIUMTURQUOISE=Object.freeze(re.fromCssColorString("#48D1CC"));re.MEDIUMVIOLETRED=Object.freeze(re.fromCssColorString("#C71585"));re.MIDNIGHTBLUE=Object.freeze(re.fromCssColorString("#191970"));re.MINTCREAM=Object.freeze(re.fromCssColorString("#F5FFFA"));re.MISTYROSE=Object.freeze(re.fromCssColorString("#FFE4E1"));re.MOCCASIN=Object.freeze(re.fromCssColorString("#FFE4B5"));re.NAVAJOWHITE=Object.freeze(re.fromCssColorString("#FFDEAD"));re.NAVY=Object.freeze(re.fromCssColorString("#000080"));re.OLDLACE=Object.freeze(re.fromCssColorString("#FDF5E6"));re.OLIVE=Object.freeze(re.fromCssColorString("#808000"));re.OLIVEDRAB=Object.freeze(re.fromCssColorString("#6B8E23"));re.ORANGE=Object.freeze(re.fromCssColorString("#FFA500"));re.ORANGERED=Object.freeze(re.fromCssColorString("#FF4500"));re.ORCHID=Object.freeze(re.fromCssColorString("#DA70D6"));re.PALEGOLDENROD=Object.freeze(re.fromCssColorString("#EEE8AA"));re.PALEGREEN=Object.freeze(re.fromCssColorString("#98FB98"));re.PALETURQUOISE=Object.freeze(re.fromCssColorString("#AFEEEE"));re.PALEVIOLETRED=Object.freeze(re.fromCssColorString("#DB7093"));re.PAPAYAWHIP=Object.freeze(re.fromCssColorString("#FFEFD5"));re.PEACHPUFF=Object.freeze(re.fromCssColorString("#FFDAB9"));re.PERU=Object.freeze(re.fromCssColorString("#CD853F"));re.PINK=Object.freeze(re.fromCssColorString("#FFC0CB"));re.PLUM=Object.freeze(re.fromCssColorString("#DDA0DD"));re.POWDERBLUE=Object.freeze(re.fromCssColorString("#B0E0E6"));re.PURPLE=Object.freeze(re.fromCssColorString("#800080"));re.RED=Object.freeze(re.fromCssColorString("#FF0000"));re.ROSYBROWN=Object.freeze(re.fromCssColorString("#BC8F8F"));re.ROYALBLUE=Object.freeze(re.fromCssColorString("#4169E1"));re.SADDLEBROWN=Object.freeze(re.fromCssColorString("#8B4513"));re.SALMON=Object.freeze(re.fromCssColorString("#FA8072"));re.SANDYBROWN=Object.freeze(re.fromCssColorString("#F4A460"));re.SEAGREEN=Object.freeze(re.fromCssColorString("#2E8B57"));re.SEASHELL=Object.freeze(re.fromCssColorString("#FFF5EE"));re.SIENNA=Object.freeze(re.fromCssColorString("#A0522D"));re.SILVER=Object.freeze(re.fromCssColorString("#C0C0C0"));re.SKYBLUE=Object.freeze(re.fromCssColorString("#87CEEB"));re.SLATEBLUE=Object.freeze(re.fromCssColorString("#6A5ACD"));re.SLATEGRAY=Object.freeze(re.fromCssColorString("#708090"));re.SLATEGREY=re.SLATEGRAY;re.SNOW=Object.freeze(re.fromCssColorString("#FFFAFA"));re.SPRINGGREEN=Object.freeze(re.fromCssColorString("#00FF7F"));re.STEELBLUE=Object.freeze(re.fromCssColorString("#4682B4"));re.TAN=Object.freeze(re.fromCssColorString("#D2B48C"));re.TEAL=Object.freeze(re.fromCssColorString("#008080"));re.THISTLE=Object.freeze(re.fromCssColorString("#D8BFD8"));re.TOMATO=Object.freeze(re.fromCssColorString("#FF6347"));re.TURQUOISE=Object.freeze(re.fromCssColorString("#40E0D0"));re.VIOLET=Object.freeze(re.fromCssColorString("#EE82EE"));re.WHEAT=Object.freeze(re.fromCssColorString("#F5DEB3"));re.WHITE=Object.freeze(re.fromCssColorString("#FFFFFF"));re.WHITESMOKE=Object.freeze(re.fromCssColorString("#F5F5F5"));re.YELLOW=Object.freeze(re.fromCssColorString("#FFFF00"));re.YELLOWGREEN=Object.freeze(re.fromCssColorString("#9ACD32"));re.TRANSPARENT=Object.freeze(new re(0,0,0,0));var G=re;function EO(e){e=e??W.EMPTY_OBJECT,this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}EO.ALL=Object.freeze(new EO({color:new G(0,0,0,0),depth:1,stencil:0}));EO.prototype.execute=function(e,t){e.clear(this,t)};var ti=EO;var iSe={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE:4,CESIUM_3D_TILE_CLASSIFICATION:5,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:6,OPAQUE:7,TRANSLUCENT:8,VOXELS:9,OVERLAY:10,NUMBER_OF_PASSES:11},De=Object.freeze(iSe);function gZ(e){e=e??W.EMPTY_OBJECT,this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=e.persists??!1,this.pass=De.COMPUTE,this.owner=e.owner}gZ.prototype.execute=function(e){e.execute(this)};var cl=gZ;function Ft(e,t){this.x=e??0,this.y=t??0}Ft.fromElements=function(e,t,n){return c(n)?(n.x=e,n.y=t,n):new Ft(e,t)};Ft.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t):new Ft(e.x,e.y)};Ft.fromCartesian3=Ft.clone;Ft.fromCartesian4=Ft.clone;Ft.packedLength=2;Ft.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n]=e.y,t};Ft.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Ft),n.x=e[t++],n.y=e[t],n};Ft.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*2;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 2 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)Ft.pack(e[o],t,o*2);return t};Ft.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,2),e.length%2!==0)throw new C("array length must be a multiple of 2.");let n=e.length;c(t)?t.length=n/2:t=new Array(n/2);for(let i=0;i<n;i+=2){let o=i/2;t[o]=Ft.unpack(e,i,t[o])}return t};Ft.fromArray=Ft.unpack;Ft.maximumComponent=function(e){return T.typeOf.object("cartesian",e),Math.max(e.x,e.y)};Ft.minimumComponent=function(e){return T.typeOf.object("cartesian",e),Math.min(e.x,e.y)};Ft.minimumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),n.x=Math.min(e.x,t.x),n.y=Math.min(e.y,t.y),n};Ft.maximumByComponent=function(e,t,n){return T.typeOf.object("first",e),T.typeOf.object("second",t),T.typeOf.object("result",n),n.x=Math.max(e.x,t.x),n.y=Math.max(e.y,t.y),n};Ft.clamp=function(e,t,n,i){T.typeOf.object("value",e),T.typeOf.object("min",t),T.typeOf.object("max",n),T.typeOf.object("result",i);let o=O.clamp(e.x,t.x,n.x),r=O.clamp(e.y,t.y,n.y);return i.x=o,i.y=r,i};Ft.magnitudeSquared=function(e){return T.typeOf.object("cartesian",e),e.x*e.x+e.y*e.y};Ft.magnitude=function(e){return Math.sqrt(Ft.magnitudeSquared(e))};var SO=new Ft;Ft.distance=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),Ft.subtract(e,t,SO),Ft.magnitude(SO)};Ft.distanceSquared=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),Ft.subtract(e,t,SO),Ft.magnitudeSquared(SO)};Ft.normalize=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=Ft.magnitude(e);if(t.x=e.x/n,t.y=e.y/n,isNaN(t.x)||isNaN(t.y))throw new C("normalized result is not a number");return t};Ft.dot=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.x*t.x+e.y*t.y};Ft.cross=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.x*t.y-e.y*t.x};Ft.multiplyComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x*t.x,n.y=e.y*t.y,n};Ft.divideComponents=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x/t.x,n.y=e.y/t.y,n};Ft.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n};Ft.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n};Ft.multiplyByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n};Ft.divideByScalar=function(e,t,n){return T.typeOf.object("cartesian",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n};Ft.negate=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t};Ft.abs=function(e,t){return T.typeOf.object("cartesian",e),T.typeOf.object("result",t),t.x=Math.abs(e.x),t.y=Math.abs(e.y),t};var yZ=new Ft;Ft.lerp=function(e,t,n,i){return T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),Ft.multiplyByScalar(t,n,yZ),i=Ft.multiplyByScalar(e,1-n,i),Ft.add(yZ,i,i)};var bZ=new Ft,xZ=new Ft;Ft.angleBetween=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),Ft.normalize(e,bZ),Ft.normalize(t,xZ),O.acosClamped(Ft.dot(bZ,xZ))};var oSe=new Ft;Ft.mostOrthogonalAxis=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=Ft.normalize(e,oSe);return Ft.abs(n,n),n.x<=n.y?t=Ft.clone(Ft.UNIT_X,t):t=Ft.clone(Ft.UNIT_Y,t),t};Ft.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y};Ft.equalsArray=function(e,t,n){return e.x===t[n]&&e.y===t[n+1]};Ft.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(t)&&O.equalsEpsilon(e.x,t.x,n,i)&&O.equalsEpsilon(e.y,t.y,n,i)};Ft.ZERO=Object.freeze(new Ft(0,0));Ft.ONE=Object.freeze(new Ft(1,1));Ft.UNIT_X=Object.freeze(new Ft(1,0));Ft.UNIT_Y=Object.freeze(new Ft(0,1));Ft.prototype.clone=function(e){return Ft.clone(this,e)};Ft.prototype.equals=function(e){return Ft.equals(this,e)};Ft.prototype.equalsEpsilon=function(e,t,n){return Ft.equalsEpsilon(this,e,t,n)};Ft.prototype.toString=function(){return`(${this.x}, ${this.y})`};var z=Ft;var rSe=new d,sSe=new d;function aSe(e,t,n,i,o){if(!c(e))throw new C("cartesian is required.");if(!c(t))throw new C("oneOverRadii is required.");if(!c(n))throw new C("oneOverRadiiSquared is required.");if(!c(i))throw new C("centerToleranceSquared is required.");let r=e.x,s=e.y,a=e.z,l=t.x,u=t.y,f=t.z,h=r*r*l*l,p=s*s*u*u,g=a*a*f*f,m=h+p+g,y=Math.sqrt(1/m),b=d.multiplyByScalar(e,y,rSe);if(m<i)return isFinite(y)?d.clone(b,o):void 0;let x=n.x,A=n.y,E=n.z,S=sSe;S.x=b.x*x*2,S.y=b.y*A*2,S.z=b.z*E*2;let v=(1-y)*d.magnitude(e)/(.5*d.magnitude(S)),P=0,M,R,L,B,_,w,D,I,N,k,H;do{v-=P,L=1/(1+v*x),B=1/(1+v*A),_=1/(1+v*E),w=L*L,D=B*B,I=_*_,N=w*L,k=D*B,H=I*_,M=h*w+p*D+g*I-1,R=h*N*x+p*k*A+g*H*E;let V=-2*R;P=M/V}while(Math.abs(M)>O.EPSILON12);return c(o)?(o.x=r*L,o.y=s*B,o.z=a*_,o):new d(r*L,s*B,a*_)}var sT=aSe;function Ro(e,t,n){this.longitude=e??0,this.latitude=t??0,this.height=n??0}Ro.fromRadians=function(e,t,n,i){return T.typeOf.number("longitude",e),T.typeOf.number("latitude",t),n=n??0,c(i)?(i.longitude=e,i.latitude=t,i.height=n,i):new Ro(e,t,n)};Ro.fromDegrees=function(e,t,n,i){return T.typeOf.number("longitude",e),T.typeOf.number("latitude",t),e=O.toRadians(e),t=O.toRadians(t),Ro.fromRadians(e,t,n,i)};var cSe=new d,lSe=new d,uSe=new d;Ro._ellipsoidOneOverRadii=new d(1/6378137,1/6378137,1/6356752314245179e-9);Ro._ellipsoidOneOverRadiiSquared=new d(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9));Ro._ellipsoidCenterToleranceSquared=O.EPSILON1;Ro.fromCartesian=function(e,t,n){let i=c(t)?t.oneOverRadii:Ro._ellipsoidOneOverRadii,o=c(t)?t.oneOverRadiiSquared:Ro._ellipsoidOneOverRadiiSquared,r=c(t)?t._centerToleranceSquared:Ro._ellipsoidCenterToleranceSquared,s=sT(e,i,o,r,lSe);if(!c(s))return;let a=d.multiplyComponents(s,o,cSe);a=d.normalize(a,a);let l=d.subtract(e,s,uSe),u=Math.atan2(a.y,a.x),f=Math.asin(a.z),h=O.sign(d.dot(l,e))*d.magnitude(l);return c(n)?(n.longitude=u,n.latitude=f,n.height=h,n):new Ro(u,f,h)};Ro.toCartesian=function(e,t,n){return T.defined("cartographic",e),d.fromRadians(e.longitude,e.latitude,e.height,t,n)};Ro.clone=function(e,t){if(c(e))return c(t)?(t.longitude=e.longitude,t.latitude=e.latitude,t.height=e.height,t):new Ro(e.longitude,e.latitude,e.height)};Ro.equals=function(e,t){return e===t||c(e)&&c(t)&&e.longitude===t.longitude&&e.latitude===t.latitude&&e.height===t.height};Ro.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e.longitude-t.longitude)<=n&&Math.abs(e.latitude-t.latitude)<=n&&Math.abs(e.height-t.height)<=n};Ro.ZERO=Object.freeze(new Ro(0,0,0));Ro.prototype.clone=function(e){return Ro.clone(this,e)};Ro.prototype.equals=function(e){return Ro.equals(this,e)};Ro.prototype.equalsEpsilon=function(e,t){return Ro.equalsEpsilon(this,e,t)};Ro.prototype.toString=function(){return`(${this.longitude}, ${this.latitude}, ${this.height})`};var he=Ro;function AZ(e,t,n,i){t=t??0,n=n??0,i=i??0,T.typeOf.number.greaterThanOrEquals("x",t,0),T.typeOf.number.greaterThanOrEquals("y",n,0),T.typeOf.number.greaterThanOrEquals("z",i,0),e._radii=new d(t,n,i),e._radiiSquared=new d(t*t,n*n,i*i),e._radiiToTheFourth=new d(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new d(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new d(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=O.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}function mi(e,t,n){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,AZ(this,e,t,n)}Object.defineProperties(mi.prototype,{radii:{get:function(){return this._radii}},radiiSquared:{get:function(){return this._radiiSquared}},radiiToTheFourth:{get:function(){return this._radiiToTheFourth}},oneOverRadii:{get:function(){return this._oneOverRadii}},oneOverRadiiSquared:{get:function(){return this._oneOverRadiiSquared}},minimumRadius:{get:function(){return this._minimumRadius}},maximumRadius:{get:function(){return this._maximumRadius}}});mi.clone=function(e,t){if(!c(e))return;let n=e._radii;return c(t)?(d.clone(n,t._radii),d.clone(e._radiiSquared,t._radiiSquared),d.clone(e._radiiToTheFourth,t._radiiToTheFourth),d.clone(e._oneOverRadii,t._oneOverRadii),d.clone(e._oneOverRadiiSquared,t._oneOverRadiiSquared),t._minimumRadius=e._minimumRadius,t._maximumRadius=e._maximumRadius,t._centerToleranceSquared=e._centerToleranceSquared,t):new mi(n.x,n.y,n.z)};mi.fromCartesian3=function(e,t){return c(t)||(t=new mi),c(e)&&AZ(t,e.x,e.y,e.z),t};mi.WGS84=Object.freeze(new mi(6378137,6378137,6356752314245179e-9));mi.UNIT_SPHERE=Object.freeze(new mi(1,1,1));mi.MOON=Object.freeze(new mi(O.LUNAR_RADIUS,O.LUNAR_RADIUS,O.LUNAR_RADIUS));mi._default=mi.WGS84;Object.defineProperties(mi,{default:{get:function(){return mi._default},set:function(e){T.typeOf.object("value",e),mi._default=e,d._ellipsoidRadiiSquared=e.radiiSquared,he._ellipsoidOneOverRadii=e.oneOverRadii,he._ellipsoidOneOverRadiiSquared=e.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=e._centerToleranceSquared}}});mi.prototype.clone=function(e){return mi.clone(this,e)};mi.packedLength=d.packedLength;mi.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,d.pack(e._radii,t,n),t};mi.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=d.unpack(e,t);return mi.fromCartesian3(i,n)};mi.prototype.geocentricSurfaceNormal=d.normalize;mi.prototype.geodeticSurfaceNormalCartographic=function(e,t){T.typeOf.object("cartographic",e);let n=e.longitude,i=e.latitude,o=Math.cos(i),r=o*Math.cos(n),s=o*Math.sin(n),a=Math.sin(i);return c(t)||(t=new d),t.x=r,t.y=s,t.z=a,d.normalize(t,t)};mi.prototype.geodeticSurfaceNormal=function(e,t){if(T.typeOf.object("cartesian",e),isNaN(e.x)||isNaN(e.y)||isNaN(e.z))throw new C("cartesian has a NaN component");if(!d.equalsEpsilon(e,d.ZERO,O.EPSILON14))return c(t)||(t=new d),t=d.multiplyComponents(e,this._oneOverRadiiSquared,t),d.normalize(t,t)};var fSe=new d,dSe=new d;mi.prototype.cartographicToCartesian=function(e,t){let n=fSe,i=dSe;this.geodeticSurfaceNormalCartographic(e,n),d.multiplyComponents(this._radiiSquared,n,i);let o=Math.sqrt(d.dot(n,i));return d.divideByScalar(i,o,i),d.multiplyByScalar(n,e.height,n),c(t)||(t=new d),d.add(i,n,t)};mi.prototype.cartographicArrayToCartesianArray=function(e,t){T.defined("cartographics",e);let n=e.length;c(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=this.cartographicToCartesian(e[i],t[i]);return t};var hSe=new d,mSe=new d,pSe=new d;mi.prototype.cartesianToCartographic=function(e,t){let n=this.scaleToGeodeticSurface(e,mSe);if(!c(n))return;let i=this.geodeticSurfaceNormal(n,hSe),o=d.subtract(e,n,pSe),r=Math.atan2(i.y,i.x),s=Math.asin(i.z),a=O.sign(d.dot(o,e))*d.magnitude(o);return c(t)?(t.longitude=r,t.latitude=s,t.height=a,t):new he(r,s,a)};mi.prototype.cartesianArrayToCartographicArray=function(e,t){T.defined("cartesians",e);let n=e.length;c(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.cartesianToCartographic(e[i],t[i]);return t};mi.prototype.scaleToGeodeticSurface=function(e,t){return sT(e,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,t)};mi.prototype.scaleToGeocentricSurface=function(e,t){T.typeOf.object("cartesian",e),c(t)||(t=new d);let n=e.x,i=e.y,o=e.z,r=this._oneOverRadiiSquared,s=1/Math.sqrt(n*n*r.x+i*i*r.y+o*o*r.z);return d.multiplyByScalar(e,s,t)};mi.prototype.transformPositionToScaledSpace=function(e,t){return c(t)||(t=new d),d.multiplyComponents(e,this._oneOverRadii,t)};mi.prototype.transformPositionFromScaledSpace=function(e,t){return c(t)||(t=new d),d.multiplyComponents(e,this._radii,t)};mi.prototype.equals=function(e){return this===e||c(e)&&d.equals(this._radii,e._radii)};mi.prototype.toString=function(){return this._radii.toString()};mi.prototype.getSurfaceNormalIntersectionWithZAxis=function(e,t,n){if(T.typeOf.object("position",e),!O.equalsEpsilon(this._radii.x,this._radii.y,O.EPSILON15))throw new C("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");T.typeOf.number.greaterThan("Ellipsoid.radii.z",this._radii.z,0),t=t??0;let i=this._squaredXOverSquaredZ;if(c(n)||(n=new d),n.x=0,n.y=0,n.z=e.z*(1-i),!(Math.abs(n.z)>=this._radii.z-t))return n};var _Se=new d;mi.prototype.getLocalCurvature=function(e,t){T.typeOf.object("surfacePosition",e),c(t)||(t=new z);let n=this.getSurfaceNormalIntersectionWithZAxis(e,0,_Se),i=d.distance(e,n),o=this.minimumRadius*i/this.maximumRadius**2,r=i*o**2;return z.fromElements(1/i,1/r,t)};var gSe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],ySe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function TZ(e,t,n){T.typeOf.number("a",e),T.typeOf.number("b",t),T.typeOf.func("func",n);let i=.5*(t+e),o=.5*(t-e),r=0;for(let s=0;s<5;s++){let a=o*gSe[s];r+=ySe[s]*(n(i+a)+n(i-a))}return r*=o,r}mi.prototype.surfaceArea=function(e){T.typeOf.object("rectangle",e);let t=e.west,n=e.east,i=e.south,o=e.north;for(;n<t;)n+=O.TWO_PI;let r=this._radiiSquared,s=r.x,a=r.y,l=r.z,u=s*a;return TZ(i,o,function(f){let h=Math.cos(f),p=Math.sin(f);return Math.cos(f)*TZ(t,n,function(g){let m=Math.cos(g),y=Math.sin(g);return Math.sqrt(u*p*p+l*(a*m*m+s*y*y)*h*h)})})};var ie=mi;function wO(e){this._ellipsoid=e??ie.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(wO.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});wO.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=e.latitude*n,r=e.height;return c(t)?(t.x=i,t.y=o,t.z=r,t):new d(i,o,r)};wO.prototype.unproject=function(e,t){if(!c(e))throw new C("cartesian is required");let n=this._oneOverSemimajorAxis,i=e.x*n,o=e.y*n,r=e.z;return c(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Oi=wO;var bSe={OUTSIDE:-1,INTERSECTING:0,INSIDE:1},Wt=Object.freeze(bSe);function xSe(e,t,n){T.defined("array",e),T.defined("itemToFind",t),T.defined("comparator",n);let i=0,o=e.length-1,r,s;for(;i<=o;){if(r=~~((i+o)/2),s=n(e[r],t),s<0){i=r+1;continue}if(s>0){o=r-1;continue}return r}return~(o+1)}var Mo=xSe;function TSe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var D0=TSe;function ASe(e){if(e===null||isNaN(e))throw new C("year is required and must be a number.");return e%4===0&&e%100!==0||e%400===0}var Th=ASe;var CZ=[31,28,31,30,31,30,31,31,30,31,30,31];function CSe(e,t,n,i,o,r,s,a){e=e??1,t=t??1,n=n??1,i=i??0,o=o??0,r=r??0,s=s??0,a=a??!1,y(),b(),this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function y(){T.typeOf.number.greaterThanOrEquals("Year",e,1),T.typeOf.number.lessThanOrEquals("Year",e,9999),T.typeOf.number.greaterThanOrEquals("Month",t,1),T.typeOf.number.lessThanOrEquals("Month",t,12),T.typeOf.number.greaterThanOrEquals("Day",n,1),T.typeOf.number.lessThanOrEquals("Day",n,31),T.typeOf.number.greaterThanOrEquals("Hour",i,0),T.typeOf.number.lessThanOrEquals("Hour",i,23),T.typeOf.number.greaterThanOrEquals("Minute",o,0),T.typeOf.number.lessThanOrEquals("Minute",o,59),T.typeOf.bool("IsLeapSecond",a),T.typeOf.number.greaterThanOrEquals("Second",r,0),T.typeOf.number.lessThanOrEquals("Second",r,a?60:59),T.typeOf.number.greaterThanOrEquals("Millisecond",s,0),T.typeOf.number.lessThan("Millisecond",s,1e3)}function b(){let x=t===2&&Th(e)?CZ[t-1]+1:CZ[t-1];if(n>x)throw new C("Month and Day represents invalid date")}}var op=CSe;function ESe(e,t){this.julianDate=e,this.offset=t}var Yi=ESe;var SSe={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1},qn=Object.freeze(SSe);var wSe={UTC:0,TAI:1},Wn=Object.freeze(wSe);var SZ=new op,vO=[31,28,31,30,31,30,31,31,30,31,30,31],DO=29;function f5(e,t){return It.compare(e.julianDate,t.julianDate)}var aT=new Yi;function IO(e){aT.julianDate=e;let t=It.leapSeconds,n=Mo(t,aT,f5);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&It.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),It.addSeconds(e,i,e)}function EZ(e,t){aT.julianDate=e;let n=It.leapSeconds,i=Mo(n,aT,f5);if(i<0&&(i=~i),i===0)return It.addSeconds(e,-n[0].offset,t);if(i>=n.length)return It.addSeconds(e,-n[i-1].offset,t);let o=It.secondsDifference(n[i].julianDate,e);if(o===0)return It.addSeconds(e,-n[i].offset,t);if(!(o<=1))return It.addSeconds(e,-n[--i].offset,t)}function B_(e,t,n){let i=t/qn.SECONDS_PER_DAY|0;return e+=i,t-=qn.SECONDS_PER_DAY*i,t<0&&(e--,t+=qn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function d5(e,t,n,i,o,r,s){let a=(t-14)/12|0,l=e+4800+a,u=(1461*l/4|0)+(367*(t-2-12*a)/12|0)-(3*((l+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=r+(i*qn.SECONDS_PER_HOUR+o*qn.SECONDS_PER_MINUTE+s*qn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var vSe=/^(\d{4})$/,DSe=/^(\d{4})-(\d{2})$/,PSe=/^(\d{4})-?(\d{3})$/,ISe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,OSe=/^(\d{4})-?(\d{2})-?(\d{2})$/,h5=/([Z+\-])?(\d{2})?:?(\d{2})?$/,RSe=/^(\d{2})(\.\d+)?/.source+h5.source,MSe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+h5.source,LSe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+h5.source,sd="Invalid ISO 8601 date.";function It(e,t,n){this.dayNumber=void 0,this.secondsOfDay=void 0,e=e??0,t=t??0,n=n??Wn.UTC;let i=e|0;t=t+(e-i)*qn.SECONDS_PER_DAY,B_(i,t,this),n===Wn.UTC&&IO(this)}It.fromGregorianDate=function(e,t){if(!(e instanceof op))throw new C("date must be a valid GregorianDate.");let n=d5(e.year,e.month,e.day,e.hour,e.minute,e.second,e.millisecond);return c(t)?(B_(n[0],n[1],t),IO(t),t):new It(n[0],n[1],Wn.UTC)};It.fromDate=function(e,t){if(!(e instanceof Date)||isNaN(e.getTime()))throw new C("date must be a valid JavaScript Date.");let n=d5(e.getUTCFullYear(),e.getUTCMonth()+1,e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds());return c(t)?(B_(n[0],n[1],t),IO(t),t):new It(n[0],n[1],Wn.UTC)};It.fromIso8601=function(e,t){if(typeof e!="string")throw new C(sd);e=e.replace(",",".");let n=e.split("T"),i,o=1,r=1,s=0,a=0,l=0,u=0,f=n[0],h=n[1],p,g;if(!c(f))throw new C(sd);let m;if(n=f.match(OSe),n!==null){if(m=f.split("-").length-1,m>0&&m!==2)throw new C(sd);i=+n[1],o=+n[2],r=+n[3]}else if(n=f.match(DSe),n!==null)i=+n[1],o=+n[2];else if(n=f.match(vSe),n!==null)i=+n[1];else{let A;if(n=f.match(PSe),n!==null){if(i=+n[1],A=+n[2],g=Th(i),A<1||g&&A>366||!g&&A>365)throw new C(sd)}else if(n=f.match(ISe),n!==null){i=+n[1];let E=+n[2],S=+n[3]||0;if(m=f.split("-").length-1,m>0&&(!c(n[3])&&m!==1||c(n[3])&&m!==2))throw new C(sd);let v=new Date(Date.UTC(i,0,4));A=E*7+S-v.getUTCDay()-3}else throw new C(sd);p=new Date(Date.UTC(i,0,1)),p.setUTCDate(A),o=p.getUTCMonth()+1,r=p.getUTCDate()}if(g=Th(i),o<1||o>12||r<1||(o!==2||!g)&&r>vO[o-1]||g&&o===2&&r>DO)throw new C(sd);let y;if(c(h)){if(n=h.match(LSe),n!==null){if(m=h.split(":").length-1,m>0&&m!==2&&m!==3)throw new C(sd);s=+n[1],a=+n[2],l=+n[3],u=+(n[4]||0)*1e3,y=5}else if(n=h.match(MSe),n!==null){if(m=h.split(":").length-1,m>2)throw new C(sd);s=+n[1],a=+n[2],l=+(n[3]||0)*60,y=4}else if(n=h.match(RSe),n!==null)s=+n[1],a=+(n[2]||0)*60,y=3;else throw new C(sd);if(a>=60||l>=61||s>24||s===24&&(a>0||l>0||u>0))throw new C(sd);let A=n[y],E=+n[y+1],S=+(n[y+2]||0);switch(A){case"+":s=s-E,a=a-S;break;case"-":s=s+E,a=a+S;break;case"Z":break;default:a=a+new Date(Date.UTC(i,o-1,r,s,a)).getTimezoneOffset();break}}let b=l===60;for(b&&l--;a>=60;)a-=60,s++;for(;s>=24;)s-=24,r++;for(p=g&&o===2?DO:vO[o-1];r>p;)r-=p,o++,o>12&&(o-=12,i++),p=g&&o===2?DO:vO[o-1];for(;a<0;)a+=60,s--;for(;s<0;)s+=24,r--;for(;r<1;)o--,o<1&&(o+=12,i--),p=g&&o===2?DO:vO[o-1],r+=p;let x=d5(i,o,r,s,a,l,u);return c(t)?(B_(x[0],x[1],t),IO(t)):t=new It(x[0],x[1],Wn.UTC),b&&It.addSeconds(t,1,t),t};It.now=function(e){return It.fromDate(new Date,e)};var PO=new It(0,0,Wn.TAI);It.toGregorianDate=function(e,t){if(!c(e))throw new C("julianDate is required.");let n=!1,i=EZ(e,PO);c(i)||(It.addSeconds(e,-1,PO),i=EZ(PO,PO),n=!0);let o=i.dayNumber,r=i.secondsOfDay;r>=43200&&(o+=1);let s=o+68569|0,a=4*s/146097|0;s=s-((146097*a+3)/4|0)|0;let l=4e3*(s+1)/1461001|0;s=s-(1461*l/4|0)+31|0;let u=80*s/2447|0,f=s-(2447*u/80|0)|0;s=u/11|0;let h=u+2-12*s|0,p=100*(a-49)+l+s|0,g=r/qn.SECONDS_PER_HOUR|0,m=r-g*qn.SECONDS_PER_HOUR,y=m/qn.SECONDS_PER_MINUTE|0;m=m-y*qn.SECONDS_PER_MINUTE;let b=m|0,x=(m-b)/qn.SECONDS_PER_MILLISECOND;return g+=12,g>23&&(g-=24),n&&(b+=1),c(t)?(t.year=p,t.month=h,t.day=f,t.hour=g,t.minute=y,t.second=b,t.millisecond=x,t.isLeapSecond=n,t):new op(p,h,f,g,y,b,x,n)};It.toDate=function(e){if(!c(e))throw new C("julianDate is required.");let t=It.toGregorianDate(e,SZ),n=t.second;return t.isLeapSecond&&(n-=1),new Date(Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,n,t.millisecond))};It.toIso8601=function(e,t){if(!c(e))throw new C("julianDate is required.");let n=It.toGregorianDate(e,SZ),i=n.year,o=n.month,r=n.day,s=n.hour,a=n.minute,l=n.second,u=n.millisecond;i===1e4&&o===1&&r===1&&s===0&&a===0&&l===0&&u===0&&(i=9999,o=12,r=31,s=24);let f;if(!c(t)&&u!==0){let h=u*.01;return f=h<1e-6?h.toFixed(20).replace(".","").replace(/0+$/,""):h.toString().replace(".",""),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${f}Z`}return!c(t)||t===0?`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}Z`:(f=(u*.01).toFixed(t).replace(".","").slice(0,t),`${i.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${r.toString().padStart(2,"0")}T${s.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}:${l.toString().padStart(2,"0")}.${f}Z`)};It.clone=function(e,t){if(c(e))return c(t)?(t.dayNumber=e.dayNumber,t.secondsOfDay=e.secondsOfDay,t):new It(e.dayNumber,e.secondsOfDay,Wn.TAI)};It.compare=function(e,t){if(!c(e))throw new C("left is required.");if(!c(t))throw new C("right is required.");let n=e.dayNumber-t.dayNumber;return n!==0?n:e.secondsOfDay-t.secondsOfDay};It.equals=function(e,t){return e===t||c(e)&&c(t)&&e.dayNumber===t.dayNumber&&e.secondsOfDay===t.secondsOfDay};It.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(It.secondsDifference(e,t))<=n};It.totalDays=function(e){if(!c(e))throw new C("julianDate is required.");return e.dayNumber+e.secondsOfDay/qn.SECONDS_PER_DAY};It.secondsDifference=function(e,t){if(!c(e))throw new C("left is required.");if(!c(t))throw new C("right is required.");return(e.dayNumber-t.dayNumber)*qn.SECONDS_PER_DAY+(e.secondsOfDay-t.secondsOfDay)};It.daysDifference=function(e,t){if(!c(e))throw new C("left is required.");if(!c(t))throw new C("right is required.");let n=e.dayNumber-t.dayNumber,i=(e.secondsOfDay-t.secondsOfDay)/qn.SECONDS_PER_DAY;return n+i};It.computeTaiMinusUtc=function(e){aT.julianDate=e;let t=It.leapSeconds,n=Mo(t,aT,f5);return n<0&&(n=~n,--n,n<0&&(n=0)),t[n].offset};It.addSeconds=function(e,t,n){if(!c(e))throw new C("julianDate is required.");if(!c(t))throw new C("seconds is required.");if(!c(n))throw new C("result is required.");return B_(e.dayNumber,e.secondsOfDay+t,n)};It.addMinutes=function(e,t,n){if(!c(e))throw new C("julianDate is required.");if(!c(t))throw new C("minutes is required.");if(!c(n))throw new C("result is required.");let i=e.secondsOfDay+t*qn.SECONDS_PER_MINUTE;return B_(e.dayNumber,i,n)};It.addHours=function(e,t,n){if(!c(e))throw new C("julianDate is required.");if(!c(t))throw new C("hours is required.");if(!c(n))throw new C("result is required.");let i=e.secondsOfDay+t*qn.SECONDS_PER_HOUR;return B_(e.dayNumber,i,n)};It.addDays=function(e,t,n){if(!c(e))throw new C("julianDate is required.");if(!c(t))throw new C("days is required.");if(!c(n))throw new C("result is required.");let i=e.dayNumber+t;return B_(i,e.secondsOfDay,n)};It.lessThan=function(e,t){return It.compare(e,t)<0};It.lessThanOrEquals=function(e,t){return It.compare(e,t)<=0};It.greaterThan=function(e,t){return It.compare(e,t)>0};It.greaterThanOrEquals=function(e,t){return It.compare(e,t)>=0};It.prototype.clone=function(e){return It.clone(this,e)};It.prototype.equals=function(e){return It.equals(this,e)};It.prototype.equalsEpsilon=function(e,t){return It.equalsEpsilon(this,e,t)};It.prototype.toString=function(){return It.toIso8601(this)};It.leapSeconds=[new Yi(new It(2441317,43210,Wn.TAI),10),new Yi(new It(2441499,43211,Wn.TAI),11),new Yi(new It(2441683,43212,Wn.TAI),12),new Yi(new It(2442048,43213,Wn.TAI),13),new Yi(new It(2442413,43214,Wn.TAI),14),new Yi(new It(2442778,43215,Wn.TAI),15),new Yi(new It(2443144,43216,Wn.TAI),16),new Yi(new It(2443509,43217,Wn.TAI),17),new Yi(new It(2443874,43218,Wn.TAI),18),new Yi(new It(2444239,43219,Wn.TAI),19),new Yi(new It(2444786,43220,Wn.TAI),20),new Yi(new It(2445151,43221,Wn.TAI),21),new Yi(new It(2445516,43222,Wn.TAI),22),new Yi(new It(2446247,43223,Wn.TAI),23),new Yi(new It(2447161,43224,Wn.TAI),24),new Yi(new It(2447892,43225,Wn.TAI),25),new Yi(new It(2448257,43226,Wn.TAI),26),new Yi(new It(2448804,43227,Wn.TAI),27),new Yi(new It(2449169,43228,Wn.TAI),28),new Yi(new It(2449534,43229,Wn.TAI),29),new Yi(new It(2450083,43230,Wn.TAI),30),new Yi(new It(2450630,43231,Wn.TAI),31),new Yi(new It(2451179,43232,Wn.TAI),32),new Yi(new It(2453736,43233,Wn.TAI),33),new Yi(new It(2454832,43234,Wn.TAI),34),new Yi(new It(2456109,43235,Wn.TAI),35),new Yi(new It(2457204,43236,Wn.TAI),36),new Yi(new It(2457754,43237,Wn.TAI),37)];var Q=It;var jZ=jr(ql(),1);function NSe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var LO=NSe;function RZ(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=RZ(o,t)),n[i]=o}return n}var We=RZ;function MZ(e,t,n){n=n??!1;let i={},o=c(e),r=c(t),s,a,l;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(l=t[s],typeof l=="object"?i[s]=MZ(a,l,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(l=t[s],i[s]=l);return i}var xt=MZ;function FSe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Yl=FSe;var LZ=jr(ql(),1);function m5(e,t){let n;return typeof document<"u"&&(n=document),m5._implementation(e,t,n)}m5._implementation=function(e,t,n){if(!c(e))throw new C("relative uri is required.");if(!c(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new LZ.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var rp=m5;var NZ=jr(ql(),1);function BSe(e,t){if(!c(e))throw new C("uri is required.");let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new NZ.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var NO=BSe;var FZ=jr(ql(),1);function kSe(e){if(!c(e))throw new C("uri is required.");let t=new FZ.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var uT=kSe;var BZ={};function USe(e,t,n){c(t)||(t=e.width),c(n)||(n=e.height);let i=BZ[t];c(i)||(i={},BZ[t]=i);let o=i[n];if(!c(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var Ah=USe;var VSe=/^blob:/i;function zSe(e){return T.typeOf.string("uri",e),VSe.test(e)}var fT=zSe;var Ch;function HSe(e){c(Ch)||(Ch=document.createElement("a")),Ch.href=window.location.href;let t=Ch.host,n=Ch.protocol;return Ch.href=e,Ch.href=Ch.href,n!==Ch.protocol||t!==Ch.host}var P0=HSe;var GSe=/^data:/i;function jSe(e){return T.typeOf.string("uri",e),GSe.test(e)}var k_=jSe;function WSe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var dT=WSe;function qSe(e){if(!c(e))throw new C("obj is required.");let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r)t+=`${o+encodeURIComponent(i[r])}&`;else t+=`${o+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var hT=qSe;function YSe(e){if(!c(e))throw new C("queryString is required.");let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,o=n.length;i<o;++i){let r=n[i].split("="),s=decodeURIComponent(r[0]),a=r[1];c(a)?a=decodeURIComponent(a):a="";let l=t[s];typeof l=="string"?t[s]=[l,a]:Array.isArray(l)?l.push(a):t[s]=a}return t}var Ku=YSe;var XSe={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5},Zn=Object.freeze(XSe);var KSe={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3},gs=Object.freeze(KSe);function FO(e){e=e??W.EMPTY_OBJECT;let t=e.throttleByServer??!1,n=e.throttle??!1;this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=e.priority??0,this.throttle=n,this.throttleByServer=t,this.type=e.type??gs.OTHER,this.serverKey=e.serverKey,this.state=Zn.UNISSUED,this.deferred=void 0,this.cancelled=!1}FO.prototype.cancel=function(){this.cancelled=!0};FO.prototype.clone=function(e){return c(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=Zn.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new FO(this)};var ir=FO;function $Se(e){let t={};if(!e)return t;let n=e.split(`\r
`);for(let i=0;i<n.length;++i){let o=n[i],r=o.indexOf(": ");if(r>0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var BO=$Se;function kZ(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=BO(this.responseHeaders))}kZ.prototype.toString=function(){let e="Request has failed.";return c(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var sp=kZ;var UO=jr(ql(),1);function YS(){this._listeners=[],this._scopes=[],this._toRemove=[],this._insideRaiseEvent=!1}Object.defineProperties(YS.prototype,{numberOfListeners:{get:function(){return this._listeners.length-this._toRemove.length}}});YS.prototype.addEventListener=function(e,t){T.typeOf.func("listener",e),this._listeners.push(e),this._scopes.push(t);let n=this;return function(){n.removeEventListener(e,t)}};YS.prototype.removeEventListener=function(e,t){T.typeOf.func("listener",e);let n=this._listeners,i=this._scopes,o=-1;for(let r=0;r<n.length;r++)if(n[r]===e&&i[r]===t){o=r;break}return o!==-1?(this._insideRaiseEvent?(this._toRemove.push(o),n[o]=void 0,i[o]=void 0):(n.splice(o,1),i.splice(o,1)),!0):!1};function ZSe(e,t){return t-e}YS.prototype.raiseEvent=function(){this._insideRaiseEvent=!0;let e,t=this._listeners,n=this._scopes,i=t.length;for(e=0;e<i;e++){let r=t[e];c(r)&&t[e].apply(n[e],arguments)}let o=this._toRemove;if(i=o.length,i>0){for(o.sort(ZSe),e=0;e<i;e++){let r=o[e];t.splice(r,1),n.splice(r,1)}o.length=0}this._insideRaiseEvent=!1};var pe=YS;function I0(e){T.typeOf.object("options",e),T.defined("options.comparator",e.comparator),this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(I0.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){T.typeOf.number.greaterThanOrEquals("maximumLength",e,0);let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function p5(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}I0.prototype.reserve=function(e){e=e??this._length,this._array.length=e};I0.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,i=this._array,o=-1,r=!0;for(;r;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?o=a:o=e,s<t&&n(i[s],i[o])<0&&(o=s),o!==e?(p5(i,o,e),e=o):r=!1}};I0.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};I0.prototype.insert=function(e){T.defined("element",e);let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(o<t.length?t[o]=e:t.push(e);o!==0;){let s=Math.floor((o-1)/2);if(n(t[o],t[s])<0)p5(t,o,s),o=s;else break}let r;return c(i)&&this._length>i&&(r=t[i],this._length=i),r};I0.prototype.pop=function(e){if(e=e??0,this._length===0)return;T.typeOf.number.lessThan("index",e,this._length);let t=this._array,n=t[e];return p5(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var kO=I0;function QSe(e,t){return e.priority-t.priority}var Zi={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},mT=20,qa=new kO({comparator:QSe});qa.maximumLength=mT;qa.reserve(mT);var Eh=[],ap={},JSe=typeof document<"u"?new UO.default(document.location.href):new UO.default,VO=new pe;function Ho(){}Ho.maximumRequests=50;Ho.maximumRequestsPerServer=18;Ho.requestsByServer={};Ho.throttleRequests=!0;Ho.debugShowStatistics=!1;Ho.requestCompletedEvent=VO;Object.defineProperties(Ho,{statistics:{get:function(){return Zi}},priorityHeapLength:{get:function(){return mT},set:function(e){if(e<mT)for(;qa.length>e;){let t=qa.pop();O0(t)}mT=e,qa.maximumLength=e,qa.reserve(e)}}});function UZ(e){c(e.priorityFunction)&&(e.priority=e.priorityFunction())}Ho.serverHasOpenSlots=function(e,t){t=t??1;let n=Ho.requestsByServer[e]??Ho.maximumRequestsPerServer;return ap[e]+t<=n};Ho.heapHasOpenSlots=function(e){return qa.length+e<=mT};function VZ(e){return e.state===Zn.UNISSUED&&(e.state=Zn.ISSUED,e.deferred=Yl()),e.deferred.promise}function ewe(e){return function(t){if(e.state===Zn.CANCELLED)return;let n=e.deferred;--Zi.numberOfActiveRequests,--ap[e.serverKey],VO.raiseEvent(),e.state=Zn.RECEIVED,e.deferred=void 0,n.resolve(t)}}function twe(e){return function(t){e.state!==Zn.CANCELLED&&(++Zi.numberOfFailedRequests,--Zi.numberOfActiveRequests,--ap[e.serverKey],VO.raiseEvent(t),e.state=Zn.FAILED,e.deferred.reject(t))}}function zZ(e){let t=VZ(e);return e.state=Zn.ACTIVE,Eh.push(e),++Zi.numberOfActiveRequests,++Zi.numberOfActiveRequestsEver,++ap[e.serverKey],e.requestFunction().then(ewe(e)).catch(twe(e)),t}function O0(e){let t=e.state===Zn.ACTIVE;if(e.state=Zn.CANCELLED,++Zi.numberOfCancelledRequests,c(e.deferred)){let n=e.deferred;e.deferred=void 0,n.reject()}t&&(--Zi.numberOfActiveRequests,--ap[e.serverKey],++Zi.numberOfCancelledActiveRequests),c(e.cancelFunction)&&e.cancelFunction()}Ho.update=function(){let e,t,n=0,i=Eh.length;for(e=0;e<i;++e){if(t=Eh[e],t.cancelled&&O0(t),t.state!==Zn.ACTIVE){++n;continue}n>0&&(Eh[e-n]=t)}Eh.length-=n;let o=qa.internalArray,r=qa.length;for(e=0;e<r;++e)UZ(o[e]);qa.resort();let s=Math.max(Ho.maximumRequests-Eh.length,0),a=0;for(;a<s&&qa.length>0;){if(t=qa.pop(),t.cancelled){O0(t);continue}if(t.throttleByServer&&!Ho.serverHasOpenSlots(t.serverKey)){O0(t);continue}zZ(t),++a}nwe()};Ho.getServerKey=function(e){T.typeOf.string("url",e);let t=new UO.default(e);t.scheme()===""&&(t=t.absoluteTo(JSe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=ap[n];return c(i)||(ap[n]=0),n};Ho.request=function(e){if(T.typeOf.object("request",e),T.typeOf.string("request.url",e.url),T.typeOf.func("request.requestFunction",e.requestFunction),k_(e.url)||fT(e.url))return VO.raiseEvent(),e.state=Zn.RECEIVED,e.requestFunction();if(++Zi.numberOfAttemptedRequests,c(e.serverKey)||(e.serverKey=Ho.getServerKey(e.url)),Ho.throttleRequests&&e.throttleByServer&&!Ho.serverHasOpenSlots(e.serverKey))return;if(!Ho.throttleRequests||!e.throttle)return zZ(e);if(Eh.length>=Ho.maximumRequests)return;UZ(e);let t=qa.insert(e);if(c(t)){if(t===e)return;O0(t)}return VZ(e)};function nwe(){Ho.debugShowStatistics&&(Zi.numberOfActiveRequests===0&&Zi.lastNumberOfActiveRequests>0&&(Zi.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Zi.numberOfAttemptedRequests}`),Zi.numberOfAttemptedRequests=0),Zi.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Zi.numberOfCancelledRequests}`),Zi.numberOfCancelledRequests=0),Zi.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Zi.numberOfCancelledActiveRequests}`),Zi.numberOfCancelledActiveRequests=0),Zi.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Zi.numberOfFailedRequests}`),Zi.numberOfFailedRequests=0)),Zi.lastNumberOfActiveRequests=Zi.numberOfActiveRequests)}Ho.clearForSpecs=function(){for(;qa.length>0;){let t=qa.pop();O0(t)}let e=Eh.length;for(let t=0;t<e;++t)O0(Eh[t]);Eh.length=0,ap={},Zi.numberOfAttemptedRequests=0,Zi.numberOfActiveRequests=0,Zi.numberOfCancelledRequests=0,Zi.numberOfCancelledActiveRequests=0,Zi.numberOfFailedRequests=0,Zi.numberOfActiveRequestsEver=0,Zi.lastNumberOfActiveRequests=0};Ho.numberOfActiveRequestsByServer=function(e){return ap[e]};Ho.requestHeap=qa;var Tc=Ho;var HZ=jr(ql(),1);var XS={},pT={};XS.add=function(e,t){if(!c(e))throw new C("host is required.");if(!c(t)||t<=0)throw new C("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;c(pT[n])||(pT[n]=!0)};XS.remove=function(e,t){if(!c(e))throw new C("host is required.");if(!c(t)||t<=0)throw new C("port is required to be greater than 0.");let n=`${e.toLowerCase()}:${t}`;c(pT[n])&&delete pT[n]};function iwe(e){let t=new HZ.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}XS.contains=function(e){if(!c(e))throw new C("url is required.");let t=iwe(e);return!!(c(t)&&c(pT[t]))};XS.clear=function(){pT={}};var KS=XS;var WZ=function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}}();function vt(e){e=e??W.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),T.typeOf.string("options.url",e.url),this._url=void 0,this._templateValues=Sh(e.templateValues,{}),this._queryParameters=Sh(e.queryParameters,{}),this.headers=Sh(e.headers,{}),this.request=e.request??new ir,this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=e.retryAttempts??0,this._retryCount=0,e.parseUrl??!0?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Sh(e,t){return c(e)?We(e):t}vt.createIfNeeded=function(e){return e instanceof vt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new vt({url:e})};var _T;vt.supportsImageBitmapOptions=function(){return c(_T)?_T:typeof createImageBitmap!="function"?(_T=Promise.resolve(!1),_T):(_T=vt.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=Ah(t[0]),i=Ah(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),_T)};Object.defineProperties(vt,{isBlobSupported:{get:function(){return WZ}}});Object.defineProperties(vt.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return uT(this._url)}},isDataUri:{get:function(){return k_(this._url)}},isBlobUri:{get:function(){return fT(this._url)}},isCrossOriginUrl:{get:function(){return P0(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});vt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};vt.prototype.parseUrl=function(e,t,n,i){let o=new jZ.default(e),r=owe(o.query());this._queryParameters=t?HO(r,this.queryParameters,n):r,o.search(""),o.fragment(""),c(i)&&o.scheme()===""&&(o=o.absoluteTo(rp(i))),this._url=o.toString()};function owe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Ku(e)}function HO(e,t,n){if(!n)return xt(e,t);let i=We(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];c(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}vt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${rwe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return c(s)?encodeURIComponent(s):o})),t&&c(this.proxy)&&(n=this.proxy.getURL(n)),n};function rwe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!c(e[t[0]])?`?${t[0]}`:`?${hT(e)}`}vt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=HO(this._queryParameters,e,!1):this._queryParameters=HO(e,this._queryParameters,!1)};vt.prototype.appendQueryParameters=function(e){this._queryParameters=HO(e,this._queryParameters,!0)};vt.prototype.setTemplateValues=function(e,t){t?this._templateValues=xt(this._templateValues,e):this._templateValues=xt(e,this._templateValues)};vt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,c(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return c(e.queryParameters)&&(t._queryParameters=xt(e.queryParameters,t.queryParameters)),c(e.templateValues)&&(t._templateValues=xt(e.templateValues,t.templateValues)),c(e.headers)&&(t.headers=xt(e.headers,t.headers)),c(e.proxy)&&(t.proxy=e.proxy),c(e.request)&&(t.request=e.request),c(e.retryCallback)&&(t.retryCallback=e.retryCallback),c(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};vt.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};vt.prototype.clone=function(e){return c(e)?(e._url=this._url,e._queryParameters=We(this._queryParameters),e._templateValues=We(this._templateValues),e.headers=We(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new vt({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:c(this.credits)?this.credits.slice():void 0})};vt.prototype.getBaseUri=function(e){return NO(this.getUrlComponent(e),e)};vt.prototype.appendForwardSlash=function(){this._url=LO(this._url)};vt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};vt.fetchArrayBuffer=function(e){return new vt(e).fetchArrayBuffer()};vt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};vt.fetchBlob=function(e){return new vt(e).fetchBlob()};vt.prototype.fetchImage=function(e){e=e??W.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(g5(this.request),!WZ||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return _5({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!c(r))return;let s,a,l,u;return vt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,r}).then(function(f){if(!c(f))return;if(u=f,a)return vt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let h=window.URL.createObjectURL(f);return l=new vt({url:h}),_5({resource:l,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(f){if(c(f))return f.blob=u,a||window.URL.revokeObjectURL(l.url),f}).catch(function(f){return c(l)&&window.URL.revokeObjectURL(l.url),f.blob=u,Promise.reject(f)})};function _5(e){let t=e.resource,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let l=Yl();return vt._Implementations.createImage(r,a,l,n,i,o),l.promise};let s=Tc.request(r);if(c(s))return s.catch(function(a){return r.state!==Zn.FAILED?Promise.reject(a):t.retryOnError(a).then(function(l){return l?(r.state=Zn.UNISSUED,r.deferred=void 0,_5({resource:t,flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})}vt.fetchImage=function(e){return new vt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};vt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};vt.fetchText=function(e){return new vt(e).fetchText()};vt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(c(e))return e.then(function(t){if(c(t))return JSON.parse(t)})};vt.fetchJson=function(e){return new vt(e).fetchJson()};vt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};vt.fetchXML=function(e){return new vt(e).fetchXML()};vt.prototype.fetchJsonp=function(e){e=e??"callback",g5(this.request);let t;do t=`loadJsonp${O.nextRandomNumber().toString().substring(2,8)}`;while(c(window[t]));return qZ(this,e,t)};function qZ(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=Yl();return window[n]=function(l){a.resolve(l);try{delete window[n]}catch{window[n]=void 0}},vt._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=Tc.request(o);if(c(s))return s.catch(function(a){return o.state!==Zn.FAILED?Promise.reject(a):e.retryOnError(a).then(function(l){return l?(o.state=Zn.UNISSUED,o.deferred=void 0,qZ(e,t,n)):Promise.reject(a)})})}vt.fetchJsonp=function(e){return new vt(e).fetchJsonp(e.callbackParameterName)};vt.prototype._makeRequest=function(e){let t=this;g5(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=xt(e.headers,t.headers),a=e.overrideMimeType,l=e.method,u=e.data,f=Yl(),h=vt._Implementations.loadWithXhr(i,r,l,u,s,f,a);return c(h)&&c(h.abort)&&(n.cancelFunction=function(){h.abort()}),f.promise};let o=Tc.request(n);if(c(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==Zn.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=Zn.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function g5(e){if(e.state===Zn.ISSUED||e.state===Zn.ACTIVE)throw new ae("The Resource is already being fetched.");e.state=Zn.UNISSUED,e.deferred=void 0}var swe=/^data:(.*?)(;base64)?,(.*)$/;function zO(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function GZ(e,t){let n=zO(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r<n.length;r++)o[r]=n.charCodeAt(r);return i}function awe(e,t){t=t??"";let n=e[1],i=!!e[2],o=e[3],r,s;switch(t){case"":case"text":return zO(i,o);case"arraybuffer":return GZ(i,o);case"blob":return r=GZ(i,o),new Blob([r],{type:n});case"document":return s=new DOMParser,s.parseFromString(zO(i,o),n);case"json":return JSON.parse(zO(i,o));default:throw new C(`Unhandled responseType: ${t}`)}}vt.prototype.fetch=function(e){return e=Sh(e,{}),e.method="GET",this._makeRequest(e)};vt.fetch=function(e){return new vt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.delete=function(e){return e=Sh(e,{}),e.method="DELETE",this._makeRequest(e)};vt.delete=function(e){return new vt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};vt.prototype.head=function(e){return e=Sh(e,{}),e.method="HEAD",this._makeRequest(e)};vt.head=function(e){return new vt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.options=function(e){return e=Sh(e,{}),e.method="OPTIONS",this._makeRequest(e)};vt.options=function(e){return new vt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.post=function(e,t){return T.defined("data",e),t=Sh(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};vt.post=function(e){return new vt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.put=function(e,t){return T.defined("data",e),t=Sh(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};vt.put=function(e){return new vt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt.prototype.patch=function(e,t){return T.defined("data",e),t=Sh(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};vt.patch=function(e){return new vt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};vt._Implementations={};vt._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(o){n.reject(o)},t&&(KS.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};vt._Implementations.createImage=function(e,t,n,i,o,r){let s=e.url;vt.supportsImageBitmapOptions().then(function(a){if(!(a&&r)){vt._Implementations.loadImageElement(s,t,n);return}let l="blob",u="GET",f=Yl(),h=vt._Implementations.loadWithXhr(s,l,u,void 0,void 0,f,void 0,void 0,void 0);return c(h)&&c(h.abort)&&(e.cancelFunction=function(){h.abort()}),f.promise.then(function(p){if(!c(p)){n.reject(new ae(`Successfully retrieved ${s} but it contained no content.`));return}return vt.createImageBitmapFromBlob(p,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o})}).then(function(p){n.resolve(p)})}).catch(function(a){n.reject(a)})};vt.createImageBitmapFromBlob=function(e,t){return T.defined("options",t),T.typeOf.bool("options.flipY",t.flipY),T.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),T.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function cwe(e,t,n,i,o,r,s){fetch(e,{method:n,headers:o}).then(async a=>{if(!a.ok){let l={};a.headers.forEach((u,f)=>{l[f]=u}),r.reject(new sp(a.status,a,l));return}switch(t){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new sp)})}var lwe=typeof XMLHttpRequest>"u";vt._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=swe.exec(e);if(a!==null){r.resolve(awe(a,t));return}if(lwe){cwe(e,t,n,i,o,r,s);return}let l=new XMLHttpRequest;if(KS.contains(e)&&(l.withCredentials=!0),l.open(n,e,!0),c(s)&&c(l.overrideMimeType)&&l.overrideMimeType(s),c(o))for(let f in o)o.hasOwnProperty(f)&&l.setRequestHeader(f,o[f]);c(t)&&(l.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),l.onload=function(){if((l.status<200||l.status>=300)&&!(u&&l.status===0)){r.reject(new sp(l.status,l.response,l.getAllResponseHeaders()));return}let f=l.response,h=l.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=l.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(y){let b=y.split(": "),x=b.shift();m[x]=b.join(": ")}),r.resolve(m);return}if(l.status===204)r.resolve(void 0);else if(c(f)&&(!c(t)||h===t))r.resolve(f);else if(t==="json"&&typeof f=="string")try{r.resolve(JSON.parse(f))}catch(p){r.reject(p)}else(h===""||h==="document")&&c(l.responseXML)&&l.responseXML.hasChildNodes()?r.resolve(l.responseXML):(h===""||h==="text")&&c(l.responseText)?r.resolve(l.responseText):r.reject(new ae("Invalid XMLHttpRequest response type."))},l.onerror=function(f){r.reject(new sp)},l.send(i),l};vt._Implementations.loadAndExecuteScript=function(e,t,n){return dT(e,t).catch(function(i){n.reject(i)})};vt._DefaultImplementations={};vt._DefaultImplementations.createImage=vt._Implementations.createImage;vt._DefaultImplementations.loadWithXhr=vt._Implementations.loadWithXhr;vt._DefaultImplementations.loadAndExecuteScript=vt._Implementations.loadAndExecuteScript;vt.DEFAULT=Object.freeze(new vt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var we=vt;function ZS(e){e=e??W.EMPTY_OBJECT,this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=e.addNewLeapSeconds??!0,c(e.data)?YZ(this,e.data):YZ(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}ZS.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=we.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new ae(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new ZS({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};ZS.NONE=Object.freeze({compute:function(e,t){return c(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new D0(0,0,0,0,0),t}});ZS.prototype.compute=function(e,t){if(!c(this._samples))return;if(c(t)||(t=new D0(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o=0,r=0;if(c(i)){let a=n[i],l=n[i+1],u=Q.lessThanOrEquals(a,e),f=!c(l),h=f||Q.greaterThanOrEquals(l,e);if(u&&h)return o=i,!f&&l.equals(e)&&++o,r=o+1,KZ(this,n,this._samples,e,o,r,t),t}let s=Mo(n,e,Q.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,o=s,r=s):(r=~s,o=r-1,o<0&&(o=0)),this._lastIndex=o,KZ(this,n,this._samples,e,o,r,t),t};function uwe(e,t){return Q.compare(e.julianDate,t)}function YZ(e,t){if(!c(t.columnNames))throw new ae("Error in loaded EOP data: The columnNames property is required.");if(!c(t.samples))throw new ae("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),o=t.columnNames.indexOf("yPoleWanderRadians"),r=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),l=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||o<0||r<0||s<0||a<0||l<0)throw new ae("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=o,e._ut1MinusUtcSecondsColumn=r,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=l,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let h,p=e._addNewLeapSeconds;for(let g=0,m=u.length;g<m;g+=e._columnCount){let y=u[g+n],b=u[g+l],x=y+qn.MODIFIED_JULIAN_DATE_DIFFERENCE,A=new Q(x,b,Wn.TAI);if(f.push(A),p){if(b!==h&&c(h)){let E=Q.leapSeconds,S=Mo(E,A,uwe);if(S<0){let v=new Yi(A,b);E.splice(~S,0,v)}}h=b}}}function XZ(e,t,n,i,o){let r=n*i;o.xPoleWander=t[r+e._xPoleWanderRadiansColumn],o.yPoleWander=t[r+e._yPoleWanderRadiansColumn],o.xPoleOffset=t[r+e._xCelestialPoleOffsetRadiansColumn],o.yPoleOffset=t[r+e._yCelestialPoleOffsetRadiansColumn],o.ut1MinusUtc=t[r+e._ut1MinusUtcSecondsColumn]}function $S(e,t,n){return t+e*(n-t)}function KZ(e,t,n,i,o,r,s){let a=e._columnCount;if(r>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let l=t[o],u=t[r];if(l.equals(u)||i.equals(l))return XZ(e,n,o,a,s),s;if(i.equals(u))return XZ(e,n,r,a,s),s;let f=Q.secondsDifference(i,l)/Q.secondsDifference(u,l),h=o*a,p=r*a,g=n[h+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],y=m-g;if(y>.5||y<-.5){let b=n[h+e._taiMinusUtcSecondsColumn],x=n[p+e._taiMinusUtcSecondsColumn];b!==x&&(u.equals(i)?g=m:m-=x-b)}return s.xPoleWander=$S(f,n[h+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=$S(f,n[h+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=$S(f,n[h+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=$S(f,n[h+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=$S(f,g,m),s}var GO=ZS;function Ya(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Ya.fromQuaternion=function(e,t){if(!c(e))throw new C("quaternion is required");c(t)||(t=new Ya);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-O.asinClamped(n),t};Ya.fromDegrees=function(e,t,n,i){if(!c(e))throw new C("heading is required");if(!c(t))throw new C("pitch is required");if(!c(n))throw new C("roll is required");return c(i)||(i=new Ya),i.heading=e*O.RADIANS_PER_DEGREE,i.pitch=t*O.RADIANS_PER_DEGREE,i.roll=n*O.RADIANS_PER_DEGREE,i};Ya.clone=function(e,t){if(c(e))return c(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Ya(e.heading,e.pitch,e.roll)};Ya.equals=function(e,t){return e===t||c(e)&&c(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Ya.equalsEpsilon=function(e,t,n,i){return e===t||c(e)&&c(t)&&O.equalsEpsilon(e.heading,t.heading,n,i)&&O.equalsEpsilon(e.pitch,t.pitch,n,i)&&O.equalsEpsilon(e.roll,t.roll,n,i)};Ya.prototype.clone=function(e){return Ya.clone(this,e)};Ya.prototype.equals=function(e){return Ya.equals(this,e)};Ya.prototype.equalsEpsilon=function(e,t,n){return Ya.equalsEpsilon(this,e,t,n)};Ya.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Xa=Ya;var $Z=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function fwe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),o=$Z.exec(i);if(o!==null)return o[1]}}var jO;function ZZ(e){return typeof document>"u"?e:(c(jO)||(jO=document.createElement("a")),jO.href=e,jO.href)}var R0;function QZ(){if(c(R0))return R0;let e;if(typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:c(import.meta?.url)?e=rp(".",import.meta.url):typeof define=="object"&&c(define.amd)&&!define.amd.toUrlUndefined&&c(cO.toUrl)?e=rp("..",M0("Core/buildModuleUrl.js")):e=fwe(),!c(e))throw new C("Unable to determine Cesium base URL automatically, try defining a global variable called CESIUM_BASE_URL.");return R0=new we({url:ZZ(e)}),R0.appendForwardSlash(),R0}function dwe(e){return ZZ(cO.toUrl(`../${e}`))}function JZ(e){return QZ().getDerivedResource({url:e}).url}var WO;function M0(e){return c(WO)||(typeof define=="object"&&c(define.amd)&&!define.amd.toUrlUndefined&&c(cO.toUrl)?WO=dwe:WO=JZ),WO(e)}M0._cesiumScriptRegex=$Z;M0._buildModuleUrlFromBaseUrl=JZ;M0._clearBaseResource=function(){R0=void 0};M0.setBaseUrl=function(e){R0=we.DEFAULT.getDerivedResource({url:e})};M0.getCesiumBaseUrl=QZ;var tn=M0;function hwe(e,t,n){this.x=e,this.y=t,this.s=n}var gT=hwe;function x5(e){e=e??W.EMPTY_OBJECT,this._xysFileUrlTemplate=we.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new Q(this._sampleZeroJulianEphemerisDate,0,Wn.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=e.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var mwe=new Q(0,0,Wn.TAI);function y5(e,t,n){let i=mwe;return i.dayNumber=t,i.secondsOfDay=n,Q.daysDifference(i,e._sampleZeroDateTT)}x5.prototype.preload=function(e,t,n,i){let o=y5(this,e,t),r=y5(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let l=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let h=l;h<=u;++h)f.push(b5(this,h));return Promise.all(f)};x5.prototype.computeXysRadians=function(e,t,n){let i=y5(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let l=!1,u=this._samples;if(c(u[s*3])||(b5(this,s/this._samplesPerXysFile|0),l=!0),c(u[a*3])||(b5(this,a/this._samplesPerXysFile|0),l=!0),l)return;c(n)?(n.x=0,n.y=0,n.s=0):n=new gT(0,0,0);let f=i-s*this._stepSizeDays,h=this._work,p=this._denominators,g=this._coef,m=this._xTable,y,b;for(y=0;y<=r;++y)h[y]=f-m[y];for(y=0;y<=r;++y){for(g[y]=1,b=0;b<=r;++b)b!==y&&(g[y]*=h[b]);g[y]*=p[y];let x=(s+y)*3;n.x+=g[y]*u[x++],n.y+=g[y]*u[x++],n.s+=g[y]*u[x]}return n};function b5(e,t){if(e._chunkDownloadsInProgress[t])return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;c(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new we({url:tn(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let o=n.fetchJson().then(function(r){e._chunkDownloadsInProgress[t]=!1;let s=e._samples,a=r.samples,l=t*e._samplesPerXysFile*3;for(let u=0,f=a.length;u<f;++u)s[l+u]=a[u]});return e._chunkDownloadsInProgress[t]=o,o}var qO=x5;function nt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var QS=new d;nt.fromAxisAngle=function(e,t,n){T.typeOf.object("axis",e),T.typeOf.number("angle",t);let i=t/2,o=Math.sin(i);QS=d.normalize(e,QS);let r=QS.x*o,s=QS.y*o,a=QS.z*o,l=Math.cos(i);return c(n)?(n.x=r,n.y=s,n.z=a,n.w=l,n):new nt(r,s,a,l)};var pwe=[1,2,0],_we=new Array(3);nt.fromRotationMatrix=function(e,t){T.typeOf.object("matrix",e);let n,i,o,r,s,a=e[J.COLUMN0ROW0],l=e[J.COLUMN1ROW1],u=e[J.COLUMN2ROW2],f=a+l+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[J.COLUMN1ROW2]-e[J.COLUMN2ROW1])*n,o=(e[J.COLUMN2ROW0]-e[J.COLUMN0ROW2])*n,r=(e[J.COLUMN0ROW1]-e[J.COLUMN1ROW0])*n;else{let h=pwe,p=0;l>a&&(p=1),u>a&&u>l&&(p=2);let g=h[p],m=h[g];n=Math.sqrt(e[J.getElementIndex(p,p)]-e[J.getElementIndex(g,g)]-e[J.getElementIndex(m,m)]+1);let y=_we;y[p]=.5*n,n=.5/n,s=(e[J.getElementIndex(m,g)]-e[J.getElementIndex(g,m)])*n,y[g]=(e[J.getElementIndex(g,p)]+e[J.getElementIndex(p,g)])*n,y[m]=(e[J.getElementIndex(m,p)]+e[J.getElementIndex(p,m)])*n,i=-y[0],o=-y[1],r=-y[2]}return c(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new nt(i,o,r,s)};var eQ=new nt,tQ=new nt,T5=new nt,nQ=new nt;nt.fromHeadingPitchRoll=function(e,t){return T.typeOf.object("headingPitchRoll",e),nQ=nt.fromAxisAngle(d.UNIT_X,e.roll,eQ),T5=nt.fromAxisAngle(d.UNIT_Y,-e.pitch,t),t=nt.multiply(T5,nQ,T5),tQ=nt.fromAxisAngle(d.UNIT_Z,-e.heading,eQ),nt.multiply(tQ,t,t)};var YO=new d,A5=new d,ad=new nt,iQ=new nt,XO=new nt;nt.packedLength=4;nt.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};nt.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new nt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};nt.packedInterpolationLength=3;nt.convertPackedArrayForInterpolation=function(e,t,n,i){nt.unpack(e,n*4,XO),nt.conjugate(XO,XO);for(let o=0,r=n-t+1;o<r;o++){let s=o*3;nt.unpack(e,(t+o)*4,ad),nt.multiply(ad,XO,ad),ad.w<0&&nt.negate(ad,ad),nt.computeAxis(ad,YO);let a=nt.computeAngle(ad);c(i)||(i=[]),i[s]=YO.x*a,i[s+1]=YO.y*a,i[s+2]=YO.z*a}};nt.unpackInterpolationResult=function(e,t,n,i,o){c(o)||(o=new nt),d.fromArray(e,0,A5);let r=d.magnitude(A5);return nt.unpack(t,i*4,iQ),r===0?nt.clone(nt.IDENTITY,ad):nt.fromAxisAngle(A5,r,ad),nt.multiply(ad,iQ,o)};nt.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new nt(e.x,e.y,e.z,e.w)};nt.conjugate=function(e,t){return T.typeOf.object("quaternion",e),T.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};nt.magnitudeSquared=function(e){return T.typeOf.object("quaternion",e),e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};nt.magnitude=function(e){return Math.sqrt(nt.magnitudeSquared(e))};nt.normalize=function(e,t){T.typeOf.object("result",t);let n=1/nt.magnitude(e),i=e.x*n,o=e.y*n,r=e.z*n,s=e.w*n;return t.x=i,t.y=o,t.z=r,t.w=s,t};nt.inverse=function(e,t){T.typeOf.object("result",t);let n=nt.magnitudeSquared(e);return t=nt.conjugate(e,t),nt.multiplyByScalar(t,1/n,t)};nt.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};nt.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};nt.negate=function(e,t){return T.typeOf.object("quaternion",e),T.typeOf.object("result",t),t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};nt.dot=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};nt.multiply=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n);let i=e.x,o=e.y,r=e.z,s=e.w,a=t.x,l=t.y,u=t.z,f=t.w,h=s*a+i*f+o*u-r*l,p=s*l-i*u+o*f+r*a,g=s*u+i*l-o*a+r*f,m=s*f-i*a-o*l-r*u;return n.x=h,n.y=p,n.z=g,n.w=m,n};nt.multiplyByScalar=function(e,t,n){return T.typeOf.object("quaternion",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};nt.divideByScalar=function(e,t,n){return T.typeOf.object("quaternion",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};nt.computeAxis=function(e,t){T.typeOf.object("quaternion",e),T.typeOf.object("result",t);let n=e.w;if(Math.abs(n-1)<O.EPSILON6||Math.abs(n+1)<O.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};nt.computeAngle=function(e){return T.typeOf.object("quaternion",e),Math.abs(e.w-1)<O.EPSILON6?0:2*Math.acos(e.w)};var C5=new nt;nt.lerp=function(e,t,n,i){return T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i),C5=nt.multiplyByScalar(t,n,C5),i=nt.multiplyByScalar(e,1-n,i),nt.add(C5,i,i)};var oQ=new nt,E5=new nt,S5=new nt;nt.slerp=function(e,t,n,i){T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i);let o=nt.dot(e,t),r=t;if(o<0&&(o=-o,r=oQ=nt.negate(t,oQ)),1-o<O.EPSILON6)return nt.lerp(e,r,n,i);let s=Math.acos(o);return E5=nt.multiplyByScalar(e,Math.sin((1-n)*s),E5),S5=nt.multiplyByScalar(r,Math.sin(n*s),S5),i=nt.add(E5,S5,i),nt.multiplyByScalar(i,1/Math.sin(s),i)};nt.log=function(e,t){T.typeOf.object("quaternion",e),T.typeOf.object("result",t);let n=O.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),d.multiplyByScalar(e,i,t)};nt.exp=function(e,t){T.typeOf.object("cartesian",e),T.typeOf.object("result",t);let n=d.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var gwe=new d,ywe=new d,JS=new nt,yT=new nt;nt.computeInnerQuadrangle=function(e,t,n,i){T.typeOf.object("q0",e),T.typeOf.object("q1",t),T.typeOf.object("q2",n),T.typeOf.object("result",i);let o=nt.conjugate(t,JS);nt.multiply(o,n,yT);let r=nt.log(yT,gwe);nt.multiply(o,e,yT);let s=nt.log(yT,ywe);return d.add(r,s,r),d.multiplyByScalar(r,.25,r),d.negate(r,r),nt.exp(r,JS),nt.multiply(t,JS,i)};nt.squad=function(e,t,n,i,o,r){T.typeOf.object("q0",e),T.typeOf.object("q1",t),T.typeOf.object("s0",n),T.typeOf.object("s1",i),T.typeOf.number("t",o),T.typeOf.object("result",r);let s=nt.slerp(e,t,o,JS),a=nt.slerp(n,i,o,yT);return nt.slerp(s,a,2*o*(1-o),r)};var bwe=new nt,rQ=1.9011074535173003,KO=zt.supportsTypedArrays()?new Float32Array(8):[],$O=zt.supportsTypedArrays()?new Float32Array(8):[],cp=zt.supportsTypedArrays()?new Float32Array(8):[],lp=zt.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;KO[e]=1/(t*n),$O[e]=t/n}KO[7]=rQ/(8*17);$O[7]=rQ*8/17;nt.fastSlerp=function(e,t,n,i){T.typeOf.object("start",e),T.typeOf.object("end",t),T.typeOf.number("t",n),T.typeOf.object("result",i);let o=nt.dot(e,t),r;o>=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,l=n*n,u=a*a;for(let g=7;g>=0;--g)cp[g]=(KO[g]*l-$O[g])*s,lp[g]=(KO[g]*u-$O[g])*s;let f=r*n*(1+cp[0]*(1+cp[1]*(1+cp[2]*(1+cp[3]*(1+cp[4]*(1+cp[5]*(1+cp[6]*(1+cp[7])))))))),h=a*(1+lp[0]*(1+lp[1]*(1+lp[2]*(1+lp[3]*(1+lp[4]*(1+lp[5]*(1+lp[6]*(1+lp[7])))))))),p=nt.multiplyByScalar(e,h,bwe);return nt.multiplyByScalar(t,f,i),nt.add(p,i,i)};nt.fastSquad=function(e,t,n,i,o,r){T.typeOf.object("q0",e),T.typeOf.object("q1",t),T.typeOf.object("s0",n),T.typeOf.object("s1",i),T.typeOf.number("t",o),T.typeOf.object("result",r);let s=nt.fastSlerp(e,t,o,JS),a=nt.fastSlerp(n,i,o,yT);return nt.fastSlerp(s,a,2*o*(1-o),r)};nt.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};nt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};nt.ZERO=Object.freeze(new nt(0,0,0,0));nt.IDENTITY=Object.freeze(new nt(0,0,0,1));nt.prototype.clone=function(e){return nt.clone(this,e)};nt.prototype.equals=function(e){return nt.equals(this,e)};nt.prototype.equalsEpsilon=function(e,t){return nt.equalsEpsilon(this,e,t)};nt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Le=nt;var ci={},w5={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"}},bT={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},v5={},ll={east:new d,north:new d,up:new d,west:new d,south:new d,down:new d},U_=new d,V_=new d,z_=new d;ci.localFrameToFixedFrameGenerator=function(e,t){if(!w5.hasOwnProperty(e)||!w5[e].hasOwnProperty(t))throw new C("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=w5[e][t],i,o=e+t;return c(v5[o])?i=v5[o]:(i=function(r,s,a){if(!c(r))throw new C("origin is required.");if(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))throw new C("origin has a NaN component");if(c(a)||(a=new F),d.equalsEpsilon(r,d.ZERO,O.EPSILON14))d.unpack(bT[e],0,U_),d.unpack(bT[t],0,V_),d.unpack(bT[n],0,z_);else if(O.equalsEpsilon(r.x,0,O.EPSILON14)&&O.equalsEpsilon(r.y,0,O.EPSILON14)){let l=O.sign(r.z);d.unpack(bT[e],0,U_),e!=="east"&&e!=="west"&&d.multiplyByScalar(U_,l,U_),d.unpack(bT[t],0,V_),t!=="east"&&t!=="west"&&d.multiplyByScalar(V_,l,V_),d.unpack(bT[n],0,z_),n!=="east"&&n!=="west"&&d.multiplyByScalar(z_,l,z_)}else{s=s??ie.default,s.geodeticSurfaceNormal(r,ll.up);let l=ll.up,u=ll.east;u.x=-r.y,u.y=r.x,u.z=0,d.normalize(u,ll.east),d.cross(l,u,ll.north),d.multiplyByScalar(ll.up,-1,ll.down),d.multiplyByScalar(ll.east,-1,ll.west),d.multiplyByScalar(ll.north,-1,ll.south),U_=ll[e],V_=ll[t],z_=ll[n]}return a[0]=U_.x,a[1]=U_.y,a[2]=U_.z,a[3]=0,a[4]=V_.x,a[5]=V_.y,a[6]=V_.z,a[7]=0,a[8]=z_.x,a[9]=z_.y,a[10]=z_.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},v5[o]=i),i};ci.eastNorthUpToFixedFrame=ci.localFrameToFixedFrameGenerator("east","north");ci.northEastDownToFixedFrame=ci.localFrameToFixedFrameGenerator("north","east");ci.northUpEastToFixedFrame=ci.localFrameToFixedFrameGenerator("north","up");ci.northWestUpToFixedFrame=ci.localFrameToFixedFrameGenerator("north","west");var xwe=new Le,Twe=new d(1,1,1),Awe=new F;ci.headingPitchRollToFixedFrame=function(e,t,n,i,o){T.typeOf.object("HeadingPitchRoll",t),i=i??ci.eastNorthUpToFixedFrame;let r=Le.fromHeadingPitchRoll(t,xwe),s=F.fromTranslationQuaternionRotationScale(d.ZERO,r,Twe,Awe);return o=i(e,n,o),F.multiply(o,s,o)};var Cwe=new F,Ewe=new J;ci.headingPitchRollQuaternion=function(e,t,n,i,o){T.typeOf.object("HeadingPitchRoll",t);let r=ci.headingPitchRollToFixedFrame(e,t,n,i,Cwe),s=F.getMatrix3(r,Ewe);return Le.fromRotationMatrix(s,o)};var Swe=new d(1,1,1),wwe=new d,sQ=new F,vwe=new F,Dwe=new J,Pwe=new Le;ci.fixedFrameToHeadingPitchRoll=function(e,t,n,i){T.defined("transform",e),t=t??ie.default,n=n??ci.eastNorthUpToFixedFrame,c(i)||(i=new Xa);let o=F.getTranslation(e,wwe);if(d.equals(o,d.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=F.inverseTransformation(n(o,t,sQ),sQ),s=F.setScale(e,Swe,vwe);s=F.setTranslation(s,d.ZERO,s),r=F.multiply(r,s,r);let a=Le.fromRotationMatrix(F.getMatrix3(r,Dwe),Pwe);return a=Le.normalize(a,a),Xa.fromQuaternion(a,i)};var Iwe=6*3600+41*60+50.54841,Owe=8640184812866e-6,Rwe=.093104,Mwe=-62e-7,Lwe=11772758384668e-32,Nwe=72921158553e-15,Fwe=O.TWO_PI/86400,ZO=new Q;ci.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=ci.computeIcrfToFixedMatrix(e,t);return c(n)||(n=ci.computeTemeToPseudoFixedMatrix(e,t)),n};ci.computeTemeToPseudoFixedMatrix=function(e,t){if(!c(e))throw new C("date is required.");ZO=Q.addSeconds(e,-Q.computeTaiMinusUtc(e),ZO);let n=ZO.dayNumber,i=ZO.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/qn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/qn.DAYS_PER_JULIAN_CENTURY;let a=(Iwe+o*(Owe+o*(Rwe+o*Mwe)))*Fwe%O.TWO_PI,l=Nwe+Lwe*(n-24515455e-1),u=(i+qn.SECONDS_PER_DAY*.5)%qn.SECONDS_PER_DAY,f=a+l*u,h=Math.cos(f),p=Math.sin(f);return c(t)?(t[0]=h,t[1]=-p,t[2]=0,t[3]=p,t[4]=h,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new J(h,p,0,-p,h,0,0,0,1)};ci.iau2006XysData=new qO;ci.earthOrientationParameters=GO.NONE;var I5=32.184,Bwe=2451545;ci.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+I5,i=e.stop.dayNumber,o=e.stop.secondsOfDay+I5;return ci.iau2006XysData.preload(t,n,i,o)};ci.computeIcrfToFixedMatrix=function(e,t){if(!c(e))throw new C("date is required.");c(t)||(t=new J);let n=ci.computeFixedToIcrfMatrix(e,t);if(c(n))return J.transpose(n,t)};var kwe=32.184,Uwe=2451545,QO=new Xa,Vwe=new J,zwe=new Q;ci.computeMoonFixedToIcrfMatrix=function(e,t){if(!c(e))throw new C("date is required.");c(t)||(t=new J);let n=Q.addSeconds(e,kwe,zwe),i=Q.totalDays(n)-Uwe,o=O.toRadians(12.112)-O.toRadians(.052992)*i,r=O.toRadians(24.224)-O.toRadians(.105984)*i,s=O.toRadians(227.645)+O.toRadians(13.012)*i,a=O.toRadians(261.105)+O.toRadians(13.340716)*i,l=O.toRadians(358)+O.toRadians(.9856)*i;return QO.pitch=O.toRadians(180)-O.toRadians(3.878)*Math.sin(o)-O.toRadians(.12)*Math.sin(r)+O.toRadians(.07)*Math.sin(s)-O.toRadians(.017)*Math.sin(a),QO.roll=O.toRadians(66.53-90)+O.toRadians(1.543)*Math.cos(o)+O.toRadians(.24)*Math.cos(r)-O.toRadians(.028)*Math.cos(s)+O.toRadians(.007)*Math.cos(a),QO.heading=O.toRadians(244.375-90)+O.toRadians(13.17635831)*i+O.toRadians(3.558)*Math.sin(o)+O.toRadians(.121)*Math.sin(r)-O.toRadians(.064)*Math.sin(s)+O.toRadians(.016)*Math.sin(a)+O.toRadians(.025)*Math.sin(l),J.fromHeadingPitchRoll(QO,Vwe)};ci.computeIcrfToMoonFixedMatrix=function(e,t){if(!c(e))throw new C("date is required.");c(t)||(t=new J);let n=ci.computeMoonFixedToIcrfMatrix(e,t);if(c(n))return J.transpose(n,t)};var Hwe=new gT(0,0,0),Gwe=new D0(0,0,0,0,0,0),D5=new J,P5=new J;ci.computeFixedToIcrfMatrix=function(e,t){if(!c(e))throw new C("date is required.");c(t)||(t=new J);let n=ci.earthOrientationParameters.compute(e,Gwe);if(!c(n))return;let i=e.dayNumber,o=e.secondsOfDay+I5,r=ci.iau2006XysData.computeXysRadians(i,o,Hwe);if(!c(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,l=1/(1+Math.sqrt(1-s*s-a*a)),u=D5;u[0]=1-l*s*s,u[3]=-l*s*a,u[6]=s,u[1]=-l*s*a,u[4]=1-l*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-l*(s*s+a*a);let f=J.fromRotationZ(-r.s,P5),h=J.multiply(u,f,D5),p=e.dayNumber,g=e.secondsOfDay-Q.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,y=g/qn.SECONDS_PER_DAY,b=.779057273264+y+.00273781191135448*(m+y);b=b%1*O.TWO_PI;let x=J.fromRotationZ(b,P5),A=J.multiply(h,x,D5),E=Math.cos(n.xPoleWander),S=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),P=Math.sin(n.yPoleWander),M=i-Bwe+o/qn.SECONDS_PER_DAY;M/=36525;let R=-47e-6*M*O.RADIANS_PER_DEGREE/3600,L=Math.cos(R),B=Math.sin(R),_=P5;return _[0]=E*L,_[1]=E*B,_[2]=v,_[3]=-S*B+P*v*L,_[4]=S*L+P*v*B,_[5]=-P*E,_[6]=-P*B-S*v*L,_[7]=P*L-S*v*B,_[8]=S*E,J.multiply(A,_,t)};var jwe=new se;ci.pointToWindowCoordinates=function(e,t,n,i){return i=ci.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};ci.pointToGLWindowCoordinates=function(e,t,n,i){if(!c(e))throw new C("modelViewProjectionMatrix is required.");if(!c(t))throw new C("viewportTransformation is required.");if(!c(n))throw new C("point is required.");c(i)||(i=new z);let o=jwe;return F.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,o),o),se.multiplyByScalar(o,1/o.w,o),F.multiplyByVector(t,o,o),z.fromCartesian4(o,i)};var Wwe=new d,qwe=new d,Ywe=new d;ci.rotationMatrixFromPositionVelocity=function(e,t,n,i){if(!c(e))throw new C("position is required.");if(!c(t))throw new C("velocity is required.");let o=(n??ie.default).geodeticSurfaceNormal(e,Wwe),r=d.cross(t,o,qwe);d.equalsEpsilon(r,d.ZERO,O.EPSILON6)&&(r=d.clone(d.UNIT_X,r));let s=d.cross(r,t,Ywe);return d.normalize(s,s),d.cross(t,s,r),d.negate(r,r),d.normalize(r,r),c(i)||(i=new J),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};var aQ=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1),cQ=new he,O5=new d,Xwe=new d,Kwe=new J,R5=new F,lQ=new F;ci.basisTo2D=function(e,t,n){if(!c(e))throw new C("projection is required.");if(!c(t))throw new C("matrix is required.");if(!c(n))throw new C("result is required.");let i=F.getTranslation(t,Xwe),o=e.ellipsoid,r;if(d.equals(i,d.ZERO))r=d.clone(d.ZERO,O5);else{let f=o.cartesianToCartographic(i,cQ);r=e.project(f,O5),d.fromElements(r.z,r.x,r.y,r)}let s=ci.eastNorthUpToFixedFrame(i,o,R5),a=F.inverseTransformation(s,lQ),l=F.getMatrix3(t,Kwe),u=F.multiplyByMatrix3(a,l,n);return F.multiply(aQ,u,n),F.setTranslation(n,r,n),n};ci.ellipsoidTo2DModelMatrix=function(e,t,n){if(!c(e))throw new C("projection is required.");if(!c(t))throw new C("center is required.");if(!c(n))throw new C("result is required.");let i=e.ellipsoid,o=ci.eastNorthUpToFixedFrame(t,i,R5),r=F.inverseTransformation(o,lQ),s=i.cartesianToCartographic(t,cQ),a=e.project(s,O5);d.fromElements(a.z,a.x,a.y,a);let l=F.fromTranslation(a,R5);return F.multiply(aQ,r,n),F.multiply(l,n,n),n};var Ot=ci;function vn(e,t,n,i){this.west=e??0,this.south=t??0,this.east=n??0,this.north=i??0}Object.defineProperties(vn.prototype,{width:{get:function(){return vn.computeWidth(this)}},height:{get:function(){return vn.computeHeight(this)}}});vn.packedLength=4;vn.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.west,t[n++]=e.south,t[n++]=e.east,t[n]=e.north,t};vn.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new vn),n.west=e[t++],n.south=e[t++],n.east=e[t++],n.north=e[t],n};vn.computeWidth=function(e){T.typeOf.object("rectangle",e);let t=e.east,n=e.west;return t<n&&(t+=O.TWO_PI),t-n};vn.computeHeight=function(e){return T.typeOf.object("rectangle",e),e.north-e.south};vn.fromDegrees=function(e,t,n,i,o){return e=O.toRadians(e??0),t=O.toRadians(t??0),n=O.toRadians(n??0),i=O.toRadians(i??0),c(o)?(o.west=e,o.south=t,o.east=n,o.north=i,o):new vn(e,t,n,i)};vn.fromRadians=function(e,t,n,i,o){return c(o)?(o.west=e??0,o.south=t??0,o.east=n??0,o.north=i??0,o):new vn(e,t,n,i)};vn.fromCartographicArray=function(e,t){T.defined("cartographics",e);let n=Number.MAX_VALUE,i=-Number.MAX_VALUE,o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE;for(let l=0,u=e.length;l<u;l++){let f=e[l];n=Math.min(n,f.longitude),i=Math.max(i,f.longitude),s=Math.min(s,f.latitude),a=Math.max(a,f.latitude);let h=f.longitude>=0?f.longitude:f.longitude+O.TWO_PI;o=Math.min(o,h),r=Math.max(r,h)}return i-n>r-o&&(n=o,i=r,i>O.PI&&(i=i-O.TWO_PI),n>O.PI&&(n=n-O.TWO_PI)),c(t)?(t.west=n,t.south=s,t.east=i,t.north=a,t):new vn(n,s,i,a)};vn.fromCartesianArray=function(e,t,n){T.defined("cartesians",e),t=t??ie.default;let i=Number.MAX_VALUE,o=-Number.MAX_VALUE,r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,l=-Number.MAX_VALUE;for(let u=0,f=e.length;u<f;u++){let h=t.cartesianToCartographic(e[u]);i=Math.min(i,h.longitude),o=Math.max(o,h.longitude),a=Math.min(a,h.latitude),l=Math.max(l,h.latitude);let p=h.longitude>=0?h.longitude:h.longitude+O.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>O.PI&&(o=o-O.TWO_PI),i>O.PI&&(i=i-O.TWO_PI)),c(n)?(n.west=i,n.south=a,n.east=o,n.north=l,n):new vn(i,a,o,l)};var $we=new d,Zwe=new d,Qwe=new d,Jwe=new d,eve=new d,M5=new Array(5);for(let e=0;e<M5.length;++e)M5[e]=new d;vn.fromBoundingSphere=function(e,t,n){T.typeOf.object("boundingSphere",e);let i=e.center,o=e.radius;if(c(t)||(t=ie.default),c(n)||(n=new vn),d.equals(i,d.ZERO))return vn.clone(vn.MAX_VALUE,n),n;let r=Ot.eastNorthUpToFixedFrame(i,t,$we),s=F.multiplyByPointAsVector(r,d.UNIT_X,Zwe);d.normalize(s,s);let a=F.multiplyByPointAsVector(r,d.UNIT_Y,Qwe);d.normalize(a,a),d.multiplyByScalar(a,o,a),d.multiplyByScalar(s,o,s);let l=d.negate(a,eve),u=d.negate(s,Jwe),f=M5,h=f[0];return d.add(i,a,h),h=f[1],d.add(i,u,h),h=f[2],d.add(i,l,h),h=f[3],d.add(i,s,h),f[4]=i,vn.fromCartesianArray(f,t,n)};vn.clone=function(e,t){if(c(e))return c(t)?(t.west=e.west,t.south=e.south,t.east=e.east,t.north=e.north,t):new vn(e.west,e.south,e.east,e.north)};vn.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e.west-t.west)<=n&&Math.abs(e.south-t.south)<=n&&Math.abs(e.east-t.east)<=n&&Math.abs(e.north-t.north)<=n};vn.prototype.clone=function(e){return vn.clone(this,e)};vn.prototype.equals=function(e){return vn.equals(this,e)};vn.equals=function(e,t){return e===t||c(e)&&c(t)&&e.west===t.west&&e.south===t.south&&e.east===t.east&&e.north===t.north};vn.prototype.equalsEpsilon=function(e,t){return vn.equalsEpsilon(this,e,t)};vn._validate=function(e){T.typeOf.object("rectangle",e);let t=e.north;T.typeOf.number.greaterThanOrEquals("north",t,-O.PI_OVER_TWO),T.typeOf.number.lessThanOrEquals("north",t,O.PI_OVER_TWO);let n=e.south;T.typeOf.number.greaterThanOrEquals("south",n,-O.PI_OVER_TWO),T.typeOf.number.lessThanOrEquals("south",n,O.PI_OVER_TWO);let i=e.west;T.typeOf.number.greaterThanOrEquals("west",i,-Math.PI),T.typeOf.number.lessThanOrEquals("west",i,Math.PI);let o=e.east;T.typeOf.number.greaterThanOrEquals("east",o,-Math.PI),T.typeOf.number.lessThanOrEquals("east",o,Math.PI)};vn.southwest=function(e,t){return T.typeOf.object("rectangle",e),c(t)?(t.longitude=e.west,t.latitude=e.south,t.height=0,t):new he(e.west,e.south)};vn.northwest=function(e,t){return T.typeOf.object("rectangle",e),c(t)?(t.longitude=e.west,t.latitude=e.north,t.height=0,t):new he(e.west,e.north)};vn.northeast=function(e,t){return T.typeOf.object("rectangle",e),c(t)?(t.longitude=e.east,t.latitude=e.north,t.height=0,t):new he(e.east,e.north)};vn.southeast=function(e,t){return T.typeOf.object("rectangle",e),c(t)?(t.longitude=e.east,t.latitude=e.south,t.height=0,t):new he(e.east,e.south)};vn.center=function(e,t){T.typeOf.object("rectangle",e);let n=e.east,i=e.west;n<i&&(n+=O.TWO_PI);let o=O.negativePiToPi((i+n)*.5),r=(e.south+e.north)*.5;return c(t)?(t.longitude=o,t.latitude=r,t.height=0,t):new he(o,r)};vn.intersection=function(e,t,n){T.typeOf.object("rectangle",e),T.typeOf.object("otherRectangle",t);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=O.TWO_PI:r<s&&i>0&&(r+=O.TWO_PI),i<o&&s<0?s+=O.TWO_PI:r<s&&o<0&&(o+=O.TWO_PI);let a=O.negativePiToPi(Math.max(o,s)),l=O.negativePiToPi(Math.min(i,r));if((e.west<e.east||t.west<t.east)&&l<=a)return;let u=Math.max(e.south,t.south),f=Math.min(e.north,t.north);if(!(u>=f))return c(n)?(n.west=a,n.south=u,n.east=l,n.north=f,n):new vn(a,u,l,f)};vn.simpleIntersection=function(e,t,n){T.typeOf.object("rectangle",e),T.typeOf.object("otherRectangle",t);let i=Math.max(e.west,t.west),o=Math.max(e.south,t.south),r=Math.min(e.east,t.east),s=Math.min(e.north,t.north);if(!(o>=s||i>=r))return c(n)?(n.west=i,n.south=o,n.east=r,n.north=s,n):new vn(i,o,r,s)};vn.union=function(e,t,n){T.typeOf.object("rectangle",e),T.typeOf.object("otherRectangle",t),c(n)||(n=new vn);let i=e.east,o=e.west,r=t.east,s=t.west;i<o&&r>0?i+=O.TWO_PI:r<s&&i>0&&(r+=O.TWO_PI),i<o&&s<0?s+=O.TWO_PI:r<s&&o<0&&(o+=O.TWO_PI);let a=O.negativePiToPi(Math.min(o,s)),l=O.negativePiToPi(Math.max(i,r));return n.west=a,n.south=Math.min(e.south,t.south),n.east=l,n.north=Math.max(e.north,t.north),n};vn.expand=function(e,t,n){return T.typeOf.object("rectangle",e),T.typeOf.object("cartographic",t),c(n)||(n=new vn),n.west=Math.min(e.west,t.longitude),n.south=Math.min(e.south,t.latitude),n.east=Math.max(e.east,t.longitude),n.north=Math.max(e.north,t.latitude),n};vn.contains=function(e,t){T.typeOf.object("rectangle",e),T.typeOf.object("cartographic",t);let n=t.longitude,i=t.latitude,o=e.west,r=e.east;return r<o&&(r+=O.TWO_PI,n<0&&(n+=O.TWO_PI)),(n>o||O.equalsEpsilon(n,o,O.EPSILON14))&&(n<r||O.equalsEpsilon(n,r,O.EPSILON14))&&i>=e.south&&i<=e.north};var tve=new he;vn.subsample=function(e,t,n,i){T.typeOf.object("rectangle",e),t=t??ie.default,n=n??0,c(i)||(i=[]);let o=0,r=e.north,s=e.south,a=e.east,l=e.west,u=tve;u.height=n,u.longitude=l,u.latitude=r,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.latitude=s,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=l,i[o]=t.cartographicToCartesian(u,i[o]),o++,r<0?u.latitude=r:s>0?u.latitude=s:u.latitude=0;for(let f=1;f<8;++f)u.longitude=-Math.PI+f*O.PI_OVER_TWO,vn.contains(e,u)&&(i[o]=t.cartographicToCartesian(u,i[o]),o++);return u.latitude===0&&(u.longitude=l,i[o]=t.cartographicToCartesian(u,i[o]),o++,u.longitude=a,i[o]=t.cartographicToCartesian(u,i[o]),o++),i.length=o,i};vn.subsection=function(e,t,n,i,o,r){if(T.typeOf.object("rectangle",e),T.typeOf.number.greaterThanOrEquals("westLerp",t,0),T.typeOf.number.lessThanOrEquals("westLerp",t,1),T.typeOf.number.greaterThanOrEquals("southLerp",n,0),T.typeOf.number.lessThanOrEquals("southLerp",n,1),T.typeOf.number.greaterThanOrEquals("eastLerp",i,0),T.typeOf.number.lessThanOrEquals("eastLerp",i,1),T.typeOf.number.greaterThanOrEquals("northLerp",o,0),T.typeOf.number.lessThanOrEquals("northLerp",o,1),T.typeOf.number.lessThanOrEquals("westLerp",t,i),T.typeOf.number.lessThanOrEquals("southLerp",n,o),c(r)||(r=new vn),e.west<=e.east){let a=e.east-e.west;r.west=e.west+t*a,r.east=e.west+i*a}else{let a=O.TWO_PI+e.east-e.west;r.west=O.negativePiToPi(e.west+t*a),r.east=O.negativePiToPi(e.west+i*a)}let s=e.north-e.south;return r.south=e.south+n*s,r.north=e.south+o*s,t===1&&(r.west=e.east),i===1&&(r.east=e.east),n===1&&(r.south=e.north),o===1&&(r.north=e.north),r};vn.MAX_VALUE=Object.freeze(new vn(-Math.PI,-O.PI_OVER_TWO,Math.PI,O.PI_OVER_TWO));var ce=vn;function Or(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}Or.packedLength=4;Or.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};Or.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Or),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};Or.fromPoints=function(e,t){if(c(t)||(t=new Or),!c(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,o=e[0].y,r=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let l=e[a],u=l.x,f=l.y;i=Math.min(u,i),r=Math.max(u,r),o=Math.min(f,o),s=Math.max(f,s)}return t.x=i,t.y=o,t.width=r-i,t.height=s-o,t};var uQ=new Oi,nve=new he,ive=new he;Or.fromRectangle=function(e,t,n){if(c(n)||(n=new Or),!c(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;uQ._ellipsoid=ie.default,t=t??uQ;let i=t.project(ce.southwest(e,nve)),o=t.project(ce.northeast(e,ive));return z.subtract(o,i,o),n.x=i.x,n.y=i.y,n.width=o.x,n.height=o.y,n};Or.clone=function(e,t){if(c(e))return c(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new Or(e.x,e.y,e.width,e.height)};Or.union=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),c(n)||(n=new Or);let i=Math.min(e.x,t.x),o=Math.min(e.y,t.y),r=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=o,n.width=r-i,n.height=s-o,n};Or.expand=function(e,t,n){T.typeOf.object("rectangle",e),T.typeOf.object("point",t),n=Or.clone(e,n);let i=t.x-n.x,o=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};Or.intersect=function(e,t){T.typeOf.object("left",e),T.typeOf.object("right",t);let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.width<o||i+e.height<r||i>r+t.height?Wt.OUTSIDE:Wt.INTERSECTING};Or.equals=function(e,t){return e===t||c(e)&&c(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};Or.prototype.clone=function(e){return Or.clone(this,e)};Or.prototype.intersect=function(e){return Or.intersect(this,e)};Or.prototype.equals=function(e){return Or.equals(this,e)};var Ke=Or;var Aa={POINTS:ne.POINTS,LINES:ne.LINES,LINE_LOOP:ne.LINE_LOOP,LINE_STRIP:ne.LINE_STRIP,TRIANGLES:ne.TRIANGLES,TRIANGLE_STRIP:ne.TRIANGLE_STRIP,TRIANGLE_FAN:ne.TRIANGLE_FAN};Aa.isLines=function(e){return e===Aa.LINES||e===Aa.LINE_LOOP||e===Aa.LINE_STRIP};Aa.isTriangles=function(e){return e===Aa.TRIANGLES||e===Aa.TRIANGLE_STRIP||e===Aa.TRIANGLE_FAN};Aa.validate=function(e){return e===Aa.POINTS||e===Aa.LINES||e===Aa.LINE_LOOP||e===Aa.LINE_STRIP||e===Aa.TRIANGLES||e===Aa.TRIANGLE_STRIP||e===Aa.TRIANGLE_FAN};var Me=Object.freeze(Aa);var xT=`in vec4 position;
in vec2 textureCoordinates;
out vec2 v_textureCoordinates;
void main()
{
gl_Position = position;
v_textureCoordinates = textureCoordinates;
}
`;var mr={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128};function ew(e){e=e??W.EMPTY_OBJECT,this._boundingVolume=e.boundingVolume,this._orientedBoundingBox=e.orientedBoundingBox,this._modelMatrix=e.modelMatrix,this._primitiveType=e.primitiveType??Me.TRIANGLES,this._vertexArray=e.vertexArray,this._count=e.count,this._offset=e.offset??0,this._instanceCount=e.instanceCount??0,this._shaderProgram=e.shaderProgram,this._uniformMap=e.uniformMap,this._renderState=e.renderState,this._framebuffer=e.framebuffer,this._pass=e.pass,this._owner=e.owner,this._debugOverlappingFrustums=0,this._pickId=e.pickId,this._pickMetadataAllowed=e.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=e.cull??!0,this.occlude=e.occlude??!0,this.executeInClosestFrustum=e.executeInClosestFrustum??!1,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.castShadows=e.castShadows??!1,this.receiveShadows=e.receiveShadows??!1,this.pickOnly=e.pickOnly??!1,this.depthForTranslucentClassification=e.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}function Ka(e,t){return(e._flags&t)===t}function H_(e,t,n){n?e._flags|=t:e._flags&=~t}Object.defineProperties(ew.prototype,{boundingVolume:{get:function(){return this._boundingVolume},set:function(e){this._boundingVolume!==e&&(this._boundingVolume=e,this.dirty=!0)}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox},set:function(e){this._orientedBoundingBox!==e&&(this._orientedBoundingBox=e,this.dirty=!0)}},cull:{get:function(){return Ka(this,mr.CULL)},set:function(e){Ka(this,mr.CULL)!==e&&(H_(this,mr.CULL,e),this.dirty=!0)}},occlude:{get:function(){return Ka(this,mr.OCCLUDE)},set:function(e){Ka(this,mr.OCCLUDE)!==e&&(H_(this,mr.OCCLUDE,e),this.dirty=!0)}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix!==e&&(this._modelMatrix=e,this.dirty=!0)}},primitiveType:{get:function(){return this._primitiveType},set:function(e){this._primitiveType!==e&&(this._primitiveType=e,this.dirty=!0)}},vertexArray:{get:function(){return this._vertexArray},set:function(e){this._vertexArray!==e&&(this._vertexArray=e,this.dirty=!0)}},count:{get:function(){return this._count},set:function(e){this._count!==e&&(this._count=e,this.dirty=!0)}},offset:{get:function(){return this._offset},set:function(e){this._offset!==e&&(this._offset=e,this.dirty=!0)}},instanceCount:{get:function(){return this._instanceCount},set:function(e){this._instanceCount!==e&&(this._instanceCount=e,this.dirty=!0)}},shaderProgram:{get:function(){return this._shaderProgram},set:function(e){this._shaderProgram!==e&&(this._shaderProgram=e,this.dirty=!0)}},castShadows:{get:function(){return Ka(this,mr.CAST_SHADOWS)},set:function(e){Ka(this,mr.CAST_SHADOWS)!==e&&(H_(this,mr.CAST_SHADOWS,e),this.dirty=!0)}},receiveShadows:{get:function(){return Ka(this,mr.RECEIVE_SHADOWS)},set:function(e){Ka(this,mr.RECEIVE_SHADOWS)!==e&&(H_(this,mr.RECEIVE_SHADOWS,e),this.dirty=!0)}},uniformMap:{get:function(){return this._uniformMap},set:function(e){this._uniformMap!==e&&(this._uniformMap=e,this.dirty=!0)}},renderState:{get:function(){return this._renderState},set:function(e){this._renderState!==e&&(this._renderState=e,this.dirty=!0)}},framebuffer:{get:function(){return this._framebuffer},set:function(e){this._framebuffer!==e&&(this._framebuffer=e,this.dirty=!0)}},pass:{get:function(){return this._pass},set:function(e){this._pass!==e&&(this._pass=e,this.dirty=!0)}},executeInClosestFrustum:{get:function(){return Ka(this,mr.EXECUTE_IN_CLOSEST_FRUSTUM)},set:function(e){Ka(this,mr.EXECUTE_IN_CLOSEST_FRUSTUM)!==e&&(H_(this,mr.EXECUTE_IN_CLOSEST_FRUSTUM,e),this.dirty=!0)}},owner:{get:function(){return this._owner},set:function(e){this._owner!==e&&(this._owner=e,this.dirty=!0)}},debugShowBoundingVolume:{get:function(){return Ka(this,mr.DEBUG_SHOW_BOUNDING_VOLUME)},set:function(e){Ka(this,mr.DEBUG_SHOW_BOUNDING_VOLUME)!==e&&(H_(this,mr.DEBUG_SHOW_BOUNDING_VOLUME,e),this.dirty=!0)}},debugOverlappingFrustums:{get:function(){return this._debugOverlappingFrustums},set:function(e){this._debugOverlappingFrustums!==e&&(this._debugOverlappingFrustums=e,this.dirty=!0)}},pickId:{get:function(){return this._pickId},set:function(e){this._pickId!==e&&(this._pickId=e,this.dirty=!0)}},pickMetadataAllowed:{get:function(){return this._pickMetadataAllowed}},pickedMetadataInfo:{get:function(){return this._pickedMetadataInfo},set:function(e){this._pickedMetadataInfo!==e&&(this._pickedMetadataInfo=e,this.dirty=!0)}},pickOnly:{get:function(){return Ka(this,mr.PICK_ONLY)},set:function(e){Ka(this,mr.PICK_ONLY)!==e&&(H_(this,mr.PICK_ONLY,e),this.dirty=!0)}},depthForTranslucentClassification:{get:function(){return Ka(this,mr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)},set:function(e){Ka(this,mr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==e&&(H_(this,mr.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,e),this.dirty=!0)}}});ew.shallowClone=function(e,t){if(c(e))return c(t)||(t=new ew),t._boundingVolume=e._boundingVolume,t._orientedBoundingBox=e._orientedBoundingBox,t._modelMatrix=e._modelMatrix,t._primitiveType=e._primitiveType,t._vertexArray=e._vertexArray,t._count=e._count,t._offset=e._offset,t._instanceCount=e._instanceCount,t._shaderProgram=e._shaderProgram,t._uniformMap=e._uniformMap,t._renderState=e._renderState,t._framebuffer=e._framebuffer,t._pass=e._pass,t._owner=e._owner,t._debugOverlappingFrustums=e._debugOverlappingFrustums,t._pickId=e._pickId,t._pickMetadataAllowed=e._pickMetadataAllowed,t._pickedMetadataInfo=e._pickedMetadataInfo,t._flags=e._flags,t.dirty=!0,t.lastDirtyTime=0,t};ew.prototype.execute=function(e,t){e.draw(this,t)};var Je=ew;var li={UNSIGNED_BYTE:ne.UNSIGNED_BYTE,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,UNSIGNED_INT:ne.UNSIGNED_INT,FLOAT:ne.FLOAT,HALF_FLOAT:ne.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ne.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ne.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ne.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ne.UNSIGNED_SHORT_5_6_5};li.toWebGLConstant=function(e,t){switch(e){case li.UNSIGNED_BYTE:return ne.UNSIGNED_BYTE;case li.UNSIGNED_SHORT:return ne.UNSIGNED_SHORT;case li.UNSIGNED_INT:return ne.UNSIGNED_INT;case li.FLOAT:return ne.FLOAT;case li.HALF_FLOAT:return t.webgl2?ne.HALF_FLOAT:ne.HALF_FLOAT_OES;case li.UNSIGNED_INT_24_8:return ne.UNSIGNED_INT_24_8;case li.UNSIGNED_SHORT_4_4_4_4:return ne.UNSIGNED_SHORT_4_4_4_4;case li.UNSIGNED_SHORT_5_5_5_1:return ne.UNSIGNED_SHORT_5_5_5_1;case li.UNSIGNED_SHORT_5_6_5:return li.UNSIGNED_SHORT_5_6_5}};li.isPacked=function(e){return e===li.UNSIGNED_INT_24_8||e===li.UNSIGNED_SHORT_4_4_4_4||e===li.UNSIGNED_SHORT_5_5_5_1||e===li.UNSIGNED_SHORT_5_6_5};li.sizeInBytes=function(e){switch(e){case li.UNSIGNED_BYTE:return 1;case li.UNSIGNED_SHORT:case li.UNSIGNED_SHORT_4_4_4_4:case li.UNSIGNED_SHORT_5_5_5_1:case li.UNSIGNED_SHORT_5_6_5:case li.HALF_FLOAT:return 2;case li.UNSIGNED_INT:case li.FLOAT:case li.UNSIGNED_INT_24_8:return 4}};li.validate=function(e){return e===li.UNSIGNED_BYTE||e===li.UNSIGNED_SHORT||e===li.UNSIGNED_INT||e===li.FLOAT||e===li.HALF_FLOAT||e===li.UNSIGNED_INT_24_8||e===li.UNSIGNED_SHORT_4_4_4_4||e===li.UNSIGNED_SHORT_5_5_5_1||e===li.UNSIGNED_SHORT_5_6_5};li.getTypedArrayConstructor=function(e){let t=li.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===li.FLOAT?Float32Array:Uint32Array};var Ue=Object.freeze(li);var rt={DEPTH_COMPONENT:ne.DEPTH_COMPONENT,DEPTH_STENCIL:ne.DEPTH_STENCIL,ALPHA:ne.ALPHA,RED:ne.RED,RG:ne.RG,RGB:ne.RGB,RGBA:ne.RGBA,LUMINANCE:ne.LUMINANCE,LUMINANCE_ALPHA:ne.LUMINANCE_ALPHA,RGB_DXT1:ne.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ne.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ne.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ne.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ne.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ne.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ne.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ne.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ne.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ne.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ne.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ne.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ne.COMPRESSED_RGBA_BPTC_UNORM};rt.componentsLength=function(e){switch(e){case rt.RGB:return 3;case rt.RGBA:return 4;case rt.LUMINANCE_ALPHA:case rt.RG:return 2;case rt.ALPHA:case rt.RED:case rt.LUMINANCE:return 1;default:return 1}};rt.validate=function(e){return e===rt.DEPTH_COMPONENT||e===rt.DEPTH_STENCIL||e===rt.ALPHA||e===rt.RED||e===rt.RG||e===rt.RGB||e===rt.RGBA||e===rt.LUMINANCE||e===rt.LUMINANCE_ALPHA||e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5||e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1||e===rt.RGBA_ASTC||e===rt.RGB_ETC1||e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC||e===rt.RGBA_BC7};rt.isColorFormat=function(e){return e===rt.RED||e===rt.ALPHA||e===rt.RGB||e===rt.RGBA||e===rt.LUMINANCE||e===rt.LUMINANCE_ALPHA};rt.isDepthFormat=function(e){return e===rt.DEPTH_COMPONENT||e===rt.DEPTH_STENCIL};rt.isCompressedFormat=function(e){return e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5||e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1||e===rt.RGBA_ASTC||e===rt.RGB_ETC1||e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC||e===rt.RGBA_BC7};rt.isDXTFormat=function(e){return e===rt.RGB_DXT1||e===rt.RGBA_DXT1||e===rt.RGBA_DXT3||e===rt.RGBA_DXT5};rt.isPVRTCFormat=function(e){return e===rt.RGB_PVRTC_4BPPV1||e===rt.RGB_PVRTC_2BPPV1||e===rt.RGBA_PVRTC_4BPPV1||e===rt.RGBA_PVRTC_2BPPV1};rt.isASTCFormat=function(e){return e===rt.RGBA_ASTC};rt.isETC1Format=function(e){return e===rt.RGB_ETC1};rt.isETC2Format=function(e){return e===rt.RGB8_ETC2||e===rt.RGBA8_ETC2_EAC};rt.isBC7Format=function(e){return e===rt.RGBA_BC7};rt.compressedTextureSizeInBytes=function(e,t,n){switch(e){case rt.RGB_DXT1:case rt.RGBA_DXT1:case rt.RGB_ETC1:case rt.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case rt.RGBA_DXT3:case rt.RGBA_DXT5:case rt.RGBA_ASTC:case rt.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case rt.RGB_PVRTC_4BPPV1:case rt.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case rt.RGB_PVRTC_2BPPV1:case rt.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case rt.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};rt.textureSizeInBytes=function(e,t,n,i){let o=rt.componentsLength(e);return Ue.isPacked(t)&&(o=1),o*Ue.sizeInBytes(t)*n*i};rt.alignmentInBytes=function(e,t,n){let i=rt.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};rt.createTypedArray=function(e,t,n,i){let o=Ue.getTypedArrayConstructor(t),r=rt.componentsLength(e)*n*i;return new o(r)};rt.flipY=function(e,t,n,i,o){if(o===1)return e;let r=rt.createTypedArray(t,n,i,o),s=rt.componentsLength(t),a=i*s;for(let l=0;l<o;++l){let u=l*i*s,f=(o-l-1)*i*s;for(let h=0;h<a;++h)r[f+h]=e[u+h]}return r};rt.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===rt.DEPTH_STENCIL)return ne.DEPTH24_STENCIL8;if(e===rt.DEPTH_COMPONENT){if(t===Ue.UNSIGNED_SHORT)return ne.DEPTH_COMPONENT16;if(t===Ue.UNSIGNED_INT)return ne.DEPTH_COMPONENT24}if(t===Ue.FLOAT)switch(e){case rt.RGBA:return ne.RGBA32F;case rt.RGB:return ne.RGB32F;case rt.RG:return ne.RG32F;case rt.RED:return ne.R32F}if(t===Ue.HALF_FLOAT)switch(e){case rt.RGBA:return ne.RGBA16F;case rt.RGB:return ne.RGB16F;case rt.RG:return ne.RG16F;case rt.RED:return ne.R16F}return e};var ke=Object.freeze(rt);var pr={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(pr,{maximumCombinedTextureImageUnits:{get:function(){return pr._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return pr._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return pr._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return pr._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return pr._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return pr._maximumTextureSize}},maximumVaryingVectors:{get:function(){return pr._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return pr._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return pr._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return pr._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return pr._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return pr._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return pr._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return pr._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return pr._maximumViewportWidth}},maximumViewportHeight:{get:function(){return pr._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return pr._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return pr._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return pr._maximumColorAttachments}},maximumSamples:{get:function(){return pr._maximumSamples}},highpFloatSupported:{get:function(){return pr._highpFloatSupported}},highpIntSupported:{get:function(){return pr._highpIntSupported}}});var ut=pr;function L5(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function JO(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function cd(e){e=e??W.EMPTY_OBJECT;let t=e.context;T.defined("options.context",t);let n=t._gl,i=ut.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e.destroyAttachments??!0,c(e.colorTextures)&&c(e.colorRenderbuffers))throw new C("Cannot have both color texture and color renderbuffer attachments.");if(c(e.depthTexture)&&c(e.depthRenderbuffer))throw new C("Cannot have both a depth texture and depth renderbuffer attachment.");if(c(e.depthStencilTexture)&&c(e.depthStencilRenderbuffer))throw new C("Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment.");let o=c(e.depthTexture)||c(e.depthRenderbuffer),r=c(e.depthStencilTexture)||c(e.depthStencilRenderbuffer);if(o&&r)throw new C("Cannot have both a depth and depth-stencil attachment.");if(c(e.stencilRenderbuffer)&&r)throw new C("Cannot have both a stencil and depth-stencil attachment.");if(o&&c(e.stencilRenderbuffer))throw new C("Cannot have both a depth and stencil attachment.");if(this._bind(),c(e.colorTextures)){let s=e.colorTextures,a=this._colorTextures.length=this._activeColorAttachments.length=s.length;if(a>i)throw new C("The number of color attachments exceeds the number supported.");for(let l=0;l<a;++l){let u=s[l];if(!ke.isColorFormat(u.pixelFormat))throw new C("The color-texture pixel-format must be a color format.");if(u.pixelDatatype===Ue.FLOAT&&!t.colorBufferFloat)throw new C("The color texture pixel datatype is FLOAT and the WebGL implementation does not support the EXT_color_buffer_float or WEBGL_color_buffer_float extensions. See Context.colorBufferFloat.");if(u.pixelDatatype===Ue.HALF_FLOAT&&!t.colorBufferHalfFloat)throw new C("The color texture pixel datatype is HALF_FLOAT and the WebGL implementation does not support the EXT_color_buffer_half_float extension. See Context.colorBufferHalfFloat.");let f=this._gl.COLOR_ATTACHMENT0+l;L5(this,f,u),this._activeColorAttachments[l]=f,this._colorTextures[l]=u}}if(c(e.colorRenderbuffers)){let s=e.colorRenderbuffers,a=this._colorRenderbuffers.length=this._activeColorAttachments.length=s.length;if(a>i)throw new C("The number of color attachments exceeds the number supported.");for(let l=0;l<a;++l){let u=s[l],f=this._gl.COLOR_ATTACHMENT0+l;JO(this,f,u),this._activeColorAttachments[l]=f,this._colorRenderbuffers[l]=u}}if(c(e.depthTexture)){let s=e.depthTexture;if(s.pixelFormat!==ke.DEPTH_COMPONENT)throw new C("The depth-texture pixel-format must be DEPTH_COMPONENT.");L5(this,this._gl.DEPTH_ATTACHMENT,s),this._depthTexture=s}if(c(e.depthRenderbuffer)){let s=e.depthRenderbuffer;JO(this,this._gl.DEPTH_ATTACHMENT,s),this._depthRenderbuffer=s}if(c(e.stencilRenderbuffer)){let s=e.stencilRenderbuffer;JO(this,this._gl.STENCIL_ATTACHMENT,s),this._stencilRenderbuffer=s}if(c(e.depthStencilTexture)){let s=e.depthStencilTexture;if(s.pixelFormat!==ke.DEPTH_STENCIL)throw new C("The depth-stencil pixel-format must be DEPTH_STENCIL.");L5(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilTexture=s}if(c(e.depthStencilRenderbuffer)){let s=e.depthStencilRenderbuffer;JO(this,this._gl.DEPTH_STENCIL_ATTACHMENT,s),this._depthStencilRenderbuffer=s}this._unBind()}Object.defineProperties(cd.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});cd.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};cd.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};cd.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};cd.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};cd.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};cd.prototype.getColorTexture=function(e){if(!c(e)||e<0||e>=this._colorTextures.length)throw new C("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorTextures[e]};cd.prototype.getColorRenderbuffer=function(e){if(!c(e)||e<0||e>=this._colorRenderbuffers.length)throw new C("index is required, must be greater than or equal to zero and must be less than the number of color attachments.");return this._colorRenderbuffers[e]};cd.prototype.isDestroyed=function(){return!1};cd.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];c(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];c(i)&&i.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),de(this)};var Wr=cd;var e1={CLOCKWISE:ne.CW,COUNTER_CLOCKWISE:ne.CCW};e1.validate=function(e){return e===e1.CLOCKWISE||e===e1.COUNTER_CLOCKWISE};var ts=Object.freeze(e1);function fQ(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=fQ(e[t]));return Object.freeze(e)}var t1=fQ;function dQ(e){return e===ne.FUNC_ADD||e===ne.FUNC_SUBTRACT||e===ne.FUNC_REVERSE_SUBTRACT||e===ne.MIN||e===ne.MAX}function n1(e){return e===ne.ZERO||e===ne.ONE||e===ne.SRC_COLOR||e===ne.ONE_MINUS_SRC_COLOR||e===ne.DST_COLOR||e===ne.ONE_MINUS_DST_COLOR||e===ne.SRC_ALPHA||e===ne.ONE_MINUS_SRC_ALPHA||e===ne.DST_ALPHA||e===ne.ONE_MINUS_DST_ALPHA||e===ne.CONSTANT_COLOR||e===ne.ONE_MINUS_CONSTANT_COLOR||e===ne.CONSTANT_ALPHA||e===ne.ONE_MINUS_CONSTANT_ALPHA||e===ne.SRC_ALPHA_SATURATE}function ove(e){return e===ne.FRONT||e===ne.BACK||e===ne.FRONT_AND_BACK}function rve(e){return e===ne.NEVER||e===ne.LESS||e===ne.EQUAL||e===ne.LEQUAL||e===ne.GREATER||e===ne.NOTEQUAL||e===ne.GEQUAL||e===ne.ALWAYS}function hQ(e){return e===ne.NEVER||e===ne.LESS||e===ne.EQUAL||e===ne.LEQUAL||e===ne.GREATER||e===ne.NOTEQUAL||e===ne.GEQUAL||e===ne.ALWAYS}function TT(e){return e===ne.ZERO||e===ne.KEEP||e===ne.REPLACE||e===ne.INCR||e===ne.DECR||e===ne.INVERT||e===ne.INCR_WRAP||e===ne.DECR_WRAP}function vh(e){let t=e??W.EMPTY_OBJECT,n=t.cull??W.EMPTY_OBJECT,i=t.polygonOffset??W.EMPTY_OBJECT,o=t.scissorTest??W.EMPTY_OBJECT,r=o.rectangle??W.EMPTY_OBJECT,s=t.depthRange??W.EMPTY_OBJECT,a=t.depthTest??W.EMPTY_OBJECT,l=t.colorMask??W.EMPTY_OBJECT,u=t.blending??W.EMPTY_OBJECT,f=u.color??W.EMPTY_OBJECT,h=t.stencilTest??W.EMPTY_OBJECT,p=h.frontOperation??W.EMPTY_OBJECT,g=h.backOperation??W.EMPTY_OBJECT,m=t.sampleCoverage??W.EMPTY_OBJECT,y=t.viewport;if(this.frontFace=t.frontFace??ts.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??ne.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:o.enabled??!1,rectangle:Ke.clone(r)},this.depthRange={near:s.near??0,far:s.far??1},this.depthTest={enabled:a.enabled??!1,func:a.func??ne.LESS},this.colorMask={red:l.red??!0,green:l.green??!0,blue:l.blue??!0,alpha:l.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:u.enabled??!1,color:new G(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??ne.FUNC_ADD,equationAlpha:u.equationAlpha??ne.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??ne.ONE,functionSourceAlpha:u.functionSourceAlpha??ne.ONE,functionDestinationRgb:u.functionDestinationRgb??ne.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??ne.ZERO},this.stencilTest={enabled:h.enabled??!1,frontFunction:h.frontFunction??ne.ALWAYS,backFunction:h.backFunction??ne.ALWAYS,reference:h.reference??0,mask:h.mask??-1,frontOperation:{fail:p.fail??ne.KEEP,zFail:p.zFail??ne.KEEP,zPass:p.zPass??ne.KEEP},backOperation:{fail:g.fail??ne.KEEP,zFail:g.zFail??ne.KEEP,zPass:g.zPass??ne.KEEP}},this.sampleCoverage={enabled:m.enabled??!1,value:m.value??1,invert:m.invert??!1},this.viewport=c(y)?new Ke(y.x,y.y,y.width,y.height):void 0,this.lineWidth<ut.minimumAliasedLineWidth||this.lineWidth>ut.maximumAliasedLineWidth)throw new C("renderState.lineWidth is out of range. Check minimumAliasedLineWidth and maximumAliasedLineWidth.");if(!ts.validate(this.frontFace))throw new C("Invalid renderState.frontFace.");if(!ove(this.cull.face))throw new C("Invalid renderState.cull.face.");if(this.scissorTest.rectangle.width<0||this.scissorTest.rectangle.height<0)throw new C("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero.");if(this.depthRange.near>this.depthRange.far)throw new C("renderState.depthRange.near can not be greater than renderState.depthRange.far.");if(this.depthRange.near<0)throw new C("renderState.depthRange.near must be greater than or equal to zero.");if(this.depthRange.far>1)throw new C("renderState.depthRange.far must be less than or equal to one.");if(!rve(this.depthTest.func))throw new C("Invalid renderState.depthTest.func.");if(this.blending.color.red<0||this.blending.color.red>1||this.blending.color.green<0||this.blending.color.green>1||this.blending.color.blue<0||this.blending.color.blue>1||this.blending.color.alpha<0||this.blending.color.alpha>1)throw new C("renderState.blending.color components must be greater than or equal to zero and less than or equal to one.");if(!dQ(this.blending.equationRgb))throw new C("Invalid renderState.blending.equationRgb.");if(!dQ(this.blending.equationAlpha))throw new C("Invalid renderState.blending.equationAlpha.");if(!n1(this.blending.functionSourceRgb))throw new C("Invalid renderState.blending.functionSourceRgb.");if(!n1(this.blending.functionSourceAlpha))throw new C("Invalid renderState.blending.functionSourceAlpha.");if(!n1(this.blending.functionDestinationRgb))throw new C("Invalid renderState.blending.functionDestinationRgb.");if(!n1(this.blending.functionDestinationAlpha))throw new C("Invalid renderState.blending.functionDestinationAlpha.");if(!hQ(this.stencilTest.frontFunction))throw new C("Invalid renderState.stencilTest.frontFunction.");if(!hQ(this.stencilTest.backFunction))throw new C("Invalid renderState.stencilTest.backFunction.");if(!TT(this.stencilTest.frontOperation.fail))throw new C("Invalid renderState.stencilTest.frontOperation.fail.");if(!TT(this.stencilTest.frontOperation.zFail))throw new C("Invalid renderState.stencilTest.frontOperation.zFail.");if(!TT(this.stencilTest.frontOperation.zPass))throw new C("Invalid renderState.stencilTest.frontOperation.zPass.");if(!TT(this.stencilTest.backOperation.fail))throw new C("Invalid renderState.stencilTest.backOperation.fail.");if(!TT(this.stencilTest.backOperation.zFail))throw new C("Invalid renderState.stencilTest.backOperation.zFail.");if(!TT(this.stencilTest.backOperation.zPass))throw new C("Invalid renderState.stencilTest.backOperation.zPass.");if(c(this.viewport)){if(this.viewport.width<0)throw new C("renderState.viewport.width must be greater than or equal to zero.");if(this.viewport.height<0)throw new C("renderState.viewport.height must be greater than or equal to zero.");if(this.viewport.width>ut.maximumViewportWidth)throw new C(`renderState.viewport.width must be less than or equal to the maximum viewport width (${ut.maximumViewportWidth.toString()}). Check maximumViewportWidth.`);if(this.viewport.height>ut.maximumViewportHeight)throw new C(`renderState.viewport.height must be less than or equal to the maximum viewport height (${ut.maximumViewportHeight.toString()}). Check maximumViewportHeight.`)}this.id=0,this._applyFunctions=[]}var sve=0,wh={};vh.fromCache=function(e){let t=JSON.stringify(e),n=wh[t];if(c(n))return++n.referenceCount,n.state;let i=new vh(e),o=JSON.stringify(i);return n=wh[o],c(n)||(i.id=sve++,i=t1(i),n={referenceCount:0,state:i},wh[o]=n),++n.referenceCount,wh[t]={referenceCount:1,state:n.state},n.state};vh.removeFromCache=function(e){let t=new vh(e),n=JSON.stringify(t),i=wh[n],o=JSON.stringify(e),r=wh[o];c(r)&&(--r.referenceCount,r.referenceCount===0&&(delete wh[o],c(i)&&--i.referenceCount)),c(i)&&i.referenceCount===0&&delete wh[n]};vh.getCache=function(){return wh};vh.clearCache=function(){wh={}};function L0(e,t,n){n?e.enable(t):e.disable(t)}function mQ(e,t){e.frontFace(t.frontFace)}function pQ(e,t){let n=t.cull,i=n.enabled;L0(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function _Q(e,t){e.lineWidth(t.lineWidth)}function gQ(e,t){let n=t.polygonOffset,i=n.enabled;L0(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function yQ(e,t,n){let i=t.scissorTest,o=c(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(L0(e,e.SCISSOR_TEST,o),o){let r=c(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(r.x,r.y,r.width,r.height)}}function bQ(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function xQ(e,t){let n=t.depthTest,i=n.enabled;L0(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function TQ(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function AQ(e,t){e.depthMask(t.depthMask)}function CQ(e,t){e.stencilMask(t.stencilMask)}function ave(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function EQ(e,t,n){let i=t.blending,o=c(n.blendingEnabled)?n.blendingEnabled:i.enabled;L0(e,e.BLEND,o),o&&(ave(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function SQ(e,t){let n=t.stencilTest,i=n.enabled;if(L0(e,e.STENCIL_TEST,i),i){let o=n.frontFunction,r=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(o,s,a),e.stencilFuncSeparate(e.BACK,r,s,a),e.stencilFuncSeparate(e.FRONT,o,s,a);let l=n.frontOperation,u=l.fail,f=l.zFail,h=l.zPass;e.stencilOpSeparate(e.FRONT,u,f,h);let p=n.backOperation,g=p.fail,m=p.zFail,y=p.zPass;e.stencilOpSeparate(e.BACK,g,m,y)}}function wQ(e,t){let n=t.sampleCoverage,i=n.enabled;L0(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var cve=new Ke;function vQ(e,t,n){let i=t.viewport??n.viewport;c(i)||(i=cve,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}vh.apply=function(e,t,n){mQ(e,t),pQ(e,t),_Q(e,t),gQ(e,t),bQ(e,t),xQ(e,t),TQ(e,t),AQ(e,t),CQ(e,t),SQ(e,t),wQ(e,t),yQ(e,t,n),EQ(e,t,n),vQ(e,t,n)};function lve(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(mQ),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(pQ),e.lineWidth!==t.lineWidth&&n.push(_Q),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(gQ),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(bQ),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(xQ),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(TQ),e.depthMask!==t.depthMask&&n.push(AQ),e.stencilMask!==t.stencilMask&&n.push(CQ),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(SQ),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(wQ),n}vh.partialApply=function(e,t,n,i,o,r){if(t!==n){let f=n._applyFunctions[t.id];c(f)||(f=lve(t,n),n._applyFunctions[t.id]=f);let h=f.length;for(let p=0;p<h;++p)f[p](e,n)}let s=c(i.scissorTest)?i.scissorTest:t.scissorTest,a=c(o.scissorTest)?o.scissorTest:n.scissorTest;(s!==a||r)&&yQ(e,n,o);let l=c(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=c(o.blendingEnabled)?o.blendingEnabled:n.blending.enabled;(l!==u||u&&t.blending!==n.blending)&&EQ(e,n,o),(t!==n||i!==o||i.context!==o.context)&&vQ(e,n,o)};vh.getState=function(e){if(!c(e))throw new C("renderState is required.");return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:Ke.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:G.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:c(e.viewport)?Ke.clone(e.viewport):void 0}};var ze=vh;function Kt(e,t,n,i){this[0]=e??0,this[1]=n??0,this[2]=t??0,this[3]=i??0}Kt.packedLength=4;Kt.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e[0],t[n++]=e[1],t[n++]=e[2],t[n++]=e[3],t};Kt.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Kt),n[0]=e[t++],n[1]=e[t++],n[2]=e[t++],n[3]=e[t++],n};Kt.packArray=function(e,t){T.defined("array",e);let n=e.length,i=n*4;if(!c(t))t=new Array(i);else{if(!Array.isArray(t)&&t.length!==i)throw new C("If result is a typed array, it must have exactly array.length * 4 elements");t.length!==i&&(t.length=i)}for(let o=0;o<n;++o)Kt.pack(e[o],t,o*4);return t};Kt.unpackArray=function(e,t){if(T.defined("array",e),T.typeOf.number.greaterThanOrEquals("array.length",e.length,4),e.length%4!==0)throw new C("array length must be a multiple of 4.");let n=e.length;c(t)?t.length=n/4:t=new Array(n/4);for(let i=0;i<n;i+=4){let o=i/4;t[o]=Kt.unpack(e,i,t[o])}return t};Kt.clone=function(e,t){if(c(e))return c(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):new Kt(e[0],e[2],e[1],e[3])};Kt.fromArray=Kt.unpack;Kt.fromColumnMajorArray=function(e,t){return T.defined("values",e),Kt.clone(e,t)};Kt.fromRowMajorArray=function(e,t){return T.defined("values",e),c(t)?(t[0]=e[0],t[1]=e[2],t[2]=e[1],t[3]=e[3],t):new Kt(e[0],e[1],e[2],e[3])};Kt.fromScale=function(e,t){return T.typeOf.object("scale",e),c(t)?(t[0]=e.x,t[1]=0,t[2]=0,t[3]=e.y,t):new Kt(e.x,0,0,e.y)};Kt.fromUniformScale=function(e,t){return T.typeOf.number("scale",e),c(t)?(t[0]=e,t[1]=0,t[2]=0,t[3]=e,t):new Kt(e,0,0,e)};Kt.fromRotation=function(e,t){T.typeOf.number("angle",e);let n=Math.cos(e),i=Math.sin(e);return c(t)?(t[0]=n,t[1]=i,t[2]=-i,t[3]=n,t):new Kt(n,-i,i,n)};Kt.toArray=function(e,t){return T.typeOf.object("matrix",e),c(t)?(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t):[e[0],e[1],e[2],e[3]]};Kt.getElementIndex=function(e,t){return T.typeOf.number.greaterThanOrEquals("row",t,0),T.typeOf.number.lessThanOrEquals("row",t,1),T.typeOf.number.greaterThanOrEquals("column",e,0),T.typeOf.number.lessThanOrEquals("column",e,1),e*2+t};Kt.getColumn=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,1),T.typeOf.object("result",n);let i=t*2,o=e[i],r=e[i+1];return n.x=o,n.y=r,n};Kt.setColumn=function(e,t,n,i){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,1),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=Kt.clone(e,i);let o=t*2;return i[o]=n.x,i[o+1]=n.y,i};Kt.getRow=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,1),T.typeOf.object("result",n);let i=e[t],o=e[t+2];return n.x=i,n.y=o,n};Kt.setRow=function(e,t,n,i){return T.typeOf.object("matrix",e),T.typeOf.number.greaterThanOrEquals("index",t,0),T.typeOf.number.lessThanOrEquals("index",t,1),T.typeOf.object("cartesian",n),T.typeOf.object("result",i),i=Kt.clone(e,i),i[t]=n.x,i[t+2]=n.y,i};var uve=new z;Kt.setScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n);let i=Kt.getScale(e,uve),o=t.x/i.x,r=t.y/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var fve=new z;Kt.setUniformScale=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n);let i=Kt.getScale(e,fve),o=t/i.x,r=t/i.y;return n[0]=e[0]*o,n[1]=e[1]*o,n[2]=e[2]*r,n[3]=e[3]*r,n};var DQ=new z;Kt.getScale=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t.x=z.magnitude(z.fromElements(e[0],e[1],DQ)),t.y=z.magnitude(z.fromElements(e[2],e[3],DQ)),t};var PQ=new z;Kt.getMaximumScale=function(e){return Kt.getScale(e,PQ),z.maximumComponent(PQ)};var dve=new z;Kt.setRotation=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("result",n);let i=Kt.getScale(e,dve);return n[0]=t[0]*i.x,n[1]=t[1]*i.x,n[2]=t[2]*i.y,n[3]=t[3]*i.y,n};var hve=new z;Kt.getRotation=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=Kt.getScale(e,hve);return t[0]=e[0]/n.x,t[1]=e[1]/n.x,t[2]=e[2]/n.y,t[3]=e[3]/n.y,t};Kt.multiply=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n);let i=e[0]*t[0]+e[2]*t[1],o=e[0]*t[2]+e[2]*t[3],r=e[1]*t[0]+e[3]*t[1],s=e[1]*t[2]+e[3]*t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n};Kt.add=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n[0]=e[0]+t[0],n[1]=e[1]+t[1],n[2]=e[2]+t[2],n[3]=e[3]+t[3],n};Kt.subtract=function(e,t,n){return T.typeOf.object("left",e),T.typeOf.object("right",t),T.typeOf.object("result",n),n[0]=e[0]-t[0],n[1]=e[1]-t[1],n[2]=e[2]-t[2],n[3]=e[3]-t[3],n};Kt.multiplyByVector=function(e,t,n){T.typeOf.object("matrix",e),T.typeOf.object("cartesian",t),T.typeOf.object("result",n);let i=e[0]*t.x+e[2]*t.y,o=e[1]*t.x+e[3]*t.y;return n.x=i,n.y=o,n};Kt.multiplyByScalar=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scalar",t),T.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Kt.multiplyByScale=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.object("scale",t),T.typeOf.object("result",n),n[0]=e[0]*t.x,n[1]=e[1]*t.x,n[2]=e[2]*t.y,n[3]=e[3]*t.y,n};Kt.multiplyByUniformScale=function(e,t,n){return T.typeOf.object("matrix",e),T.typeOf.number("scale",t),T.typeOf.object("result",n),n[0]=e[0]*t,n[1]=e[1]*t,n[2]=e[2]*t,n[3]=e[3]*t,n};Kt.negate=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t};Kt.transpose=function(e,t){T.typeOf.object("matrix",e),T.typeOf.object("result",t);let n=e[0],i=e[2],o=e[1],r=e[3];return t[0]=n,t[1]=i,t[2]=o,t[3]=r,t};Kt.abs=function(e,t){return T.typeOf.object("matrix",e),T.typeOf.object("result",t),t[0]=Math.abs(e[0]),t[1]=Math.abs(e[1]),t[2]=Math.abs(e[2]),t[3]=Math.abs(e[3]),t};Kt.equals=function(e,t){return e===t||c(e)&&c(t)&&e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]};Kt.equalsArray=function(e,t,n){return e[0]===t[n]&&e[1]===t[n+1]&&e[2]===t[n+2]&&e[3]===t[n+3]};Kt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e[0]-t[0])<=n&&Math.abs(e[1]-t[1])<=n&&Math.abs(e[2]-t[2])<=n&&Math.abs(e[3]-t[3])<=n};Kt.IDENTITY=Object.freeze(new Kt(1,0,0,1));Kt.ZERO=Object.freeze(new Kt(0,0,0,0));Kt.COLUMN0ROW0=0;Kt.COLUMN0ROW1=1;Kt.COLUMN1ROW0=2;Kt.COLUMN1ROW1=3;Object.defineProperties(Kt.prototype,{length:{get:function(){return Kt.packedLength}}});Kt.prototype.clone=function(e){return Kt.clone(this,e)};Kt.prototype.equals=function(e){return Kt.equals(this,e)};Kt.prototype.equalsEpsilon=function(e,t){return Kt.equalsEpsilon(this,e,t)};Kt.prototype.toString=function(){return`(${this[0]}, ${this[2]})
(${this[1]}, ${this[3]})`};var Ri=Kt;function mve(e,t,n,i){switch(t.type){case e.FLOAT:return new IQ(e,t,n,i);case e.FLOAT_VEC2:return new OQ(e,t,n,i);case e.FLOAT_VEC3:return new RQ(e,t,n,i);case e.FLOAT_VEC4:return new MQ(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new N5(e,t,n,i);case e.INT:case e.BOOL:return new LQ(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new NQ(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new FQ(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new BQ(e,t,n,i);case e.FLOAT_MAT2:return new kQ(e,t,n,i);case e.FLOAT_MAT3:return new UQ(e,t,n,i);case e.FLOAT_MAT4:return new VQ(e,t,n,i);default:throw new ae(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function IQ(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}IQ.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))};function OQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new z,this._gl=e,this._location=i}OQ.prototype.set=function(){let e=this.value;z.equals(e,this._value)||(z.clone(e,this._value),this._gl.uniform2f(this._location,e.x,e.y))};function RQ(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}RQ.prototype.set=function(){let e=this.value;if(c(e.red))G.equals(e,this._value)||(this._value=G.clone(e,this._value),this._gl.uniform3f(this._location,e.red,e.green,e.blue));else if(c(e.x))d.equals(e,this._value)||(this._value=d.clone(e,this._value),this._gl.uniform3f(this._location,e.x,e.y,e.z));else throw new C(`Invalid vec3 value for uniform "${this.name}".`)};function MQ(e,t,n,i){this.name=n,this.value=void 0,this._value=void 0,this._gl=e,this._location=i}MQ.prototype.set=function(){let e=this.value;if(c(e.red))G.equals(e,this._value)||(this._value=G.clone(e,this._value),this._gl.uniform4f(this._location,e.red,e.green,e.blue,e.alpha));else if(c(e.x))se.equals(e,this._value)||(this._value=se.clone(e,this._value),this._gl.uniform4f(this._location,e.x,e.y,e.z,e.w));else throw new C(`Invalid vec4 value for uniform "${this.name}".`)};function N5(e,t,n,i){this.name=n,this.value=void 0,this._gl=e,this._location=i,this.textureUnitIndex=void 0}N5.prototype.set=function(){let e=this._gl;e.activeTexture(e.TEXTURE0+this.textureUnitIndex);let t=this.value;e.bindTexture(t._target,t._texture)};N5.prototype._setSampler=function(e){return this.textureUnitIndex=e,this._gl.uniform1i(this._location,e),e+1};function LQ(e,t,n,i){this.name=n,this.value=void 0,this._value=0,this._gl=e,this._location=i}LQ.prototype.set=function(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))};function NQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new z,this._gl=e,this._location=i}NQ.prototype.set=function(){let e=this.value;z.equals(e,this._value)||(z.clone(e,this._value),this._gl.uniform2i(this._location,e.x,e.y))};function FQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new d,this._gl=e,this._location=i}FQ.prototype.set=function(){let e=this.value;d.equals(e,this._value)||(d.clone(e,this._value),this._gl.uniform3i(this._location,e.x,e.y,e.z))};function BQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new se,this._gl=e,this._location=i}BQ.prototype.set=function(){let e=this.value;se.equals(e,this._value)||(se.clone(e,this._value),this._gl.uniform4i(this._location,e.x,e.y,e.z,e.w))};var pve=new Float32Array(4);function kQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new Ri,this._gl=e,this._location=i}kQ.prototype.set=function(){if(!Ri.equalsArray(this.value,this._value,0)){Ri.clone(this.value,this._value);let e=Ri.toArray(this.value,pve);this._gl.uniformMatrix2fv(this._location,!1,e)}};var _ve=new Float32Array(9);function UQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new J,this._gl=e,this._location=i}UQ.prototype.set=function(){if(!J.equalsArray(this.value,this._value,0)){J.clone(this.value,this._value);let e=J.toArray(this.value,_ve);this._gl.uniformMatrix3fv(this._location,!1,e)}};var gve=new Float32Array(16);function VQ(e,t,n,i){this.name=n,this.value=void 0,this._value=new F,this._gl=e,this._location=i}VQ.prototype.set=function(){if(!F.equalsArray(this.value,this._value,0)){F.clone(this.value,this._value);let e=F.toArray(this.value,gve);this._gl.uniformMatrix4fv(this._location,!1,e)}};var i1=mve;function yve(e,t,n,i){switch(t.type){case e.FLOAT:return new zQ(e,t,n,i);case e.FLOAT_VEC2:return new HQ(e,t,n,i);case e.FLOAT_VEC3:return new GQ(e,t,n,i);case e.FLOAT_VEC4:return new jQ(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_CUBE:return new F5(e,t,n,i);case e.INT:case e.BOOL:return new WQ(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new qQ(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new YQ(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new XQ(e,t,n,i);case e.FLOAT_MAT2:return new KQ(e,t,n,i);case e.FLOAT_MAT3:return new $Q(e,t,n,i);case e.FLOAT_MAT4:return new ZQ(e,t,n,i);default:throw new ae(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}function zQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._location=i[0]}zQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1fv(this._location,n)};function HQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=e,this._location=i[0]}HQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];z.equalsArray(s,n,o)||(z.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2fv(this._location,n)};function GQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=e,this._location=i[0]}GQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];if(c(s.red))(s.red!==n[o]||s.green!==n[o+1]||s.blue!==n[o+2])&&(n[o]=s.red,n[o+1]=s.green,n[o+2]=s.blue,i=!0);else if(c(s.x))d.equalsArray(s,n,o)||(d.pack(s,n,o),i=!0);else throw new C("Invalid vec3 value.");o+=3}i&&this._gl.uniform3fv(this._location,n)};function jQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}jQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];if(c(s.red))G.equalsArray(s,n,o)||(G.pack(s,n,o),i=!0);else if(c(s.x))se.equalsArray(s,n,o)||(se.pack(s,n,o),i=!0);else throw new C("Invalid vec4 value.");o+=4}i&&this._gl.uniform4fv(this._location,n)};function F5(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o),this._gl=e,this._locations=i,this.textureUnitIndex=void 0}F5.prototype.set=function(){let e=this._gl,t=e.TEXTURE0+this.textureUnitIndex,n=this.value,i=n.length;for(let o=0;o<i;++o){let r=n[o];e.activeTexture(t+o),e.bindTexture(r._target,r._texture)}};F5.prototype._setSampler=function(e){this.textureUnitIndex=e;let t=this._locations,n=t.length;for(let i=0;i<n;++i){let o=e+i;this._gl.uniform1i(t[i],o)}return e+n};function WQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o),this._gl=e,this._location=i[0]}WQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1;for(let o=0;o<t;++o){let r=e[o];r!==n[o]&&(n[o]=r,i=!0)}i&&this._gl.uniform1iv(this._location,n)};function qQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=e,this._location=i[0]}qQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];z.equalsArray(s,n,o)||(z.pack(s,n,o),i=!0),o+=2}i&&this._gl.uniform2iv(this._location,n)};function YQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=e,this._location=i[0]}YQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];d.equalsArray(s,n,o)||(d.pack(s,n,o),i=!0),o+=3}i&&this._gl.uniform3iv(this._location,n)};function XQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=e,this._location=i[0]}XQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];se.equalsArray(s,n,o)||(se.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniform4iv(this._location,n)};function KQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=e,this._location=i[0]}KQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];Ri.equalsArray(s,n,o)||(Ri.pack(s,n,o),i=!0),o+=4}i&&this._gl.uniformMatrix2fv(this._location,!1,n)};function $Q(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=e,this._location=i[0]}$Q.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];J.equalsArray(s,n,o)||(J.pack(s,n,o),i=!0),o+=9}i&&this._gl.uniformMatrix3fv(this._location,!1,n)};function ZQ(e,t,n,i){let o=i.length;this.name=n,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=e,this._location=i[0]}ZQ.prototype.set=function(){let e=this.value,t=e.length,n=this._value,i=!1,o=0;for(let r=0;r<t;++r){let s=e[r];F.equalsArray(s,n,o)||(F.pack(s,n,o),i=!0),o+=16}i&&this._gl.uniformMatrix4fv(this._location,!1,n)};var o1=yve;var bve=0;function up(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=xve(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=bve++}up.fromCache=function(e){return e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context),e.context.shaderCache.getShaderProgram(e)};up.replaceCache=function(e){return e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context),e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(up.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return r1(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return r1(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return r1(this),this._uniformsByName}}});function QQ(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(c(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o].trim(),s=r.slice(r.lastIndexOf(" ")+1);t.push(s)}}return t}function xve(e,t){let n={};if(!ut.highpFloatSupported||!ut.highpIntSupported){let i,o,r,s,a=QQ(e),l=QQ(t),u=a.length,f=l.length;for(i=0;i<u;i++)for(o=0;o<f;o++)if(a[i]===l[o]){r=a[i],s=`czm_mediump_${r}`;let h=new RegExp(`${r}\\b`,"g");t=t.replace(h,s),n[s]=r}}return{fragmentShaderText:t,duplicateUniformNames:n}}var Dh="[Cesium WebGL] ";function Tve(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,o=e.createShader(e.VERTEX_SHADER);e.shaderSource(o,n),e.compileShader(o);let r=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(r,i),e.compileShader(r);let s=e.createProgram();e.attachShader(s,o),e.attachShader(s,r);let a=t._attributeLocations;if(c(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let l;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(l=e.getShaderInfoLog(o),c(l)&&l.length>0&&console.log(`${Dh}Vertex shader compile log: ${l}`),l=e.getShaderInfoLog(r),c(l)&&l.length>0&&console.log(`${Dh}Fragment shader compile log: ${l}`),l=e.getProgramInfoLog(s),c(l)&&l.length>0&&console.log(`${Dh}Shader program link log: ${l}`)),e.deleteShader(o),e.deleteShader(r),s;let u,f=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(l=e.getProgramInfoLog(s),console.error(`${Dh}Shader program link log: ${l}`),h(o,"vertex"),h(r,"fragment"),u=`Program failed to link. Link log: ${l}`):(l=e.getShaderInfoLog(o),console.error(`${Dh}Vertex shader compile log: ${l}`),console.error(`${Dh} Vertex shader source:
${n}`),u=`Vertex shader failed to compile. Compile log: ${l}`):(l=e.getShaderInfoLog(r),console.error(`${Dh}Fragment shader compile log: ${l}`),console.error(`${Dh} Fragment shader source:
${i}`),u=`Fragment shader failed to compile. Compile log: ${l}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new ae(u);function h(p,g){if(!c(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${Dh}${g} shader translation failed.`);return}console.error(`${Dh}Translated ${g} shaderSource:
${m}`)}}function Ave(e,t,n){let i={};for(let o=0;o<n;++o){let r=e.getActiveAttrib(t,o),s=e.getAttribLocation(t,r.name);i[r.name]={name:r.name,type:r.type,index:s}}return i}function Cve(e,t){let n={},i=[],o=[],r=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<r;++s){let a=e.getActiveUniform(t,s),l="[0]",u=a.name.indexOf(l,a.name.length-l.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let h=i1(e,a,u,f);n[u]=h,i.push(h),h._setSampler&&o.push(h)}}else{let f,h,p,g,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!c(f))continue;h=f._locations,h.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(h.push(g),p.push(e.getUniform(t,g))))}else{h=[];for(let y=0;y<a.size;++y)g=e.getUniformLocation(t,`${u}[${y}]`),g!==null&&h.push(g);f=o1(e,a,u,h),n[u]=f,i.push(f),f._setSampler&&o.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:o}}function Eve(e,t){let n=[],i=[];for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=o,a=e._duplicateUniformNames[s];c(a)&&(r.name=a,s=a);let l=N_[s];c(l)?n.push({uniform:r,automaticUniform:l}):i.push(r)}return{automaticUniforms:n,manualUniforms:i}}function Sve(e,t,n){e.useProgram(t);let i=0,o=n.length;for(let r=0;r<o;++r)i=n[r]._setSampler(i);return e.useProgram(null),i}function r1(e){c(e._program)||JQ(e)}function JQ(e){let t=e._program,n=e._gl,i=Tve(n,e,e._debugShaders),o=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),r=Cve(n,i),s=Eve(e,r.uniformsByName);e._program=i,e._numberOfVertexAttributes=o,e._vertexAttributes=Ave(n,i,o),e._uniformsByName=r.uniformsByName,e._uniforms=r.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=Sve(n,i,r.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,l,u,f){let h=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=l.replace(g," != ");try{JQ(e),u(e._program)}catch(m){e._vertexShaderText=h,e._fragmentShaderText=p;let b=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(b?b[1]:m.message)}})}up.prototype._bind=function(){r1(this),this._gl.useProgram(this._program)};up.prototype._setUniforms=function(e,t,n){let i,o;if(c(e)){let a=this._manualUniforms;for(i=a.length,o=0;o<i;++o){let l=a[o];if(!c(e[l.name]))throw new C(`Unknown uniform: ${l.name}`);l.value=e[l.name]()}}let r=this._automaticUniforms;for(i=r.length,o=0;o<i;++o){let a=r[o];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,o=0;o<i;++o)s[o].set();if(n){let a=this._gl,l=this._program;if(a.validateProgram(l),!a.getProgramParameter(l,a.VALIDATE_STATUS))throw new C(`Program validation failed. Program info log: ${a.getProgramInfoLog(l)}`)}};up.prototype.isDestroyed=function(){return!1};up.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};up.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),de(this)};var en=up;function s1(e){this._context=e}var tw,wve=new Je({primitiveType:Me.TRIANGLES}),vve=new ti({color:new G(0,0,0,0)});function Dve(e,t){return new Wr({context:e,colorTextures:[t],destroyAttachments:!1})}function Pve(e,t){return en.fromCache({context:e,vertexShaderSource:xT,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function Ive(e,t){return(!c(tw)||tw.viewport.width!==e||tw.viewport.height!==t)&&(tw=ze.fromCache({viewport:new Ke(0,0,e,t)})),tw}s1.prototype.execute=function(e){if(T.defined("computeCommand",e),c(e.preExecute)&&e.preExecute(e),!c(e.fragmentShaderSource)&&!c(e.shaderProgram))throw new C("computeCommand.fragmentShaderSource or computeCommand.shaderProgram is required.");T.defined("computeCommand.outputTexture",e.outputTexture);let t=e.outputTexture,n=t.width,i=t.height,o=this._context,r=c(e.vertexArray)?e.vertexArray:o.getViewportQuadVertexArray(),s=c(e.shaderProgram)?e.shaderProgram:Pve(o,e.fragmentShaderSource),a=Dve(o,t),l=Ive(n,i),u=e.uniformMap,f=vve;f.framebuffer=a,f.renderState=l,f.execute(o);let h=wve;h.vertexArray=r,h.renderState=l,h.shaderProgram=s,h.uniformMap=u,h.framebuffer=a,h.execute(o),a.destroy(),e.persists||(s.destroy(),c(e.vertexArray)&&r.destroy()),c(e.postExecute)&&e.postExecute(t)};s1.prototype.isDestroyed=function(){return!1};s1.prototype.destroy=function(){return de(this)};var a1=s1;var En={BYTE:ne.BYTE,UNSIGNED_BYTE:ne.UNSIGNED_BYTE,SHORT:ne.SHORT,UNSIGNED_SHORT:ne.UNSIGNED_SHORT,INT:ne.INT,UNSIGNED_INT:ne.UNSIGNED_INT,FLOAT:ne.FLOAT,DOUBLE:ne.DOUBLE};En.getSizeInBytes=function(e){if(!c(e))throw new C("value is required.");switch(e){case En.BYTE:return Int8Array.BYTES_PER_ELEMENT;case En.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case En.SHORT:return Int16Array.BYTES_PER_ELEMENT;case En.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case En.INT:return Int32Array.BYTES_PER_ELEMENT;case En.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case En.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case En.DOUBLE:return Float64Array.BYTES_PER_ELEMENT;default:throw new C("componentDatatype is not a valid value.")}};En.fromTypedArray=function(e){if(e instanceof Int8Array)return En.BYTE;if(e instanceof Uint8Array)return En.UNSIGNED_BYTE;if(e instanceof Int16Array)return En.SHORT;if(e instanceof Uint16Array)return En.UNSIGNED_SHORT;if(e instanceof Int32Array)return En.INT;if(e instanceof Uint32Array)return En.UNSIGNED_INT;if(e instanceof Float32Array)return En.FLOAT;if(e instanceof Float64Array)return En.DOUBLE;throw new C("array must be an Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, or Float64Array.")};En.validate=function(e){return c(e)&&(e===En.BYTE||e===En.UNSIGNED_BYTE||e===En.SHORT||e===En.UNSIGNED_SHORT||e===En.INT||e===En.UNSIGNED_INT||e===En.FLOAT||e===En.DOUBLE)};En.createTypedArray=function(e,t){if(!c(e))throw new C("componentDatatype is required.");if(!c(t))throw new C("valuesOrLength is required.");switch(e){case En.BYTE:return new Int8Array(t);case En.UNSIGNED_BYTE:return new Uint8Array(t);case En.SHORT:return new Int16Array(t);case En.UNSIGNED_SHORT:return new Uint16Array(t);case En.INT:return new Int32Array(t);case En.UNSIGNED_INT:return new Uint32Array(t);case En.FLOAT:return new Float32Array(t);case En.DOUBLE:return new Float64Array(t);default:throw new C("componentDatatype is not a valid value.")}};En.createArrayBufferView=function(e,t,n,i){if(!c(e))throw new C("componentDatatype is required.");if(!c(t))throw new C("buffer is required.");switch(n=n??0,i=i??(t.byteLength-n)/En.getSizeInBytes(e),e){case En.BYTE:return new Int8Array(t,n,i);case En.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case En.SHORT:return new Int16Array(t,n,i);case En.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case En.INT:return new Int32Array(t,n,i);case En.UNSIGNED_INT:return new Uint32Array(t,n,i);case En.FLOAT:return new Float32Array(t,n,i);case En.DOUBLE:return new Float64Array(t,n,i);default:throw new C("componentDatatype is not a valid value.")}};En.fromName=function(e){switch(e){case"BYTE":return En.BYTE;case"UNSIGNED_BYTE":return En.UNSIGNED_BYTE;case"SHORT":return En.SHORT;case"UNSIGNED_SHORT":return En.UNSIGNED_SHORT;case"INT":return En.INT;case"UNSIGNED_INT":return En.UNSIGNED_INT;case"FLOAT":return En.FLOAT;case"DOUBLE":return En.DOUBLE;default:throw new C("name is not a valid value.")}};var $=Object.freeze(En);var Ove={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3},ld=Object.freeze(Ove);function B5(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.attributes",e.attributes),this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Me.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??ld.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}B5.computeNumberOfVertices=function(e){T.typeOf.object("geometry",e);let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&c(e.attributes[n])&&c(e.attributes[n].values)){let i=e.attributes[n],o=i.values.length/i.componentsPerAttribute;if(t!==o&&t!==-1)throw new C("All attribute lists must have the same number of attributes.");t=o}return t};var Rve=new he,Mve=new d,eJ=new F,Lve=[new he,new he,new he],Nve=[new z,new z,new z],Fve=[new z,new z,new z],Bve=new d,kve=new Le,Uve=new F,Vve=new Ri;B5._textureCoordinateRotationPoints=function(e,t,n,i){let o,r=ce.center(i,Rve),s=he.toCartesian(r,n,Mve),a=Ot.eastNorthUpToFixedFrame(s,n,eJ),l=F.inverse(a,eJ),u=Nve,f=Lve;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let h=Bve;for(o=0;o<3;o++)he.toCartesian(f[o],n,h),h=F.multiplyByPointAsVector(l,h,h),u[o].x=h.x,u[o].y=h.y;let p=Le.fromAxisAngle(d.UNIT_Z,-t,kve),g=J.fromQuaternion(p,Uve),m=e.length,y=Number.POSITIVE_INFINITY,b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,A=Number.NEGATIVE_INFINITY;for(o=0;o<m;o++)h=F.multiplyByPointAsVector(l,e[o],h),h=J.multiplyByVector(g,h,h),y=Math.min(y,h.x),b=Math.min(b,h.y),x=Math.max(x,h.x),A=Math.max(A,h.y);let E=Ri.fromRotation(t,Vve),S=Fve;S[0].x=y,S[0].y=b,S[1].x=y,S[1].y=A,S[2].x=x,S[2].y=b;let v=u[0],P=u[2].x-v.x,M=u[1].y-v.y;for(o=0;o<3;o++){let w=S[o];Ri.multiplyByVector(E,w,w),w.x=(w.x-v.x)/P,w.y=(w.y-v.y)/M}let R=S[0],L=S[1],B=S[2],_=new Array(6);return z.pack(R,_),z.pack(L,_,2),z.pack(B,_,4),_};var ct=B5;function zve(e){if(e=e??W.EMPTY_OBJECT,!c(e.componentDatatype))throw new C("options.componentDatatype is required.");if(!c(e.componentsPerAttribute))throw new C("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new C("options.componentsPerAttribute must be between 1 and 4.");if(!c(e.values))throw new C("options.values is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var ve=zve;function AT(e,t,n,i,o){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=o}Object.defineProperties(AT.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}});AT.clone=function(e){if(c(e))return new AT(e._format,e._datatype,e._width,e._height,e._buffer)};AT.prototype.clone=function(){return AT.clone(this)};var c1=AT;var tJ=jr(ql(),1);function nJ(){if(!c(Js._canTransferArrayBuffer)){let e=V5("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return Js._canTransferArrayBuffer=!1,Js._canTransferArrayBuffer}Js._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(o){let r=o.data.array,s=c(r)&&r[0]===t;i(s),e.terminate(),Js._canTransferArrayBuffer=s}})}return Js._canTransferArrayBuffer}var U5=new pe;function k5(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(e),t=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function V5(e){let t=new tJ.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(P0(e))s=e;else if(!n){let a=tn(`${Js._workerModulePrefix}/${i}.js`);P0(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=k5(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=`
importScripts("${k5(CESIUM_WORKERS)}");
CesiumWorkers["${i}"]();
`;return r=k5(a),new Worker(r,o)}if(r=e,n||(r=tn(`${Js._workerModulePrefix+i}.js`)),!zt.supportsEsmWebWorkers())throw new ae("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function Hve(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!zt.supportsWebAssembly()){if(!c(t.fallbackModulePath))throw new ae(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=tn(t.fallbackModulePath),n}n.wasmBinaryFile=tn(t.wasmBinaryFile);let i=await we.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function Js(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var Gve=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(c(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new ae(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new C(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),U5.raiseEvent(s),i(s)}else U5.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},jve=[];async function Wve(e,t,n){let i=await Promise.resolve(nJ());c(n)?i||(n.length=0):n=jve;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",Gve(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:tn.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function qve(e,t,n){++e._activeTasks;try{let i=await Wve(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}Js.prototype.scheduleTask=function(e,t){if(c(this._worker)||(this._worker=V5(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return qve(this,e,t)};Js.prototype.initWebAssemblyModule=async function(e){if(c(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=V5(this._workerPath),i=await Hve(this,e),o=await Promise.resolve(nJ()),r,s=i.wasmBinary;c(s)&&o&&(r=[s]);let a=new Promise((l,u)=>{n.onmessage=function({data:f}){c(f)?l(f.result):u(new ae("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};Js.prototype.isDestroyed=function(){return!1};Js.prototype.destroy=function(){return c(this._worker)&&this._worker.terminate(),de(this)};Js.taskCompletedEvent=U5;Js._defaultWorkerModulePrefix="Workers/";Js._workerModulePrefix=Js._defaultWorkerModulePrefix;Js._canTransferArrayBuffer=void 0;var bi=Js;function fp(){}fp._transcodeTaskProcessor=new bi("transcodeKTX2",Number.POSITIVE_INFINITY);fp._readyPromise=void 0;function Yve(){let e=fp._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return fp._transcodeTaskProcessor;throw new ae("KTX2 transcoder could not be initialized.")});fp._readyPromise=e}fp.transcode=function(e,t){return T.defined("supportedTargetFormats",t),c(fp._readyPromise)||Yve(),fp._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]);for(let r=0;r<i;r++){let s=n[r];for(let a=0;a<o.length;a++){let l=s[o[a]];s[o[a]]=new c1(l.internalFormat,l.datatype,l.width,l.height,l.levelBuffer)}}if(o.length===1){for(let r=0;r<i;++r)n[r]=n[r][o[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var l1=fp;var iJ;oJ.setKTX2SupportedFormats=function(e,t,n,i,o,r){iJ={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:o,bc7:r}};function oJ(e){T.defined("resourceOrUrlOrBuffer",e);let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=we.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return l1.transcode(n,iJ)})}var Xl=oJ;function Xve(e,t){this.start=e??0,this.stop=t??0}var $a=Xve;function dn(e,t){this.center=d.clone(e??d.ZERO),this.radius=t??0}var G5=new d,j5=new d,W5=new d,q5=new d,Y5=new d,X5=new d,K5=new d,ea=new d,$5=new d,Z5=new d,Q5=new d,J5=new d,Kve=4/3*O.PI;dn.fromPoints=function(e,t){if(c(t)||(t=new dn),!c(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=d.clone(e[0],K5),i=d.clone(n,G5),o=d.clone(n,j5),r=d.clone(n,W5),s=d.clone(n,q5),a=d.clone(n,Y5),l=d.clone(n,X5),u=e.length,f;for(f=1;f<u;f++){d.clone(e[f],n);let R=n.x,L=n.y,B=n.z;R<i.x&&d.clone(n,i),R>s.x&&d.clone(n,s),L<o.y&&d.clone(n,o),L>a.y&&d.clone(n,a),B<r.z&&d.clone(n,r),B>l.z&&d.clone(n,l)}let h=d.magnitudeSquared(d.subtract(s,i,ea)),p=d.magnitudeSquared(d.subtract(a,o,ea)),g=d.magnitudeSquared(d.subtract(l,r,ea)),m=i,y=s,b=h;p>b&&(b=p,m=o,y=a),g>b&&(b=g,m=r,y=l);let x=$5;x.x=(m.x+y.x)*.5,x.y=(m.y+y.y)*.5,x.z=(m.z+y.z)*.5;let A=d.magnitudeSquared(d.subtract(y,x,ea)),E=Math.sqrt(A),S=Z5;S.x=i.x,S.y=o.y,S.z=r.z;let v=Q5;v.x=s.x,v.y=a.y,v.z=l.z;let P=d.midpoint(S,v,J5),M=0;for(f=0;f<u;f++){d.clone(e[f],n);let R=d.magnitude(d.subtract(n,P,ea));R>M&&(M=R);let L=d.magnitudeSquared(d.subtract(n,x,ea));if(L>A){let B=Math.sqrt(L);E=(E+B)*.5,A=E*E;let _=B-E;x.x=(E*x.x+_*n.x)/B,x.y=(E*x.y+_*n.y)/B,x.z=(E*x.z+_*n.z)/B}}return E<M?(d.clone(x,t.center),t.radius=E):(d.clone(P,t.center),t.radius=M),t};var rJ=new Oi,$ve=new d,Zve=new d,z5=new he,H5=new he;dn.fromRectangle2D=function(e,t,n){return dn.fromRectangleWithHeights2D(e,t,0,0,n)};dn.fromRectangleWithHeights2D=function(e,t,n,i,o){if(c(o)||(o=new dn),!c(e))return o.center=d.clone(d.ZERO,o.center),o.radius=0,o;rJ._ellipsoid=ie.default,t=t??rJ,ce.southwest(e,z5),z5.height=n,ce.northeast(e,H5),H5.height=i;let r=t.project(z5,$ve),s=t.project(H5,Zve),a=s.x-r.x,l=s.y-r.y,u=s.z-r.z;o.radius=Math.sqrt(a*a+l*l+u*u)*.5;let f=o.center;return f.x=r.x+a*.5,f.y=r.y+l*.5,f.z=r.z+u*.5,o};var Qve=[];dn.fromRectangle3D=function(e,t,n,i){if(t=t??ie.default,n=n??0,c(i)||(i=new dn),!c(e))return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;let o=ce.subsample(e,t,n,Qve);return dn.fromPoints(o,i)};dn.fromVertices=function(e,t,n,i){if(c(i)||(i=new dn),!c(e)||e.length===0)return i.center=d.clone(d.ZERO,i.center),i.radius=0,i;t=t??d.ZERO,n=n??3,T.typeOf.number.greaterThanOrEquals("stride",n,3);let o=K5;o.x=e[0]+t.x,o.y=e[1]+t.y,o.z=e[2]+t.z;let r=d.clone(o,G5),s=d.clone(o,j5),a=d.clone(o,W5),l=d.clone(o,q5),u=d.clone(o,Y5),f=d.clone(o,X5),h=e.length,p;for(p=0;p<h;p+=n){let B=e[p]+t.x,_=e[p+1]+t.y,w=e[p+2]+t.z;o.x=B,o.y=_,o.z=w,B<r.x&&d.clone(o,r),B>l.x&&d.clone(o,l),_<s.y&&d.clone(o,s),_>u.y&&d.clone(o,u),w<a.z&&d.clone(o,a),w>f.z&&d.clone(o,f)}let g=d.magnitudeSquared(d.subtract(l,r,ea)),m=d.magnitudeSquared(d.subtract(u,s,ea)),y=d.magnitudeSquared(d.subtract(f,a,ea)),b=r,x=l,A=g;m>A&&(A=m,b=s,x=u),y>A&&(A=y,b=a,x=f);let E=$5;E.x=(b.x+x.x)*.5,E.y=(b.y+x.y)*.5,E.z=(b.z+x.z)*.5;let S=d.magnitudeSquared(d.subtract(x,E,ea)),v=Math.sqrt(S),P=Z5;P.x=r.x,P.y=s.y,P.z=a.z;let M=Q5;M.x=l.x,M.y=u.y,M.z=f.z;let R=d.midpoint(P,M,J5),L=0;for(p=0;p<h;p+=n){o.x=e[p]+t.x,o.y=e[p+1]+t.y,o.z=e[p+2]+t.z;let B=d.magnitude(d.subtract(o,R,ea));B>L&&(L=B);let _=d.magnitudeSquared(d.subtract(o,E,ea));if(_>S){let w=Math.sqrt(_);v=(v+w)*.5,S=v*v;let D=w-v;E.x=(v*E.x+D*o.x)/w,E.y=(v*E.y+D*o.y)/w,E.z=(v*E.z+D*o.z)/w}}return v<L?(d.clone(E,i.center),i.radius=v):(d.clone(R,i.center),i.radius=L),i};dn.fromEncodedCartesianVertices=function(e,t,n){if(c(n)||(n=new dn),!c(e)||!c(t)||e.length!==t.length||e.length===0)return n.center=d.clone(d.ZERO,n.center),n.radius=0,n;let i=K5;i.x=e[0]+t[0],i.y=e[1]+t[1],i.z=e[2]+t[2];let o=d.clone(i,G5),r=d.clone(i,j5),s=d.clone(i,W5),a=d.clone(i,q5),l=d.clone(i,Y5),u=d.clone(i,X5),f=e.length,h;for(h=0;h<f;h+=3){let L=e[h]+t[h],B=e[h+1]+t[h+1],_=e[h+2]+t[h+2];i.x=L,i.y=B,i.z=_,L<o.x&&d.clone(i,o),L>a.x&&d.clone(i,a),B<r.y&&d.clone(i,r),B>l.y&&d.clone(i,l),_<s.z&&d.clone(i,s),_>u.z&&d.clone(i,u)}let p=d.magnitudeSquared(d.subtract(a,o,ea)),g=d.magnitudeSquared(d.subtract(l,r,ea)),m=d.magnitudeSquared(d.subtract(u,s,ea)),y=o,b=a,x=p;g>x&&(x=g,y=r,b=l),m>x&&(x=m,y=s,b=u);let A=$5;A.x=(y.x+b.x)*.5,A.y=(y.y+b.y)*.5,A.z=(y.z+b.z)*.5;let E=d.magnitudeSquared(d.subtract(b,A,ea)),S=Math.sqrt(E),v=Z5;v.x=o.x,v.y=r.y,v.z=s.z;let P=Q5;P.x=a.x,P.y=l.y,P.z=u.z;let M=d.midpoint(v,P,J5),R=0;for(h=0;h<f;h+=3){i.x=e[h]+t[h],i.y=e[h+1]+t[h+1],i.z=e[h+2]+t[h+2];let L=d.magnitude(d.subtract(i,M,ea));L>R&&(R=L);let B=d.magnitudeSquared(d.subtract(i,A,ea));if(B>E){let _=Math.sqrt(B);S=(S+_)*.5,E=S*S;let w=_-S;A.x=(S*A.x+w*i.x)/_,A.y=(S*A.y+w*i.y)/_,A.z=(S*A.z+w*i.z)/_}}return S<R?(d.clone(A,n.center),n.radius=S):(d.clone(M,n.center),n.radius=R),n};dn.fromCornerPoints=function(e,t,n){T.typeOf.object("corner",e),T.typeOf.object("oppositeCorner",t),c(n)||(n=new dn);let i=d.midpoint(e,t,n.center);return n.radius=d.distance(i,t),n};dn.fromEllipsoid=function(e,t){return T.typeOf.object("ellipsoid",e),c(t)||(t=new dn),d.clone(d.ZERO,t.center),t.radius=e.maximumRadius,t};var Jve=new d;dn.fromBoundingSpheres=function(e,t){if(c(t)||(t=new dn),!c(e)||e.length===0)return t.center=d.clone(d.ZERO,t.center),t.radius=0,t;let n=e.length;if(n===1)return dn.clone(e[0],t);if(n===2)return dn.union(e[0],e[1],t);let i=[],o;for(o=0;o<n;o++)i.push(e[o].center);t=dn.fromPoints(i,t);let r=t.center,s=t.radius;for(o=0;o<n;o++){let a=e[o];s=Math.max(s,d.distance(r,a.center,Jve)+a.radius)}return t.radius=s,t};var eDe=new d,tDe=new d,nDe=new d;dn.fromOrientedBoundingBox=function(e,t){T.defined("orientedBoundingBox",e),c(t)||(t=new dn);let n=e.halfAxes,i=J.getColumn(n,0,eDe),o=J.getColumn(n,1,tDe),r=J.getColumn(n,2,nDe);return d.add(i,o,i),d.add(i,r,i),t.center=d.clone(e.center,t.center),t.radius=d.magnitude(i),t};var iDe=new d,oDe=new d;dn.fromTransformation=function(e,t){T.typeOf.object("transformation",e),c(t)||(t=new dn);let n=F.getTranslation(e,iDe),i=F.getScale(e,oDe),o=.5*d.magnitude(i);return t.center=d.clone(n,t.center),t.radius=o,t};dn.clone=function(e,t){if(c(e))return c(t)?(t.center=d.clone(e.center,t.center),t.radius=e.radius,t):new dn(e.center,e.radius)};dn.packedLength=4;dn.pack=function(e,t,n){T.typeOf.object("value",e),T.defined("array",t),n=n??0;let i=e.center;return t[n++]=i.x,t[n++]=i.y,t[n++]=i.z,t[n]=e.radius,t};dn.unpack=function(e,t,n){T.defined("array",e),t=t??0,c(n)||(n=new dn);let i=n.center;return i.x=e[t++],i.y=e[t++],i.z=e[t++],n.radius=e[t],n};var rDe=new d,sDe=new d;dn.union=function(e,t,n){T.typeOf.object("left",e),T.typeOf.object("right",t),c(n)||(n=new dn);let i=e.center,o=e.radius,r=t.center,s=t.radius,a=d.subtract(r,i,rDe),l=d.magnitude(a);if(o>=l+s)return e.clone(n),n;if(s>=l+o)return t.clone(n),n;let u=(o+l+s)*.5,f=d.multiplyByScalar(a,(-o+u)/l,sDe);return d.add(f,i,f),d.clone(f,n.center),n.radius=u,n};var aDe=new d;dn.expand=function(e,t,n){T.typeOf.object("sphere",e),T.typeOf.object("point",t),n=dn.clone(e,n);let i=d.magnitude(d.subtract(t,n.center,aDe));return i>n.radius&&(n.radius=i),n};dn.intersectPlane=function(e,t){T.typeOf.object("sphere",e),T.typeOf.object("plane",t);let n=e.center,i=e.radius,o=t.normal,r=d.dot(o,n)+t.distance;return r<-i?Wt.OUTSIDE:r<i?Wt.INTERSECTING:Wt.INSIDE};dn.transform=function(e,t,n){return T.typeOf.object("sphere",e),T.typeOf.object("transform",t),c(n)||(n=new dn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=F.getMaximumScale(t)*e.radius,n};var cDe=new d;dn.distanceSquaredTo=function(e,t){T.typeOf.object("sphere",e),T.typeOf.object("cartesian",t);let n=d.subtract(e.center,t,cDe),i=d.magnitude(n)-e.radius;return i<=0?0:i*i};dn.transformWithoutScale=function(e,t,n){return T.typeOf.object("sphere",e),T.typeOf.object("transform",t),c(n)||(n=new dn),n.center=F.multiplyByPoint(t,e.center,n.center),n.radius=e.radius,n};var lDe=new d;dn.computePlaneDistances=function(e,t,n,i){T.typeOf.object("sphere",e),T.typeOf.object("position",t),T.typeOf.object("direction",n),c(i)||(i=new $a);let o=d.subtract(e.center,t,lDe),r=d.dot(n,o);return i.start=r-e.radius,i.stop=r+e.radius,i};var sJ=new d,uDe=new d,fDe=new d,dDe=new d,hDe=new d,mDe=new he,cJ=new Array(8);for(let e=0;e<8;++e)cJ[e]=new d;var aJ=new Oi;dn.projectTo2D=function(e,t,n){T.typeOf.object("sphere",e),aJ._ellipsoid=ie.default,t=t??aJ;let i=t.ellipsoid,o=e.center,r=e.radius,s;d.equals(o,d.ZERO)?s=d.clone(d.UNIT_X,sJ):s=i.geodeticSurfaceNormal(o,sJ);let a=d.cross(d.UNIT_Z,s,uDe);d.normalize(a,a);let l=d.cross(s,a,fDe);d.normalize(l,l),d.multiplyByScalar(s,r,s),d.multiplyByScalar(l,r,l),d.multiplyByScalar(a,r,a);let u=d.negate(l,hDe),f=d.negate(a,dDe),h=cJ,p=h[0];d.add(s,l,p),d.add(p,a,p),p=h[1],d.add(s,l,p),d.add(p,f,p),p=h[2],d.add(s,u,p),d.add(p,f,p),p=h[3],d.add(s,u,p),d.add(p,a,p),d.negate(s,s),p=h[4],d.add(s,l,p),d.add(p,a,p),p=h[5],d.add(s,l,p),d.add(p,f,p),p=h[6],d.add(s,u,p),d.add(p,f,p),p=h[7],d.add(s,u,p),d.add(p,a,p);let g=h.length;for(let x=0;x<g;++x){let A=h[x];d.add(o,A,A);let E=i.cartesianToCartographic(A,mDe);t.project(E,A)}n=dn.fromPoints(h,n),o=n.center;let m=o.x,y=o.y,b=o.z;return o.x=b,o.y=m,o.z=y,n};dn.isOccluded=function(e,t){return T.typeOf.object("sphere",e),T.typeOf.object("occluder",t),!t.isBoundingSphereVisible(e)};dn.equals=function(e,t){return e===t||c(e)&&c(t)&&d.equals(e.center,t.center)&&e.radius===t.radius};dn.prototype.intersectPlane=function(e){return dn.intersectPlane(this,e)};dn.prototype.distanceSquaredTo=function(e){return dn.distanceSquaredTo(this,e)};dn.prototype.computePlaneDistances=function(e,t,n){return dn.computePlaneDistances(this,e,t,n)};dn.prototype.isOccluded=function(e){return dn.isOccluded(this,e)};dn.prototype.equals=function(e){return dn.equals(this,e)};dn.prototype.clone=function(e){return dn.clone(this,e)};dn.prototype.volume=function(){let e=this.radius;return Kve*e*e*e};var le=dn;function pDe(e){e=e??W.EMPTY_OBJECT,this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var hn=pDe;var _De={NONE:0,TOP:1,ALL:2},Zt=Object.freeze(_De);function ns(e){e=e??W.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}ns.POSITION_ONLY=Object.freeze(new ns({position:!0}));ns.POSITION_AND_NORMAL=Object.freeze(new ns({position:!0,normal:!0}));ns.POSITION_NORMAL_AND_ST=Object.freeze(new ns({position:!0,normal:!0,st:!0}));ns.POSITION_AND_ST=Object.freeze(new ns({position:!0,st:!0}));ns.POSITION_AND_COLOR=Object.freeze(new ns({position:!0,color:!0}));ns.ALL=Object.freeze(new ns({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ns.DEFAULT=ns.POSITION_NORMAL_AND_ST;ns.packedLength=6;ns.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};ns.unpack=function(e,t,n){if(!c(e))throw new C("array is required");return t=t??0,c(n)||(n=new ns),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};ns.clone=function(e,t){if(c(e))return c(t)||(t=new ns),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Ie=ns;var gDe=new d;function Kl(e){e=e??W.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;if(T.typeOf.object("min",t),T.typeOf.object("max",n),c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new C("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");let i=e.vertexFormat??Ie.DEFAULT;this._minimum=d.clone(t),this._maximum=d.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Kl.fromDimensions=function(e){e=e??W.EMPTY_OBJECT;let t=e.dimensions;T.typeOf.object("dimensions",t),T.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),T.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),T.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let n=d.multiplyByScalar(t,.5,new d);return new Kl({minimum:d.negate(n,new d),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};Kl.fromAxisAlignedBoundingBox=function(e){return T.typeOf.object("boundingBox",e),new Kl({minimum:e.minimum,maximum:e.maximum})};Kl.packedLength=2*d.packedLength+Ie.packedLength+1;Kl.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,d.pack(e._minimum,t,n),d.pack(e._maximum,t,n+d.packedLength),Ie.pack(e._vertexFormat,t,n+2*d.packedLength),t[n+2*d.packedLength+Ie.packedLength]=e._offsetAttribute??-1,t};var uJ=new d,fJ=new d,dJ=new Ie,lJ={minimum:uJ,maximum:fJ,vertexFormat:dJ,offsetAttribute:void 0};Kl.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=d.unpack(e,t,uJ),o=d.unpack(e,t+d.packedLength,fJ),r=Ie.unpack(e,t+2*d.packedLength,dJ),s=e[t+2*d.packedLength+Ie.packedLength];return c(n)?(n._minimum=d.clone(i,n._minimum),n._maximum=d.clone(o,n._maximum),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(lJ.offsetAttribute=s===-1?void 0:s,new Kl(lJ))};Kl.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(d.equals(t,n))return;let o=new hn,r,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(6*4*3),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,o.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,o.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,o.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,o.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,o.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:u})}r=new Uint16Array(6*2*3),r[0]=0,r[1]=1,r[2]=2,r[3]=0,r[4]=2,r[5]=3,r[6]=6,r[7]=5,r[8]=4,r[9]=7,r[10]=6,r[11]=4,r[12]=8,r[13]=9,r[14]=10,r[15]=8,r[16]=10,r[17]=11,r[18]=14,r[19]=13,r[20]=12,r[21]=15,r[22]=14,r[23]=12,r[24]=18,r[25]=17,r[26]=16,r[27]=19,r[28]=18,r[29]=16,r[30]=20,r[31]=21,r[32]=22,r[33]=20,r[34]=22,r[35]=23}else s=new Float64Array(8*3),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,o.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:s}),r=new Uint16Array(6*2*3),r[0]=4,r[1]=5,r[2]=6,r[3]=4,r[4]=6,r[5]=7,r[6]=1,r[7]=0,r[8]=3,r[9]=1,r[10]=3,r[11]=2,r[12]=1,r[13]=6,r[14]=5,r[15]=1,r[16]=2,r[17]=6,r[18]=2,r[19]=3,r[20]=7,r[21]=2,r[22]=7,r[23]=6,r[24]=3,r[25]=0,r[26]=4,r[27]=3,r[28]=4,r[29]=7,r[30]=0,r[31]=1,r[32]=5,r[33]=0,r[34]=5,r[35]=4;let a=d.subtract(n,t,gDe),l=d.magnitude(a)*.5;if(c(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===Zt.NONE?0:1,h=new Uint8Array(u/3).fill(f);o.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return new ct({attributes:o,indices:r,primitiveType:Me.TRIANGLES,boundingSphere:new le(d.ZERO,l),offsetAttribute:e._offsetAttribute})};var e6;Kl.getUnitBox=function(){return c(e6)||(e6=Kl.createGeometry(Kl.fromDimensions({dimensions:new d(1,1,1),vertexFormat:Ie.POSITION_ONLY}))),e6};var Za=Kl;var Qi={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Qi.getMathType=function(e){switch(e){case Qi.SCALAR:return Number;case Qi.VEC2:return z;case Qi.VEC3:return d;case Qi.VEC4:return se;case Qi.MAT2:return Ri;case Qi.MAT3:return J;case Qi.MAT4:return F;default:throw new C("attributeType is not a valid value.")}};Qi.getNumberOfComponents=function(e){switch(e){case Qi.SCALAR:return 1;case Qi.VEC2:return 2;case Qi.VEC3:return 3;case Qi.VEC4:case Qi.MAT2:return 4;case Qi.MAT3:return 9;case Qi.MAT4:return 16;default:throw new C("attributeType is not a valid value.")}};Qi.getAttributeLocationCount=function(e){switch(e){case Qi.SCALAR:case Qi.VEC2:case Qi.VEC3:case Qi.VEC4:return 1;case Qi.MAT2:return 2;case Qi.MAT3:return 3;case Qi.MAT4:return 4;default:throw new C("attributeType is not a valid value.")}};Qi.getGlslType=function(e){switch(T.typeOf.string("attributeType",e),e){case Qi.SCALAR:return"float";case Qi.VEC2:return"vec2";case Qi.VEC3:return"vec3";case Qi.VEC4:return"vec4";case Qi.MAT2:return"mat2";case Qi.MAT3:return"mat3";case Qi.MAT4:return"mat4";default:throw new C("attributeType is not a valid value.")}};var nn=Object.freeze(Qi);var hJ=1/256,mJ=256,mo={};mo.octEncodeInRange=function(e,t,n){T.defined("vector",e),T.defined("result",n);let i=d.magnitudeSquared(e);if(Math.abs(i-1)>O.EPSILON6)throw new C("vector must be normalized.");if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let o=n.x,r=n.y;n.x=(1-Math.abs(r))*O.signNotZero(o),n.y=(1-Math.abs(o))*O.signNotZero(r)}return n.x=O.toSNorm(n.x,t),n.y=O.toSNorm(n.y,t),n};mo.octEncode=function(e,t){return mo.octEncodeInRange(e,255,t)};var nw=new z,pJ=new Uint8Array(1);function u1(e){return pJ[0]=e,pJ[0]}mo.octEncodeToCartesian4=function(e,t){return mo.octEncodeInRange(e,65535,nw),t.x=u1(nw.x*hJ),t.y=u1(nw.x),t.z=u1(nw.y*hJ),t.w=u1(nw.y),t};mo.octDecodeInRange=function(e,t,n,i){if(T.defined("result",i),e<0||e>n||t<0||t>n)throw new C(`x and y must be unsigned normalized integers between 0 and ${n}`);if(i.x=O.fromSNorm(e,n),i.y=O.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let o=i.x;i.x=(1-Math.abs(i.y))*O.signNotZero(o),i.y=(1-Math.abs(o))*O.signNotZero(i.y)}return d.normalize(i,i)};mo.octDecode=function(e,t,n){return mo.octDecodeInRange(e,t,255,n)};mo.octDecodeFromCartesian4=function(e,t){T.typeOf.object("encoded",e),T.typeOf.object("result",t);let n=e.x,i=e.y,o=e.z,r=e.w;if(n<0||n>255||i<0||i>255||o<0||o>255||r<0||r>255)throw new C("x, y, z, and w must be unsigned normalized integers between 0 and 255");let s=n*mJ+i,a=o*mJ+r;return mo.octDecodeInRange(s,a,65535,t)};mo.octPackFloat=function(e){return T.defined("encoded",e),256*e.x+e.y};var n6=new z;mo.octEncodeFloat=function(e){return mo.octEncode(e,n6),mo.octPackFloat(n6)};mo.octDecodeFloat=function(e,t){T.defined("value",e);let n=e/256,i=Math.floor(n),o=(n-i)*256;return mo.octDecode(i,o,t)};mo.octPack=function(e,t,n,i){T.defined("v1",e),T.defined("v2",t),T.defined("v3",n),T.defined("result",i);let o=mo.octEncodeFloat(e),r=mo.octEncodeFloat(t),s=mo.octEncode(n,n6);return i.x=65536*s.x+o,i.y=65536*s.y+r,i};mo.octUnpack=function(e,t,n,i){T.defined("packed",e),T.defined("v1",t),T.defined("v2",n),T.defined("v3",i);let o=e.x/65536,r=Math.floor(o),s=(o-r)*65536;o=e.y/65536;let a=Math.floor(o),l=(o-a)*65536;mo.octDecodeFloat(s,t),mo.octDecodeFloat(l,n),mo.octDecode(r,a,i)};mo.compressTextureCoordinates=function(e){T.defined("textureCoordinates",e);let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};mo.decompressTextureCoordinates=function(e,t){T.defined("compressed",e),T.defined("result",t);let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function t6(e){return e>>1^-(e&1)}mo.zigZagDeltaDecode=function(e,t,n){T.defined("uBuffer",e),T.defined("vBuffer",t),T.typeOf.number.equals("uBuffer.length","vBuffer.length",e.length,t.length),c(n)&&T.typeOf.number.equals("uBuffer.length","heightBuffer.length",e.length,n.length);let i=e.length,o=0,r=0,s=0;for(let a=0;a<i;++a)o+=t6(e[a]),r+=t6(t[a]),e[a]=o,t[a]=r,c(n)&&(s+=t6(n[a]),n[a]=s)};mo.dequantize=function(e,t,n,i){T.defined("typedArray",e),T.defined("componentDatatype",t),T.defined("type",n),T.defined("count",i);let o=nn.getNumberOfComponents(n),r;switch(t){case $.BYTE:r=127;break;case $.UNSIGNED_BYTE:r=255;break;case $.SHORT:r=32767;break;case $.UNSIGNED_SHORT:r=65535;break;case $.INT:r=2147483647;break;case $.UNSIGNED_INT:r=4294967295;break;default:throw new C(`Cannot dequantize component datatype: ${t}`)}let s=new Float32Array(i*o);for(let a=0;a<i;a++)for(let l=0;l<o;l++){let u=a*o+l;s[u]=Math.max(e[u]/r,-1)}return s};mo.decodeRGB565=function(e,t){T.defined("typedArray",e);let n=e.length*3;c(t)&&T.typeOf.number.equals("result.length","typedArray.length * 3",t.length,n);let i=e.length;c(t)||(t=new Float32Array(i*3));let o=31,r=63,s=1/31,a=1/63;for(let l=0;l<i;l++){let u=e[l],f=u>>11,h=u>>5&r,p=u&o,g=3*l;t[g]=f*s,t[g+1]=h*a,t[g+2]=p*s}return t};var Ln=mo;var _J=new d,gJ=new d,yJ=new d;function yDe(e,t,n,i,o){T.defined("point",e),T.defined("p0",t),T.defined("p1",n),T.defined("p2",i),c(o)||(o=new d);let r,s,a,l,u,f,h,p;if(c(t.z)){if(d.equalsEpsilon(e,t,O.EPSILON14))return d.clone(d.UNIT_X,o);if(d.equalsEpsilon(e,n,O.EPSILON14))return d.clone(d.UNIT_Y,o);if(d.equalsEpsilon(e,i,O.EPSILON14))return d.clone(d.UNIT_Z,o);r=d.subtract(n,t,_J),s=d.subtract(i,t,gJ),a=d.subtract(e,t,yJ),l=d.dot(r,r),u=d.dot(r,s),f=d.dot(r,a),h=d.dot(s,s),p=d.dot(s,a)}else{if(z.equalsEpsilon(e,t,O.EPSILON14))return d.clone(d.UNIT_X,o);if(z.equalsEpsilon(e,n,O.EPSILON14))return d.clone(d.UNIT_Y,o);if(z.equalsEpsilon(e,i,O.EPSILON14))return d.clone(d.UNIT_Z,o);r=z.subtract(n,t,_J),s=z.subtract(i,t,gJ),a=z.subtract(e,t,yJ),l=z.dot(r,r),u=z.dot(r,s),f=z.dot(r,a),h=z.dot(s,s),p=z.dot(s,a)}o.y=h*f-u*p,o.z=l*p-u*f;let g=l*h-u*u;if(g!==0)return o.y/=g,o.z/=g,o.x=1-o.y-o.z,o}var CT=yDe;function Ph(){this.high=d.clone(d.ZERO),this.low=d.clone(d.ZERO)}Ph.encode=function(e,t){T.typeOf.number("value",e),c(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var dp={high:0,low:0};Ph.fromCartesian=function(e,t){T.typeOf.object("cartesian",e),c(t)||(t=new Ph);let n=t.high,i=t.low;return Ph.encode(e.x,dp),n.x=dp.high,i.x=dp.low,Ph.encode(e.y,dp),n.y=dp.high,i.y=dp.low,Ph.encode(e.z,dp),n.z=dp.high,i.z=dp.low,t};var i6=new Ph;Ph.writeElements=function(e,t,n){T.defined("cartesianArray",t),T.typeOf.number("index",n),T.typeOf.number.greaterThanOrEquals("index",n,0),Ph.fromCartesian(e,i6);let i=i6.high,o=i6.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var Hn=Ph;var o6={};o6.computeDiscriminant=function(e,t,n){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");return t*t-4*e*n};function bJ(e,t,n){let i=e+t;return O.sign(e)!==O.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}o6.computeRealRoots=function(e,t,n){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let l=Math.abs(n),u=Math.abs(e);if(l<u&&l/u<O.EPSILON14)return[0,0];if(l>u&&u/l<O.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let o=t*t,r=4*e*n,s=bJ(o,-r,O.EPSILON14);if(s<0)return[];let a=-.5*bJ(t,O.sign(t)*Math.sqrt(s),O.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var ul=o6;var s6={};s6.computeDiscriminant=function(e,t,n,i){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function r6(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,l=o*s,u=r*a,f=r*r,h=s*s,p=o*s-f,g=o*a-r*s,m=r*a-h,y=4*p*m-g*g,b,x;if(y<0){let q,X,te;f*u>=l*h?(q=o,X=p,te=-2*r*p+o*g):(q=a,X=m,te=-a*g+2*s*m);let Z=-(te<0?-1:1)*Math.abs(q)*Math.sqrt(-y);x=-te+Z;let ee=x/2,me=ee<0?-Math.pow(-ee,1/3):Math.pow(ee,1/3),xe=x===Z?-me:-X/me;return b=X<=0?me+xe:-te/(me*me+xe*xe+X),f*u>=l*h?[(b-r)/o]:[-a/(b+s)]}let A=p,E=-2*r*p+o*g,S=m,v=-a*g+2*s*m,P=Math.sqrt(y),M=Math.sqrt(3)/2,R=Math.abs(Math.atan2(o*P,-E)/3);b=2*Math.sqrt(-A);let L=Math.cos(R);x=b*L;let B=b*(-L/2-M*Math.sin(R)),_=x+B>2*r?x-r:B-r,w=o,D=_/w;R=Math.abs(Math.atan2(a*P,-v)/3),b=2*Math.sqrt(-S),L=Math.cos(R),x=b*L,B=b*(-L/2-M*Math.sin(R));let I=-a,N=x+B<2*s?x+s:B+s,k=I/N,H=w*N,V=-_*N-w*I,j=_*I,U=(s*V-r*j)/(-r*V+s*H);return D<=U?D<=k?U<=k?[D,U,k]:[D,k,U]:[k,D,U]:D<=k?[U,D,k]:U<=k?[U,k,D]:[k,U,D]}s6.computeRealRoots=function(e,t,n,i){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");let o,r;if(e===0)return ul.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=ul.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return r6(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):r6(e,t,0,i);if(i===0)return o=ul.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return r6(e,t,n,i)};var ET=s6;var a6={};a6.computeDiscriminant=function(e,t,n,i,o){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");if(typeof o!="number")throw new C("e is a required number.");let r=e*e,s=r*e,a=t*t,l=a*t,u=n*n,f=u*n,h=i*i,p=h*i,g=o*o,m=g*o;return a*u*h-4*l*p-4*e*f*h+18*e*t*n*p-27*r*h*h+256*s*m+o*(18*l*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*h+144*r*n*h)+g*(144*e*a*n-27*a*a-128*r*u-192*r*t*i)};function ud(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,l=ET.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(l.length>0){let u=-e/4,f=l[l.length-1];if(Math.abs(f)<O.EPSILON14){let h=ul.computeRealRoots(1,r,a);if(h.length===2){let p=h[0],g=h[1],m;if(p>=0&&g>=0){let y=Math.sqrt(p),b=Math.sqrt(g);return[u-b,u-y,u+y,u+b]}else{if(p>=0&&g<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&g>=0)return m=Math.sqrt(g),[u-m,u+m]}}return[]}else if(f>0){let h=Math.sqrt(f),p=(r+f-s/h)/2,g=(r+f+s/h)/2,m=ul.computeRealRoots(1,h,p),y=ul.computeRealRoots(1,-h,g);return m.length!==0?(m[0]+=u,m[1]+=u,y.length!==0?(y[0]+=u,y[1]+=u,m[1]<=y[0]?[m[0],m[1],y[0],y[1]]:y[1]<=m[0]?[y[0],y[1],m[0],m[1]]:m[0]>=y[0]&&m[1]<=y[1]?[y[0],m[0],m[1],y[1]]:y[0]>=m[0]&&y[1]<=m[1]?[m[0],y[0],y[1],m[1]]:m[0]>y[0]&&m[0]<y[1]?[y[0],m[0],y[1],m[1]]:[m[0],y[0],m[1],y[1]]):m):y.length!==0?(y[0]+=u,y[1]+=u,y):[]}}return[]}function iw(e,t,n,i){let o=n*n,r=t*t,s=e*e,a=-2*t,l=n*e+r-4*i,u=s*i-n*t*e+o,f=ET.computeRealRoots(1,a,l,u);if(f.length>0){let h=f[0],p=t-h,g=p*p,m=e/2,y=p/2,b=g-4*i,x=g+4*Math.abs(i),A=s-4*h,E=s+4*Math.abs(h),S,v;if(h<0||b*E<A*x){let w=Math.sqrt(A);S=w/2,v=w===0?0:(e*y-n)/w}else{let w=Math.sqrt(b);S=w===0?0:(e*y-n)/w,v=w/2}let P,M;m===0&&S===0?(P=0,M=0):O.sign(m)===O.sign(S)?(P=m+S,M=h/P):(M=m-S,P=h/M);let R,L;y===0&&v===0?(R=0,L=0):O.sign(y)===O.sign(v)?(R=y+v,L=i/R):(L=y-v,R=i/L);let B=ul.computeRealRoots(1,P,R),_=ul.computeRealRoots(1,M,L);if(B.length!==0)return _.length!==0?B[1]<=_[0]?[B[0],B[1],_[0],_[1]]:_[1]<=B[0]?[_[0],_[1],B[0],B[1]]:B[0]>=_[0]&&B[1]<=_[1]?[_[0],B[0],B[1],_[1]]:_[0]>=B[0]&&_[1]<=B[1]?[B[0],_[0],_[1],B[1]]:B[0]>_[0]&&B[0]<_[1]?[_[0],B[0],_[1],B[1]]:[B[0],_[0],B[1],_[1]]:B;if(_.length!==0)return _}return[]}a6.computeRealRoots=function(e,t,n,i,o){if(typeof e!="number")throw new C("a is a required number.");if(typeof t!="number")throw new C("b is a required number.");if(typeof n!="number")throw new C("c is a required number.");if(typeof i!="number")throw new C("d is a required number.");if(typeof o!="number")throw new C("e is a required number.");if(Math.abs(e)<O.EPSILON15)return ET.computeRealRoots(t,n,i,o);let r=t/e,s=n/e,a=i/e,l=o/e,u=r<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=l<0?u+1:u,u){case 0:return ud(r,s,a,l);case 1:return iw(r,s,a,l);case 2:return iw(r,s,a,l);case 3:return ud(r,s,a,l);case 4:return ud(r,s,a,l);case 5:return iw(r,s,a,l);case 6:return ud(r,s,a,l);case 7:return ud(r,s,a,l);case 8:return iw(r,s,a,l);case 9:return ud(r,s,a,l);case 10:return ud(r,s,a,l);case 11:return iw(r,s,a,l);case 12:return ud(r,s,a,l);case 13:return ud(r,s,a,l);case 14:return ud(r,s,a,l);case 15:return ud(r,s,a,l);default:return}};var f1=a6;function d1(e,t){t=d.clone(t??d.ZERO),d.equals(t,d.ZERO)||d.normalize(t,t),this.origin=d.clone(e??d.ZERO),this.direction=t}d1.clone=function(e,t){if(c(e))return c(t)?(t.origin=d.clone(e.origin),t.direction=d.clone(e.direction),t):new d1(e.origin,e.direction)};d1.getPoint=function(e,t,n){return T.typeOf.object("ray",e),T.typeOf.number("t",t),c(n)||(n=new d),n=d.multiplyByScalar(e.direction,t,n),d.add(e.origin,n,n)};var _n=d1;var Lo={};Lo.rayPlane=function(e,t,n){if(!c(e))throw new C("ray is required.");if(!c(t))throw new C("plane is required.");c(n)||(n=new d);let i=e.origin,o=e.direction,r=t.normal,s=d.dot(r,o);if(Math.abs(s)<O.EPSILON15)return;let a=(-t.distance-d.dot(r,i))/s;if(!(a<0))return n=d.multiplyByScalar(o,a,n),d.add(i,n,n)};var bDe=new d,xDe=new d,vJ=new d,xJ=new d,TJ=new d;Lo.rayTriangleParametric=function(e,t,n,i,o){if(!c(e))throw new C("ray is required.");if(!c(t))throw new C("p0 is required.");if(!c(n))throw new C("p1 is required.");if(!c(i))throw new C("p2 is required.");o=o??!1;let r=e.origin,s=e.direction,a=d.subtract(n,t,bDe),l=d.subtract(i,t,xDe),u=d.cross(s,l,vJ),f=d.dot(a,u),h,p,g,m,y;if(o){if(f<O.EPSILON6||(h=d.subtract(r,t,xJ),g=d.dot(h,u),g<0||g>f)||(p=d.cross(h,a,TJ),m=d.dot(s,p),m<0||g+m>f))return;y=d.dot(l,p)/f}else{if(Math.abs(f)<O.EPSILON6)return;let b=1/f;if(h=d.subtract(r,t,xJ),g=d.dot(h,u)*b,g<0||g>1||(p=d.cross(h,a,TJ),m=d.dot(s,p)*b,m<0||g+m>1))return;y=d.dot(l,p)*b}return y};Lo.rayTriangle=function(e,t,n,i,o,r){let s=Lo.rayTriangleParametric(e,t,n,i,o);if(!(!c(s)||s<0))return c(r)||(r=new d),d.multiplyByScalar(e.direction,s,r),d.add(e.origin,r,r)};var TDe=new _n;Lo.lineSegmentTriangle=function(e,t,n,i,o,r,s){if(!c(e))throw new C("v0 is required.");if(!c(t))throw new C("v1 is required.");if(!c(n))throw new C("p0 is required.");if(!c(i))throw new C("p1 is required.");if(!c(o))throw new C("p2 is required.");let a=TDe;d.clone(e,a.origin),d.subtract(t,e,a.direction),d.normalize(a.direction,a.direction);let l=Lo.rayTriangleParametric(a,n,i,o,r);if(!(!c(l)||l<0||l>d.distance(e,t)))return c(s)||(s=new d),d.multiplyByScalar(a.direction,l,s),d.add(a.origin,s,s)};function ADe(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),l=(-t+a)*s,u=(-t-a)*s;return l<u?(i.root0=l,i.root1=u):(i.root0=u,i.root1=l),i}let r=-t/(2*e);if(r!==0)return i.root0=i.root1=r,i}var CDe={root0:0,root1:0};function DJ(e,t,n){c(n)||(n=new $a);let i=e.origin,o=e.direction,r=t.center,s=t.radius*t.radius,a=d.subtract(i,r,vJ),l=d.dot(o,o),u=2*d.dot(o,a),f=d.magnitudeSquared(a)-s,h=ADe(l,u,f,CDe);if(c(h))return n.start=h.root0,n.stop=h.root1,n}Lo.raySphere=function(e,t,n){if(!c(e))throw new C("ray is required.");if(!c(t))throw new C("sphere is required.");if(n=DJ(e,t,n),!(!c(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var EDe=new _n;Lo.lineSegmentSphere=function(e,t,n,i){if(!c(e))throw new C("p0 is required.");if(!c(t))throw new C("p1 is required.");if(!c(n))throw new C("sphere is required.");let o=EDe;d.clone(e,o.origin);let r=d.subtract(t,e,o.direction),s=d.magnitude(r);if(d.normalize(r,r),i=DJ(o,n,i),!(!c(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var SDe=new d,wDe=new d;Lo.rayEllipsoid=function(e,t){if(!c(e))throw new C("ray is required.");if(!c(t))throw new C("ellipsoid is required.");let n=t.oneOverRadii,i=d.multiplyComponents(n,e.origin,SDe),o=d.multiplyComponents(n,e.direction,wDe),r=d.magnitudeSquared(i),s=d.dot(i,o),a,l,u,f,h;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,l=d.magnitudeSquared(o),u=l*a,p<u)return;if(p>u){f=s*s-u,h=-s+Math.sqrt(f);let m=h/l,y=a/h;return m<y?new $a(m,y):{start:y,stop:m}}let g=Math.sqrt(a/l);return new $a(g,g)}else if(r<1)return a=r-1,l=d.magnitudeSquared(o),u=l*a,f=s*s-u,h=-s+Math.sqrt(f),new $a(0,h/l);if(s<0)return l=d.magnitudeSquared(o),new $a(0,-s/l)};function N0(e,t,n){let i=e+t;return O.sign(e)!==O.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Lo.quadraticVectorExpression=function(e,t,n,i,o){let r=i*i,s=o*o,a=(e[J.COLUMN1ROW1]-e[J.COLUMN2ROW2])*s,l=o*(i*N0(e[J.COLUMN1ROW0],e[J.COLUMN0ROW1],O.EPSILON15)+t.y),u=e[J.COLUMN0ROW0]*r+e[J.COLUMN2ROW2]*s+i*t.x+n,f=s*N0(e[J.COLUMN2ROW1],e[J.COLUMN1ROW2],O.EPSILON15),h=o*(i*N0(e[J.COLUMN2ROW0],e[J.COLUMN0ROW2])+t.z),p,g=[];if(h===0&&f===0){if(p=ul.computeRealRoots(a,l,u),p.length===0)return g;let R=p[0],L=Math.sqrt(Math.max(1-R*R,0));if(g.push(new d(i,o*R,o*-L)),g.push(new d(i,o*R,o*L)),p.length===2){let B=p[1],_=Math.sqrt(Math.max(1-B*B,0));g.push(new d(i,o*B,o*-_)),g.push(new d(i,o*B,o*_))}return g}let m=h*h,y=f*f,b=a*a,x=h*f,A=b+y,E=2*(l*a+x),S=2*u*a+l*l-y+m,v=2*(u*l-x),P=u*u-m;if(A===0&&E===0&&S===0&&v===0)return g;p=f1.computeRealRoots(A,E,S,v,P);let M=p.length;if(M===0)return g;for(let R=0;R<M;++R){let L=p[R],B=L*L,_=Math.max(1-B,0),w=Math.sqrt(_),D;O.sign(a)===O.sign(u)?D=N0(a*B+u,l*L,O.EPSILON12):O.sign(u)===O.sign(l*L)?D=N0(a*B,l*L+u,O.EPSILON12):D=N0(a*B+l*L,u,O.EPSILON12);let I=N0(f*L,h,O.EPSILON15),N=D*I;N<0?g.push(new d(i,o*L,o*w)):N>0?g.push(new d(i,o*L,o*-w)):w!==0?(g.push(new d(i,o*L,o*-w)),g.push(new d(i,o*L,o*w)),++R):g.push(new d(i,o*L,o*w))}return g};var c6=new d,AJ=new d,CJ=new d,h1=new d,vDe=new d,DDe=new J,PDe=new J,IDe=new J,ODe=new J,RDe=new J,EJ=new J,SJ=new J,wJ=new d,MDe=new d,LDe=new he;Lo.grazingAltitudeLocation=function(e,t){if(!c(e))throw new C("ray is required.");if(!c(t))throw new C("ellipsoid is required.");let n=e.origin,i=e.direction;if(!d.equals(n,d.ZERO)){let P=t.geodeticSurfaceNormal(n,c6);if(d.dot(i,P)>=0)return n}let o=c(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,c6),s=d.normalize(r,r),a=d.mostOrthogonalAxis(r,h1),l=d.normalize(d.cross(a,s,AJ),AJ),u=d.normalize(d.cross(s,l,CJ),CJ),f=DDe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=l.x,f[4]=l.y,f[5]=l.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let h=J.transpose(f,PDe),p=J.fromScale(t.radii,IDe),g=J.fromScale(t.oneOverRadii,ODe),m=RDe;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let y=J.multiply(J.multiply(h,g,EJ),m,EJ),b=J.multiply(J.multiply(y,p,SJ),f,SJ),x=J.multiplyByVector(y,n,vDe),A=Lo.quadraticVectorExpression(b,d.negate(x,c6),0,0,1),E,S,v=A.length;if(v>0){let P=d.clone(d.ZERO,MDe),M=Number.NEGATIVE_INFINITY;for(let L=0;L<v;++L){E=J.multiplyByVector(p,J.multiplyByVector(f,A[L],wJ),wJ);let B=d.normalize(d.subtract(E,n,h1),h1),_=d.dot(B,i);_>M&&(M=_,P=d.clone(E,P))}let R=t.cartesianToCartographic(P,LDe);return M=O.clamp(M,0,1),S=d.magnitude(d.subtract(P,n,h1))*Math.sqrt(1-M*M),S=o?-S:S,R.height=S,t.cartographicToCartesian(R,new d)}};var NDe=new d;Lo.lineSegmentPlane=function(e,t,n,i){if(!c(e))throw new C("endPoint0 is required.");if(!c(t))throw new C("endPoint1 is required.");if(!c(n))throw new C("plane is required.");c(i)||(i=new d);let o=d.subtract(t,e,NDe),r=n.normal,s=d.dot(r,o);if(Math.abs(s)<O.EPSILON6)return;let a=d.dot(r,e),l=-(n.distance+a)/s;if(!(l<0||l>1))return d.multiplyByScalar(o,l,i),d.add(e,i,i),i};Lo.trianglePlaneIntersection=function(e,t,n,i){if(!c(e)||!c(t)||!c(n)||!c(i))throw new C("p0, p1, p2, and plane are required.");let o=i.normal,r=i.distance,s=d.dot(o,e)+r<0,a=d.dot(o,t)+r<0,l=d.dot(o,n)+r<0,u=0;u+=s?1:0,u+=a?1:0,u+=l?1:0;let f,h;if((u===1||u===2)&&(f=new d,h=new d),u===1){if(s)return Lo.lineSegmentPlane(e,t,i,f),Lo.lineSegmentPlane(e,n,i,h),{positions:[e,t,n,f,h],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Lo.lineSegmentPlane(t,n,i,f),Lo.lineSegmentPlane(t,e,i,h),{positions:[e,t,n,f,h],indices:[1,3,4,2,0,4,2,4,3]};if(l)return Lo.lineSegmentPlane(n,e,i,f),Lo.lineSegmentPlane(n,t,i,h),{positions:[e,t,n,f,h],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!l)return Lo.lineSegmentPlane(e,n,i,f),Lo.lineSegmentPlane(t,n,i,h),{positions:[e,t,n,f,h],indices:[0,1,4,0,4,3,2,3,4]}}else return Lo.lineSegmentPlane(n,t,i,f),Lo.lineSegmentPlane(e,t,i,h),{positions:[e,t,n,f,h],indices:[2,0,4,2,4,3,1,3,4]};else return Lo.lineSegmentPlane(t,e,i,f),Lo.lineSegmentPlane(n,e,i,h),{positions:[e,t,n,f,h],indices:[1,2,4,1,4,3,0,3,4]}};var Qn=Lo;function Os(e,t){if(T.typeOf.object("normal",e),!O.equalsEpsilon(d.magnitude(e),1,O.EPSILON6))throw new C("normal must be normalized.");T.typeOf.number("distance",t),this.normal=d.clone(e),this.distance=t}Os.fromPointNormal=function(e,t,n){if(T.typeOf.object("point",e),T.typeOf.object("normal",t),!O.equalsEpsilon(d.magnitude(t),1,O.EPSILON6))throw new C("normal must be normalized.");let i=-d.dot(t,e);return c(n)?(d.clone(t,n.normal),n.distance=i,n):new Os(t,i)};var FDe=new d;Os.fromCartesian4=function(e,t){T.typeOf.object("coefficients",e);let n=d.fromCartesian4(e,FDe),i=e.w;if(!O.equalsEpsilon(d.magnitude(n),1,O.EPSILON6))throw new C("normal must be normalized.");return c(t)?(d.clone(n,t.normal),t.distance=i,t):new Os(n,i)};Os.getPointDistance=function(e,t){return T.typeOf.object("plane",e),T.typeOf.object("point",t),d.dot(e.normal,t)+e.distance};var BDe=new d;Os.projectPointOntoPlane=function(e,t,n){T.typeOf.object("plane",e),T.typeOf.object("point",t),c(n)||(n=new d);let i=Os.getPointDistance(e,t),o=d.multiplyByScalar(e.normal,i,BDe);return d.subtract(t,o,n)};var kDe=new F,UDe=new se,VDe=new d;Os.transform=function(e,t,n){T.typeOf.object("plane",e),T.typeOf.object("transform",t);let i=e.normal,o=e.distance,r=F.inverseTranspose(t,kDe),s=se.fromElements(i.x,i.y,i.z,o,UDe);s=F.multiplyByVector(r,s,s);let a=d.fromCartesian4(s,VDe);return s=se.divideByScalar(s,d.magnitude(a),s),Os.fromCartesian4(s,n)};Os.clone=function(e,t){return T.typeOf.object("plane",e),c(t)?(d.clone(e.normal,t.normal),t.distance=e.distance,t):new Os(e.normal,e.distance)};Os.equals=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.distance===t.distance&&d.equals(e.normal,t.normal)};Os.ORIGIN_XY_PLANE=Object.freeze(new Os(d.UNIT_Z,0));Os.ORIGIN_YZ_PLANE=Object.freeze(new Os(d.UNIT_X,0));Os.ORIGIN_ZX_PLANE=Object.freeze(new Os(d.UNIT_Y,0));var sn=Os;var l6={};l6.calculateACMR=function(e){e=e??W.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24;if(!c(t))throw new C("indices is required.");let o=t.length;if(o<3||o%3!==0)throw new C("indices length must be a multiple of three.");if(n<=0)throw new C("maximumIndex must be greater than zero.");if(i<3)throw new C("cacheSize must be greater than two.");if(!c(n)){n=0;let a=0,l=t[a];for(;a<o;)l>n&&(n=l),++a,l=t[a]}let r=[];for(let a=0;a<n+1;a++)r[a]=0;let s=i+1;for(let a=0;a<o;++a)s-r[t[a]]>i&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};l6.tipsify=function(e){e=e??W.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(_,w,D,I){for(;w.length>=1;){let N=w[w.length-1];if(w.splice(w.length-1,1),_[N].numLiveTriangles>0)return N}for(;o<I;){if(_[o].numLiveTriangles>0)return++o,o-1;++o}return-1}function s(_,w,D,I,N,k,H){let V=-1,j,U=-1,q=0;for(;q<D.length;){let X=D[q];I[X].numLiveTriangles&&(j=0,N-I[X].timeStamp+2*I[X].numLiveTriangles<=w&&(j=N-I[X].timeStamp),(j>U||U===-1)&&(U=j,V=X)),++q}return V===-1?r(I,k,_,H):V}if(!c(t))throw new C("indices is required.");let a=t.length;if(a<3||a%3!==0)throw new C("indices length must be a multiple of three.");if(n<=0)throw new C("maximumIndex must be greater than zero.");if(i<3)throw new C("cacheSize must be greater than two.");let l=0,u=0,f=t[u],h=a;if(c(n))l=n+1;else{for(;u<h;)f>l&&(l=f),++u,f=t[u];if(l===-1)return 0;++l}let p=[],g;for(g=0;g<l;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<h;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let y=0,b=i+1;o=1;let x=[],A=[],E,S,v=0,P=[],M=a/3,R=[];for(g=0;g<M;g++)R[g]=!1;let L,B;for(;y!==-1;){x=[],S=p[y],B=S.vertexTriangles.length;for(let _=0;_<B;++_)if(m=S.vertexTriangles[_],!R[m]){R[m]=!0,u=m+m+m;for(let w=0;w<3;++w)L=t[u],x.push(L),A.push(L),P[v]=L,++v,E=p[L],--E.numLiveTriangles,b-E.timeStamp>i&&(E.timeStamp=b,++b),++u}y=s(t,i,x,p,b,A,l)}return P};var m1=l6;var Ac={};function T1(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function zDe(e){let t=e.length,n=t/3*6,i=Fe.createTypedArray(t,n),o=0;for(let r=0;r<t;r+=3,o+=6)T1(i,o,e[r],e[r+1],e[r+2]);return i}function HDe(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=Fe.createTypedArray(t,n);T1(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r<t;++r,o+=6)T1(i,o,e[r-1],e[r],e[r-2]);return i}return new Uint16Array}function GDe(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=Fe.createTypedArray(t,n),o=e[0],r=0;for(let s=1;s<t;++s,r+=6)T1(i,r,o,e[s],e[s+1]);return i}return new Uint16Array}Ac.toWireframe=function(e){if(!c(e))throw new C("geometry is required.");let t=e.indices;if(c(t)){switch(e.primitiveType){case Me.TRIANGLES:e.indices=zDe(t);break;case Me.TRIANGLE_STRIP:e.indices=HDe(t);break;case Me.TRIANGLE_FAN:e.indices=GDe(t);break;default:throw new C("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.")}e.primitiveType=Me.LINES}return e};Ac.createLineSegmentsForVectors=function(e,t,n){if(t=t??"normal",!c(e))throw new C("geometry is required.");if(!c(e.attributes.position))throw new C("geometry.attributes.position is required.");if(!c(e.attributes[t]))throw new C(`geometry.attributes must have an attribute with the same name as the attributeName parameter, ${t}.`);n=n??1e4;let i=e.attributes.position.values,o=e.attributes[t].values,r=i.length,s=new Float64Array(2*r),a=0;for(let f=0;f<r;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+o[f]*n,s[a++]=i[f+1]+o[f+1]*n,s[a++]=i[f+2]+o[f+2]*n;let l,u=e.boundingSphere;return c(u)&&(l=new le(u.center,u.radius+n)),new ct({attributes:{position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Me.LINES,boundingSphere:l})};Ac.createAttributeLocations=function(e){if(!c(e))throw new C("geometry is required.");let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},o=0,r,s=t.length;for(r=0;r<s;++r){let a=t[r];c(n[a])&&(i[a]=o++)}for(let a in n)n.hasOwnProperty(a)&&!c(i[a])&&(i[a]=o++);return i};Ac.reorderForPreVertexCache=function(e){if(!c(e))throw new C("geometry is required.");let t=ct.computeNumberOfVertices(e),n=e.indices;if(c(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let o=n,r=o.length,s=Fe.createTypedArray(t,r),a=0,l=0,u=0,f;for(;a<r;)f=i[o[a]],f!==-1?s[l]=f:(f=o[a],i[f]=u,s[l]=u,++u),++a,++l;e.indices=s;let h=e.attributes;for(let p in h)if(h.hasOwnProperty(p)&&c(h[p])&&c(h[p].values)){let g=h[p],m=g.values,y=0,b=g.componentsPerAttribute,x=$.createTypedArray(g.componentDatatype,u*b);for(;y<t;){let A=i[y];if(A!==-1)for(let E=0;E<b;E++)x[b*A+E]=m[b*y+E];++y}g.values=x}}return e};Ac.reorderForPostVertexCache=function(e,t){if(!c(e))throw new C("geometry is required.");let n=e.indices;if(e.primitiveType===Me.TRIANGLES&&c(n)){let i=n.length,o=0;for(let r=0;r<i;r++)n[r]>o&&(o=n[r]);e.indices=m1.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function PJ(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)){let i=e[n];t[n]=new ve({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function jDe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&c(t[i])&&c(t[i].values)){let o=t[i];for(let r=0;r<o.componentsPerAttribute;++r)e[i].values.push(o.values[n*o.componentsPerAttribute+r])}}Ac.fitToUnsignedShortIndices=function(e){if(!c(e))throw new C("geometry is required.");if(c(e.indices)&&e.primitiveType!==Me.TRIANGLES&&e.primitiveType!==Me.LINES&&e.primitiveType!==Me.POINTS)throw new C("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS.");let t=[],n=ct.computeNumberOfVertices(e);if(c(e.indices)&&n>=O.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=PJ(e.attributes),a=e.indices,l=a.length,u;e.primitiveType===Me.TRIANGLES?u=3:e.primitiveType===Me.LINES?u=2:e.primitiveType===Me.POINTS&&(u=1);for(let f=0;f<l;f+=u){for(let h=0;h<u;++h){let p=a[f+h],g=i[p];c(g)||(g=r++,i[p]=g,jDe(s,e.attributes,p)),o.push(g)}r+u>=O.SIXTY_FOUR_KILOBYTES&&(t.push(new ct({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=PJ(e.attributes))}o.length!==0&&t.push(new ct({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var IJ=new d,WDe=new he;Ac.projectTo2D=function(e,t,n,i,o){if(!c(e))throw new C("geometry is required.");if(!c(t))throw new C("attributeName is required.");if(!c(n))throw new C("attributeName3D is required.");if(!c(i))throw new C("attributeName2D is required.");if(!c(e.attributes[t]))throw new C(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==$.DOUBLE)throw new C("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let r=e.attributes[t];o=c(o)?o:new Oi;let s=o.ellipsoid,a=r.values,l=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let h=d.fromArray(a,f,IJ),p=s.cartesianToCartographic(h,WDe);if(!c(p))throw new C(`Could not project point (${h.x}, ${h.y}, ${h.z}) to 2D.`);let g=o.project(p,IJ);l[u++]=g.x,l[u++]=g.y,l[u++]=g.z}return e.attributes[n]=r,e.attributes[i]=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:l}),delete e.attributes[t],e};var u6={high:0,low:0};Ac.encodeAttribute=function(e,t,n,i){if(!c(e))throw new C("geometry is required.");if(!c(t))throw new C("attributeName is required.");if(!c(n))throw new C("attributeHighName is required.");if(!c(i))throw new C("attributeLowName is required.");if(!c(e.attributes[t]))throw new C(`geometry must have attribute matching the attributeName argument: ${t}.`);if(e.attributes[t].componentDatatype!==$.DOUBLE)throw new C("The attribute componentDatatype must be ComponentDatatype.DOUBLE.");let o=e.attributes[t],r=o.values,s=r.length,a=new Float32Array(s),l=new Float32Array(s);for(let f=0;f<s;++f)Hn.encode(r[f],u6),a[f]=u6.high,l[f]=u6.low;let u=o.componentsPerAttribute;return e.attributes[n]=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:u,values:l}),delete e.attributes[t],e};var dd=new d;function f6(e,t){if(c(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,dd),F.multiplyByPoint(e,dd,dd),d.pack(dd,n,o)}}function d6(e,t){if(c(t)){let n=t.values,i=n.length;for(let o=0;o<i;o+=3)d.unpack(n,o,dd),J.multiplyByVector(e,dd,dd),dd=d.normalize(dd,dd),d.pack(dd,n,o)}}var p1=new F,_1=new J;Ac.transformToWorldCoordinates=function(e){if(!c(e))throw new C("instance is required.");let t=e.modelMatrix;if(F.equals(t,F.IDENTITY))return e;let n=e.geometry.attributes;f6(t,n.position),f6(t,n.prevPosition),f6(t,n.nextPosition),(c(n.normal)||c(n.tangent)||c(n.bitangent))&&(F.inverse(t,p1),F.transpose(p1,p1),F.getMatrix3(p1,_1),d6(_1,n.normal),d6(_1,n.tangent),d6(_1,n.bitangent));let i=e.geometry.boundingSphere;return c(i)&&(e.geometry.boundingSphere=le.transform(i,t,i)),e.modelMatrix=F.clone(F.IDENTITY),e};function qDe(e,t){let n=e.length,i={},o=e[0][t].attributes,r;for(r in o)if(o.hasOwnProperty(r)&&c(o[r])&&c(o[r].values)){let s=o[r],a=s.values.length,l=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[r];if(!c(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){l=!1;break}a+=f.values.length}l&&(i[r]=new ve({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:$.createTypedArray(s.componentDatatype,a)}))}return i}var YDe=new d;function h6(e,t){let n=e.length,i,o,r,s,a=e[0].modelMatrix,l=c(e[0][t].indices),u=e[0][t].primitiveType;for(o=1;o<n;++o){if(!F.equals(e[o].modelMatrix,a))throw new C("All instances must have the same modelMatrix.");if(c(e[o][t].indices)!==l)throw new C("All instance geometries must have an indices or not have one.");if(e[o][t].primitiveType!==u)throw new C("All instance geometries must have the same primitiveType.")}let f=qDe(e,t),h,p,g;for(i in f)if(f.hasOwnProperty(i))for(h=f[i].values,s=0,o=0;o<n;++o)for(p=e[o][t].attributes[i].values,g=p.length,r=0;r<g;++r)h[s++]=p[r];let m;if(l){let A=0;for(o=0;o<n;++o)A+=e[o][t].indices.length;let E=ct.computeNumberOfVertices(new ct({attributes:f,primitiveType:Me.POINTS})),S=Fe.createTypedArray(E,A),v=0,P=0;for(o=0;o<n;++o){let M=e[o][t].indices,R=M.length;for(s=0;s<R;++s)S[v++]=P+M[s];P+=ct.computeNumberOfVertices(e[o][t])}m=S}let y=new d,b=0,x;for(o=0;o<n;++o){if(x=e[o][t].boundingSphere,!c(x)){y=void 0;break}d.add(x.center,y,y)}if(c(y))for(d.divideByScalar(y,n,y),o=0;o<n;++o){x=e[o][t].boundingSphere;let A=d.magnitude(d.subtract(x.center,y,YDe))+x.radius;A>b&&(b=A)}return new ct({attributes:f,indices:m,primitiveType:u,boundingSphere:c(y)?new le(y,b):void 0})}Ac.combineInstances=function(e){if(!c(e)||e.length<1)throw new C("instances is required and must have length greater than zero.");let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let s=e[r];c(s.geometry)?t.push(s):c(s.westHemisphereGeometry)&&c(s.eastHemisphereGeometry)&&n.push(s)}let o=[];return t.length>0&&o.push(h6(t,"geometry")),n.length>0&&(o.push(h6(n,"westHemisphereGeometry")),o.push(h6(n,"eastHemisphereGeometry"))),o};var $u=new d,ow=new d,ST=new d,wT=new d;Ac.computeNormal=function(e){if(!c(e))throw new C("geometry is required.");if(!c(e.attributes.position)||!c(e.attributes.position.values))throw new C("geometry.attributes.position.values is required.");if(!c(e.indices))throw new C("geometry.indices is required.");if(e.indices.length<2||e.indices.length%3!==0)throw new C("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==Me.TRIANGLES)throw new C("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),l=new Array(r),u;for(u=0;u<o;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<r;u+=3){let m=t[u],y=t[u+1],b=t[u+2],x=m*3,A=y*3,E=b*3;ow.x=i[x],ow.y=i[x+1],ow.z=i[x+2],ST.x=i[A],ST.y=i[A+1],ST.z=i[A+2],wT.x=i[E],wT.y=i[E+1],wT.z=i[E+2],s[m].count++,s[y].count++,s[b].count++,d.subtract(ST,ow,ST),d.subtract(wT,ow,wT),a[f]=d.cross(ST,wT,new d),f++}let h=0;for(u=0;u<o;u++)s[u].indexOffset+=h,h+=s[u].count;f=0;let p;for(u=0;u<r;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;l[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,l[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,l[m]=f,p.currentCount++,f++}let g=new Float32Array(o*3);for(u=0;u<o;u++){let m=u*3;if(p=s[u],d.clone(d.ZERO,$u),p.count>0){for(f=0;f<p.count;f++)d.add($u,a[l[p.indexOffset+f]],$u);d.equalsEpsilon(d.ZERO,$u,O.EPSILON10)&&d.clone(a[l[p.indexOffset]],$u)}d.equalsEpsilon(d.ZERO,$u,O.EPSILON10)&&($u.z=1),d.normalize($u,$u),g[m]=$u.x,g[m+1]=$u.y,g[m+2]=$u.z}return e.attributes.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g}),e};var XDe=new d,OJ=new d,KDe=new d;Ac.computeTangentAndBitangent=function(e){if(!c(e))throw new C("geometry is required.");let t=e.attributes,n=e.indices;if(!c(t.position)||!c(t.position.values))throw new C("geometry.attributes.position.values is required.");if(!c(t.normal)||!c(t.normal.values))throw new C("geometry.attributes.normal.values is required.");if(!c(t.st)||!c(t.st.values))throw new C("geometry.attributes.st.values is required.");if(!c(n))throw new C("geometry.indices is required.");if(n.length<2||n.length%3!==0)throw new C("geometry.indices length must be greater than 0 and be a multiple of 3.");if(e.primitiveType!==Me.TRIANGLES)throw new C("geometry.primitiveType must be PrimitiveType.TRIANGLES.");let i=e.attributes.position.values,o=e.attributes.normal.values,r=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,l=new Array(s*3),u;for(u=0;u<l.length;u++)l[u]=0;let f,h,p;for(u=0;u<a;u+=3){let y=n[u],b=n[u+1],x=n[u+2];f=y*3,h=b*3,p=x*3;let A=y*2,E=b*2,S=x*2,v=i[f],P=i[f+1],M=i[f+2],R=r[A],L=r[A+1],B=r[E+1]-L,_=r[S+1]-L,w=1/((r[E]-R)*_-(r[S]-R)*B),D=(_*(i[h]-v)-B*(i[p]-v))*w,I=(_*(i[h+1]-P)-B*(i[p+1]-P))*w,N=(_*(i[h+2]-M)-B*(i[p+2]-M))*w;l[f]+=D,l[f+1]+=I,l[f+2]+=N,l[h]+=D,l[h+1]+=I,l[h+2]+=N,l[p]+=D,l[p+1]+=I,l[p+2]+=N}let g=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,h=f+1,p=f+2;let y=d.fromArray(o,f,XDe),b=d.fromArray(l,f,KDe),x=d.dot(y,b);d.multiplyByScalar(y,x,OJ),d.normalize(d.subtract(b,OJ,b),b),g[f]=b.x,g[h]=b.y,g[p]=b.z,d.normalize(d.cross(y,b,b),b),m[f]=b.x,m[h]=b.y,m[p]=b.z}return e.attributes.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m}),e};var rw=new z,fd=new d,RJ=new d,MJ=new d,g1=new z;Ac.compressVertices=function(e){if(!c(e))throw new C("geometry is required.");let t=e.attributes.extrudeDirection,n,i;if(c(t)){let P=t.values;i=P.length/3;let M=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(d.fromArray(P,n*3,fd),d.equals(fd,d.ZERO)){R+=2;continue}g1=Ln.octEncodeInRange(fd,65535,g1),M[R++]=g1.x,M[R++]=g1.y}return e.attributes.compressedAttributes=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:M}),delete e.attributes.extrudeDirection,e}let o=e.attributes.normal,r=e.attributes.st,s=c(o),a=c(r);if(!s&&!a)return e;let l=e.attributes.tangent,u=e.attributes.bitangent,f=c(l),h=c(u),p,g,m,y;s&&(p=o.values),a&&(g=r.values),f&&(m=l.values),h&&(y=u.values),i=(s?p.length:g.length)/(s?3:2);let A=i,E=a&&s?2:1;E+=f||h?1:0,A*=E;let S=new Float32Array(A),v=0;for(n=0;n<i;++n){a&&(z.fromArray(g,n*2,rw),S[v++]=Ln.compressTextureCoordinates(rw));let P=n*3;s&&c(m)&&c(y)?(d.fromArray(p,P,fd),d.fromArray(m,P,RJ),d.fromArray(y,P,MJ),Ln.octPack(fd,RJ,MJ,rw),S[v++]=rw.x,S[v++]=rw.y):(s&&(d.fromArray(p,P,fd),S[v++]=Ln.octEncodeFloat(fd)),f&&(d.fromArray(m,P,fd),S[v++]=Ln.octEncodeFloat(fd)),h&&(d.fromArray(y,P,fd),S[v++]=Ln.octEncodeFloat(fd)))}return e.attributes.compressedAttributes=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:E,values:S}),s&&delete e.attributes.normal,a&&delete e.attributes.st,h&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function $De(e){if(c(e.indices))return e;let t=ct.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least three.");if(t%3!==0)throw new C("The number of vertices must be a multiple of three.");let n=Fe.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function ZDe(e){let t=ct.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least three.");let n=Fe.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let o=3;o<t;++o)n[i++]=o-1,n[i++]=0,n[i++]=o;return e.indices=n,e.primitiveType=Me.TRIANGLES,e}function QDe(e){let t=ct.computeNumberOfVertices(e);if(t<3)throw new C("The number of vertices must be at least 3.");let n=Fe.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;o<t-1;o+=2)n[i++]=o,n[i++]=o-1,n[i++]=o+1,o+2<t&&(n[i++]=o,n[i++]=o+1,n[i++]=o+2);return e.indices=n,e.primitiveType=Me.TRIANGLES,e}function JDe(e){if(c(e.indices))return e;let t=ct.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");if(t%2!==0)throw new C("The number of vertices must be a multiple of 2.");let n=Fe.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function ePe(e){let t=ct.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");let n=Fe.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return e.indices=n,e.primitiveType=Me.LINES,e}function tPe(e){let t=ct.computeNumberOfVertices(e);if(t<2)throw new C("The number of vertices must be at least two.");let n=Fe.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let o=2;o<t;++o)n[i++]=o-1,n[i++]=o;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Me.LINES,e}function nPe(e){switch(e.primitiveType){case Me.TRIANGLE_FAN:return ZDe(e);case Me.TRIANGLE_STRIP:return QDe(e);case Me.TRIANGLES:return $De(e);case Me.LINE_STRIP:return ePe(e);case Me.LINE_LOOP:return tPe(e);case Me.LINES:return JDe(e)}return e}function G_(e,t){Math.abs(e.y)<O.EPSILON6&&(t?e.y=-O.EPSILON6:e.y=O.EPSILON6)}function iPe(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){G_(e,e.y<0),G_(t,t.y<0),G_(n,n.y<0);return}let i=Math.abs(e.y),o=Math.abs(t.y),r=Math.abs(n.y),s;i>o?i>r?s=O.sign(e.y):s=O.sign(n.y):o>r?s=O.sign(t.y):s=O.sign(n.y);let a=s<0;G_(e,a),G_(t,a),G_(n,a)}var LJ=new d;function Zu(e,t,n,i){d.add(e,d.multiplyByScalar(d.subtract(t,e,LJ),e.y/(e.y-t.y),LJ),n),d.clone(n,i),G_(n,!0),G_(i,!1)}var F0=new d,B0=new d,k0=new d,U0=new d,m6={positions:new Array(7),indices:new Array(3*3)};function oPe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;iPe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=m6.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Zu(e,t,F0,k0),Zu(e,n,B0,U0),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Zu(t,n,F0,k0),Zu(t,e,B0,U0),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Zu(n,e,F0,k0),Zu(n,t,B0,U0),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(Zu(n,e,F0,k0),Zu(n,t,B0,U0),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Zu(t,n,F0,k0),Zu(t,e,B0,U0),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Zu(e,t,F0,k0),Zu(e,n,B0,U0),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let l=m6.positions;return l[0]=e,l[1]=t,l[2]=n,l.length=3,(s===1||s===2)&&(l[3]=F0,l[4]=B0,l[5]=k0,l[6]=U0,l.length=7),m6}function NJ(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&c(n[o])&&c(n[o].values)){let r=n[o];r.values=$.createTypedArray(r.componentDatatype,r.values)}let i=ct.computeNumberOfVertices(e);return e.indices=Fe.createTypedArray(i,e.indices),t&&(e.boundingSphere=le.fromVertices(n.position.values)),e}function DT(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&c(t[i])&&c(t[i].values)){let o=t[i];n[i]=new ve({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new ct({attributes:n,indices:[],primitiveType:e.primitiveType})}function y6(e,t,n){let i=c(e.geometry.boundingSphere);t=NJ(t,i),n=NJ(n,i),c(n)&&!c(t)?e.geometry=n:!c(n)&&c(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function b6(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,l,u,f,h,p){let g=e.fromArray(u,r*t,n),m=e.fromArray(u,s*t,i),y=e.fromArray(u,a*t,o);e.multiplyByScalar(g,l.x,g),e.multiplyByScalar(m,l.y,m),e.multiplyByScalar(y,l.z,y);let b=e.add(g,m,g);e.add(b,y,b),p&&e.normalize(b,b),e.pack(b,f,h*t)}}var rPe=b6(se,4),x1=b6(d,3),zJ=b6(z,2),sPe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,l=o[t]*i.y,u=o[n]*i.z;r[s]=a+l+u>O.EPSILON6?1:0},sw=new d,p6=new d,_6=new d,aPe=new d;function y1(e,t,n,i,o,r,s,a,l,u,f,h,p,g,m,y){if(!c(r)&&!c(s)&&!c(a)&&!c(l)&&!c(u)&&g===0)return;let b=d.fromArray(o,e*3,sw),x=d.fromArray(o,t*3,p6),A=d.fromArray(o,n*3,_6),E=CT(i,b,x,A,aPe);if(c(E)){if(c(r)&&x1(e,t,n,E,r,h.normal.values,y,!0),c(u)){let S=d.fromArray(u,e*3,sw),v=d.fromArray(u,t*3,p6),P=d.fromArray(u,n*3,_6);d.multiplyByScalar(S,E.x,S),d.multiplyByScalar(v,E.y,v),d.multiplyByScalar(P,E.z,P);let M;!d.equals(S,d.ZERO)||!d.equals(v,d.ZERO)||!d.equals(P,d.ZERO)?(M=d.add(S,v,S),d.add(M,P,M),d.normalize(M,M)):(M=sw,M.x=0,M.y=0,M.z=0),d.pack(M,h.extrudeDirection.values,y*3)}if(c(f)&&sPe(e,t,n,E,f,h.applyOffset.values,y),c(s)&&x1(e,t,n,E,s,h.tangent.values,y,!0),c(a)&&x1(e,t,n,E,a,h.bitangent.values,y,!0),c(l)&&zJ(e,t,n,E,l,h.st.values,y),g>0)for(let S=0;S<g;S++){let v=p[S];cPe(e,t,n,E,y,m[v],h[v])}}}function cPe(e,t,n,i,o,r,s){let a=r.componentsPerAttribute,l=r.values,u=s.values;switch(a){case 4:rPe(e,t,n,i,l,u,o,!1);break;case 3:x1(e,t,n,i,l,u,o,!1);break;case 2:zJ(e,t,n,i,l,u,o,!1);break;default:u[o]=l[e]*i.x+l[t]*i.y+l[n]*i.z}}function Ih(e,t,n,i,o,r){let s=e.position.values.length/3;if(o!==-1){let a=i[o],l=n[a];return l===-1?(n[a]=s,e.position.values.push(r.x,r.y,r.z),t.push(s),s):(t.push(l),l)}return e.position.values.push(r.x,r.y,r.z),t.push(s),s}var lPe={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function FJ(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=c(n.normal)?n.normal.values:void 0,r=c(n.bitangent)?n.bitangent.values:void 0,s=c(n.tangent)?n.tangent.values:void 0,a=c(n.st)?n.st.values:void 0,l=c(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=c(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,h=[];for(let M in n)n.hasOwnProperty(M)&&!lPe[M]&&c(n[M])&&h.push(M);let p=h.length,g=DT(t),m=DT(t),y,b,x,A,E,S=[];S.length=i.length/3;let v=[];for(v.length=i.length/3,E=0;E<S.length;++E)S[E]=-1,v[E]=-1;let P=f.length;for(E=0;E<P;E+=3){let M=f[E],R=f[E+1],L=f[E+2],B=d.fromArray(i,M*3),_=d.fromArray(i,R*3),w=d.fromArray(i,L*3),D=oPe(B,_,w);if(c(D)&&D.positions.length>3){let I=D.positions,N=D.indices,k=N.length;for(let H=0;H<k;++H){let V=N[H],j=I[V];j.y<0?(y=m.attributes,b=m.indices,x=S):(y=g.attributes,b=g.indices,x=v),A=Ih(y,b,x,f,V<3?E+V:-1,j),y1(M,R,L,j,i,o,s,r,a,l,u,y,h,p,n,A)}}else c(D)&&(B=D.positions[0],_=D.positions[1],w=D.positions[2]),B.y<0?(y=m.attributes,b=m.indices,x=S):(y=g.attributes,b=g.indices,x=v),A=Ih(y,b,x,f,E,B),y1(M,R,L,B,i,o,s,r,a,l,u,y,h,p,n,A),A=Ih(y,b,x,f,E+1,_),y1(M,R,L,_,i,o,s,r,a,l,u,y,h,p,n,A),A=Ih(y,b,x,f,E+2,w),y1(M,R,L,w,i,o,s,r,a,l,u,y,h,p,n,A)}y6(e,m,g)}var HJ=sn.fromPointNormal(d.ZERO,d.UNIT_Y),uPe=new d,fPe=new d;function vT(e,t,n,i,o,r,s){if(!c(s))return;let a=d.fromArray(i,e*3,sw);d.equalsEpsilon(a,n,O.EPSILON10)?r.applyOffset.values[o]=s[e]:r.applyOffset.values[o]=s[t]}function BJ(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=c(n.applyOffset)?n.applyOffset.values:void 0,r=t.indices,s=DT(t),a=DT(t),l,u=r.length,f=[];f.length=i.length/3;let h=[];for(h.length=i.length/3,l=0;l<f.length;++l)f[l]=-1,h[l]=-1;for(l=0;l<u;l+=2){let p=r[l],g=r[l+1],m=d.fromArray(i,p*3,sw),y=d.fromArray(i,g*3,p6),b;Math.abs(m.y)<O.EPSILON6&&(m.y<0?m.y=-O.EPSILON6:m.y=O.EPSILON6),Math.abs(y.y)<O.EPSILON6&&(y.y<0?y.y=-O.EPSILON6:y.y=O.EPSILON6);let x=s.attributes,A=s.indices,E=h,S=a.attributes,v=a.indices,P=f,M=Qn.lineSegmentPlane(m,y,HJ,_6);if(c(M)){let R=d.multiplyByScalar(d.UNIT_Y,5*O.EPSILON9,uPe);m.y<0&&(d.negate(R,R),x=a.attributes,A=a.indices,E=f,S=s.attributes,v=s.indices,P=h);let L=d.add(M,R,fPe);b=Ih(x,A,E,r,l,m),vT(p,g,m,i,b,x,o),b=Ih(x,A,E,r,-1,L),vT(p,g,L,i,b,x,o),d.negate(R,R),d.add(M,R,L),b=Ih(S,v,P,r,-1,L),vT(p,g,L,i,b,S,o),b=Ih(S,v,P,r,l+1,y),vT(p,g,y,i,b,S,o)}else{let R,L,B;m.y<0?(R=a.attributes,L=a.indices,B=f):(R=s.attributes,L=s.indices,B=h),b=Ih(R,L,B,r,l,m),vT(p,g,m,i,b,R,o),b=Ih(R,L,B,r,l+1,y),vT(p,g,y,i,b,R,o)}}y6(e,a,s)}var kJ=new z,dPe=new z,GJ=new d,jJ=new d,g6=new d,hPe=new d,mPe=new d,pPe=new d,UJ=new se;function VJ(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,o=t.nextPosition.values,r=n.length;for(let s=0;s<r;s+=3){let a=d.unpack(n,s,GJ);if(a.x>0)continue;let l=d.unpack(i,s,jJ);(a.y<0&&l.y>0||a.y>0&&l.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):d.pack(a,i,s));let u=d.unpack(o,s,g6);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<r?(o[s]=n[s+3],o[s+1]=n[s+4],o[s+2]=n[s+5]):d.pack(a,o,s))}}var _Pe=5*O.EPSILON9,b1=O.EPSILON6;function gPe(e){let t=e.geometry,n=t.attributes,i=n.position.values,o=n.prevPosition.values,r=n.nextPosition.values,s=n.expandAndWidth.values,a=c(n.st)?n.st.values:void 0,l=c(n.color)?n.color.values:void 0,u=DT(t),f=DT(t),h,p,g,m=!1,y=i.length/3;for(h=0;h<y;h+=4){let b=h,x=h+2,A=d.fromArray(i,b*3,GJ),E=d.fromArray(i,x*3,jJ);if(Math.abs(A.y)<b1)for(A.y=b1*(E.y<0?-1:1),i[h*3+1]=A.y,i[(h+1)*3+1]=A.y,p=b*3;p<b*3+4*3;p+=3)o[p]=i[h*3],o[p+1]=i[h*3+1],o[p+2]=i[h*3+2];if(Math.abs(E.y)<b1)for(E.y=b1*(A.y<0?-1:1),i[(h+2)*3+1]=E.y,i[(h+3)*3+1]=E.y,p=b*3;p<b*3+4*3;p+=3)r[p]=i[(h+2)*3],r[p+1]=i[(h+2)*3+1],r[p+2]=i[(h+2)*3+2];let S=u.attributes,v=u.indices,P=f.attributes,M=f.indices,R=Qn.lineSegmentPlane(A,E,HJ,hPe);if(c(R)){m=!0;let L=d.multiplyByScalar(d.UNIT_Y,_Pe,mPe);A.y<0&&(d.negate(L,L),S=f.attributes,v=f.indices,P=u.attributes,M=u.indices);let B=d.add(R,L,pPe);S.position.values.push(A.x,A.y,A.z,A.x,A.y,A.z),S.position.values.push(B.x,B.y,B.z),S.position.values.push(B.x,B.y,B.z),S.prevPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),S.prevPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]),S.prevPosition.values.push(A.x,A.y,A.z,A.x,A.y,A.z),S.nextPosition.values.push(B.x,B.y,B.z),S.nextPosition.values.push(B.x,B.y,B.z),S.nextPosition.values.push(B.x,B.y,B.z),S.nextPosition.values.push(B.x,B.y,B.z),d.negate(L,L),d.add(R,L,B),P.position.values.push(B.x,B.y,B.z),P.position.values.push(B.x,B.y,B.z),P.position.values.push(E.x,E.y,E.z,E.x,E.y,E.z),P.prevPosition.values.push(B.x,B.y,B.z),P.prevPosition.values.push(B.x,B.y,B.z),P.prevPosition.values.push(B.x,B.y,B.z),P.prevPosition.values.push(B.x,B.y,B.z),P.nextPosition.values.push(E.x,E.y,E.z,E.x,E.y,E.z),P.nextPosition.values.push(r[x*3],r[x*3+1],r[x*3+2]),P.nextPosition.values.push(r[x*3+3],r[x*3+4],r[x*3+5]);let _=z.fromArray(s,b*2,kJ),w=Math.abs(_.y);S.expandAndWidth.values.push(-1,w,1,w),S.expandAndWidth.values.push(-1,-w,1,-w),P.expandAndWidth.values.push(-1,w,1,w),P.expandAndWidth.values.push(-1,-w,1,-w);let D=d.magnitudeSquared(d.subtract(R,A,g6));if(D/=d.magnitudeSquared(d.subtract(E,A,g6)),c(l)){let I=se.fromArray(l,b*4,UJ),N=se.fromArray(l,x*4,UJ),k=O.lerp(I.x,N.x,D),H=O.lerp(I.y,N.y,D),V=O.lerp(I.z,N.z,D),j=O.lerp(I.w,N.w,D);for(p=b*4;p<b*4+2*4;++p)S.color.values.push(l[p]);for(S.color.values.push(k,H,V,j),S.color.values.push(k,H,V,j),P.color.values.push(k,H,V,j),P.color.values.push(k,H,V,j),p=x*4;p<x*4+2*4;++p)P.color.values.push(l[p])}if(c(a)){let I=z.fromArray(a,b*2,kJ),N=z.fromArray(a,(h+3)*2,dPe),k=O.lerp(I.x,N.x,D);for(p=b*2;p<b*2+2*2;++p)S.st.values.push(a[p]);for(S.st.values.push(k,I.y),S.st.values.push(k,N.y),P.st.values.push(k,I.y),P.st.values.push(k,N.y),p=x*2;p<x*2+2*2;++p)P.st.values.push(a[p])}g=S.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3),g=P.position.values.length/3-4,M.push(g,g+2,g+1),M.push(g+1,g+2,g+3)}else{let L,B;for(A.y<0?(L=f.attributes,B=f.indices):(L=u.attributes,B=u.indices),L.position.values.push(A.x,A.y,A.z),L.position.values.push(A.x,A.y,A.z),L.position.values.push(E.x,E.y,E.z),L.position.values.push(E.x,E.y,E.z),p=h*3;p<h*3+4*3;++p)L.prevPosition.values.push(o[p]),L.nextPosition.values.push(r[p]);for(p=h*2;p<h*2+4*2;++p)L.expandAndWidth.values.push(s[p]),c(a)&&L.st.values.push(a[p]);if(c(l))for(p=h*4;p<h*4+4*4;++p)L.color.values.push(l[p]);g=L.position.values.length/3-4,B.push(g,g+2,g+1),B.push(g+1,g+2,g+3)}}m&&(VJ(f),VJ(u)),y6(e,f,u)}Ac.splitLongitude=function(e){if(!c(e))throw new C("instance is required.");let t=e.geometry,n=t.boundingSphere;if(c(n)&&(n.center.x-n.radius>0||le.intersectPlane(n,sn.ORIGIN_ZX_PLANE)!==Wt.INTERSECTING))return e;if(t.geometryType!==ld.NONE)switch(t.geometryType){case ld.POLYLINES:gPe(e);break;case ld.TRIANGLES:FJ(e);break;case ld.LINES:BJ(e);break}else nPe(t),t.primitiveType===Me.TRIANGLES?FJ(e):t.primitiveType===Me.LINES&&BJ(e);return e};var Nn=Ac;function aw(e,t,n,i,o,r,s,a,l,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=l,this._flipY=u,this._initialized=f}Object.defineProperties(aw.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});aw.prototype.copyFrom=function(e){T.defined("options",e);let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(T.defined("options.source",i),T.typeOf.number.greaterThanOrEquals("xOffset",t,0),T.typeOf.number.greaterThanOrEquals("yOffset",n,0),t+i.width>this._size)throw new C("xOffset + options.source.width must be less than or equal to width.");if(n+i.height>this._size)throw new C("yOffset + options.source.height must be less than or equal to height.");let{width:r,height:s}=i,a=this._context._gl,l=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(l,this._texture);let f=i.arrayBufferView,h=this._size,p=this._pixelFormat,g=this._internalFormat,m=this._pixelDatatype,y=this._preMultiplyAlpha,b=this._flipY,x=4;c(f)&&(x=ke.alignmentInBytes(p,m,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,x),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let A=!1;if(!this._initialized){let E;t===0&&n===0&&r===h&&s===h?(c(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=ke.flipY(f,p,m,h,h)),E=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),E=i),A=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),E=ke.createTypedArray(p,m,h,h)),a.texImage2D(u,0,g,h,h,0,p,Ue.toWebGLConstant(m,this._context),E),this._initialized=!0}A||(c(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),b&&(f=ke.flipY(f,p,m,r,s)),a.texSubImage2D(u,0,t,n,r,s,p,Ue.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,b),a.texSubImage2D(u,0,t,n,p,Ue.toWebGLConstant(m,this._context),i))),a.bindTexture(l,null)};aw.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){if(e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._size,r=r??this._size,T.typeOf.number.greaterThanOrEquals("xOffset",e,0),T.typeOf.number.greaterThanOrEquals("yOffset",t,0),T.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),T.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),e+o>this._size)throw new C("xOffset + source.width must be less than or equal to width.");if(t+r>this._size)throw new C("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===Ue.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};aw.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){if(e=e??0,t=t??0,n=n??this._size,i=i??this._size,o=o??0,T.typeOf.number.greaterThanOrEquals("xOffset",e,0),T.typeOf.number.greaterThanOrEquals("yOffset",t,0),e+n>this._size)throw new C("xOffset + source.width must be less than or equal to width.");if(t+i>this._size)throw new C("yOffset + source.height must be less than or equal to height.");if(this._pixelDatatype===Ue.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");let r=this._context._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(s,null),this._initialized=!0};var A1=aw;var C1={DONT_CARE:ne.DONT_CARE,FASTEST:ne.FASTEST,NICEST:ne.NICEST,validate:function(e){return e===C1.DONT_CARE||e===C1.FASTEST||e===C1.NICEST}},hd=Object.freeze(C1);var E1={NEAREST:ne.NEAREST,LINEAR:ne.LINEAR};E1.validate=function(e){return e===E1.NEAREST||e===E1.LINEAR};var ui=Object.freeze(E1);var j_={NEAREST:ne.NEAREST,LINEAR:ne.LINEAR,NEAREST_MIPMAP_NEAREST:ne.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ne.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ne.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ne.LINEAR_MIPMAP_LINEAR};j_.validate=function(e){return e===j_.NEAREST||e===j_.LINEAR||e===j_.NEAREST_MIPMAP_NEAREST||e===j_.LINEAR_MIPMAP_NEAREST||e===j_.NEAREST_MIPMAP_LINEAR||e===j_.LINEAR_MIPMAP_LINEAR};var Yt=Object.freeze(j_);var S1={CLAMP_TO_EDGE:ne.CLAMP_TO_EDGE,REPEAT:ne.REPEAT,MIRRORED_REPEAT:ne.MIRRORED_REPEAT,validate:function(e){return e===S1.CLAMP_TO_EDGE||e===S1.REPEAT||e===S1.MIRRORED_REPEAT}},gn=Object.freeze(S1);function cw(e){e=e??W.EMPTY_OBJECT;let{wrapS:t=gn.CLAMP_TO_EDGE,wrapT:n=gn.CLAMP_TO_EDGE,minificationFilter:i=Yt.LINEAR,magnificationFilter:o=ui.LINEAR,maximumAnisotropy:r=1}=e;if(!gn.validate(t))throw new C("Invalid sampler.wrapS.");if(!gn.validate(n))throw new C("Invalid sampler.wrapT.");if(!Yt.validate(i))throw new C("Invalid sampler.minificationFilter.");if(!ui.validate(o))throw new C("Invalid sampler.magnificationFilter.");T.typeOf.number.greaterThanOrEquals("maximumAnisotropy",r,1),this._wrapS=t,this._wrapT=n,this._minificationFilter=i,this._magnificationFilter=o,this._maximumAnisotropy=r}Object.defineProperties(cw.prototype,{wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});cw.equals=function(e,t){return e===t||c(e)&&c(t)&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};cw.NEAREST=Object.freeze(new cw({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.NEAREST,magnificationFilter:ui.NEAREST}));var Qt=cw;function yPe(e,t,n,i){let o=c(t.vertexBuffer),r=c(t.value),s=t.value?t.value.length:t.componentsPerAttribute;if(!o&&!r)throw new C("attribute must have a vertexBuffer or a value.");if(o&&r)throw new C("attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices.");if(s!==1&&s!==2&&s!==3&&s!==4)throw r?new C("attribute.value.length must be in the range [1, 4]."):new C("attribute.componentsPerAttribute must be in the range [1, 4].");if(c(t.componentDatatype)&&!$.validate(t.componentDatatype))throw new C("attribute must have a valid componentDatatype or not specify it.");if(c(t.strideInBytes)&&t.strideInBytes>255)throw new C("attribute must have a strideInBytes less than or equal to 255 or not specify it.");if(c(t.instanceDivisor)&&t.instanceDivisor>0&&!i.instancedArrays)throw new C("instanced arrays is not supported");if(c(t.instanceDivisor)&&t.instanceDivisor<0)throw new C("attribute must have an instanceDivisor greater than or equal to zero");if(c(t.instanceDivisor)&&r)throw new C("attribute cannot have have an instanceDivisor if it is not backed by a buffer");if(c(t.instanceDivisor)&&t.instanceDivisor>0&&t.index===0)throw new C("attribute zero cannot have an instanceDivisor greater than 0");let a={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:t.componentDatatype??$.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(o)a.vertexAttrib=function(l){let u=this.index;l.bindBuffer(l.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),l.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),l.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(l){l.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(l){l.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(l){l.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(l){l.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(l){l.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(l){}}e.push(a)}function qJ(e,t,n){for(let i=0;i<t.length;++i){let o=t[i];o.enabled&&o.vertexAttrib(e)}c(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function hp(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context),T.defined("options.attributes",e.attributes);let t=e.context,n=t._gl,i=e.attributes,o=e.indexBuffer,r,s=[],a=1,l=!1,u=!1,f=i.length;for(r=0;r<f;++r)yPe(s,i[r],r,t);for(f=s.length,r=0;r<f;++r){let g=s[r];if(c(g.vertexBuffer)&&g.instanceDivisor===0){let m=g.strideInBytes||g.componentsPerAttribute*$.getSizeInBytes(g.componentDatatype);a=g.vertexBuffer.sizeInBytes/m;break}}for(r=0;r<f;++r)s[r].instanceDivisor>0&&(l=!0),c(s[r].value)&&(u=!0);let h={};for(r=0;r<f;++r){let g=s[r].index;if(h[g])throw new C(`Index ${g} is used by more than one attribute.`);h[g]=!0}let p;t.vertexArrayObject&&(p=t.glCreateVertexArray(),t.glBindVertexArray(p),qJ(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=l,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=p,this._attributes=s,this._indexBuffer=o}function WJ(e){return e.values.length/e.componentsPerAttribute}function bPe(e){return $.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function xPe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&c(e[n])&&c(e[n].values)&&(o.push(n),e[n].componentDatatype===$.DOUBLE&&(e[n].componentDatatype=$.FLOAT,e[n].values=$.createTypedArray($.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=WJ(e[o[0]]),t=1;t<s;++t){let u=WJ(e[o[t]]);if(u!==r)throw new ae(`Each attribute list must have the same number of vertices. Attribute ${o[t]} has a different number of vertices (${u.toString()}) than attribute ${o[0]} (${r.toString()}).`)}o.sort(function(u,f){return $.getSizeInBytes(e[f].componentDatatype)-$.getSizeInBytes(e[u].componentDatatype)});let a=0,l={};for(t=0;t<s;++t)n=o[t],i=e[n],l[n]=a,a+=bPe(i);if(a>0){let u=$.getSizeInBytes(e[o[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let h=r*a,p=new ArrayBuffer(h),g={};for(t=0;t<s;++t){n=o[t];let m=$.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:$.createTypedArray(e[n].componentDatatype,p),index:l[n]/m,strideInComponentType:a/m}}for(t=0;t<r;++t)for(let m=0;m<s;++m){n=o[m],i=e[n];let y=i.values,b=g[n],x=b.pointer,A=i.componentsPerAttribute;for(let E=0;E<A;++E)x[b.index+E]=y[t*A+E];b.index+=b.strideInComponentType}return{buffer:p,offsetsInBytes:l,vertexSizeInBytes:a}}}hp.fromGeometry=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let t=e.context,n=e.geometry??W.EMPTY_OBJECT,i=e.bufferUsage??Be.DYNAMIC_DRAW,o=e.attributeLocations??W.EMPTY_OBJECT,r=e.interleave??!1,s=e.vertexArrayAttributes,a,l,u,f=c(s)?s:[],h=n.attributes;if(r){let m=xPe(h);if(c(m)){u=bt.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let y=m.offsetsInBytes,b=m.vertexSizeInBytes;for(a in h)h.hasOwnProperty(a)&&c(h[a])&&(l=h[a],c(l.values)?f.push({index:o[a],vertexBuffer:u,componentDatatype:l.componentDatatype,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize,offsetInBytes:y[a],strideInBytes:b}):f.push({index:o[a],value:l.value,componentDatatype:l.componentDatatype,normalize:l.normalize}))}}else for(a in h)if(h.hasOwnProperty(a)&&c(h[a])){l=h[a];let m=l.componentDatatype;m===$.DOUBLE&&(m=$.FLOAT),u=void 0,c(l.values)&&(u=bt.createVertexBuffer({context:t,typedArray:$.createTypedArray(m,l.values),usage:i})),f.push({index:o[a],vertexBuffer:u,value:l.value,componentDatatype:m,componentsPerAttribute:l.componentsPerAttribute,normalize:l.normalize})}let p,g=n.indices;return c(g)&&(ct.computeNumberOfVertices(n)>=O.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=bt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:Fe.UNSIGNED_INT}):p=bt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:Fe.UNSIGNED_SHORT})),new hp({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(hp.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});hp.prototype.getAttribute=function(e){return T.defined("index",e),this._attributes[e]};function TPe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=ut.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s<a;++s){let l=o[s];if(l.enabled){let u=l.instanceDivisor,f=l.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<r;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function APe(e,t){let n=e._attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];r.enabled&&c(r.value)&&r.vertexAttrib(t)}}hp.prototype._bind=function(){c(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&TPe(this),this._hasConstantAttributes&&APe(this,this._gl)):qJ(this._gl,this._attributes,this._indexBuffer)};hp.prototype._unBind=function(){if(c(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};hp.prototype.isDestroyed=function(){return!1};hp.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;c(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return c(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),c(this._vao)&&this._context.glDeleteVertexArray(this._vao),de(this)};var ni=hp;function bo(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let{context:t,source:n,pixelFormat:i=ke.RGBA,pixelDatatype:o=Ue.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Qt}=e,l=e.preMultiplyAlpha||i===ke.RGB||i===ke.LUMINANCE,{width:u,height:f}=e;if(c(n)){if(!Object.values(bo.FaceName).every(E=>c(n[E])))throw new C(`options.source requires faces ${Object.values(bo.FaceName).join(", ")}.`);({width:u,height:f}=n.positiveX);for(let E of bo.faceNames()){let S=n[E];if(Number(S.width)!==u||Number(S.height)!==f)throw new C("Each face in options.source must have the same width and height.")}}let h=u;if(!c(u)||!c(f))throw new C("options requires a source field to create an initialized cube map or width and height fields to create a blank cube map.");if(u!==f)throw new C("Width must equal height.");if(h<=0)throw new C("Width and height must be greater than zero.");if(h>ut.maximumCubeMapSize)throw new C(`Width and height must be less than or equal to the maximum cube map size (${ut.maximumCubeMapSize}). Check maximumCubeMapSize.`);if(!ke.validate(i))throw new C("Invalid options.pixelFormat.");if(ke.isDepthFormat(i))throw new C("options.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL.");if(!Ue.validate(o))throw new C("Invalid options.pixelDatatype.");if(o===Ue.FLOAT&&!t.floatingPointTexture)throw new C("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension.");if(o===Ue.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new C("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension.");let p=ke.textureSizeInBytes(i,o,h,h)*6,g=ke.toInternalFormat(i,o,t),m=t._gl,y=m.TEXTURE_CUBE_MAP,b=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=b,this._pixelFormat=i,this._pixelDatatype=o,this._size=h,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=l,this._flipY=r;let x=c(n);function A(E){return new A1(t,b,y,E,g,i,o,h,l,r,x)}this._positiveX=A(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=A(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=A(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=A(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=A(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=A(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,YJ(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(y,b),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let E of bo.faceNames())x6(this[E],n?.[E],0);m.bindTexture(y,null)}bo.prototype.copyFace=function(e,t,n,i){let o=e.context,r=new Wr({context:o,colorTextures:[t],destroyAttachments:!1});r._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),r._unBind(),r.destroy()};bo.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*CPe(){yield bo.FaceName.POSITIVEX,yield bo.FaceName.NEGATIVEX,yield bo.FaceName.POSITIVEY,yield bo.FaceName.NEGATIVEY,yield bo.FaceName.POSITIVEZ,yield bo.FaceName.NEGATIVEZ}bo.faceNames=function(){return CPe()};function x6(e,t,n){n=n??0;let i=e._targetFace,o=Math.max(Math.floor(e._size/2**n),1),r=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,l=e._flipY,u=e._preMultiplyAlpha,f=e._context,h=f._gl;if(!c(t)){h.texImage2D(i,n,a,o,o,0,r,Ue.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,g=4;c(p)&&(g=ke.alignmentInBytes(r,s,o)),h.pixelStorei(h.UNPACK_ALIGNMENT,g),c(p)?(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1),l&&(p=ke.flipY(p,r,s,o,o)),h.texImage2D(i,n,a,o,o,0,r,Ue.toWebGLConstant(s,f),p)):(h.pixelStorei(h.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,l),h.texImage2D(i,n,a,r,Ue.toWebGLConstant(s,f),t))}bo.loadFace=x6;Object.defineProperties(bo.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){YJ(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});bo.getDirection=function(e,t){switch(e){case bo.FaceName.POSITIVEX:return d.clone(d.UNIT_X,t);case bo.FaceName.NEGATIVEX:return d.negate(d.UNIT_X,t);case bo.FaceName.POSITIVEY:return d.clone(d.UNIT_Y,t);case bo.FaceName.NEGATIVEY:return d.negate(d.UNIT_Y,t);case bo.FaceName.POSITIVEZ:return d.clone(d.UNIT_Z,t);case bo.FaceName.NEGATIVEZ:return d.negate(d.UNIT_Z,t)}};function YJ(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Yt.NEAREST_MIPMAP_NEAREST,Yt.NEAREST_MIPMAP_LINEAR,Yt.LINEAR_MIPMAP_NEAREST,Yt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelDatatype;(s===Ue.FLOAT&&!r.textureFloatLinear||s===Ue.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Yt.NEAREST_MIPMAP_NEAREST:Yt.NEAREST,i=ui.NEAREST);let a=r._gl,l=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(l,e._texture),a.texParameteri(l,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(l,a.TEXTURE_MAG_FILTER,i),a.texParameteri(l,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(l,a.TEXTURE_WRAP_T,t.wrapT),c(e._textureFilterAnisotropic)&&a.texParameteri(l,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(l,null)}bo.prototype.loadMipmaps=function(e,t){if(T.defined("source",e),!Array.isArray(e))throw new C("source must be an array");let n=Math.log2(this._size);if(e.length!==n)throw new C("all mip levels must be defined");t=t??!1;let i=this._context._gl,o=this._texture,r=this._textureTarget;i.activeTexture(i.TEXTURE0),i.bindTexture(r,o),t?i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.NONE):i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,i.BROWSER_DEFAULT_WEBGL);for(let s=0;s<e.length;s++){let a=e[s],l=s+1;for(let u of bo.faceNames())x6(this[u],a[u],l)}i.bindTexture(r,null),this._hasMipmap=!0};bo.prototype.generateMipmap=function(e){if(e=e??hd.DONT_CARE,this._size>1&&!O.isPowerOfTwo(this._size))throw new C("width and height must be a power of two to call generateMipmap().");if(!hd.validate(e))throw new C("hint is invalid.");this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};bo.createVertexArray=function(e){let t=Za.createGeometry(Za.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY})),n=this._attributeLocations=Nn.createAttributeLocations(t);return ni.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Be.STATIC_DRAW})};bo.prototype.isDestroyed=function(){return!1};bo.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=de(this._positiveX),this._negativeX=de(this._negativeX),this._positiveY=de(this._positiveY),this._negativeY=de(this._negativeY),this._positiveZ=de(this._positiveZ),this._negativeZ=de(this._negativeZ),de(this)};var Go=bo;function EPe(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var Cc=EPe;var w1=`const float czm_degreesPerRadian = 57.29577951308232;
`;var v1=`const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0);
`;var D1=`const float czm_epsilon1 = 0.1;
`;var P1=`const float czm_epsilon2 = 0.01;
`;var I1=`const float czm_epsilon3 = 0.001;
`;var O1=`const float czm_epsilon4 = 0.0001;
`;var R1=`const float czm_epsilon5 = 0.00001;
`;var M1=`const float czm_epsilon6 = 0.000001;
`;var L1=`const float czm_epsilon7 = 0.0000001;
`;var N1=`const float czm_infinity = 5906376272000.0;
`;var F1=`const float czm_oneOverPi = 0.3183098861837907;
`;var B1=`const float czm_oneOverTwoPi = 0.15915494309189535;
`;var k1=`const float czm_passCesium3DTile = 4.0;
`;var U1=`const float czm_passCesium3DTileClassification = 5.0;
`;var V1=`const float czm_passCesium3DTileClassificationIgnoreShow = 6.0;
`;var z1=`const float czm_passClassification = 7.0;
`;var H1=`const float czm_passCompute = 1.0;
`;var G1=`const float czm_passEnvironment = 0.0;
`;var j1=`const float czm_passGlobe = 2.0;
`;var W1=`const float czm_passOpaque = 7.0;
`;var q1=`const float czm_passOverlay = 10.0;
`;var Y1=`const float czm_passTerrainClassification = 3.0;
`;var X1=`const float czm_passTranslucent = 8.0;
`;var K1=`const float czm_passVoxels = 9.0;
`;var $1=`const float czm_pi = 3.141592653589793;
`;var Z1=`const float czm_piOverFour = 0.7853981633974483;
`;var Q1=`const float czm_piOverSix = 0.5235987755982988;
`;var J1=`const float czm_piOverThree = 1.0471975511965976;
`;var eR=`const float czm_piOverTwo = 1.5707963267948966;
`;var tR=`const float czm_radiansPerDegree = 0.017453292519943295;
`;var nR=`const float czm_sceneMode2D = 2.0;
`;var iR=`const float czm_sceneMode3D = 3.0;
`;var oR=`const float czm_sceneModeColumbusView = 1.0;
`;var rR=`const float czm_sceneModeMorphing = 0.0;
`;var sR=`const float czm_solarRadius = 695500000.0;
`;var aR=`const float czm_threePiOver2 = 4.71238898038469;
`;var cR=`const float czm_twoPi = 6.283185307179586;
`;var lR=`const float czm_webMercatorMaxLatitude = 1.4844222297453324;
`;var uR=`struct czm_depthRangeStruct
{
float near;
float far;
};
`;var fR=`struct czm_material
{
vec3 diffuse;
float specular;
float shininess;
vec3 normal;
vec3 emission;
float alpha;
};
`;var dR=`struct czm_materialInput
{
float s;
vec2 st;
vec3 str;
vec3 normalEC;
mat3 tangentToEyeMatrix;
vec3 positionToEyeEC;
float height;
float slope;
float aspect;
float waterMask;
};
`;var hR=`struct czm_modelMaterial {
vec4 baseColor;
vec3 diffuse;
float alpha;
vec3 specular;
float roughness;
vec3 normalEC;
float occlusion;
vec3 emissive;
#ifdef USE_SPECULAR
float specularWeight;
#endif
#ifdef USE_ANISOTROPY
vec3 anisotropicT;
vec3 anisotropicB;
float anisotropyStrength;
#endif
#ifdef USE_CLEARCOAT
float clearcoatFactor;
float clearcoatRoughness;
vec3 clearcoatNormal;
#endif
};
`;var mR=`struct czm_modelVertexOutput {
vec3 positionMC;
float pointSize;
};
`;var pR=`struct czm_ray
{
vec3 origin;
vec3 direction;
};
`;var _R=`struct czm_raySegment
{
float start;
float stop;
};
const czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);
const czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);
`;var gR=`struct czm_shadowParameters
{
#ifdef USE_CUBE_MAP_SHADOW
vec3 texCoords;
#else
vec2 texCoords;
#endif
float depthBias;
float depth;
float nDotL;
vec2 texelStepSize;
float normalShadingSmooth;
float darkness;
};
`;var yR=`vec3 czm_acesTonemapping(vec3 color) {
float g = 0.985;
float a = 0.065;
float b = 0.0001;
float c = 0.433;
float d = 0.238;
color = (color * (color + a) - b) / (color * (g * color + c) + d);
color = clamp(color, 0.0, 1.0);
return color;
}
`;var bR=`float czm_alphaWeight(float a)
{
float z = (gl_FragCoord.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
return pow(a + 0.01, 4.0) + max(1e-2, min(3.0 * 1e3, 0.003 / (1e-5 + pow(abs(z) / 200.0, 4.0))));
}
`;var xR=`vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)
{
float val1 = clamp(dist / fuzzFactor, 0.0, 1.0);
float val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);
val1 = val1 * (1.0 - val2);
val1 = val1 * val1 * (3.0 - (2.0 * val1));
val1 = pow(val1, 0.5);
vec4 midColor = (color1 + color2) * 0.5;
return mix(midColor, currentColor, val1);
}
vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)
{
return czm_antialias(color1, color2, currentColor, dist, 0.1);
}
`;var TR=`vec3 czm_applyHSBShift(vec3 rgb, vec3 hsbShift, bool ignoreBlackPixels) {
vec3 hsb = czm_RGBToHSB(rgb);
hsb.x += hsbShift.x;
hsb.y = clamp(hsb.y + hsbShift.y, 0.0, 1.0);
if (ignoreBlackPixels) {
hsb.z = hsb.z > czm_epsilon7 ? hsb.z + hsbShift.z : 0.0;
} else {
hsb.z = hsb.z + hsbShift.z;
}
hsb.z = clamp(hsb.z, 0.0, 1.0);
return czm_HSBToRGB(hsb);
}
`;var AR=`vec2 czm_approximateSphericalCoordinates(vec3 normal) {
float latitudeApproximation = czm_fastApproximateAtan(sqrt(normal.x * normal.x + normal.y * normal.y), normal.z);
float longitudeApproximation = czm_fastApproximateAtan(normal.x, normal.y);
return vec2(latitudeApproximation, longitudeApproximation);
}
`;var CR=`float czm_approximateTanh(float x) {
float x2 = x * x;
return max(-1.0, min(1.0, x * (27.0 + x2) / (27.0 + 9.0 * x2)));
}
`;var ER=`bool czm_backFacing()
{
return gl_FrontFacing == false;
}
`;var SR=`float czm_branchFreeTernary(bool comparison, float a, float b) {
float useA = float(comparison);
return a * useA + b * (1.0 - useA);
}
vec2 czm_branchFreeTernary(bool comparison, vec2 a, vec2 b) {
float useA = float(comparison);
return a * useA + b * (1.0 - useA);
}
vec3 czm_branchFreeTernary(bool comparison, vec3 a, vec3 b) {
float useA = float(comparison);
return a * useA + b * (1.0 - useA);
}
vec4 czm_branchFreeTernary(bool comparison, vec4 a, vec4 b) {
float useA = float(comparison);
return a * useA + b * (1.0 - useA);
}
`;var wR=`vec4 czm_cascadeColor(vec4 weights)
{
return vec4(1.0, 0.0, 0.0, 1.0) * weights.x +
vec4(0.0, 1.0, 0.0, 1.0) * weights.y +
vec4(0.0, 0.0, 1.0, 1.0) * weights.z +
vec4(1.0, 0.0, 1.0, 1.0) * weights.w;
}
`;var vR=`uniform vec4 shadowMap_cascadeDistances;
float czm_cascadeDistance(vec4 weights)
{
return dot(shadowMap_cascadeDistances, weights);
}
`;var DR=`uniform mat4 shadowMap_cascadeMatrices[4];
mat4 czm_cascadeMatrix(vec4 weights)
{
return shadowMap_cascadeMatrices[0] * weights.x +
shadowMap_cascadeMatrices[1] * weights.y +
shadowMap_cascadeMatrices[2] * weights.z +
shadowMap_cascadeMatrices[3] * weights.w;
}
`;var PR=`uniform vec4 shadowMap_cascadeSplits[2];
vec4 czm_cascadeWeights(float depthEye)
{
vec4 near = step(shadowMap_cascadeSplits[0], vec4(depthEye));
vec4 far = step(depthEye, shadowMap_cascadeSplits[1]);
return near * far;
}
`;var IR=`float getSignedDistance(vec2 uv, highp sampler2D clippingDistance) {
float signedDistance = texture(clippingDistance, uv).r;
return (signedDistance - 0.5) * 2.0;
}
void czm_clipPolygons(highp sampler2D clippingDistance, int extentsLength, vec2 clippingPosition, int regionIndex) {
vec2 rectUv = clippingPosition;
if (regionIndex < 0 || rectUv.x <= 0.0 || rectUv.y <= 0.0 || rectUv.x >= 1.0 || rectUv.y >= 1.0) {
#ifdef CLIPPING_INVERSE
discard;
#endif
return;
}
vec2 clippingDistanceTextureDimensions = vec2(textureSize(clippingDistance, 0));
vec2 sampleOffset = max(1.0 / clippingDistanceTextureDimensions, vec2(0.005));
float dimension = float(extentsLength);
if (extentsLength > 2) {
dimension = ceil(log2(float(extentsLength)));
}
vec2 textureOffset = vec2(mod(float(regionIndex), dimension), floor(float(regionIndex) / dimension)) / dimension;
vec2 uv = textureOffset + rectUv / dimension;
float signedDistance = getSignedDistance(uv, clippingDistance);
#ifdef CLIPPING_INVERSE
if (signedDistance > 0.0) {
discard;
}
#else
if (signedDistance < 0.0) {
discard;
}
#endif
}
`;var OR=`vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)
{
vec3 p = mix(position2D.xyz, position3D.xyz, time);
return vec4(p, 1.0);
}
`;var RR=`vec4 czm_computeAtmosphereColor(
vec3 positionWC,
vec3 lightDirection,
vec3 rayleighColor,
vec3 mieColor,
float opacity
) {
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
float cosAngleSq = cosAngle * cosAngle;
float G = czm_atmosphereMieAnisotropy;
float GSq = G * G;
float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));
vec3 rayleigh = rayleighPhase * rayleighColor;
vec3 mie = miePhase * mieColor;
vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;
return vec4(color, opacity);
}
vec4 czm_computeAtmosphereColor(
czm_ray primaryRay,
vec3 lightDirection,
vec3 rayleighColor,
vec3 mieColor,
float opacity
) {
vec3 direction = normalize(primaryRay.direction);
float cosAngle = dot(direction, lightDirection);
float cosAngleSq = cosAngle * cosAngle;
float G = czm_atmosphereMieAnisotropy;
float GSq = G * G;
float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));
vec3 rayleigh = rayleighPhase * rayleighColor;
vec3 mie = miePhase * mieColor;
vec3 color = (rayleigh + mie) * czm_atmosphereLightIntensity;
return vec4(color, opacity);
}
`;var MR=`void czm_computeGroundAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
float atmosphereInnerRadius = length(positionWC);
czm_computeScattering(
primaryRay,
length(cameraToPositionWC),
lightDirection,
atmosphereInnerRadius,
rayleighColor,
mieColor,
opacity
);
}
`;var LR=`vec4 czm_computePosition();
`;var NR=`void czm_computeScattering(
czm_ray primaryRay,
float primaryRayLength,
vec3 lightDirection,
float atmosphereInnerRadius,
out vec3 rayleighColor,
out vec3 mieColor,
out float opacity
) {
const float ATMOSPHERE_THICKNESS = 111e3;
const int PRIMARY_STEPS_MAX = 16;
const int LIGHT_STEPS_MAX = 4;
rayleighColor = vec3(0.0);
mieColor = vec3(0.0);
opacity = 0.0;
float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
vec3 origin = vec3(0.0);
czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);
if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
return;
}
float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));
float start_0 = primaryRayAtmosphereIntersect.start;
primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));
float x_o_a = start_0 - ATMOSPHERE_THICKNESS;
float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));
int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0);
int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0);
float rayPositionLength = primaryRayAtmosphereIntersect.start;
float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));
vec3 rayleighAccumulation = vec3(0.0);
vec3 mieAccumulation = vec3(0.0);
vec2 opticalDepth = vec2(0.0);
vec2 heightScale = vec2(czm_atmosphereRayleighScaleHeight, czm_atmosphereMieScaleHeight);
for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {
if (i >= PRIMARY_STEPS) {
break;
}
vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);
float sampleHeight = length(samplePosition) - atmosphereInnerRadius;
vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
opticalDepth += sampleDensity;
czm_ray lightRay = czm_ray(samplePosition, lightDirection);
czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);
float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
float lightPositionLength = 0.0;
vec2 lightOpticalDepth = vec2(0.0);
for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {
if (j >= LIGHT_STEPS) {
break;
}
vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);
float lightHeight = length(lightPosition) - atmosphereInnerRadius;
lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;
lightPositionLength += lightStepLength;
}
vec3 attenuation = exp(-((czm_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (czm_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));
rayleighAccumulation += sampleDensity.x * attenuation;
mieAccumulation += sampleDensity.y * attenuation;
rayPositionLength += (rayStepLength += rayStepLengthIncrease);
}
rayleighColor = czm_atmosphereRayleighCoefficient * rayleighAccumulation;
mieColor = czm_atmosphereMieCoefficient * mieAccumulation;
opacity = length(exp(-((czm_atmosphereMieCoefficient * opticalDepth.y) + (czm_atmosphereRayleighCoefficient * opticalDepth.x))));
}
`;var FR=`vec2 cordic(float angle)
{
vec2 vector = vec2(6.0725293500888267e-1, 0.0);
float sense = (angle < 0.0) ? -1.0 : 1.0;
mat2 rotation = mat2(1.0, sense, -sense, 1.0);
vector = rotation * vector;
angle -= sense * 7.8539816339744828e-1;
sense = (angle < 0.0) ? -1.0 : 1.0;
float factor = sense * 5.0e-1;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 4.6364760900080609e-1;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 2.5e-1;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 2.4497866312686414e-1;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.25e-1;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.2435499454676144e-1;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 6.25e-2;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 6.2418809995957350e-2;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 3.125e-2;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 3.1239833430268277e-2;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.5625e-2;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.5623728620476831e-2;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 7.8125e-3;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 7.8123410601011111e-3;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 3.90625e-3;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 3.9062301319669718e-3;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.953125e-3;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.9531225164788188e-3;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 9.765625e-4;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 9.7656218955931946e-4;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 4.8828125e-4;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 4.8828121119489829e-4;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 2.44140625e-4;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 2.4414062014936177e-4;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.220703125e-4;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.2207031189367021e-4;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 6.103515625e-5;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 6.1035156174208773e-5;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 3.0517578125e-5;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 3.0517578115526096e-5;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.52587890625e-5;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.5258789061315762e-5;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 7.62939453125e-6;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 7.6293945311019700e-6;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 3.814697265625e-6;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 3.8146972656064961e-6;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.9073486328125e-6;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 1.9073486328101870e-6;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 9.5367431640625e-7;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 9.5367431640596084e-7;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 4.76837158203125e-7;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 4.7683715820308884e-7;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 2.384185791015625e-7;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
angle -= sense * 2.3841857910155797e-7;
sense = (angle < 0.0) ? -1.0 : 1.0;
factor = sense * 1.1920928955078125e-7;
rotation[0][1] = factor;
rotation[1][0] = -factor;
vector = rotation * vector;
return vector;
}
vec2 czm_cosineAndSine(float angle)
{
if (angle < -czm_piOverTwo || angle > czm_piOverTwo)
{
if (angle < 0.0)
{
return -cordic(angle + czm_pi);
}
else
{
return -cordic(angle - czm_pi);
}
}
else
{
return cordic(angle);
}
}
`;var BR=`vec2 czm_decompressTextureCoordinates(float encoded)
{
float temp = encoded / 4096.0;
float xZeroTo4095 = floor(temp);
float stx = xZeroTo4095 / 4095.0;
float sty = (encoded - xZeroTo4095 * 4096.0) / 4095.0;
return vec2(stx, sty);
}
`;var kR=`#if (__VERSION__ == 300 || defined(GL_EXT_frag_depth)) && !defined(LOG_DEPTH)
out float v_WindowZ;
#endif
vec4 czm_depthClamp(vec4 coords)
{
#ifndef LOG_DEPTH
#if __VERSION__ == 300 || defined(GL_EXT_frag_depth)
v_WindowZ = (0.5 * (coords.z / coords.w) + 0.5) * coords.w;
coords.z = 0.0;
#else
coords.z = min(coords.z, coords.w);
#endif
#endif
return coords;
}
`;var UR=`mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)
{
vec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));
vec3 tangentEC = normalize(czm_normal3D * tangentMC);
vec3 bitangentEC = normalize(cross(normalEC, tangentEC));
return mat3(
tangentEC.x, tangentEC.y, tangentEC.z,
bitangentEC.x, bitangentEC.y, bitangentEC.z,
normalEC.x, normalEC.y, normalEC.z);
}
`;var VR=`bool czm_ellipsoidContainsPoint(vec3 ellipsoid_inverseRadii, vec3 point)
{
vec3 scaled = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;
return (dot(scaled, scaled) <= 1.0);
}
`;var zR=`vec2 czm_ellipsoidTextureCoordinates(vec3 normal)
{
return vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);
}
`;var HR=`bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {
return all(lessThanEqual(abs(left - right), vec4(epsilon)));
}
bool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {
return all(lessThanEqual(abs(left - right), vec3(epsilon)));
}
bool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {
return all(lessThanEqual(abs(left - right), vec2(epsilon)));
}
bool czm_equalsEpsilon(float left, float right, float epsilon) {
return (abs(left - right) <= epsilon);
}
`;var GR=`vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)
{
vec4 p = positionEC;
vec4 zEyeOffset = normalize(p) * eyeOffset.z;
p.xy += eyeOffset.xy + zEyeOffset.xy;
p.z += zEyeOffset.z;
return p;
}
`;var jR=`vec4 czm_eyeToWindowCoordinates(vec4 positionEC)
{
vec4 q = czm_projection * positionEC;
q.xyz /= q.w;
q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;
return q;
}
`;var WR=`float czm_fastApproximateAtan(float x) {
return x * (-0.1784 * x - 0.0663 * x * x + 1.0301);
}
float czm_fastApproximateAtan(float x, float y) {
float t = abs(x);
float opposite = abs(y);
float adjacent = max(t, opposite);
opposite = min(t, opposite);
t = czm_fastApproximateAtan(opposite / adjacent);
t = czm_branchFreeTernary(abs(y) > abs(x), czm_piOverTwo - t, t);
t = czm_branchFreeTernary(x < 0.0, czm_pi - t, t);
t = czm_branchFreeTernary(y < 0.0, -t, t);
return t;
}
`;var qR=`vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor)
{
float scalar = distanceToCamera * czm_fogDensity;
float fog = 1.0 - exp(-(scalar * scalar));
return mix(color, fogColor, fog);
}
vec3 czm_fog(float distanceToCamera, vec3 color, vec3 fogColor, float fogModifierConstant)
{
float scalar = distanceToCamera * czm_fogDensity;
float fog = 1.0 - exp(-((fogModifierConstant * scalar + fogModifierConstant) * (scalar * (1.0 + fogModifierConstant))));
return mix(color, fogColor, fog);
}
`;var YR=`vec3 czm_gammaCorrect(vec3 color) {
#ifdef HDR
color = pow(color, vec3(czm_gamma));
#endif
return color;
}
vec4 czm_gammaCorrect(vec4 color) {
#ifdef HDR
color.rgb = pow(color.rgb, vec3(czm_gamma));
#endif
return color;
}
`;var XR=`vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)
{
return normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);
}
`;var KR=`czm_material czm_getDefaultMaterial(czm_materialInput materialInput)
{
czm_material material;
material.diffuse = vec3(0.0);
material.specular = 0.0;
material.shininess = 1.0;
material.normal = materialInput.normalEC;
material.emission = vec3(0.0);
material.alpha = 1.0;
return material;
}
`;var $R=`vec3 czm_getDynamicAtmosphereLightDirection(vec3 positionWC, float lightEnum) {
const float NONE = 0.0;
const float SCENE_LIGHT = 1.0;
const float SUNLIGHT = 2.0;
vec3 lightDirection =
positionWC * float(lightEnum == NONE) +
czm_lightDirectionWC * float(lightEnum == SCENE_LIGHT) +
czm_sunDirectionWC * float(lightEnum == SUNLIGHT);
return normalize(lightDirection);
}
`;var ZR=`float czm_getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)
{
return max(dot(lightDirectionEC, normalEC), 0.0);
}
`;var QR=`float czm_getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)
{
vec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);
float specular = max(dot(toReflectedLight, toEyeEC), 0.0);
return pow(specular, max(shininess, czm_epsilon2));
}
`;var JR=`vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)
{
float cosAngle = cos(angleInRadians);
float sinAngle = sin(angleInRadians);
vec2 s0 = vec2(1.0/17.0, 0.0);
vec2 s1 = vec2(-1.0/29.0, 0.0);
vec2 s2 = vec2(1.0/101.0, 1.0/59.0);
vec2 s3 = vec2(-1.0/109.0, -1.0/57.0);
s0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));
s1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));
s2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));
s3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));
vec2 uv0 = (uv/103.0) + (time * s0);
vec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);
vec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);
vec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);
uv0 = fract(uv0);
uv1 = fract(uv1);
uv2 = fract(uv2);
uv3 = fract(uv3);
vec4 noise = (texture(normalMap, uv0)) +
(texture(normalMap, uv1)) +
(texture(normalMap, uv2)) +
(texture(normalMap, uv3));
return ((noise / 4.0) - 0.5) * 2.0;
}
`;var eM=`const vec4 K_HSB2RGB = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
vec3 czm_HSBToRGB(vec3 hsb)
{
vec3 p = abs(fract(hsb.xxx + K_HSB2RGB.xyz) * 6.0 - K_HSB2RGB.www);
return hsb.z * mix(K_HSB2RGB.xxx, clamp(p - K_HSB2RGB.xxx, 0.0, 1.0), hsb.y);
}
`;var tM=`vec3 hueToRGB(float hue)
{
float r = abs(hue * 6.0 - 3.0) - 1.0;
float g = 2.0 - abs(hue * 6.0 - 2.0);
float b = 2.0 - abs(hue * 6.0 - 4.0);
return clamp(vec3(r, g, b), 0.0, 1.0);
}
vec3 czm_HSLToRGB(vec3 hsl)
{
vec3 rgb = hueToRGB(hsl.x);
float c = (1.0 - abs(2.0 * hsl.z - 1.0)) * hsl.y;
return (rgb - 0.5) * c + hsl.z;
}
`;var nM=`vec3 czm_hue(vec3 rgb, float adjustment)
{
const mat3 toYIQ = mat3(0.299, 0.587, 0.114,
0.595716, -0.274453, -0.321263,
0.211456, -0.522591, 0.311135);
const mat3 toRGB = mat3(1.0, 0.9563, 0.6210,
1.0, -0.2721, -0.6474,
1.0, -1.107, 1.7046);
vec3 yiq = toYIQ * rgb;
float hue = atan(yiq.z, yiq.y) + adjustment;
float chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);
vec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));
return toRGB * color;
}
`;var iM=`vec3 czm_inverseGamma(vec3 color) {
return pow(color, vec3(1.0 / czm_gamma));
}
`;var oM=`bool czm_isEmpty(czm_raySegment interval)
{
return (interval.stop < 0.0);
}
`;var rM=`bool czm_isFull(czm_raySegment interval)
{
return (interval.start == 0.0 && interval.stop == czm_infinity);
}
`;var sM=`float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorY, float oneOverMercatorHeight)
{
float sinLatitude = sin(latitude);
float mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));
return (mercatorY - southMercatorY) * oneOverMercatorHeight;
}
`;var aM=`vec3 czm_linearToSrgb(vec3 linearIn)
{
return pow(linearIn, vec3(1.0/2.2));
}
vec4 czm_linearToSrgb(vec4 linearIn)
{
vec3 srgbOut = pow(linearIn.rgb, vec3(1.0/2.2));
return vec4(srgbOut, linearIn.a);
}
`;var cM=`float czm_lineDistance(vec2 point1, vec2 point2, vec2 point) {
return abs((point2.y - point1.y) * point.x - (point2.x - point1.x) * point.y + point2.x * point1.y - point2.y * point1.x) / distance(point2, point1);
}
`;var lM=`float czm_luminance(vec3 rgb)
{
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
return dot(rgb, W);
}
`;var uM=`float czm_maximumComponent(vec2 v)
{
return max(v.x, v.y);
}
float czm_maximumComponent(vec3 v)
{
return max(max(v.x, v.y), v.z);
}
float czm_maximumComponent(vec4 v)
{
return max(max(max(v.x, v.y), v.z), v.w);
}
`;var fM=`float czm_metersPerPixel(vec4 positionEC, float pixelRatio)
{
float width = czm_viewport.z;
float height = czm_viewport.w;
float pixelWidth;
float pixelHeight;
float top = czm_frustumPlanes.x;
float bottom = czm_frustumPlanes.y;
float left = czm_frustumPlanes.z;
float right = czm_frustumPlanes.w;
if (czm_sceneMode == czm_sceneMode2D || czm_orthographicIn3D == 1.0)
{
float frustumWidth = right - left;
float frustumHeight = top - bottom;
pixelWidth = frustumWidth / width;
pixelHeight = frustumHeight / height;
}
else
{
float distanceToPixel = -positionEC.z;
float inverseNear = 1.0 / czm_currentFrustum.x;
float tanTheta = top * inverseNear;
pixelHeight = 2.0 * distanceToPixel * tanTheta / height;
tanTheta = right * inverseNear;
pixelWidth = 2.0 * distanceToPixel * tanTheta / width;
}
return max(pixelWidth, pixelHeight) * pixelRatio;
}
float czm_metersPerPixel(vec4 positionEC)
{
return czm_metersPerPixel(positionEC, czm_pixelRatio);
}
`;var dM=`vec4 czm_modelToWindowCoordinates(vec4 position)
{
vec4 q = czm_modelViewProjection * position;
q.xyz /= q.w;
q.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;
return q;
}
`;var hM=`vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)
{
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
vec3 target = left * right;
float leftLuminance = dot(left, W);
float rightLuminance = dot(right, W);
float targetLuminance = dot(target, W);
return ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;
}
`;var mM=`float czm_nearFarScalar(vec4 nearFarScalar, float cameraDistSq)
{
float valueAtMin = nearFarScalar.y;
float valueAtMax = nearFarScalar.w;
float nearDistanceSq = nearFarScalar.x * nearFarScalar.x;
float farDistanceSq = nearFarScalar.z * nearFarScalar.z;
float t = (cameraDistSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);
t = pow(clamp(t, 0.0, 1.0), 0.2);
return mix(valueAtMin, valueAtMax, t);
}
`;var pM=`vec3 czm_octDecode(vec2 encoded, float range)
{
if (encoded.x == 0.0 && encoded.y == 0.0) {
return vec3(0.0, 0.0, 0.0);
}
encoded = encoded / range * 2.0 - 1.0;
vec3 v = vec3(encoded.x, encoded.y, 1.0 - abs(encoded.x) - abs(encoded.y));
if (v.z < 0.0)
{
v.xy = (1.0 - abs(v.yx)) * czm_signNotZero(v.xy);
}
return normalize(v);
}
vec3 czm_octDecode(vec2 encoded)
{
return czm_octDecode(encoded, 255.0);
}
vec3 czm_octDecode(float encoded)
{
float temp = encoded / 256.0;
float x = floor(temp);
float y = (temp - x) * 256.0;
return czm_octDecode(vec2(x, y));
}
void czm_octDecode(vec2 encoded, out vec3 vector1, out vec3 vector2, out vec3 vector3)
{
float temp = encoded.x / 65536.0;
float x = floor(temp);
float encodedFloat1 = (temp - x) * 65536.0;
temp = encoded.y / 65536.0;
float y = floor(temp);
float encodedFloat2 = (temp - y) * 65536.0;
vector1 = czm_octDecode(encodedFloat1);
vector2 = czm_octDecode(encodedFloat2);
vector3 = czm_octDecode(vec2(x, y));
}
`;var _M=`vec4 czm_packDepth(float depth)
{
vec4 enc = vec4(1.0, 255.0, 65025.0, 16581375.0) * depth;
enc = fract(enc);
enc -= enc.yzww * vec4(1.0 / 255.0, 1.0 / 255.0, 1.0 / 255.0, 0.0);
return enc;
}
`;var gM=`vec3 lambertianDiffuse(vec3 diffuseColor)
{
return diffuseColor / czm_pi;
}
vec3 fresnelSchlick2(vec3 f0, vec3 f90, float VdotH)
{
float versine = 1.0 - VdotH;
float versineSquared = versine * versine;
return f0 + (f90 - f0) * versineSquared * versineSquared * versine;
}
#ifdef USE_ANISOTROPY
float smithVisibilityGGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 lightDirection, vec3 viewDirection)
{
vec3 roughnessScale = vec3(tangentialRoughness, bitangentRoughness, 1.0);
float GGXV = lightDirection.z * length(roughnessScale * viewDirection);
float GGXL = viewDirection.z * length(roughnessScale * lightDirection);
float v = 0.5 / (GGXV + GGXL);
return clamp(v, 0.0, 1.0);
}
float GGX_anisotropic(float bitangentRoughness, float tangentialRoughness, vec3 halfwayDirection)
{
float roughnessSquared = bitangentRoughness * tangentialRoughness;
vec3 f = halfwayDirection * vec3(bitangentRoughness, tangentialRoughness, roughnessSquared);
float w2 = roughnessSquared / dot(f, f);
return roughnessSquared * w2 * w2 / czm_pi;
}
#endif
float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV)
{
float alphaRoughnessSq = alphaRoughness * alphaRoughness;
float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
float GGX = GGXV + GGXL;
if (GGX > 0.0)
{
return 0.5 / GGX;
}
return 0.0;
}
float GGX(float alphaRoughness, float NdotH)
{
float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
float f = (NdotH * alphaRoughnessSquared - NdotH) * NdotH + 1.0;
return alphaRoughnessSquared / (czm_pi * f * f);
}
float computeDirectSpecularStrength(vec3 normal, vec3 lightDirection, vec3 viewDirection, vec3 halfwayDirection, float alphaRoughness)
{
float NdotL = clamp(dot(normal, lightDirection), 0.0, 1.0);
float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV);
float NdotH = clamp(dot(normal, halfwayDirection), 0.0, 1.0);
float D = GGX(alphaRoughness, NdotH);
return G * D;
}
vec3 czm_pbrLighting(vec3 viewDirectionEC, vec3 normalEC, vec3 lightDirectionEC, czm_modelMaterial material)
{
vec3 halfwayDirectionEC = normalize(viewDirectionEC + lightDirectionEC);
float VdotH = clamp(dot(viewDirectionEC, halfwayDirectionEC), 0.0, 1.0);
float NdotL = clamp(dot(normalEC, lightDirectionEC), 0.001, 1.0);
vec3 f0 = material.specular;
float reflectance = czm_maximumComponent(f0);
vec3 f90 = vec3(clamp(reflectance * 25.0, 0.0, 1.0));
vec3 F = fresnelSchlick2(f0, f90, VdotH);
#if defined(USE_SPECULAR)
F *= material.specularWeight;
#endif
float alphaRoughness = material.roughness * material.roughness;
#ifdef USE_ANISOTROPY
mat3 tbn = mat3(material.anisotropicT, material.anisotropicB, normalEC);
vec3 lightDirection = lightDirectionEC * tbn;
vec3 viewDirection = viewDirectionEC * tbn;
vec3 halfwayDirection = halfwayDirectionEC * tbn;
float anisotropyStrength = material.anisotropyStrength;
float tangentialRoughness = mix(alphaRoughness, 1.0, anisotropyStrength * anisotropyStrength);
float bitangentRoughness = clamp(alphaRoughness, 0.001, 1.0);
float G = smithVisibilityGGX_anisotropic(bitangentRoughness, tangentialRoughness, lightDirection, viewDirection);
float D = GGX_anisotropic(bitangentRoughness, tangentialRoughness, halfwayDirection);
vec3 specularContribution = F * G * D;
#else
float specularStrength = computeDirectSpecularStrength(normalEC, lightDirectionEC, viewDirectionEC, halfwayDirectionEC, alphaRoughness);
vec3 specularContribution = F * specularStrength;
#endif
vec3 diffuseColor = material.diffuse;
vec3 diffuseContribution = (1.0 - F) * lambertianDiffuse(diffuseColor);
return (diffuseContribution + specularContribution) * NdotL;
}
`;var yM=`vec3 czm_pbrNeutralTonemapping(vec3 color) {
const float startCompression = 0.8 - 0.04;
const float desaturation = 0.15;
float x = min(color.r, min(color.g, color.b));
float offset = czm_branchFreeTernary(x < 0.08, x - 6.25 * x * x, 0.04);
color -= offset;
float peak = max(color.r, max(color.g, color.b));
if (peak < startCompression) return color;
const float d = 1.0 - startCompression;
float newPeak = 1.0 - d * d / (peak + d - startCompression);
color *= newPeak / peak;
float g = 1.0 - 1.0 / (desaturation * (peak - newPeak) + 1.0);
return mix(color, newPeak * vec3(1.0, 1.0, 1.0), g);
}
`;var bM=`float czm_private_getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)
{
return czm_getLambertDiffuse(lightDirectionEC, material.normal);
}
float czm_private_getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)
{
return czm_getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);
}
vec4 czm_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
float diffuse = czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material);
if (czm_sceneMode == czm_sceneMode3D) {
diffuse += czm_private_getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);
}
float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);
vec3 materialDiffuse = material.diffuse * 0.5;
vec3 ambient = materialDiffuse;
vec3 color = ambient + material.emission;
color += materialDiffuse * diffuse * czm_lightColor;
color += material.specular * specular * czm_lightColor;
return vec4(color, material.alpha);
}
vec4 czm_private_phong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
float diffuse = czm_private_getLambertDiffuseOfMaterial(lightDirectionEC, material);
float specular = czm_private_getSpecularOfMaterial(lightDirectionEC, toEye, material);
vec3 ambient = vec3(0.0);
vec3 color = ambient + material.emission;
color += material.diffuse * diffuse * czm_lightColor;
color += material.specular * specular * czm_lightColor;
return vec4(color, material.alpha);
}
`;var xM=`float czm_planeDistance(vec4 plane, vec3 point) {
return (dot(plane.xyz, point) + plane.w);
}
float czm_planeDistance(vec3 planeNormal, float planeDistance, vec3 point) {
return (dot(planeNormal, point) + planeDistance);
}
`;var TM=`vec3 czm_pointAlongRay(czm_ray ray, float time)
{
return ray.origin + (time * ray.direction);
}
`;var AM=`czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, vec3 ellipsoid_center, vec3 ellipsoid_inverseRadii)
{
vec3 q = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;
vec3 w = ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;
q = q - ellipsoid_inverseRadii * (czm_inverseModelView * vec4(ellipsoid_center, 1.0)).xyz;
float q2 = dot(q, q);
float qw = dot(q, w);
if (q2 > 1.0)
{
if (qw >= 0.0)
{
return czm_emptyRaySegment;
}
else
{
float qw2 = qw * qw;
float difference = q2 - 1.0;
float w2 = dot(w, w);
float product = w2 * difference;
if (qw2 < product)
{
return czm_emptyRaySegment;
}
else if (qw2 > product)
{
float discriminant = qw * qw - product;
float temp = -qw + sqrt(discriminant);
float root0 = temp / w2;
float root1 = difference / temp;
if (root0 < root1)
{
czm_raySegment i = czm_raySegment(root0, root1);
return i;
}
else
{
czm_raySegment i = czm_raySegment(root1, root0);
return i;
}
}
else
{
float root = sqrt(difference / w2);
czm_raySegment i = czm_raySegment(root, root);
return i;
}
}
}
else if (q2 < 1.0)
{
float difference = q2 - 1.0;
float w2 = dot(w, w);
float product = w2 * difference;
float discriminant = qw * qw - product;
float temp = -qw + sqrt(discriminant);
czm_raySegment i = czm_raySegment(0.0, temp / w2);
return i;
}
else
{
if (qw < 0.0)
{
float w2 = dot(w, w);
czm_raySegment i = czm_raySegment(0.0, -qw / w2);
return i;
}
else
{
return czm_emptyRaySegment;
}
}
}
`;var CM=`czm_raySegment czm_raySphereIntersectionInterval(czm_ray ray, vec3 center, float radius)
{
vec3 o = ray.origin;
vec3 d = ray.direction;
vec3 oc = o - center;
float a = dot(d, d);
float b = 2.0 * dot(d, oc);
float c = dot(oc, oc) - (radius * radius);
float det = (b * b) - (4.0 * a * c);
if (det < 0.0) {
return czm_emptyRaySegment;
}
float sqrtDet = sqrt(det);
float t0 = (-b - sqrtDet) / (2.0 * a);
float t1 = (-b + sqrtDet) / (2.0 * a);
czm_raySegment result = czm_raySegment(t0, t1);
return result;
}
`;var EM=`float czm_readDepth(sampler2D depthTexture, vec2 texCoords)
{
return czm_reverseLogDepth(texture(depthTexture, texCoords).r);
}
`;var SM=`float czm_readNonPerspective(float value, float oneOverW) {
return value * oneOverW;
}
vec2 czm_readNonPerspective(vec2 value, float oneOverW) {
return value * oneOverW;
}
vec3 czm_readNonPerspective(vec3 value, float oneOverW) {
return value * oneOverW;
}
vec4 czm_readNonPerspective(vec4 value, float oneOverW) {
return value * oneOverW;
}
`;var wM=`float czm_reverseLogDepth(float logZ)
{
#ifdef LOG_DEPTH
float near = czm_currentFrustum.x;
float far = czm_currentFrustum.y;
float log2Depth = logZ * czm_log2FarDepthFromNearPlusOne;
float depthFromNear = exp2(log2Depth) - 1.0;
return far * (1.0 - near / (depthFromNear + near)) / (far - near);
#endif
return logZ;
}
`;var vM=`const vec4 K_RGB2HSB = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
vec3 czm_RGBToHSB(vec3 rgb)
{
vec4 p = mix(vec4(rgb.bg, K_RGB2HSB.wz), vec4(rgb.gb, K_RGB2HSB.xy), step(rgb.b, rgb.g));
vec4 q = mix(vec4(p.xyw, rgb.r), vec4(rgb.r, p.yzx), step(p.x, rgb.r));
float d = q.x - min(q.w, q.y);
return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + czm_epsilon7)), d / (q.x + czm_epsilon7), q.x);
}
`;var DM=`vec3 RGBtoHCV(vec3 rgb)
{
vec4 p = (rgb.g < rgb.b) ? vec4(rgb.bg, -1.0, 2.0 / 3.0) : vec4(rgb.gb, 0.0, -1.0 / 3.0);
vec4 q = (rgb.r < p.x) ? vec4(p.xyw, rgb.r) : vec4(rgb.r, p.yzx);
float c = q.x - min(q.w, q.y);
float h = abs((q.w - q.y) / (6.0 * c + czm_epsilon7) + q.z);
return vec3(h, c, q.x);
}
vec3 czm_RGBToHSL(vec3 rgb)
{
vec3 hcv = RGBtoHCV(rgb);
float l = hcv.z - hcv.y * 0.5;
float s = hcv.y / (1.0 - abs(l * 2.0 - 1.0) + czm_epsilon7);
return vec3(hcv.x, s, l);
}
`;var PM=`vec3 czm_RGBToXYZ(vec3 rgb)
{
const mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,
0.3576, 0.7152, 0.1192,
0.1805, 0.0722, 0.9505);
vec3 xyz = RGB2XYZ * rgb;
vec3 Yxy;
Yxy.r = xyz.g;
float temp = dot(vec3(1.0), xyz);
Yxy.gb = xyz.rg / temp;
return Yxy;
}
`;var IM=`float czm_round(float value) {
return floor(value + 0.5);
}
vec2 czm_round(vec2 value) {
return floor(value + 0.5);
}
vec3 czm_round(vec3 value) {
return floor(value + 0.5);
}
vec4 czm_round(vec4 value) {
return floor(value + 0.5);
}
`;var OM=`vec3 czm_saturation(vec3 rgb, float adjustment)
{
const vec3 W = vec3(0.2125, 0.7154, 0.0721);
vec3 intensity = vec3(dot(rgb, W));
return mix(intensity, rgb, adjustment);
}
`;var RM=`float czm_sampleShadowMap(highp samplerCube shadowMap, vec3 d)
{
return czm_unpackDepth(czm_textureCube(shadowMap, d));
}
float czm_sampleShadowMap(highp sampler2D shadowMap, vec2 uv)
{
#ifdef USE_SHADOW_DEPTH_TEXTURE
return texture(shadowMap, uv).r;
#else
return czm_unpackDepth(texture(shadowMap, uv));
#endif
}
float czm_shadowDepthCompare(samplerCube shadowMap, vec3 uv, float depth)
{
return step(depth, czm_sampleShadowMap(shadowMap, uv));
}
float czm_shadowDepthCompare(sampler2D shadowMap, vec2 uv, float depth)
{
return step(depth, czm_sampleShadowMap(shadowMap, uv));
}
`;var MM=`float czm_private_shadowVisibility(float visibility, float nDotL, float normalShadingSmooth, float darkness)
{
#ifdef USE_NORMAL_SHADING
#ifdef USE_NORMAL_SHADING_SMOOTH
float strength = clamp(nDotL / normalShadingSmooth, 0.0, 1.0);
#else
float strength = step(0.0, nDotL);
#endif
visibility *= strength;
#endif
visibility = max(visibility, darkness);
return visibility;
}
#ifdef USE_CUBE_MAP_SHADOW
float czm_shadowVisibility(samplerCube shadowMap, czm_shadowParameters shadowParameters)
{
float depthBias = shadowParameters.depthBias;
float depth = shadowParameters.depth;
float nDotL = shadowParameters.nDotL;
float normalShadingSmooth = shadowParameters.normalShadingSmooth;
float darkness = shadowParameters.darkness;
vec3 uvw = shadowParameters.texCoords;
depth -= depthBias;
float visibility = czm_shadowDepthCompare(shadowMap, uvw, depth);
return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
}
#else
float czm_shadowVisibility(sampler2D shadowMap, czm_shadowParameters shadowParameters)
{
float depthBias = shadowParameters.depthBias;
float depth = shadowParameters.depth;
float nDotL = shadowParameters.nDotL;
float normalShadingSmooth = shadowParameters.normalShadingSmooth;
float darkness = shadowParameters.darkness;
vec2 uv = shadowParameters.texCoords;
depth -= depthBias;
#ifdef USE_SOFT_SHADOWS
vec2 texelStepSize = shadowParameters.texelStepSize;
float radius = 1.0;
float dx0 = -texelStepSize.x * radius;
float dy0 = -texelStepSize.y * radius;
float dx1 = texelStepSize.x * radius;
float dy1 = texelStepSize.y * radius;
float visibility = (
czm_shadowDepthCompare(shadowMap, uv, depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy0), depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy0), depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy0), depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, 0.0), depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, 0.0), depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(dx0, dy1), depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(0.0, dy1), depth) +
czm_shadowDepthCompare(shadowMap, uv + vec2(dx1, dy1), depth)
) * (1.0 / 9.0);
#else
float visibility = czm_shadowDepthCompare(shadowMap, uv, depth);
#endif
return czm_private_shadowVisibility(visibility, nDotL, normalShadingSmooth, darkness);
}
#endif
`;var LM=`float czm_signNotZero(float value)
{
return value >= 0.0 ? 1.0 : -1.0;
}
vec2 czm_signNotZero(vec2 value)
{
return vec2(czm_signNotZero(value.x), czm_signNotZero(value.y));
}
vec3 czm_signNotZero(vec3 value)
{
return vec3(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z));
}
vec4 czm_signNotZero(vec4 value)
{
return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w));
}
`;var NM=`vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9])
{
vec3 L00 = coefficients[0];
vec3 L1_1 = coefficients[1];
vec3 L10 = coefficients[2];
vec3 L11 = coefficients[3];
vec3 L2_2 = coefficients[4];
vec3 L2_1 = coefficients[5];
vec3 L20 = coefficients[6];
vec3 L21 = coefficients[7];
vec3 L22 = coefficients[8];
float x = normal.x;
float y = normal.y;
float z = normal.z;
vec3 L =
L00
+ L1_1 * y
+ L10 * z
+ L11 * x
+ L2_2 * (y * x)
+ L2_1 * (y * z)
+ L20 * (3.0 * z * z - 1.0)
+ L21 * (z * x)
+ L22 * (x * x - y * y);
return max(L, vec3(0.0));
}
`;var FM=`vec3 czm_srgbToLinear(vec3 srgbIn)
{
return pow(srgbIn, vec3(2.2));
}
vec4 czm_srgbToLinear(vec4 srgbIn)
{
vec3 linearOut = pow(srgbIn.rgb, vec3(2.2));
return vec4(linearOut, srgbIn.a);
}
`;var BM=`mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC)
{
vec3 normal = normalize(normalEC);
vec3 tangent = normalize(tangentEC);
vec3 bitangent = normalize(bitangentEC);
return mat3(tangent.x , tangent.y , tangent.z,
bitangent.x, bitangent.y, bitangent.z,
normal.x , normal.y , normal.z);
}
`;var kM=`vec4 czm_textureCube(samplerCube sampler, vec3 p) {
#if __VERSION__ == 300
return texture(sampler, p);
#else
return textureCube(sampler, p);
#endif
}
vec4 czm_textureCube(samplerCube sampler, vec3 p, float lod) {
#if __VERSION__ == 300
return textureLod(sampler, p, lod);
#elif defined(GL_EXT_shader_texture_lod)
return textureCubeLodEXT(sampler, p, lod);
#endif
}
`;var UM=`vec4 czm_transformPlane(vec4 plane, mat4 transform) {
vec4 transformedPlane = transform * plane;
float normalMagnitude = length(transformedPlane.xyz);
return transformedPlane / normalMagnitude;
}
`;var VM=`vec4 czm_translateRelativeToEye(vec3 high, vec3 low)
{
vec3 highDifference = high - czm_encodedCameraPositionMCHigh;
if (length(highDifference) == 0.0) {
highDifference = vec3(0);
}
vec3 lowDifference = low - czm_encodedCameraPositionMCLow;
return vec4(highDifference + lowDifference, 1.0);
}
`;var zM=`vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC)
{
float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal);
if (czm_sceneMode == czm_sceneMode3D) {
diffuse += czm_getLambertDiffuse(vec3(0.0, 1.0, 0.0), material.normal);
}
diffuse = clamp(diffuse, 0.0, 1.0);
float specular = czm_getSpecular(lightDirectionEC, toEye, material.normal, material.shininess);
vec3 materialDiffuse = material.diffuse * 0.5;
vec3 ambient = materialDiffuse;
vec3 color = ambient + material.emission;
color += materialDiffuse * diffuse * czm_lightColor;
color += material.specular * specular * czm_lightColor;
return vec4(color, material.alpha);
}
`;var HM=`mat2 czm_transpose(mat2 matrix)
{
return mat2(
matrix[0][0], matrix[1][0],
matrix[0][1], matrix[1][1]);
}
mat3 czm_transpose(mat3 matrix)
{
return mat3(
matrix[0][0], matrix[1][0], matrix[2][0],
matrix[0][1], matrix[1][1], matrix[2][1],
matrix[0][2], matrix[1][2], matrix[2][2]);
}
mat4 czm_transpose(mat4 matrix)
{
return mat4(
matrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],
matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],
matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],
matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);
}
`;var GM=`vec2 getLookupUv(vec2 dimensions, int i) {
int pixY = i / int(dimensions.x);
int pixX = i - (pixY * int(dimensions.x));
float pixelWidth = 1.0 / dimensions.x;
float pixelHeight = 1.0 / dimensions.y;
float u = (float(pixX) + 0.5) * pixelWidth;
float v = (float(pixY) + 0.5) * pixelHeight;
return vec2(u, v);
}
vec4 czm_unpackClippingExtents(highp sampler2D extentsTexture, int index) {
vec2 textureDimensions = vec2(textureSize(extentsTexture, 0));
return texture(extentsTexture, getLookupUv(textureDimensions, index));
}
`;var jM=`float czm_unpackDepth(vec4 packedDepth)
{
return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0));
}
`;var WM=`float czm_unpackFloat(vec4 packedFloat)
{
packedFloat = floor(packedFloat * 255.0 + 0.5);
float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0;
float exponent = 2.0 * mod(packedFloat[3], 128.0) + step(128.0, packedFloat[2]) - 127.0;
if (exponent == -127.0)
{
return 0.0;
}
float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + packedFloat[0] + float(0x800000);
float result = sign * exp2(exponent - 23.0) * mantissa;
return result;
}
`;var qM=`int czm_unpackUint(float packedValue) {
float rounded = czm_round(packedValue * 255.0);
return int(rounded);
}
int czm_unpackUint(vec2 packedValue) {
vec2 rounded = czm_round(packedValue * 255.0);
return int(dot(rounded, vec2(1.0, 256.0)));
}
int czm_unpackUint(vec3 packedValue) {
vec3 rounded = czm_round(packedValue * 255.0);
return int(dot(rounded, vec3(1.0, 256.0, 65536.0)));
}
int czm_unpackUint(vec4 packedValue) {
vec4 rounded = czm_round(packedValue * 255.0);
return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0)));
}
`;var YM=`float czm_valueTransform(float offset, float scale, float value) {
return scale * value + offset;
}
vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) {
return scale * value + offset;
}
vec3 czm_valueTransform(vec3 offset, vec3 scale, vec3 value) {
return scale * value + offset;
}
vec4 czm_valueTransform(vec4 offset, vec4 scale, vec4 value) {
return scale * value + offset;
}
mat2 czm_valueTransform(mat2 offset, mat2 scale, mat2 value) {
return matrixCompMult(scale, value) + offset;
}
mat3 czm_valueTransform(mat3 offset, mat3 scale, mat3 value) {
return matrixCompMult(scale, value) + offset;
}
mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) {
return matrixCompMult(scale, value) + offset;
}
`;var XM=`#ifdef LOG_DEPTH
out float v_depthFromNearPlusOne;
#ifdef SHADOW_MAP
out vec3 v_logPositionEC;
#endif
#endif
vec4 czm_updatePositionDepth(vec4 coords) {
#if defined(LOG_DEPTH)
#ifdef SHADOW_MAP
vec3 logPositionEC = (czm_inverseProjection * coords).xyz;
v_logPositionEC = logPositionEC;
#endif
coords.z = clamp(coords.z / coords.w, -1.0, 1.0) * coords.w;
#endif
return coords;
}
void czm_vertexLogDepth()
{
#ifdef LOG_DEPTH
v_depthFromNearPlusOne = (gl_Position.w - czm_currentFrustum.x) + 1.0;
gl_Position = czm_updatePositionDepth(gl_Position);
#endif
}
void czm_vertexLogDepth(vec4 clipCoords)
{
#ifdef LOG_DEPTH
v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0;
czm_updatePositionDepth(clipCoords);
#endif
}
`;var KM=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate)
{
float x = 2.0 * screenCoordinate.x - 1.0;
float y = 2.0 * screenCoordinate.y - 1.0;
float z = (screenCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];
vec4 q = vec4(x, y, z, 1.0);
q /= screenCoordinate.w;
if (!(czm_inverseProjection == mat4(0.0)))
{
q = czm_inverseProjection * q;
}
else
{
float top = czm_frustumPlanes.x;
float bottom = czm_frustumPlanes.y;
float left = czm_frustumPlanes.z;
float right = czm_frustumPlanes.w;
float near = czm_currentFrustum.x;
float far = czm_currentFrustum.y;
q.x = (q.x * (right - left) + left + right) * 0.5;
q.y = (q.y * (top - bottom) + bottom + top) * 0.5;
q.z = (q.z * (near - far) - near - far) * 0.5;
q.w = 1.0;
}
return q;
}
vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)
{
vec2 screenCoordXY = (fragmentCoordinate.xy - czm_viewport.xy) / czm_viewport.zw;
return czm_screenToEyeCoordinates(vec4(screenCoordXY, fragmentCoordinate.zw));
}
vec4 czm_screenToEyeCoordinates(vec2 screenCoordinateXY, float depthOrLogDepth)
{
#if defined(LOG_DEPTH) || defined(LOG_DEPTH_READ_ONLY)
float near = czm_currentFrustum.x;
float far = czm_currentFrustum.y;
float log2Depth = depthOrLogDepth * czm_log2FarDepthFromNearPlusOne;
float depthFromNear = exp2(log2Depth) - 1.0;
float depthFromCamera = depthFromNear + near;
vec4 screenCoord = vec4(screenCoordinateXY, far * (1.0 - near / depthFromCamera) / (far - near), 1.0);
vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
eyeCoordinate.w = 1.0 / depthFromCamera;
return eyeCoordinate;
#else
vec4 screenCoord = vec4(screenCoordinateXY, depthOrLogDepth, 1.0);
vec4 eyeCoordinate = czm_screenToEyeCoordinates(screenCoord);
#endif
return eyeCoordinate;
}
vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth)
{
vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw;
return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth);
}
`;var $M=`#if !defined(LOG_DEPTH)
in float v_WindowZ;
#endif
void czm_writeDepthClamp()
{
#if (!defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0);
#endif
}
`;var ZM=`#ifdef LOG_DEPTH
in float v_depthFromNearPlusOne;
#ifdef POLYGON_OFFSET
uniform vec2 u_polygonOffset;
#endif
#endif
void czm_writeLogDepth(float depth)
{
#if (defined(LOG_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
if (depth <= 0.9999999 || depth > czm_farDepthFromNearPlusOne) {
discard;
}
#ifdef POLYGON_OFFSET
float factor = u_polygonOffset[0];
float units = u_polygonOffset[1];
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
if (factor != 0.0) {
float x = dFdx(depth);
float y = dFdy(depth);
float m = sqrt(x * x + y * y);
depth += m * factor;
}
#endif
#endif
gl_FragDepth = log2(depth) * czm_oneOverLog2FarDepthFromNearPlusOne;
#ifdef POLYGON_OFFSET
gl_FragDepth += czm_epsilon7 * units;
#endif
#endif
}
void czm_writeLogDepth() {
#ifdef LOG_DEPTH
czm_writeLogDepth(v_depthFromNearPlusOne);
#endif
}
`;var QM=`float czm_writeNonPerspective(float value, float w) {
return value * w;
}
vec2 czm_writeNonPerspective(vec2 value, float w) {
return value * w;
}
vec3 czm_writeNonPerspective(vec3 value, float w) {
return value * w;
}
vec4 czm_writeNonPerspective(vec4 value, float w) {
return value * w;
}
`;var JM=`vec3 czm_XYZToRGB(vec3 Yxy)
{
const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,
-1.5371, 1.8760, -0.2040,
-0.4985, 0.0416, 1.0572);
vec3 xyz;
xyz.r = Yxy.r * Yxy.g / Yxy.b;
xyz.g = Yxy.r;
xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;
return XYZ2RGB * xyz;
}
`;var PT={czm_degreesPerRadian:w1,czm_depthRange:v1,czm_epsilon1:D1,czm_epsilon2:P1,czm_epsilon3:I1,czm_epsilon4:O1,czm_epsilon5:R1,czm_epsilon6:M1,czm_epsilon7:L1,czm_infinity:N1,czm_oneOverPi:F1,czm_oneOverTwoPi:B1,czm_passCesium3DTile:k1,czm_passCesium3DTileClassification:U1,czm_passCesium3DTileClassificationIgnoreShow:V1,czm_passClassification:z1,czm_passCompute:H1,czm_passEnvironment:G1,czm_passGlobe:j1,czm_passOpaque:W1,czm_passOverlay:q1,czm_passTerrainClassification:Y1,czm_passTranslucent:X1,czm_passVoxels:K1,czm_pi:$1,czm_piOverFour:Z1,czm_piOverSix:Q1,czm_piOverThree:J1,czm_piOverTwo:eR,czm_radiansPerDegree:tR,czm_sceneMode2D:nR,czm_sceneMode3D:iR,czm_sceneModeColumbusView:oR,czm_sceneModeMorphing:rR,czm_solarRadius:sR,czm_threePiOver2:aR,czm_twoPi:cR,czm_webMercatorMaxLatitude:lR,czm_depthRangeStruct:uR,czm_material:fR,czm_materialInput:dR,czm_modelMaterial:hR,czm_modelVertexOutput:mR,czm_ray:pR,czm_raySegment:_R,czm_shadowParameters:gR,czm_acesTonemapping:yR,czm_alphaWeight:bR,czm_antialias:xR,czm_applyHSBShift:TR,czm_approximateSphericalCoordinates:AR,czm_approximateTanh:CR,czm_backFacing:ER,czm_branchFreeTernary:SR,czm_cascadeColor:wR,czm_cascadeDistance:vR,czm_cascadeMatrix:DR,czm_cascadeWeights:PR,czm_clipPolygons:IR,czm_columbusViewMorph:OR,czm_computeAtmosphereColor:RR,czm_computeGroundAtmosphereScattering:MR,czm_computePosition:LR,czm_computeScattering:NR,czm_cosineAndSine:FR,czm_decompressTextureCoordinates:BR,czm_depthClamp:kR,czm_eastNorthUpToEyeCoordinates:UR,czm_ellipsoidContainsPoint:VR,czm_ellipsoidTextureCoordinates:zR,czm_equalsEpsilon:HR,czm_eyeOffset:GR,czm_eyeToWindowCoordinates:jR,czm_fastApproximateAtan:WR,czm_fog:qR,czm_gammaCorrect:YR,czm_geodeticSurfaceNormal:XR,czm_getDefaultMaterial:KR,czm_getDynamicAtmosphereLightDirection:$R,czm_getLambertDiffuse:ZR,czm_getSpecular:QR,czm_getWaterNoise:JR,czm_HSBToRGB:eM,czm_HSLToRGB:tM,czm_hue:nM,czm_inverseGamma:iM,czm_isEmpty:oM,czm_isFull:rM,czm_latitudeToWebMercatorFraction:sM,czm_linearToSrgb:aM,czm_lineDistance:cM,czm_luminance:lM,czm_maximumComponent:uM,czm_metersPerPixel:fM,czm_modelToWindowCoordinates:dM,czm_multiplyWithColorBalance:hM,czm_nearFarScalar:mM,czm_octDecode:pM,czm_packDepth:_M,czm_pbrLighting:gM,czm_pbrNeutralTonemapping:yM,czm_phong:bM,czm_planeDistance:xM,czm_pointAlongRay:TM,czm_rayEllipsoidIntersectionInterval:AM,czm_raySphereIntersectionInterval:CM,czm_readDepth:EM,czm_readNonPerspective:SM,czm_reverseLogDepth:wM,czm_RGBToHSB:vM,czm_RGBToHSL:DM,czm_RGBToXYZ:PM,czm_round:IM,czm_saturation:OM,czm_shadowDepthCompare:RM,czm_shadowVisibility:MM,czm_signNotZero:LM,czm_sphericalHarmonics:NM,czm_srgbToLinear:FM,czm_tangentToEyeSpaceMatrix:BM,czm_textureCube:kM,czm_transformPlane:UM,czm_translateRelativeToEye:VM,czm_translucentPhong:zM,czm_transpose:HM,czm_unpackClippingExtents:GM,czm_unpackDepth:jM,czm_unpackFloat:WM,czm_unpackUint:qM,czm_valueTransform:YM,czm_vertexLogDepth:XM,czm_windowToEyeCoordinates:KM,czm_writeDepthClamp:$M,czm_writeLogDepth:ZM,czm_writeNonPerspective:QM,czm_XYZToRGB:JM};function SPe(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,`
varying $2`),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable
${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable
${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_EXT_shader_texture_lod
#extension GL_EXT_shader_texture_lod : enable
#endif
${n}`,n=`#ifdef GL_OES_standard_derivatives
#extension GL_OES_standard_derivatives : enable
#endif
${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100
${n}`,n}var eL=SPe;function XJ(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o<n;++o)i+=`
`;return i})}function KJ(e,t,n){let i;for(let o=0;o<n.length;++o)n[o].name===e&&(i=n[o]);return c(i)||(t=XJ(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function $J(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);c(n)&&n!==null&&(n=n.filter(function(i,o){return n.indexOf(i)===o}),n.forEach(function(i){if(i!==e.name&&Rs._czmBuiltinsAndUniforms.hasOwnProperty(i)){let o=KJ(i,Rs._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(o),o.requiredBy.push(e),$J(o,t)}}))}function wPe(e){let t=[],n=[];for(;e.length>0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r<o.dependsOn.length;++r){let s=o.dependsOn[r],a=s.requiredBy.indexOf(o);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let o=0;o<n.length;++o)n[o].requiredBy.length!==0&&i.push(n[o]);if(i.length!==0){let o=`A circular dependency was found in the following built-in functions/structs/constants:
`;for(let r=0;r<i.length;++r)o=`${o+i[r].name}
`;throw new C(o)}}function vPe(e){let t=[],n=KJ("main",e,t);$J(n,t),wPe(t);let i="";for(let o=t.length-1;o>=0;--o)i=`${i+t[o].glslSource}
`;return i.replace(n.glslSource,"")}function ZJ(e,t,n){let i,o,r="",s=e.sources;if(c(s))for(i=0,o=s.length;i<o;++i)r+=`
#line 0
${s[i]}`;r=XJ(r);let a;r=r.replace(/#version\s+(.*?)\n/gm,function(y,b){if(c(a)&&a!==b)throw new C(`inconsistent versions found: ${a} and ${b}`);return a=b,`
`});let l=[];r=r.replace(/#extension.*\n/gm,function(y){return l.push(y),`
`}),r=r.replace(/precision\s(lowp|mediump|highp)\s(float|int);/,"");let u=e.pickColorQualifier;c(u)&&(r=Rs.createPickFragmentShaderSource(r,u));let f="",h=l.length;for(i=0;i<h;i++)f+=l[i];t&&(f+=`#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
precision highp int;
#else
precision mediump float;
precision mediump int;
#define highp mediump
#endif
`);let p=e.defines;if(c(p))for(i=0,o=p.length;i<o;++i){let y=p[i];y.length!==0&&(f+=`#define ${y}
`)}n.textureFloatLinear&&(f+=`#define OES_texture_float_linear
`),n.floatingPointTexture&&(f+=`#define OES_texture_float
`);let g="";e.includeBuiltIns&&(g=vPe(r)),f+=`
#line 0
`;let m=g+r;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(m)&&!/czm_out_FragColor/g.test(m)&&/out_FragColor/g.test(m)&&(f+=`layout(location = 0) out vec4 out_FragColor;
`),f+=g,f+=r,n.webgl2?f=`#version 300 es
${f}`:f=eL(f,t),f}function Rs(e){e=e??W.EMPTY_OBJECT;let t=e.pickColorQualifier;if(c(t)&&t!=="uniform"&&t!=="in")throw new C("options.pickColorQualifier must be 'uniform' or 'in'.");this.defines=c(e.defines)?e.defines.slice(0):[],this.sources=c(e.sources)?e.sources.slice(0):[],this.pickColorQualifier=t,this.includeBuiltIns=e.includeBuiltIns??!0}Rs.prototype.clone=function(){return new Rs({sources:this.sources,defines:this.defines,pickColorQualifier:this.pickColorQualifier,includeBuiltIns:this.includeBuiltIns})};Rs.replaceMain=function(e,t){return t=`void ${t}()`,e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g,t)};Rs.prototype.getCacheKey=function(){let t=this.defines.slice().sort().join(","),n=this.pickColorQualifier,i=this.includeBuiltIns,o=this.sources.join(`
`);return`${t}:${n}:${i}:${o}`};Rs.prototype.createCombinedVertexShader=function(e){return ZJ(this,!1,e)};Rs.prototype.createCombinedFragmentShader=function(e){return ZJ(this,!0,e)};Rs._czmBuiltinsAndUniforms={};for(let e in PT)PT.hasOwnProperty(e)&&(Rs._czmBuiltinsAndUniforms[e]=PT[e]);for(let e in N_)if(N_.hasOwnProperty(e)){let t=N_[e];typeof t.getDeclaration=="function"&&(Rs._czmBuiltinsAndUniforms[e]=t.getDeclaration(e))}Rs.createPickVertexShaderSource=function(e){return`${Rs.replaceMain(e,"czm_old_main")}
in vec4 pickColor;
out vec4 czm_pickColor;
void main()
{
czm_old_main();
czm_pickColor = pickColor;
}`};Rs.createPickFragmentShaderSource=function(e,t){let n=Rs.replaceMain(e,"czm_old_main"),i=`${t} vec4 czm_pickColor;
void main()
{
czm_old_main();
if (out_FragColor.a == 0.0) {
discard;
}
out_FragColor = czm_pickColor;
}`;return`${n}
${i}`};function DPe(e,t){let n=e.defines,i=n.length;for(let o=0;o<i;++o)if(n[o]===t)return!0;return!1}function QJ(e,t){let n=e.sources,i=n.length;for(let o=0;o<i;++o)if(n[o].indexOf(t)!==-1)return!0;return!1}function JJ(e,t){let n=t.length;for(let i=0;i<n;++i){let o=t[i];if(QJ(e,o))return o}}var PPe=["v_normalEC","v_normal"];Rs.findNormalVarying=function(e){return QJ(e,"#ifdef HAS_NORMALS")?DPe(e,"HAS_NORMALS")?"v_normalEC":void 0:JJ(e,PPe)};var IPe=["v_positionEC"];Rs.findPositionVarying=function(e){return JJ(e,IPe)};var He=Rs;function md(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(md.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});md.prototype.replaceShaderProgram=function(e){return c(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function OPe(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}md.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new He({sources:[t]})),typeof n=="string"&&(n=new He({sources:[n]}));let o=t.getCacheKey(),r=n.getCacheKey(),s=c(i)?OPe(i):"",a=`${o}:${r}:${s}`,l;if(c(this._shaders[a]))l=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),h=n.createCombinedFragmentShader(u),p=new en({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:h,attributeLocations:i});l={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=l,this._shaders[a]=l,++this._numberOfShaders}return++l.count,l.shaderProgram};md.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=this._shaders[o];if(c(r)){T6(this,r);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};md.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(c(o))return o.shaderProgram};md.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new He({sources:[r]})),typeof s=="string"&&(s=new He({sources:[s]}));let l=this._context,u=r.createCombinedVertexShader(l),f=s.createCombinedFragmentShader(l),h=new en({gl:l._gl,logShaderCompilation:l.logShaderCompilation,debugShaders:l.debugShaders,vertexShaderSource:r,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:h,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),h._cachedShader=p,this._shaders[o]=p,h};function T6(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;o<i;++o){let r=n[o]+t.keyword,s=e._shaders[r];T6(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}md.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];T6(this,n),--this._numberOfShaders}this._shadersToRelease={}};md.prototype.releaseShaderProgram=function(e){if(c(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};md.prototype.isDestroyed=function(){return!1};md.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return de(this)};var tL=md;function pd(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let{context:t,source:n,pixelFormat:i=ke.RGBA,pixelDatatype:o=Ue.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Qt}=e,{width:l,height:u}=e;c(n)&&(c(l)||(l=n.videoWidth??n.naturalWidth??n.width),c(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===ke.RGB||i===ke.LUMINANCE,h=ke.toInternalFormat(i,o,t),p=ke.isCompressedFormat(h);if(!c(l)||!c(u))throw new C("options requires a source field to create an initialized texture or width and height fields to create a blank texture.");if(T.typeOf.number.greaterThan("width",l,0),l>ut.maximumTextureSize)throw new C(`Width must be less than or equal to the maximum texture size (${ut.maximumTextureSize}). Check maximumTextureSize.`);if(T.typeOf.number.greaterThan("height",u,0),u>ut.maximumTextureSize)throw new C(`Height must be less than or equal to the maximum texture size (${ut.maximumTextureSize}). Check maximumTextureSize.`);if(!ke.validate(i))throw new C("Invalid options.pixelFormat.");if(!p&&!Ue.validate(o))throw new C("Invalid options.pixelDatatype.");if(i===ke.DEPTH_COMPONENT&&o!==Ue.UNSIGNED_SHORT&&o!==Ue.UNSIGNED_INT)throw new C("When options.pixelFormat is DEPTH_COMPONENT, options.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT.");if(i===ke.DEPTH_STENCIL&&o!==Ue.UNSIGNED_INT_24_8)throw new C("When options.pixelFormat is DEPTH_STENCIL, options.pixelDatatype must be UNSIGNED_INT_24_8.");if(o===Ue.FLOAT&&!t.floatingPointTexture)throw new C("When options.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension. Check context.floatingPointTexture.");if(o===Ue.HALF_FLOAT&&!t.halfFloatingPointTexture)throw new C("When options.pixelDatatype is HALF_FLOAT, this WebGL implementation must support the OES_texture_half_float extension. Check context.halfFloatingPointTexture.");if(ke.isDepthFormat(i)){if(c(n))throw new C("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided.");if(!t.depthTexture)throw new C("When options.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check context.depthTexture.")}if(p){if(!c(n)||!c(n.arrayBufferView))throw new C("When options.pixelFormat is compressed, options.source.arrayBufferView must be defined.");if(ke.isDXTFormat(h)&&!t.s3tc)throw new C("When options.pixelFormat is S3TC compressed, this WebGL implementation must support the WEBGL_compressed_texture_s3tc extension. Check context.s3tc.");if(ke.isPVRTCFormat(h)&&!t.pvrtc)throw new C("When options.pixelFormat is PVRTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_pvrtc extension. Check context.pvrtc.");if(ke.isASTCFormat(h)&&!t.astc)throw new C("When options.pixelFormat is ASTC compressed, this WebGL implementation must support the WEBGL_compressed_texture_astc extension. Check context.astc.");if(ke.isETC2Format(h)&&!t.etc)throw new C("When options.pixelFormat is ETC2 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc extension. Check context.etc.");if(ke.isETC1Format(h)&&!t.etc1)throw new C("When options.pixelFormat is ETC1 compressed, this WebGL implementation must support the WEBGL_compressed_texture_etc1 extension. Check context.etc1.");if(ke.isBC7Format(h)&&!t.bc7)throw new C("When options.pixelFormat is BC7 compressed, this WebGL implementation must support the EXT_texture_compression_bptc extension. Check context.bc7.");if(ke.compressedTextureSizeInBytes(h,l,u)!==n.arrayBufferView.byteLength)throw new C("The byte length of the array buffer is invalid for the compressed texture with the given width and height.")}let g=t._gl,m=p?ke.compressedTextureSizeInBytes(i,l,u):ke.textureSizeInBytes(i,o,l,u);this._id=e.id??jn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=h,this._pixelFormat=i,this._pixelDatatype=o,this._width=l,this._height=u,this._dimensions=new z(l,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,iee(this,a),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),c(n)?(s?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),c(n.arrayBufferView)?ke.isCompressedFormat(h)?RPe(this,n):eee(this,n):c(n.framebuffer)?LPe(this,n):tee(this,n),this._initialized=!0):nee(this),g.bindTexture(this._textureTarget,null)}function RPe(e,t){let i=e._context._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(o,0,r,s,a,0,t.arrayBufferView),c(t.mipLevels)){let l=s,u=a;for(let f=0;f<t.mipLevels.length;++f)l=nL(l),u=nL(u),i.compressedTexImage2D(o,f+1,r,l,u,0,t.mipLevels[f])}}function eee(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,pixelFormat:l,pixelDatatype:u,flipY:f}=e,h=ke.alignmentInBytes(l,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,h),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=ke.flipY(p,l,u,s,a)),i.texImage2D(o,0,r,s,a,0,l,Ue.toWebGLConstant(u,n),p),c(t.mipLevels)){let g=s,m=a;for(let y=0;y<t.mipLevels.length;++y)g=nL(g),m=nL(m),i.texImage2D(o,y+1,r,g,m,0,l,Ue.toWebGLConstant(u,n),t.mipLevels[y])}}function MPe(e,t,n,i,o,r){let s=e._context,a=s._gl,{pixelFormat:l,pixelDatatype:u}=e,f=ke.alignmentInBytes(l,u,o);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=ke.flipY(t,l,u,o,r)),a.texSubImage2D(e._textureTarget,0,n,i,o,r,l,Ue.toWebGLConstant(u,s),t)}function LPe(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function tee(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,Ue.toWebGLConstant(e.pixelDatatype,n),t)}function NPe(e,t,n,i){let o=e._context,r=o._gl;r.pixelStorei(r.UNPACK_ALIGNMENT,4),r.pixelStorei(r.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),r.pixelStorei(r.UNPACK_FLIP_Y_WEBGL,e.flipY),r.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,Ue.toWebGLConstant(e.pixelDatatype,o),t)}function nL(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function nee(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,Ue.toWebGLConstant(e._pixelDatatype,t),null)}pd.create=function(e){return new pd(e)};pd.fromFramebuffer=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let t=e.context,n=t._gl,{pixelFormat:i=ke.RGB,framebufferXOffset:o=0,framebufferYOffset:r=0,width:s=n.drawingBufferWidth,height:a=n.drawingBufferHeight,framebuffer:l}=e;if(!ke.validate(i))throw new C("Invalid pixelFormat.");if(ke.isDepthFormat(i)||ke.isCompressedFormat(i))throw new C("pixelFormat cannot be DEPTH_COMPONENT, DEPTH_STENCIL or a compressed format.");if(T.defined("options.context",t),T.typeOf.number.greaterThanOrEquals("framebufferXOffset",o,0),T.typeOf.number.greaterThanOrEquals("framebufferYOffset",r,0),o+s>n.drawingBufferWidth)throw new C("framebufferXOffset + width must be less than or equal to drawingBufferWidth");if(r+a>n.drawingBufferHeight)throw new C("framebufferYOffset + height must be less than or equal to drawingBufferHeight.");return new pd({context:t,width:s,height:a,pixelFormat:i,source:{framebuffer:c(l)?l:t.defaultFramebuffer,xOffset:o,yOffset:r,width:s,height:a}})};Object.defineProperties(pd.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){iee(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function iee(e,t){let{minificationFilter:n,magnificationFilter:i}=t,o=[Yt.NEAREST_MIPMAP_NEAREST,Yt.NEAREST_MIPMAP_LINEAR,Yt.LINEAR_MIPMAP_NEAREST,Yt.LINEAR_MIPMAP_LINEAR].includes(n),r=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===Ue.FLOAT&&!r.textureFloatLinear||a===Ue.HALF_FLOAT&&!r.textureHalfFloatLinear)&&(n=o?Yt.NEAREST_MIPMAP_NEAREST:Yt.NEAREST,i=ui.NEAREST),r.webgl2&&ke.isDepthFormat(s)&&(n=Yt.NEAREST,i=ui.NEAREST);let l=r._gl,u=e._textureTarget;l.activeTexture(l.TEXTURE0),l.bindTexture(u,e._texture),l.texParameteri(u,l.TEXTURE_MIN_FILTER,n),l.texParameteri(u,l.TEXTURE_MAG_FILTER,i),l.texParameteri(u,l.TEXTURE_WRAP_S,t.wrapS),l.texParameteri(u,l.TEXTURE_WRAP_T,t.wrapT),c(e._textureFilterAnisotropic)&&l.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),l.bindTexture(u,null)}pd.prototype.copyFrom=function(e){T.defined("options",e);let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e;if(T.defined("options.source",i),ke.isDepthFormat(this._pixelFormat))throw new C("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ke.isCompressedFormat(this._pixelFormat))throw new C("Cannot call copyFrom with a compressed texture pixel format.");T.typeOf.number.greaterThanOrEquals("xOffset",t,0),T.typeOf.number.greaterThanOrEquals("yOffset",n,0),T.typeOf.number.lessThanOrEquals("xOffset + options.source.width",t+i.width,this._width),T.typeOf.number.lessThanOrEquals("yOffset + options.source.height",n+i.height,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:l,height:u}=i;c(i.videoWidth)&&c(i.videoHeight)?(l=i.videoWidth,u=i.videoHeight):c(i.naturalWidth)&&c(i.naturalHeight)&&(l=i.naturalWidth,u=i.naturalHeight),o?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&l===this._width&&u===this._height?(c(i.arrayBufferView)?eee(this,i):tee(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),nee(this)),this._initialized=!0),f||(c(i.arrayBufferView)?MPe(this,i.arrayBufferView,t,n,l,u):NPe(this,i,t,n)),s.bindTexture(a,null)};pd.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){if(e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._width,r=r??this._height,ke.isDepthFormat(this._pixelFormat))throw new C("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(this._pixelDatatype===Ue.FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT.");if(this._pixelDatatype===Ue.HALF_FLOAT)throw new C("Cannot call copyFromFramebuffer when the texture pixel data type is HALF_FLOAT.");if(ke.isCompressedFormat(this._pixelFormat))throw new C("Cannot call copyFrom with a compressed texture pixel format.");T.typeOf.number.greaterThanOrEquals("xOffset",e,0),T.typeOf.number.greaterThanOrEquals("yOffset",t,0),T.typeOf.number.greaterThanOrEquals("framebufferXOffset",n,0),T.typeOf.number.greaterThanOrEquals("framebufferYOffset",i,0),T.typeOf.number.lessThanOrEquals("xOffset + width",e+o,this._width),T.typeOf.number.lessThanOrEquals("yOffset + height",t+r,this._height);let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};pd.prototype.generateMipmap=function(e){if(e=e??hd.DONT_CARE,ke.isDepthFormat(this._pixelFormat))throw new C("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL.");if(ke.isCompressedFormat(this._pixelFormat))throw new C("Cannot call generateMipmap with a compressed pixel format.");if(!this._context.webgl2){if(this._width>1&&!O.isPowerOfTwo(this._width))throw new C("width must be a power of two to call generateMipmap() in a WebGL1 context.");if(this._height>1&&!O.isPowerOfTwo(this._height))throw new C("height must be a power of two to call generateMipmap() in a WebGL1 context.")}if(!hd.validate(e))throw new C("hint is invalid.");this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};pd.prototype.isDestroyed=function(){return!1};pd.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),de(this)};var Rt=pd;function V0(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(V0.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});V0.prototype.getTexture=function(e){let t=this._textures[e];if(c(t))return delete this._texturesToRelease[e],++t.count,t.texture};V0.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};V0.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};V0.prototype.isDestroyed=function(){return!1};V0.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return de(this)};var iL=V0;function Qu(e){this.planes=e??[]}var lw=[new d,new d,new d];d.clone(d.UNIT_X,lw[0]);d.clone(d.UNIT_Y,lw[1]);d.clone(d.UNIT_Z,lw[2]);var W_=new d,FPe=new d,oee=new sn(new d(1,0,0),0);Qu.fromBoundingSphere=function(e,t){if(!c(e))throw new C("boundingSphere is required.");c(t)||(t=new Qu);let n=lw.length,i=t.planes;i.length=2*n;let o=e.center,r=e.radius,s=0;for(let a=0;a<n;++a){let l=lw[a],u=i[s],f=i[s+1];c(u)||(u=i[s]=new se),c(f)||(f=i[s+1]=new se),d.multiplyByScalar(l,-r,W_),d.add(o,W_,W_),u.x=l.x,u.y=l.y,u.z=l.z,u.w=-d.dot(l,W_),d.multiplyByScalar(l,r,W_),d.add(o,W_,W_),f.x=-l.x,f.y=-l.y,f.z=-l.z,f.w=-d.dot(d.negate(l,FPe),W_),s+=2}return t};Qu.prototype.computeVisibility=function(e){if(!c(e))throw new C("boundingVolume is required.");let t=this.planes,n=!1;for(let i=0,o=t.length;i<o;++i){let r=e.intersectPlane(sn.fromCartesian4(t[i],oee));if(r===Wt.OUTSIDE)return Wt.OUTSIDE;r===Wt.INTERSECTING&&(n=!0)}return n?Wt.INTERSECTING:Wt.INSIDE};Qu.prototype.computeVisibilityWithPlaneMask=function(e,t){if(!c(e))throw new C("boundingVolume is required.");if(!c(t))throw new C("parentPlaneMask is required.");if(t===Qu.MASK_OUTSIDE||t===Qu.MASK_INSIDE)return t;let n=Qu.MASK_INSIDE,i=this.planes;for(let o=0,r=i.length;o<r;++o){let s=o<31?1<<o:0;if(o<31&&!(t&s))continue;let a=e.intersectPlane(sn.fromCartesian4(i[o],oee));if(a===Wt.OUTSIDE)return Qu.MASK_OUTSIDE;a===Wt.INTERSECTING&&(n|=s)}return n};Qu.MASK_OUTSIDE=4294967295;Qu.MASK_INSIDE=0;Qu.MASK_INDETERMINATE=2147483647;var ys=Qu;function Oh(e){e=e??W.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new ys,this._orthographicMatrix=new F}function ree(e){if(!c(e.right)||!c(e.left)||!c(e.top)||!c(e.bottom)||!c(e.near)||!c(e.far))throw new C("right, left, top, bottom, near, or far parameters are not set.");if(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far){if(e.left>e.right)throw new C("right must be greater than left.");if(e.bottom>e.top)throw new C("top must be greater than bottom.");if(e.near<=0||e.near>e.far)throw new C("near must be greater than zero and less than far.");e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=F.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix)}}Object.defineProperties(Oh.prototype,{projectionMatrix:{get:function(){return ree(this),this._orthographicMatrix}}});var BPe=new d,kPe=new d,UPe=new d,A6=new d;Oh.prototype.computeCullingVolume=function(e,t,n){if(!c(e))throw new C("position is required.");if(!c(t))throw new C("direction is required.");if(!c(n))throw new C("up is required.");let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,l=this.near,u=this.far,f=d.cross(t,n,BPe);d.normalize(f,f);let h=kPe;d.multiplyByScalar(t,l,h),d.add(e,h,h);let p=UPe;d.multiplyByScalar(f,a,p),d.add(h,p,p);let g=i[0];return c(g)||(g=i[0]=new se),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-d.dot(f,p),d.multiplyByScalar(f,s,p),d.add(h,p,p),g=i[1],c(g)||(g=i[1]=new se),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-d.dot(d.negate(f,A6),p),d.multiplyByScalar(n,r,p),d.add(h,p,p),g=i[2],c(g)||(g=i[2]=new se),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-d.dot(n,p),d.multiplyByScalar(n,o,p),d.add(h,p,p),g=i[3],c(g)||(g=i[3]=new se),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-d.dot(d.negate(n,A6),p),g=i[4],c(g)||(g=i[4]=new se),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-d.dot(t,h),d.multiplyByScalar(t,u,p),d.add(e,p,p),g=i[5],c(g)||(g=i[5]=new se),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-d.dot(d.negate(t,A6),p),this._cullingVolume};Oh.prototype.getPixelDimensions=function(e,t,n,i,o){if(ree(this),!c(e)||!c(t))throw new C("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new C("drawingBufferWidth must be greater than zero.");if(t<=0)throw new C("drawingBufferHeight must be greater than zero.");if(!c(n))throw new C("distance is required.");if(!c(i))throw new C("pixelRatio is required.");if(i<=0)throw new C("pixelRatio must be greater than zero.");if(!c(o))throw new C("A result object is required.");let r=this.right-this.left,s=this.top-this.bottom,a=i*r/e,l=i*s/t;return o.x=a,o.y=l,o};Oh.prototype.clone=function(e){return c(e)||(e=new Oh),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Oh.prototype.equals=function(e){return c(e)&&e instanceof Oh&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Oh.prototype.equalsEpsilon=function(e,t,n){return e===this||c(e)&&e instanceof Oh&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var jo=Oh;function fl(e){e=e??W.EMPTY_OBJECT,this._offCenterFrustum=new jo,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}fl.packedLength=4;fl.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};fl.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new fl),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function q_(e){if(!c(e.width)||!c(e.aspectRatio)||!c(e.near)||!c(e.far))throw new C("width, aspectRatio, near, or far parameters are not set.");let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){if(e.aspectRatio<0)throw new C("aspectRatio must be positive.");if(e.near<0||e.near>e.far)throw new C("near must be greater than zero and less than far.");e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(fl.prototype,{projectionMatrix:{get:function(){return q_(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return q_(this),this._offCenterFrustum}}});fl.prototype.computeCullingVolume=function(e,t,n){return q_(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};fl.prototype.getPixelDimensions=function(e,t,n,i,o){return q_(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};fl.prototype.clone=function(e){return c(e)||(e=new fl),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};fl.prototype.equals=function(e){return!c(e)||!(e instanceof fl)?!1:(q_(this),q_(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};fl.prototype.equalsEpsilon=function(e,t,n){return!c(e)||!(e instanceof fl)?!1:(q_(this),q_(e),O.equalsEpsilon(this.width,e.width,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var on=fl;var C6={};function VPe(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var zPe=32.184,HPe=2451545;function See(e,t){t=Q.addSeconds(e,zPe,t);let n=Q.totalDays(t)-HPe;return t=Q.addSeconds(t,VPe(n),t),t}var oL=new Q(2451545,0,Wn.TAI),GPe=1e3,Ju=O.RADIANS_PER_DEGREE,$l=O.RADIANS_PER_ARCSECOND,Ca=14959787e4,see=new J;function wee(e,t,n,i,o,r,s){if(n<0&&(n=-n,o+=O.PI),n<0||n>O.PI)throw new C("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians.");let a=e*(1-t),l=i-o,u=o,f=WPe(r-i,t);if(jPe(t,0)==="Hyperbolic"&&Math.abs(O.negativePiToPi(f))>=Math.acos(-1/t))throw new C("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");KPe(l,n,u,see);let p=a*(1+t),g=Math.cos(f),m=Math.sin(f),y=1+t*g;if(y<=O.Epsilon10)throw new C("elements cannot be converted to cartesian");let b=p/y;return c(s)?(s.x=b*g,s.y=b*m,s.z=0):s=new d(b*g,b*m,0),J.multiplyByVector(see,s,s)}function jPe(e,t){if(e<0)throw new C("eccentricity cannot be negative.");return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function WPe(e,t){if(t<0||t>=1)throw new C("eccentricity out of range.");let n=YPe(e,t);return XPe(n,t)}var aee=50,qPe=O.EPSILON8;function YPe(e,t){if(t<0||t>=1)throw new C("eccentricity out of range.");let n=Math.floor(e/O.TWO_PI);e-=n*O.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),o=Number.MAX_VALUE,r;for(r=0;r<aee&&Math.abs(o-i)>qPe;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}if(r>=aee)throw new C("Kepler equation did not converge");return o=i+n*O.TWO_PI,o}function XPe(e,t){if(t<0||t>=1)throw new C("eccentricity out of range.");let n=Math.floor(e/O.TWO_PI);e-=n*O.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=O.zeroToTwoPi(r),e<0&&(r-=O.TWO_PI),r+=n*O.TWO_PI,r}function KPe(e,t,n,i){if(t<0||t>O.PI)throw new C("inclination out of range");let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),l=Math.cos(n),u=Math.sin(n);return c(i)?(i[0]=l*o-u*r*s,i[1]=u*o+l*r*s,i[2]=r*a,i[3]=-l*r-u*o*s,i[4]=-u*r+l*o*s,i[5]=o*a,i[6]=u*a,i[7]=-l*a,i[8]=s):i=new J(l*o-u*r*s,-l*r-u*o*s,u*a,u*o+l*r*s,-u*r+l*o*s,-l*a,r*a,o*a,s),i}var $Pe=1.0000010178*Ca,ZPe=100.46645683*Ju,QPe=129597742283429e-5*$l,cee=16002,lee=21863,uee=32004,fee=10931,dee=14529,hee=16368,mee=15318,pee=32794,JPe=64*1e-7*Ca,eIe=-152*1e-7*Ca,tIe=62*1e-7*Ca,nIe=-8*1e-7*Ca,iIe=32*1e-7*Ca,oIe=-41*1e-7*Ca,rIe=19*1e-7*Ca,sIe=-11*1e-7*Ca,aIe=-150*1e-7*Ca,cIe=-46*1e-7*Ca,lIe=68*1e-7*Ca,uIe=54*1e-7*Ca,fIe=14*1e-7*Ca,dIe=24*1e-7*Ca,hIe=-28*1e-7*Ca,mIe=22*1e-7*Ca,_ee=10,gee=16002,yee=21863,bee=10931,xee=1473,Tee=32004,Aee=4387,Cee=73,pIe=-325*1e-7,_Ie=-322*1e-7,gIe=-79*1e-7,yIe=232*1e-7,bIe=-52*1e-7,xIe=97*1e-7,TIe=55*1e-7,AIe=-41*1e-7,CIe=-105*1e-7,EIe=-137*1e-7,SIe=258*1e-7,wIe=35*1e-7,vIe=-116*1e-7,DIe=-88*1e-7,PIe=-112*1e-7,IIe=-80*1e-7,IT=new Q(0,0,Wn.TAI);function OIe(e,t){See(e,IT);let i=(IT.dayNumber-oL.dayNumber+(IT.secondsOfDay-oL.secondsOfDay)/qn.SECONDS_PER_DAY)/(qn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=$Pe+JPe*Math.cos(cee*o)+aIe*Math.sin(cee*o)+eIe*Math.cos(lee*o)+cIe*Math.sin(lee*o)+tIe*Math.cos(uee*o)+lIe*Math.sin(uee*o)+nIe*Math.cos(fee*o)+uIe*Math.sin(fee*o)+iIe*Math.cos(dee*o)+fIe*Math.sin(dee*o)+oIe*Math.cos(hee*o)+dIe*Math.sin(hee*o)+rIe*Math.cos(mee*o)+hIe*Math.sin(mee*o)+sIe*Math.cos(pee*o)+mIe*Math.sin(pee*o),s=ZPe+QPe*i+pIe*Math.cos(_ee*o)+CIe*Math.sin(_ee*o)+_Ie*Math.cos(gee*o)+EIe*Math.sin(gee*o)+gIe*Math.cos(yee*o)+SIe*Math.sin(yee*o)+yIe*Math.cos(bee*o)+wIe*Math.sin(bee*o)+bIe*Math.cos(xee*o)+vIe*Math.sin(xee*o)+xIe*Math.cos(Tee*o)+DIe*Math.sin(Tee*o)+TIe*Math.cos(Aee*o)+PIe*Math.sin(Aee*o)+AIe*Math.cos(Cee*o)+IIe*Math.sin(Cee*o),a=.0167086342-.0004203654*i,l=102.93734808*Ju+11612.3529*$l*i,u=469.97289*$l*i,f=174.87317577*Ju-8679.27034*$l*i;return wee(r,a,u,l,f,s,t)}function vee(e,t){See(e,IT);let i=(IT.dayNumber-oL.dayNumber+(IT.secondsOfDay-oL.secondsOfDay)/qn.SECONDS_PER_DAY)/qn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,l=.055545526-16e-9*i,u=5.15668983*Ju,f=-8e-5*i+.02966*o-42e-6*r-13e-8*s,h=83.35324312*Ju,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,g=125.04455501*Ju,m=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,y=218.31664563*Ju,b=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,x=297.85019547*Ju+$l*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),A=93.27209062*Ju+$l*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),E=134.96340251*Ju+$l*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),S=357.52910918*Ju+$l*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),v=310.17137918*Ju-$l*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),P=2*x,M=4*x,R=6*x,L=2*E,B=3*E,_=4*E,w=2*A;a+=3400.4*Math.cos(P)-635.6*Math.cos(P-E)-235.6*Math.cos(E)+218.1*Math.cos(P-S)+181*Math.cos(P+E),l+=.014216*Math.cos(P-E)+.008551*Math.cos(P-L)-.001383*Math.cos(E)+.001356*Math.cos(P+E)-.001147*Math.cos(M-B)-914e-6*Math.cos(M-L)+869e-6*Math.cos(P-S-E)-627e-6*Math.cos(P)-394e-6*Math.cos(M-_)+282e-6*Math.cos(P-S-L)-279e-6*Math.cos(x-E)-236e-6*Math.cos(L)+231e-6*Math.cos(M)+229e-6*Math.cos(R-_)-201e-6*Math.cos(L-w),f+=486.26*Math.cos(P-w)-40.13*Math.cos(P)+37.51*Math.cos(w)+25.73*Math.cos(L-w)+19.97*Math.cos(P-S-w),p+=-55609*Math.sin(P-E)-34711*Math.sin(P-L)-9792*Math.sin(E)+9385*Math.sin(M-B)+7505*Math.sin(M-L)+5318*Math.sin(P+E)+3484*Math.sin(M-_)-3417*Math.sin(P-S-E)-2530*Math.sin(R-_)-2376*Math.sin(P)-2075*Math.sin(P-B)-1883*Math.sin(L)-1736*Math.sin(R-5*E)+1626*Math.sin(S)-1370*Math.sin(R-B),m+=-5392*Math.sin(P-w)-540*Math.sin(S)-441*Math.sin(P)+423*Math.sin(w)-288*Math.sin(L-w),b+=-3332.9*Math.sin(P)+1197.4*Math.sin(P-E)-662.5*Math.sin(S)+396.3*Math.sin(E)-218*Math.sin(P-S);let D=2*v,I=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(P-w+v)*i+.614*Math.cos(P-w-v)*i-.0297*Math.cos(D)*o-.0335*Math.cos(v)*o+.0012*Math.cos(P-w+D)*o-16e-5*Math.cos(v)*r+4e-5*Math.cos(I)*r+4e-5*Math.cos(D)*r;let N=2.116*Math.sin(v)*i-.111*Math.sin(P-w-v)*i-.0015*Math.sin(v)*o;p+=N,b+=N,m+=-520.77*Math.sin(v)*i+13.66*Math.sin(P-w+v)*i+1.12*Math.sin(P-v)*i-1.06*Math.sin(w-v)*i+.66*Math.sin(D)*o+.371*Math.sin(v)*o-.035*Math.sin(P-w+D)*o-.015*Math.sin(P-w+v)*o+.0014*Math.sin(v)*r-.0011*Math.sin(I)*r-9e-4*Math.sin(D)*r,a*=GPe;let k=u+f*$l,H=h+p*$l,V=y+b*$l,j=g+m*$l;return wee(a,l,k,H,j,V,t)}var Eee=.012300034,RIe=Eee/(Eee+1)*-1;function MIe(e,t){return t=vee(e,t),d.multiplyByScalar(t,RIe,t)}var Dee=new J(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),uw=new d;C6.computeSunPositionInEarthInertialFrame=function(e,t){return c(e)||(e=Q.now()),c(t)||(t=new d),uw=OIe(e,uw),t=d.negate(uw,t),MIe(e,uw),d.subtract(t,uw,t),J.multiplyByVector(Dee,t,t),t};C6.computeMoonPositionInEarthInertialFrame=function(e,t){return c(e)||(e=Q.now()),t=vee(e,t),J.multiplyByVector(Dee,t,t),t};var z0=C6;var rL={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};rL.getMorphTime=function(e){return e===rL.SCENE3D?1:e===rL.MORPHING?void 0:0};var oe=Object.freeze(rL);function LIe(e){e=e??W.EMPTY_OBJECT,this.color=G.clone(e.color??G.WHITE),this.intensity=e.intensity??2}var Y_=LIe;function OT(){this.globeDepthTexture=void 0,this.gamma=void 0,this._viewport=new Ke,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=F.clone(F.IDENTITY),this._viewportTransformation=F.clone(F.IDENTITY),this._model=F.clone(F.IDENTITY),this._view=F.clone(F.IDENTITY),this._inverseView=F.clone(F.IDENTITY),this._projection=F.clone(F.IDENTITY),this._infiniteProjection=F.clone(F.IDENTITY),this._entireFrustum=new z,this._currentFrustum=new z,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=J.clone(F.IDENTITY),this._view3DDirty=!0,this._view3D=new F,this._inverseView3DDirty=!0,this._inverseView3D=new F,this._inverseModelDirty=!0,this._inverseModel=new F,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new J,this._viewRotation=new J,this._inverseViewRotation=new J,this._viewRotation3D=new J,this._inverseViewRotation3D=new J,this._inverseProjectionDirty=!0,this._inverseProjection=new F,this._modelViewDirty=!0,this._modelView=new F,this._modelView3DDirty=!0,this._modelView3D=new F,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new F,this._inverseModelViewDirty=!0,this._inverseModelView=new F,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new F,this._viewProjectionDirty=!0,this._viewProjection=new F,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new F,this._modelViewProjectionDirty=!0,this._modelViewProjection=new F,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new F,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new F,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new F,this._normalDirty=!0,this._normal=new J,this._normal3DDirty=!0,this._normal3D=new J,this._inverseNormalDirty=!0,this._inverseNormal=new J,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new J,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Hn,this._cameraPosition=new d,this._sunPositionWC=new d,this._sunPositionColumbusView=new d,this._sunDirectionWC=new d,this._sunDirectionEC=new d,this._moonDirectionEC=new d,this._lightDirectionWC=new d,this._lightDirectionEC=new d,this._lightColor=new d,this._lightColorHdr=new d,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new d,this._cameraRight=new d,this._cameraUp=new d,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new z,this._eyeEllipsoidNormalEC=new d,this._eyeEllipsoidCurvature=new z,this._modelToEnu=new F,this._enuToModel=new F,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new G,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new d,this._atmosphereRayleighScaleHeight=new d,this._atmosphereMieCoefficient=new d,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(OT.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!Ke.equals(e,this._viewport)){Ke.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return Iee(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Iee(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){F.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,F.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,F.getMatrix3(this.inverseModel,e),J.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return S6(this),this._view3D}},viewRotation:{get:function(){return S6(this),this._viewRotation}},viewRotation3D:{get:function(){return S6(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Mee(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Mee(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return WIe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return qIe(this),this._modelView}},modelView3D:{get:function(){return YIe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return JIe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return XIe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return KIe(this),this._inverseModelView3D}},viewProjection:{get:function(){return $Ie(this),this._viewProjection}},inverseViewProjection:{get:function(){return ZIe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return QIe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return eOe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return tOe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return nOe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return iOe(this),this._normal}},normal3D:{get:function(){return oOe(this),this._normal3D}},inverseNormal:{get:function(){return rOe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return sOe(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return Ree(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return Ree(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return this._ellipsoid??ie.default}}});function NIe(e,t){F.clone(t,e._view),F.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function FIe(e,t){F.clone(t,e._inverseView),F.getMatrix3(t,e._inverseViewRotation)}function BIe(e,t){F.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function kIe(e,t){F.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Pee=new d,UIe=new F;function VIe(e,t){d.clone(t.positionWC,e._cameraPosition),d.clone(t.directionWC,e._cameraDirection),d.clone(t.rightWC,e._cameraRight),d.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(c(o)?(e._eyeHeight=o.height,e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=d.fromRadians(o.longitude,o.latitude,0,n,Pee)):(e._eyeHeight=-n.maximumRadius,d.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=d.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Pee)),e._encodedCameraPositionMCDirty=!0,!c(i))return;e._eyeEllipsoidNormalEC=J.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=Ot.eastNorthUpToFixedFrame(i,n,UIe);e._enuToModel=F.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=F.inverseTransformation(e._enuToModel,e._modelToEnu),O.equalsEpsilon(n._radii.x,n._radii.y,O.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var E6=new J,zIe=new he;function HIe(e,t){Ot.computeIcrfToCentralBodyFixedMatrix(t.time,E6);let n=z0.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);J.multiplyByVector(E6,n,n),d.normalize(n,e._sunDirectionWC),n=J.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),d.normalize(n,n),n=z0.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),J.multiplyByVector(E6,n,n),J.multiplyByVector(e.viewRotation3D,n,n),d.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,zIe);i.project(r,e._sunPositionColumbusView)}OT.prototype.updateCamera=function(e){NIe(this,e.viewMatrix),FIe(this,e.inverseViewMatrix),VIe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==oe.SCENE2D&&e.frustum instanceof on};OT.prototype.updateFrustum=function(e){BIe(this,e.projectionMatrix),c(e.infiniteProjectionMatrix)&&kIe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=O.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;c(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};OT.prototype.updatePass=function(e){this._pass=e};var GIe=[],jIe=new Y_;OT.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===oe.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),HIe(this,e);let n=e.light??jIe;n instanceof Y_?(this._lightDirectionWC=d.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=d.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=d.normalize(d.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=J.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=d.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=d.multiplyByScalar(o,n.intensity,o);let r=d.maximumComponent(o);r>1?d.divideByScalar(o,r,this._lightColor):d.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=c(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??GIe,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let l=e.atmosphere;c(l)&&(this._atmosphereHsbShift=d.fromElements(l.hueShift,l.saturationShift,l.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=l.lightIntensity,this._atmosphereRayleighCoefficient=d.clone(l.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=l.rayleighScaleHeight,this._atmosphereMieCoefficient=d.clone(l.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=l.mieScaleHeight,this._atmosphereMieAnisotropy=l.mieAnisotropy,this._atmosphereDynamicLighting=l.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=Ot.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,h;c(u)?f.height>f.width?h=Math.tan(.5*u)*2/f.height:h=Math.tan(.5*u)*2/f.width:h=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=h*e.maximumScreenSpaceError,G.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Iee(e){if(e._viewportDirty){let t=e._viewport;F.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),F.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function WIe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==oe.SCENE2D&&e._mode!==oe.MORPHING&&!e._orthographicIn3D?F.inverse(e._projection,e._inverseProjection):F.clone(F.ZERO,e._inverseProjection))}function qIe(e){e._modelViewDirty&&(e._modelViewDirty=!1,F.multiplyTransformation(e._view,e._model,e._modelView))}function YIe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,F.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function XIe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,F.inverse(e.modelView,e._inverseModelView))}function KIe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,F.inverse(e.modelView3D,e._inverseModelView3D))}function $Ie(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,F.multiply(e._projection,e._view,e._viewProjection))}function ZIe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,F.inverse(e.viewProjection,e._inverseViewProjection))}function QIe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,F.multiply(e._projection,e.modelView,e._modelViewProjection))}function JIe(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function eOe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,F.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function tOe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,F.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function nOe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,F.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function iOe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;F.getMatrix3(e.inverseModelView,t),J.transpose(t,t)}}function oOe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;F.getMatrix3(e.inverseModelView3D,t),J.transpose(t,t)}}function rOe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;F.getMatrix3(e.modelView,t),J.transpose(t,t)}}function sOe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;F.getMatrix3(e.modelView3D,t),J.transpose(t,t)}}var Oee=new d;function Ree(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,F.multiplyByPoint(e.inverseModel,e._cameraPosition,Oee),Hn.fromCartesian(Oee,e._encodedCameraPositionMC))}var aOe=new d,cOe=new d,lOe=new d,uOe=new d,fOe=new he,dOe=new d,hOe=new F;function mOe(e,t,n,i,o,r,s,a){let l=aOe;l.x=e.y,l.y=e.z,l.z=e.x;let u=cOe;u.x=n.y,u.y=n.z,u.z=n.x;let f=lOe;f.x=i.y,f.y=i.z,f.z=i.x;let h=uOe;h.x=t.y,h.y=t.z,h.z=t.x,r===oe.SCENE2D&&(l.z=o*.5);let p=s.unproject(l,fOe);p.longitude=O.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=O.clamp(p.latitude,-O.PI_OVER_TWO,O.PI_OVER_TWO);let g=s.ellipsoid,m=g.cartographicToCartesian(p,dOe),y=Ot.eastNorthUpToFixedFrame(m,g,hOe);return F.multiplyByPointAsVector(y,u,u),F.multiplyByPointAsVector(y,f,f),F.multiplyByPointAsVector(y,h,h),c(a)||(a=new F),a[0]=u.x,a[1]=f.x,a[2]=-h.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-h.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-h.z,a[11]=0,a[12]=-d.dot(u,m),a[13]=-d.dot(f,m),a[14]=d.dot(h,m),a[15]=1,a}function S6(e){e._view3DDirty&&(e._mode===oe.SCENE3D?F.clone(e._view,e._view3D):mOe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),F.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Mee(e){e._inverseView3DDirty&&(F.inverseTransformation(e.view3D,e._inverseView3D),F.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var sL=OT;function ef(e,t){T.defined("canvas",e);let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0}=t??{};o.alpha=o.alpha??!1,o.stencil=o.stencil??!0,o.powerPreference=o.powerPreference??"high-performance";let s=c(n)?n(e,o):pOe(e,o,i),l=typeof WebGL2RenderingContext<"u"&&s instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=s,this._gl=s,this._webgl2=l,this._id=jn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new tL(this),this._textureCache=new iL;let u=s;this._stencilBits=u.getParameter(u.STENCIL_BITS),ut._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),ut._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),ut._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),ut._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),ut._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),ut._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),ut._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),ut._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),ut._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),ut._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),ut._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let f=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);ut._minimumAliasedLineWidth=f[0],ut._maximumAliasedLineWidth=f[1];let h=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);ut._minimumAliasedPointSize=h[0],ut._maximumAliasedPointSize=h[1];let p=u.getParameter(u.MAX_VIEWPORT_DIMS);ut._maximumViewportWidth=p[0],ut._maximumViewportHeight=p[1];let g=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);ut._highpFloatSupported=g.precision!==0;let m=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);ut._highpIntSupported=m.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!_r(u,["OES_standard_derivatives"]),this._blendMinmax=!!_r(u,["EXT_blend_minmax"]),this._elementIndexUint=!!_r(u,["OES_element_index_uint"]),this._depthTexture=!!_r(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!_r(u,["EXT_frag_depth"]),this._debugShaders=_r(u,["WEBGL_debug_shaders"]),this._textureFloat=!!_r(u,["OES_texture_float"]),this._textureHalfFloat=!!_r(u,["OES_texture_half_float"]),this._textureFloatLinear=!!_r(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!_r(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!_r(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!_r(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!_r(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!_r(u,["EXT_color_buffer_half_float"]),this._s3tc=!!_r(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!_r(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!_r(u,["WEBGL_compressed_texture_astc"]),this._etc=!!_r(u,["WEBG_compressed_texture_etc"]),this._etc1=!!_r(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!_r(u,["EXT_texture_compression_bptc"]),Xl.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let y=r?_r(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=y,ut._maximumTextureFilterAnisotropy=c(y)?u.getParameter(y.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,x,A,E,S,v,P,M,R,L;if(l){let D=this;b=function(){return D._gl.createVertexArray()},x=function(I){D._gl.bindVertexArray(I)},A=function(I){D._gl.deleteVertexArray(I)},E=function(I,N,k,H,V){u.drawElementsInstanced(I,N,k,H,V)},S=function(I,N,k,H){u.drawArraysInstanced(I,N,k,H)},v=function(I,N){u.vertexAttribDivisor(I,N)},P=function(I){u.drawBuffers(I)}}else M=_r(u,["OES_vertex_array_object"]),c(M)&&(b=function(){return M.createVertexArrayOES()},x=function(D){M.bindVertexArrayOES(D)},A=function(D){M.deleteVertexArrayOES(D)}),R=_r(u,["ANGLE_instanced_arrays"]),c(R)&&(E=function(D,I,N,k,H){R.drawElementsInstancedANGLE(D,I,N,k,H)},S=function(D,I,N,k){R.drawArraysInstancedANGLE(D,I,N,k)},v=function(D,I){R.vertexAttribDivisorANGLE(D,I)}),L=_r(u,["WEBGL_draw_buffers"]),c(L)&&(P=function(D){L.drawBuffersWEBGL(D)});this.glCreateVertexArray=b,this.glBindVertexArray=x,this.glDeleteVertexArray=A,this.glDrawElementsInstanced=E,this.glDrawArraysInstanced=S,this.glVertexAttribDivisor=v,this.glDrawBuffers=P,this._vertexArrayObject=!!M,this._instancedArrays=!!R,this._drawBuffers=!!L,ut._maximumDrawBuffers=this.drawBuffers?u.getParameter(ne.MAX_DRAW_BUFFERS):1,ut._maximumColorAttachments=this.drawBuffers?u.getParameter(ne.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new G(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let B=new sL,_=new Cc(this),w=ze.fromCache();this._defaultPassState=_,this._defaultRenderState=w,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=B,this._currentRenderState=w,this._currentPassState=_,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let D=0;D<ut._maximumVertexAttributes;D++)this._vertexAttribDivisors.push(0);this._pickObjects={},this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:o,allowTextureFilterAnisotropic:r},this.cache={},ze.apply(u,w,_)}function pOe(e,t,n){if(typeof WebGLRenderingContext>"u")throw new ae("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!c(r))throw new ae("The browser supports WebGL, but initialization failed.");return r}function _Oe(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function gOe(e,t,n,i){let o=`${_Oe(e,i)}: ${t.name}(`;for(let r=0;r<n.length;++r)r!==0&&(o+=", "),o+=n[r];return o+=");",o}function yOe(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new ae(gOe(e,t,n,i))}function bOe(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function xOe(e,t){if(!c(t))return e;function n(o){return function(){let r=o.apply(e,arguments);return t(e,o,arguments),r}}let i={};for(let o in e){let r=e[o];r instanceof Function?i[o]=n(r):Object.defineProperty(i,o,bOe(e,o,t))}return i}function _r(e,t){let n=t.length;for(let i=0;i<n;++i){let o=e.getExtension(t[i]);if(o)return o}}var TOe={};Object.defineProperties(ef.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=xOe(this._originalGLContext,e?yOe:void 0)}},defaultTexture:{get:function(){return this._defaultTexture===void 0&&(this._defaultTexture=new Rt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,0])},flipY:!1})),this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Rt({context:this,pixelFormat:ke.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Rt({context:this,pixelFormat:ke.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new Go({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return TOe}}});function AOe(e){if(e.validateFramebuffer){let t=e._gl,n=t.checkFramebufferStatus(t.FRAMEBUFFER);if(n!==t.FRAMEBUFFER_COMPLETE){let i;switch(n){case t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:i="Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format.";break;case t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:i="Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height.";break;case t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:i="Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer.";break;case t.FRAMEBUFFER_UNSUPPORTED:i="Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions.";break}throw new C(i)}}}function Lee(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,ze.partialApply(e._gl,o,t,r,n,i)}var w6;typeof WebGLRenderingContext<"u"&&(w6=[ne.BACK]);function v6(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=w6;if(c(t))t._bind(),AOe(e),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var COe=new ti;ef.prototype.clear=function(e,t){e=e??COe,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;c(o)&&(G.equals(this._clearColor,o)||(G.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),c(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),c(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;Lee(this,a,t,!0);let l=e.framebuffer??t.framebuffer;v6(this,l),n.clear(i)};function EOe(e,t,n,i,o){if(c(t)&&o.depthTest&&o.depthTest.enabled&&!t.hasDepthAttachment)throw new C("The depth test can not be enabled (drawCommand.renderState.depthTest.enabled) because the framebuffer (drawCommand.framebuffer) does not have a depth or depth-stencil renderbuffer.");v6(e,t),Lee(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function SOe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,l=t.instanceCount;if(!Me.validate(o))throw new C("drawCommand.primitiveType is required and must be valid.");if(T.defined("drawCommand.vertexArray",r),T.typeOf.number.greaterThanOrEquals("drawCommand.offset",s,0),c(a)&&T.typeOf.number.greaterThanOrEquals("drawCommand.count",a,0),T.typeOf.number.greaterThanOrEquals("drawCommand.instanceCount",l,0),l>0&&!e.instancedArrays)throw new C("Instanced arrays extension is not supported");e._us.model=t._modelMatrix??F.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let u=r.indexBuffer;c(u)?(s=s*u.bytesPerIndex,c(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,l===0?e._gl.drawElements(o,a,u.indexDatatype,s):e.glDrawElementsInstanced(o,a,u.indexDatatype,s,l)):(c(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,l===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,l)),r._unBind()}ef.prototype.draw=function(e,t,n,i){T.defined("drawCommand",e),T.defined("drawCommand.shaderProgram",e._shaderProgram),t=t??this._defaultPassState;let o=e._framebuffer??t.framebuffer,r=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,EOe(this,o,t,n,r),SOe(this,e,n,i)};ef.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=w6;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};ef.prototype.readPixels=function(e){let t=this._gl;e=e??W.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??t.drawingBufferWidth,r=e.height??t.drawingBufferHeight,s=e.framebuffer;T.typeOf.number.greaterThan("readState.width",o,0),T.typeOf.number.greaterThan("readState.height",r,0);let a=Ue.UNSIGNED_BYTE;c(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype);let l=ke.createTypedArray(ke.RGBA,a,o,r);return v6(this,s),t.readPixels(n,i,o,r,ke.RGBA,Ue.toWebGLConstant(a,this),l),l};var Nee={position:0,textureCoordinates:1};ef.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!c(e)){let t=new ct({attributes:{position:new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Me.TRIANGLES});e=ni.fromGeometry({context:this,geometry:t,attributeLocations:Nee,bufferUsage:Be.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};ef.prototype.createViewportQuadCommand=function(e,t){return t=t??W.EMPTY_OBJECT,new Je({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Me.TRIANGLES,renderState:t.renderState,shaderProgram:en.fromCache({context:this,vertexShaderSource:xT,fragmentShaderSource:e,attributeLocations:Nee}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};ef.prototype.getObjectByPickColor=function(e){return T.defined("pickColor",e),this._pickObjects[e.toRgba()]};function D6(e,t,n){this._pickObjects=e,this.key=t,this.color=n}Object.defineProperties(D6.prototype,{object:{get:function(){return this._pickObjects[this.key]},set:function(e){this._pickObjects[this.key]=e}}});D6.prototype.destroy=function(){delete this._pickObjects[this.key]};ef.prototype.createPickId=function(e){T.defined("object",e),++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new ae("Out of unique Pick IDs.");return this._pickObjects[t]=e,new D6(this._pickObjects,t,G.fromRgba(t))};ef.prototype.isDestroyed=function(){return!1};ef.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];c(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),de(this)};var aL=ef;function RT(e){e=e??W.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:l}=e;if(T.defined("options.context",t),T.defined("options.width",n),T.defined("options.height",i),this._width=n,this._height=i,c(o)!==c(r))throw new C("Both color renderbuffer and texture attachments must be provided.");if(c(s)!==c(a))throw new C("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new Wr({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:l}),this._colorFramebuffer=new Wr({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:l})}RT.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};RT.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};RT.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),c(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};RT.prototype.isDestroyed=function(){return!1};RT.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),de(this)};var cL=RT;var dl={RGBA4:ne.RGBA4,RGBA8:ne.RGBA8,RGBA16F:ne.RGBA16F,RGBA32F:ne.RGBA32F,RGB5_A1:ne.RGB5_A1,RGB565:ne.RGB565,DEPTH_COMPONENT16:ne.DEPTH_COMPONENT16,STENCIL_INDEX8:ne.STENCIL_INDEX8,DEPTH_STENCIL:ne.DEPTH_STENCIL,DEPTH24_STENCIL8:ne.DEPTH24_STENCIL8,validate:function(e){return e===dl.RGBA4||e===dl.RGBA8||e===dl.RGBA16F||e===dl.RGBA32F||e===dl.RGB5_A1||e===dl.RGB565||e===dl.DEPTH_COMPONENT16||e===dl.STENCIL_INDEX8||e===dl.DEPTH_STENCIL||e===dl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ne.FLOAT?dl.RGBA32F:e===ne.HALF_FLOAT_OES?dl.RGBA16F:dl.RGBA8}},Ec=Object.freeze(dl);function fw(e){e=e??W.EMPTY_OBJECT,T.defined("options.context",e.context);let n=e.context._gl,i=ut.maximumRenderbufferSize,o=e.format??Ec.RGBA4,r=c(e.width)?e.width:n.drawingBufferWidth,s=c(e.height)?e.height:n.drawingBufferHeight,a=e.numSamples??1;if(!Ec.validate(o))throw new C("Invalid format.");if(T.typeOf.number.greaterThan("width",r,0),r>i)throw new C(`Width must be less than or equal to the maximum renderbuffer size (${i}). Check maximumRenderbufferSize.`);if(T.typeOf.number.greaterThan("height",s,0),s>i)throw new C(`Height must be less than or equal to the maximum renderbuffer size (${i}). Check maximumRenderbufferSize.`);this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(fw.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});fw.prototype._getRenderbuffer=function(){return this._renderbuffer};fw.prototype.isDestroyed=function(){return!1};fw.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),de(this)};var tf=fw;function bs(e){if(e=e??W.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,!this._color&&!this._depth&&!this._depthStencil)throw new C("Must enable at least one type of framebuffer attachment.");if(this._depth&&this._depthStencil)throw new C("Cannot have both a depth and depth-stencil attachment.");this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=e.createDepthAttachments??!0,this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(bs.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});bs.prototype.isDirty=function(e,t,n,i,o){n=n??1;let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=c(i)&&this._pixelDatatype!==i||c(o)&&this._pixelFormat!==o,l=n===1?c(this._framebuffer):c(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!l||this._color&&!c(this._colorTextures[0])};bs.prototype.update=function(e,t,n,i,o,r){if(!c(t)||!c(n))throw new C("width and height must be defined.");if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??Ue.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??ke.RGBA:void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Rt({context:e,width:t,height:n,pixelFormat:r,pixelDatatype:o,sampler:Qt.NEAREST}),this._numSamples>1){let a=Ec.getColorFormat(o);this._colorRenderbuffers[s]=new tf({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Rt({context:e,width:t,height:n,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Qt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new tf({context:e,width:t,height:n,format:Ec.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new tf({context:e,width:t,height:n,format:Ec.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Rt({context:e,width:t,height:n,pixelFormat:ke.DEPTH_COMPONENT,pixelDatatype:Ue.UNSIGNED_INT,sampler:Qt.NEAREST}):this._depthRenderbuffer=new tf({context:e,width:t,height:n,format:Ec.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new cL({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new Wr({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};bs.prototype.getColorTexture=function(e){if(e=e??0,e>=this._colorAttachmentsLength)throw new C("index must be smaller than total number of color attachments.");return this._colorTextures[e]};bs.prototype.setColorTexture=function(e,t){if(t=t??0,this._createColorAttachments)throw new C("createColorAttachments must be false if setColorTexture is called.");if(t>=this._colorAttachmentsLength)throw new C("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};bs.prototype.getColorRenderbuffer=function(e){if(e=e??0,e>=this._colorAttachmentsLength)throw new C("index must be smaller than total number of color attachments.");return this._colorRenderbuffers[e]};bs.prototype.setColorRenderbuffer=function(e,t){if(t=t??0,this._createColorAttachments)throw new C("createColorAttachments must be false if setColorRenderbuffer is called.");if(t>=this._colorAttachmentsLength)throw new C("index must be smaller than total number of color attachments.");this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};bs.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};bs.prototype.setDepthRenderbuffer=function(e){if(this._createDepthAttachments)throw new C("createDepthAttachments must be false if setDepthRenderbuffer is called.");this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};bs.prototype.getDepthTexture=function(){return this._depthTexture};bs.prototype.setDepthTexture=function(e){if(this._createDepthAttachments)throw new C("createDepthAttachments must be false if setDepthTexture is called.");this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};bs.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};bs.prototype.setDepthStencilRenderbuffer=function(e){if(this._createDepthAttachments)throw new C("createDepthAttachments must be false if setDepthStencilRenderbuffer is called.");this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};bs.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};bs.prototype.setDepthStencilTexture=function(e){if(this._createDepthAttachments)throw new C("createDepthAttachments must be false if setDepthStencilTexture is called.");this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};bs.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};bs.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};bs.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};bs.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&c(i)&&!i.isDestroyed()&&i.destroy(),c(i)&&i.isDestroyed()&&(e[n]=void 0);let o=t[n];this._createColorAttachments&&c(o)&&!o.isDestroyed()&&o.destroy(),c(o)&&o.isDestroyed()&&(t[n]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),c(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),c(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),c(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),c(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var pi=bs;function wOe(e,t,n){if(T.defined("context",e),T.defined("urls",t),Object.values(Go.FaceName).some(r=>!c(t[r])))throw new C("urls must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},o=[we.createIfNeeded(t.positiveX).fetchImage(i),we.createIfNeeded(t.negativeX).fetchImage(i),we.createIfNeeded(t.positiveY).fetchImage(i),we.createIfNeeded(t.negativeY).fetchImage(i),we.createIfNeeded(t.positiveZ).fetchImage(i),we.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(o).then(function(r){return new Go({context:e,source:{positiveX:r[0],negativeX:r[1],positiveY:r[2],negativeY:r[3],positiveZ:r[4],negativeZ:r[5]}})})}var lL=wOe;var H0={VERTEX:0,FRAGMENT:1,BOTH:2};H0.includesVertexShader=function(e){return T.typeOf.number("destination",e),e===H0.VERTEX||e===H0.BOTH};H0.includesFragmentShader=function(e){return T.typeOf.number("destination",e),e===H0.FRAGMENT||e===H0.BOTH};var ge=Object.freeze(H0);function P6(e){this.name=e,this.fields=[]}P6.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};P6.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var uL=P6;function I6(e){this.signature=e,this.body=[]}I6.prototype.addLines=function(e){if(typeof e!="string"&&!Array.isArray(e))throw new C(`Expected lines to be a string or an array of strings, actual value was ${e}`);let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};I6.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var fL=I6;function Sc(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Sc.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Sc.prototype.addDefine=function(e,t,n){T.typeOf.string("identifier",e),n=n??ge.BOTH;let i=e;c(t)&&(i+=` ${t.toString()}`),ge.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),ge.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Sc.prototype.addStruct=function(e,t,n){T.typeOf.string("structId",e),T.typeOf.string("structName",t),T.typeOf.number("destination",n),this._structs[e]=new uL(t),ge.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),ge.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Sc.prototype.addStructField=function(e,t,n){T.typeOf.string("structId",e),T.typeOf.string("type",t),T.typeOf.string("identifier",n),this._structs[e].addField(t,n)};Sc.prototype.addFunction=function(e,t,n){T.typeOf.string("functionName",e),T.typeOf.string("signature",t),T.typeOf.number("destination",n),this._functions[e]=new fL(t),ge.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),ge.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Sc.prototype.addFunctionLines=function(e,t){if(T.typeOf.string("functionName",e),typeof t!="string"&&!Array.isArray(t))throw new C(`Expected lines to be a string or an array of strings, actual value was ${t}`);this._functions[e].addLines(t)};Sc.prototype.addUniform=function(e,t,n){T.typeOf.string("type",e),T.typeOf.string("identifier",t),n=n??ge.BOTH;let i=`uniform ${e} ${t};`;ge.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),ge.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Sc.prototype.setPositionAttribute=function(e,t){if(T.typeOf.string("type",e),T.typeOf.string("identifier",t),c(this._positionAttributeLine))throw new C("setPositionAttribute() must be called exactly once for the attribute used for gl_Position. For other attributes, use addAttribute()");return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Sc.prototype.addAttribute=function(e,t){T.typeOf.string("type",e),T.typeOf.string("identifier",t);let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=DOe(e),i};Sc.prototype.addVarying=function(e,t,n){T.typeOf.string("type",e),T.typeOf.string("identifier",t),n=c(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};Sc.prototype.addVertexLines=function(e){if(typeof e!="string"&&!Array.isArray(e))throw new C(`Expected lines to be a string or an array of strings, actual value was ${e}`);let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Sc.prototype.addFragmentLines=function(e){if(typeof e!="string"&&!Array.isArray(e))throw new C(`Expected lines to be a string or an array of strings, actual value was ${e}`);let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?t.push.apply(t,e):t.push(e)};Sc.prototype.buildShaderProgram=function(e){T.typeOf.object("context",e);let t=c(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=vOe(this),i=POe(this),o=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(`
`),r=new He({defines:this._vertexShaderParts.defineLines,sources:[o]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(`
`),a=new He({defines:this._fragmentShaderParts.defineLines,sources:[s]});return en.fromCache({context:e,vertexShaderSource:r,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Sc.prototype.clone=function(){return We(this,!0)};function vOe(e){let t=[],n=[],i,o=e._vertexShaderParts.structIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.structIds,i=0;i<o.length;i++)r=o[i],s=e._structs[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}function DOe(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function POe(e){let t=[],n=[],i,o=e._vertexShaderParts.functionIds,r,s,a;for(i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),t.push.apply(t,a);for(o=e._fragmentShaderParts.functionIds,i=0;i<o.length;i++)r=o[i],s=e._functions[r],a=s.generateGlslLines(),n.push.apply(n,a);return{vertexLines:t,fragmentLines:n}}var MT=Sc;function dw({x:e,y:t,width:n,height:i}){this.rectangle=new Ke(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function O6({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new dw({x:n,y:n,width:e-2*n,height:t-2*n})}O6.prototype.pack=function(e,{width:t,height:n}){T.typeOf.number.greaterThanOrEquals("index",e,0),T.typeOf.number.greaterThanOrEquals("image.width",t,1),T.typeOf.number.greaterThanOrEquals("image.height",n,1);let i=this._findNode(this._root,{width:t,height:n});if(c(i))return i.index=e,i};O6.prototype._findNode=function(e,{width:t,height:n}){if(c(e)){if(!c(e.childNode1)&&!c(e.childNode2)){if(c(e.index))return;let{rectangle:i}=e,o=i.width,r=i.height,s=o-t,a=r-n;return s<0||a<0?void 0:s===0&&a===0?e:s>a?(e.childNode1=new dw({x:i.x,y:i.y,width:t,height:r}),e.childNode2=new dw({x:i.x+t,y:i.y,width:s,height:r}),this._findNode(e.childNode1,{width:t,height:n})):(e.childNode1=new dw({x:i.x,y:i.y,width:o,height:n}),e.childNode2=new dw({x:i.x,y:i.y+n,width:o,height:a}),this._findNode(e.childNode1,{width:t,height:n}))}return this._findNode(e.childNode1,{width:t,height:n})||this._findNode(e.childNode2,{width:t,height:n})}};var hw=O6;var Fee=16;function hl(e){e=e??W.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new z(Fee,Fee);T.typeOf.number.greaterThanOrEquals("options.borderWidthInPixels",t,0),T.typeOf.number.greaterThan("options.initialSize.x",n.x,0),T.typeOf.number.greaterThan("options.initialSize.y",n.y,0),this._pixelFormat=e.pixelFormat??ke.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=jn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(hl.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},rectangles:{get:function(){return this._rectangles}},texture:{get:function(){return this._texture}},pixelFormat:{get:function(){return this._pixelFormat}},sampler:{get:function(){return this._sampler}},numberOfImages:{get:function(){return this._nextIndex}},guid:{get:function(){return this._guid}},sizeInBytes:{get:function(){return c(this._texture)?this._texture.sizeInBytes:0}}});hl.prototype.computeTextureCoordinates=function(e,t){T.typeOf.number.greaterThanOrEquals("index",e,0);let n=this._texture,i=this._rectangles[e];if(c(t)||(t=new Ke),!c(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let o=n.width,r=n.height,s=i.width,a=i.height,l=i.x,u=i.y,f=this._subRegions.get(e);if(c(f)){let h=this._rectangles[f];l+=h.x,u+=h.y}return t.x=l/o,t.y=u/r,t.width=s/o,t.height=a/r,t};hl.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,s=new Rt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),a=e._gl,l=s._textureTarget,u=this._texture,f=new Wr({context:e,colorTextures:[u],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(l,s._texture),f._bind();let h=this.rectangles,p=this._subRegions;for(let g=0;g<h.length;++g){let m=i[g],y=h[g];if(!c(m)||!c(y)||c(p.get(g)))continue;let{x:b,y:x,width:A,height:E}=m;a.copyTexSubImage2D(l,0,b,x,y.x,y.y,A,E)}return a.bindTexture(l,null),s._initialized=!0,f._unBind(),f.destroy(),s};hl.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,o=this._imagesToAddQueue,r=this._texture,s=r.width,a=r.height,l=this._subRegions,u=i.map((A,E)=>new Bee({index:E,image:A})).filter((A,E)=>c(A.image)&&!c(l.get(E))),f=0,h=0,p=0;for(let A=t;A<o.length;++A){let{width:E,height:S}=o[A].image;f=Math.max(f,E),h=Math.max(h,S),p+=E*S,u.push(o[A])}s=Math.max(f,s),a=Math.max(h,a),e.webgl2||(s=O.nextPowerOfTwo(s),a=O.nextPowerOfTwo(a));let g=p,m=1;for(;g/s/a>=1;)m*=2,s>a?a*=m:s*=m;u.sort(({image:A},{image:E})=>E.height*E.width-A.height*A.width);let y=new Array(this._nextIndex);for(let A of this._subRegions.keys())c(l.get(A))&&(y[A]=i[A]);let b,x=!1;for(;!x;){b=new hw({height:a,width:s,borderPadding:n});let A;for(A=0;A<u.length;++A){let{index:E,image:S}=u[A];if(!c(S))continue;let v=b.pack(E,S);if(!c(v)){s>a?a*=2:s*=2;break}y[E]=v.rectangle}x=A===u.length}this._texturePacker=b,this._texture=this._copyFromTexture(e,s,a,y),r.destroy(),this._rectangles=y,this._guid=jn()};hl.prototype.getImageIndex=function(e){return T.typeOf.string("id",e),this._indexById.get(e)};hl.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let o=this._texture,r=this._rectangles[e];try{o.copyFrom({source:t,xOffset:r.x,yOffset:r.y}),c(n)&&n(e)}catch(s){if(c(i)){i(s);return}}};function Bee({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}hl.prototype._addImage=function(e,t){return T.typeOf.number.greaterThanOrEquals("index",e,0),T.defined("image",t),new Promise((n,i)=>{this._imagesToAddQueue.push(new Bee({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};hl.prototype._processImageQueue=function(e){let t=this._imagesToAddQueue;if(t.length===0)return!1;this._rectangles.length=this._nextIndex;let n,i;for(n=0;n<t.length;++n){let o=t[n],{image:r,index:s}=o,a=this._texturePacker.pack(s,r);if(!c(a)){try{this._resize(e,n)}catch(l){i=l,c(o.reject)&&o.reject(i)}break}this._rectangles[s]=a.rectangle}if(c(i)){for(n=n+1;n<t.length;++n){let{resolve:o}=t[n];c(o)&&o(-1)}return t.length=0,!1}for(let o=0;o<t.length;++o)this._copyImageToTexture(t[o]);return t.length=0,!0};hl.prototype.update=function(e){if(!c(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,o=this._sampler,r=this._borderWidthInPixels;this._texture=new Rt({context:e,width:t,height:n,pixelFormat:i,sampler:o}),this._texturePacker=new hw({height:n,width:t,borderPadding:r})}return this._processImageQueue(e)};async function IOe(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof we)&&(e=we.createIfNeeded(e).fetchImage()),e}hl.prototype.addImage=function(e,t){T.typeOf.string("id",e),T.defined("image",t);let n=this._indexPromiseById.get(e);if(c(n))return n;let i=this._nextIndex++;return this._indexById.set(e,i),n=(async()=>(t=await IOe(t,e),T.defined("image",t),this.isDestroyed()||!c(t)?-1:this._addImage(i,t)))(),this._indexPromiseById.set(e,n),n};hl.prototype.addImageSubRegion=function(e,t){T.typeOf.string("id",e),T.defined("subRegion",t);let n=this._indexById.get(e);if(!c(n))throw new ae(`image with id "${e}" not found in the atlas.`);let i=this._indexPromiseById.get(e);for(let[r,s]of this._subRegions.entries())if(n===s&&this._rectangles[r].equals(t))return i.then(l=>l===-1?-1:r);let o=this._nextIndex++;return this._subRegions.set(o,n),this._rectangles[o]=t.clone(),i.then(r=>{if(r===-1)return-1;let s=this._rectangles[r];return T.typeOf.number.lessThanOrEquals("subRegion.x",t.x,s.width),T.typeOf.number.lessThanOrEquals("subRegion.x + subRegion.width",t.x+t.width,s.width),T.typeOf.number.lessThanOrEquals("subRegion.y",t.y,s.height),T.typeOf.number.lessThanOrEquals("subRegion.y + subRegion.height",t.y+t.height,s.height),o})};hl.prototype.isDestroyed=function(){return!1};hl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{c(e)&&e(-1)}),de(this)};var LT=hl;function Ms(e,t,n,i){if(T.defined("context",e),!t||t.length===0)throw new C("At least one attribute is required.");let o=Ms._verifyAttributes(t);n=n??0;let r=[],s={},a,l,u=o.length;for(let h=0;h<u;++h){let p=o[h];if(p.vertexBuffer){r.push(p);continue}l=p.usage,a=s[l],c(a)||(a=s[l]=[]),a.push(p)}function f(h,p){return $.getSizeInBytes(p.componentDatatype)-$.getSizeInBytes(h.componentDatatype)}this._allBuffers=[];for(l in s)if(s.hasOwnProperty(l)){a=s[l],a.sort(f);let h=Ms._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:h,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Ms._createArrayViews(a,h)};this._allBuffers.push(g)}this._size=0,this._instanced=i??!1,this._precreated=r,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Ms._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let o=e[i],r={index:o.index??i,enabled:o.enabled??!0,componentsPerAttribute:o.componentsPerAttribute,componentDatatype:o.componentDatatype??$.FLOAT,normalize:o.normalize??!1,vertexBuffer:o.vertexBuffer,usage:o.usage??Be.STATIC_DRAW};if(t.push(r),r.componentsPerAttribute!==1&&r.componentsPerAttribute!==2&&r.componentsPerAttribute!==3&&r.componentsPerAttribute!==4)throw new C("attribute.componentsPerAttribute must be in the range [1, 4].");let s=r.componentDatatype;if(!$.validate(s))throw new C("Attribute must have a valid componentDatatype or not specify it.");if(!Be.validate(r.usage))throw new C("Attribute must have a valid usage or not specify it.")}let n=new Array(t.length);for(let i=0;i<t.length;++i){let r=t[i].index;if(n[r])throw new C(`Index ${r} is used by more than one attribute.`);n[r]=!0}return t};Ms._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*$.getSizeInBytes(a.componentDatatype)}let i=n>0?$.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Ms._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r<o;++r){let s=e[r],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/$.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*$.getSizeInBytes(a)}return n};Ms.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let o=t[n];Ms._resize(o,this._size),Ms._appendWriters(this.writers,o)}R6(this)};Ms._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(c(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let l=0;l<a;++l)r[l]=s[l]}let i=e.arrayViews,o=i.length;for(let r=0;r<o;++r){let s=i[r];s.view=$.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var OOe=[function(e,t,n){return function(i,o){t[i*n]=o,e.needsCommit=!0}},function(e,t,n){return function(i,o,r){let s=i*n;t[s]=o,t[s+1]=r,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s){let a=i*n;t[a]=o,t[a+1]=r,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,o,r,s,a){let l=i*n;t[l]=o,t[l+1]=r,t[l+2]=s,t[l+3]=a,e.needsCommit=!0}}];Ms._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let o=0;o<i;++o){let r=n[o];e[r.index]=OOe[r.componentsPerAttribute-1](t,r.view,r.vertexSizeInComponentType)}};Ms.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,o,r;for(o=0,r=n.length;o<r;++o)i=n[o],t=ROe(this,i)||t;if(t||!c(this.va)){R6(this);let s=this.va=[],a=O.SIXTY_FOUR_KILOBYTES-4,l=c(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<l;++u){let f=[];for(o=0,r=n.length;o<r;++o){i=n[o];let h=u*(i.vertexSizeInBytes*a);Ms._appendAttributes(f,i,h,this._instanced)}f=f.concat(this._precreated),s.push({va:new ni({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==l-1?a:this._size%a)})}}};function ROe(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=c(n);if(!o||n.sizeInBytes<i)return o&&n.destroy(),t.vertexBuffer=bt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Ms._appendAttributes=function(e,t,n,i){let o=t.arrayViews,r=o.length;for(let s=0;s<r;++s){let a=o[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Ms.prototype.subCommit=function(e,t){if(e<0||e>=this._size)throw new C("offsetInVertices must be greater than or equal to zero and less than the vertex array size.");if(e+t>this._size)throw new C("offsetInVertices + lengthInVertices cannot exceed the vertex array size.");let n=this._allBuffers;for(let i=0,o=n.length;i<o;++i)MOe(n[i],e,t)};function MOe(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Ms.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function R6(e){let t=e.va;if(!c(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Ms.prototype.isDestroyed=function(){return!1};Ms.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return R6(this),de(this)};var X_=Ms;function K_(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new pe,this.setValue(e)}Object.defineProperties(K_.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});K_.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};K_.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=c(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};K_.prototype.equals=function(e){return this===e||e instanceof K_&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};K_.prototype.valueOf=function(){return this._value};K_.prototype.toString=function(){return String(this._value)};var Xn=K_;function LOe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];c(a)&&(a(),this[n]=void 0),r!==void 0&&(!c(r)||!c(r.getValue))&&c(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),c(r)&&c(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function NOe(e){return new Xn(e)}function FOe(e,t,n){return LOe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??NOe)}var fe=FOe;function mw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(mw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),image:fe("image"),scale:fe("scale"),pixelOffset:fe("pixelOffset"),eyeOffset:fe("eyeOffset"),horizontalOrigin:fe("horizontalOrigin"),verticalOrigin:fe("verticalOrigin"),heightReference:fe("heightReference"),color:fe("color"),rotation:fe("rotation"),alignedAxis:fe("alignedAxis"),sizeInMeters:fe("sizeInMeters"),width:fe("width"),height:fe("height"),scaleByDistance:fe("scaleByDistance"),translucencyByDistance:fe("translucencyByDistance"),pixelOffsetScaleByDistance:fe("pixelOffsetScaleByDistance"),imageSubRegion:fe("imageSubRegion"),distanceDisplayCondition:fe("distanceDisplayCondition"),disableDepthTestDistance:fe("disableDepthTestDistance"),splitDirection:fe("splitDirection")});mw.prototype.clone=function(e){return c(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new mw(this)};mw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var wc=mw;function G0(){this._array=[],this._hash={}}Object.defineProperties(G0.prototype,{length:{get:function(){return this._array.length}},values:{get:function(){return this._array}}});G0.prototype.contains=function(e){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");return c(this._hash[e])};G0.prototype.set=function(e,t){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");let n=this._hash[e];t!==n&&(this.remove(e),this._hash[e]=t,this._array.push(t))};G0.prototype.get=function(e){if(typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");return this._hash[e]};G0.prototype.remove=function(e){if(c(e)&&typeof e!="string"&&typeof e!="number")throw new C("key is required to be a string or number.");let t=this._hash[e],n=c(t);if(n){let i=this._array;i.splice(i.indexOf(t),1),delete this._hash[e]}return n};G0.prototype.removeAll=function(){let e=this._array;e.length>0&&(this._hash={},e.length=0)};var Et=G0;function Zl(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(Zl.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});Zl.packedLength=2;Zl.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,t[n++]=e.near,t[n]=e.far,t};Zl.unpack=function(e,t,n){if(!c(e))throw new C("array is required");return t=t??0,c(n)||(n=new Zl),n.near=e[t++],n.far=e[t],n};Zl.equals=function(e,t){return e===t||c(e)&&c(t)&&e.near===t.near&&e.far===t.far};Zl.clone=function(e,t){if(c(e))return c(t)||(t=new Zl),t.near=e.near,t.far=e.far,t};Zl.prototype.clone=function(e){return Zl.clone(this,e)};Zl.prototype.equals=function(e){return Zl.equals(this,e)};var Lt=Zl;function nf(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}nf.clone=function(e,t){if(c(e))return c(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new nf(e.near,e.nearValue,e.far,e.farValue)};nf.packedLength=4;nf.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};nf.unpack=function(e,t,n){if(!c(e))throw new C("array is required");return t=t??0,c(n)||(n=new nf),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};nf.equals=function(e,t){return e===t||c(e)&&c(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};nf.prototype.clone=function(e){return nf.clone(this,e)};nf.prototype.equals=function(e){return nf.equals(this,e)};var Bt=nf;var j0={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6,CLIP_TO_GROUND:7},qe=Object.freeze(j0);function of(e){return e===j0.CLAMP_TO_GROUND||e===j0.CLAMP_TO_3D_TILE||e===j0.CLAMP_TO_TERRAIN}function NT(e){return e===j0.RELATIVE_TO_GROUND||e===j0.RELATIVE_TO_3D_TILE||e===j0.RELATIVE_TO_TERRAIN}var BOe={CENTER:0,LEFT:1,RIGHT:-1},xi=Object.freeze(BOe);var kOe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1},Fn=Object.freeze(kOe);var UOe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),lt=UOe;function _d(){C.throwInstantiationError()}Object.defineProperties(_d.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError}});_d.prototype.getValue=C.throwInstantiationError;_d.prototype.equals=C.throwInstantiationError;_d.equals=function(e,t){return e===t||c(e)&&e.equals(t)};_d.arrayEquals=function(e,t){if(e===t)return!0;if(!c(e)||!c(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!_d.equals(e[i],t[i]))return!1;return!0};_d.isConstant=function(e){return!c(e)||e.isConstant};_d.getValueOrUndefined=function(e,t,n){return c(e)?e.getValue(t,n):void 0};_d.getValueOrDefault=function(e,t,n,i){return c(e)?e.getValue(t,i)??n:n};_d.getValueOrClonedDefault=function(e,t,n,i){let o;return c(e)&&(o=e.getValue(t,i)),c(o)||(o=n.clone(o)),o};var Y=_d;var VOe={LEFT:-1,NONE:0,RIGHT:1},qr=Object.freeze(VOe);var zOe=G.WHITE,HOe=d.ZERO,GOe=qe.NONE,jOe=z.ZERO,WOe=1,qOe=0,YOe=d.ZERO,XOe=xi.CENTER,KOe=Fn.CENTER,$Oe=!1,ZOe=qr.NONE,QOe=new d,JOe=new G,e1e=new d,t1e=new z,n1e=new Bt,i1e=new Bt,o1e=new Bt,r1e=new Ke,s1e=new Lt;function kee(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function $_(e,t){if(!c(e))throw new C("entityCluster is required.");if(!c(t))throw new C("entityCollection is required.");t.collectionChanged.addEventListener($_.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}$_.prototype.update=function(e){if(!c(e))throw new C("time is required.");let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._billboard,l,u=r.billboard,f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),h;if(f&&(h=Y.getValueOrUndefined(s._position,e,QOe),l=Y.getValueOrUndefined(a._image,e),f=c(h)&&c(l)),!f){M6(r,s,n);continue}Y.isConstant(s._position)||(n._clusterDirty=!0),c(u)||(u=n.getBillboard(s),u.id=s,r.billboard=u,r.textureValue=void 0),u.show=f,r.textureValue!==l&&(u.image=l,r.textureValue=l),u.position=h,u.color=Y.getValueOrDefault(a._color,e,zOe,JOe),u.eyeOffset=Y.getValueOrDefault(a._eyeOffset,e,HOe,e1e),u.heightReference=Y.getValueOrDefault(a._heightReference,e,GOe),u.pixelOffset=Y.getValueOrDefault(a._pixelOffset,e,jOe,t1e),u.scale=Y.getValueOrDefault(a._scale,e,WOe),u.rotation=Y.getValueOrDefault(a._rotation,e,qOe),u.alignedAxis=Y.getValueOrDefault(a._alignedAxis,e,YOe),u.horizontalOrigin=Y.getValueOrDefault(a._horizontalOrigin,e,XOe),u.verticalOrigin=Y.getValueOrDefault(a._verticalOrigin,e,KOe),u.width=Y.getValueOrUndefined(a._width,e),u.height=Y.getValueOrUndefined(a._height,e),u.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,n1e),u.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,i1e),u.pixelOffsetScaleByDistance=Y.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,o1e),u.sizeInMeters=Y.getValueOrDefault(a._sizeInMeters,e,$Oe),u.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,s1e),u.disableDepthTestDistance=Y.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=Y.getValueOrDefault(a._splitDirection,e,ZOe);let p=Y.getValueOrUndefined(a._imageSubRegion,e,r1e);c(p)&&u.setImageSubRegion(u.image,p)}return!0};$_.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new C("entity is required.");if(!c(t))throw new C("result is required.");let n=this._items.get(e.id);if(!c(n)||!c(n.billboard))return lt.FAILED;let i=n.billboard;if(i.heightReference===qe.NONE)t.center=d.clone(i.position,t.center);else{if(!c(i._clampedPosition))return lt.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,lt.DONE};$_.prototype.isDestroyed=function(){return!1};$_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener($_.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return de(this)};$_.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],c(r._billboard)&&c(r._position)&&s.set(r.id,new kee(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._billboard)&&c(r._position)?s.contains(r.id)||s.set(r.id,new kee(r)):(M6(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],M6(s.get(r.id),r,a),s.remove(r.id)};function M6(e,t,n){c(e)&&(e.billboard=void 0,n.removeBillboard(t))}var dL=$_;var a1e=new d;function Rh(e){e=e??W.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;if(T.typeOf.object("min",t),T.typeOf.object("max",n),c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new C("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._min=d.clone(t),this._max=d.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}Rh.fromDimensions=function(e){e=e??W.EMPTY_OBJECT;let t=e.dimensions;T.typeOf.object("dimensions",t),T.typeOf.number.greaterThanOrEquals("dimensions.x",t.x,0),T.typeOf.number.greaterThanOrEquals("dimensions.y",t.y,0),T.typeOf.number.greaterThanOrEquals("dimensions.z",t.z,0);let n=d.multiplyByScalar(t,.5,new d);return new Rh({minimum:d.negate(n,new d),maximum:n,offsetAttribute:e.offsetAttribute})};Rh.fromAxisAlignedBoundingBox=function(e){return T.typeOf.object("boundindBox",e),new Rh({minimum:e.minimum,maximum:e.maximum})};Rh.packedLength=2*d.packedLength+1;Rh.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,d.pack(e._min,t,n),d.pack(e._max,t,n+d.packedLength),t[n+d.packedLength*2]=e._offsetAttribute??-1,t};var Vee=new d,zee=new d,Uee={minimum:Vee,maximum:zee,offsetAttribute:void 0};Rh.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=d.unpack(e,t,Vee),o=d.unpack(e,t+d.packedLength,zee),r=e[t+d.packedLength*2];return c(n)?(n._min=d.clone(i,n._min),n._max=d.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(Uee.offsetAttribute=r===-1?void 0:r,new Rh(Uee))};Rh.createGeometry=function(e){let t=e._min,n=e._max;if(d.equals(t,n))return;let i=new hn,o=new Uint16Array(12*2),r=new Float64Array(8*3);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=d.subtract(n,t,a1e),a=d.magnitude(s)*.5;if(c(e._offsetAttribute)){let l=r.length,u=e._offsetAttribute===Zt.NONE?0:1,f=new Uint8Array(l/3).fill(u);i.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new ct({attributes:i,indices:o,primitiveType:Me.LINES,boundingSphere:new le(d.ZERO,a),offsetAttribute:e._offsetAttribute})};var Mh=Rh;function FT(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([G.floatToByte(e),G.floatToByte(t),G.floatToByte(n),G.floatToByte(i)])}Object.defineProperties(FT.prototype,{componentDatatype:{get:function(){return $.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});FT.fromColor=function(e){if(!c(e))throw new C("color is required.");return new FT(e.red,e.green,e.blue,e.alpha)};FT.toValue=function(e,t){if(!c(e))throw new C("color is required.");return c(t)?e.toBytes(t):new Uint8Array(e.toBytes())};FT.equals=function(e,t){return e===t||c(e)&&c(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var jt=FT;function pw(e,t){if(e=e??0,t=t??Number.MAX_VALUE,t<=e)throw new C("far distance must be greater than near distance.");this.value=new Float32Array([e,t])}Object.defineProperties(pw.prototype,{componentDatatype:{get:function(){return $.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});pw.fromDistanceDisplayCondition=function(e){if(!c(e))throw new C("distanceDisplayCondition is required.");if(e.far<=e.near)throw new C("distanceDisplayCondition.far distance must be greater than distanceDisplayCondition.near distance.");return new pw(e.near,e.far)};pw.toValue=function(e,t){if(!c(e))throw new C("distanceDisplayCondition is required.");return c(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var kn=pw;function c1e(e){if(e=e??W.EMPTY_OBJECT,!c(e.geometry))throw new C("options.geometry is required.");this.geometry=e.geometry,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var St=c1e;function Wo(e){e=e??W.EMPTY_OBJECT,this.start=c(e.start)?Q.clone(e.start):new Q,this.stop=c(e.stop)?Q.clone(e.stop):new Q,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(Wo.prototype,{isEmpty:{get:function(){let e=Q.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var BT={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Wo.fromIso8601=function(e,t){T.typeOf.object("options",e),T.typeOf.string("options.iso8601",e.iso8601);let n=e.iso8601.split("/");if(n.length!==2)throw new C("options.iso8601 is an invalid ISO 8601 interval.");let i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return c(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(BT.start=i,BT.stop=o,BT.isStartIncluded=r,BT.isStopIncluded=s,BT.data=a,new Wo(BT))};Wo.toIso8601=function(e,t){return T.typeOf.object("timeInterval",e),`${Q.toIso8601(e.start,t)}/${Q.toIso8601(e.stop,t)}`};Wo.clone=function(e,t){if(c(e))return c(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new Wo(e)};Wo.equals=function(e,t,n){return e===t||c(e)&&c(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Q.equals(e.start,t.start)&&Q.equals(e.stop,t.stop)&&(e.data===t.data||c(n)&&n(e.data,t.data)))};Wo.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||c(e)&&c(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Q.equalsEpsilon(e.start,t.start,n)&&Q.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||c(i)&&i(e.data,t.data)))};Wo.intersect=function(e,t,n,i){if(T.typeOf.object("left",e),!c(t))return Wo.clone(Wo.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,l=Q.greaterThanOrEquals(s,o)&&Q.greaterThanOrEquals(r,s),u=!l&&Q.lessThanOrEquals(s,o)&&Q.lessThanOrEquals(o,a);if(!l&&!u)return Wo.clone(Wo.EMPTY,n);let f=e.isStartIncluded,h=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,m=Q.lessThan(r,a);return c(n)||(n=new Wo),n.start=l?s:o,n.isStartIncluded=f&&p||!Q.equals(s,o)&&(l&&p||u&&f),n.stop=m?r:a,n.isStopIncluded=m?h:h&&g||!Q.equals(a,r)&&g,n.data=c(i)?i(e.data,t.data):e.data,n};Wo.contains=function(e,t){if(T.typeOf.object("timeInterval",e),T.typeOf.object("julianDate",t),e.isEmpty)return!1;let n=Q.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=Q.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Wo.prototype.clone=function(e){return Wo.clone(this,e)};Wo.prototype.equals=function(e,t){return Wo.equals(this,e,t)};Wo.prototype.equalsEpsilon=function(e,t,n){return Wo.equalsEpsilon(this,e,t,n)};Wo.prototype.toString=function(){return Wo.toIso8601(this)};Wo.EMPTY=Object.freeze(new Wo({start:new Q,stop:new Q,isStartIncluded:!1,isStopIncluded:!1}));var Sn=Wo;var Hee=Object.freeze(Q.fromIso8601("0000-01-01T00:00:00Z")),Gee=Object.freeze(Q.fromIso8601("9999-12-31T24:00:00Z")),l1e=Object.freeze(new Sn({start:Hee,stop:Gee})),u1e={MINIMUM_VALUE:Hee,MAXIMUM_VALUE:Gee,MAXIMUM_INTERVAL:l1e},Ge=u1e;function _w(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(_w.prototype,{componentDatatype:{get:function(){return $.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});_w.fromCartesian3=function(e){return T.defined("offset",e),new _w(e.x,e.y,e.z)};_w.toValue=function(e,t){return T.defined("offset",e),c(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Ji=_w;function hL(e){e=e??!0,this.value=hL.toValue(e)}Object.defineProperties(hL.prototype,{componentDatatype:{get:function(){return $.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});hL.toValue=function(e,t){if(!c(e))throw new C("show is required.");return c(t)?(t[0]=e,t):new Uint8Array([e])};var xn=hL;var mL=`in vec3 v_positionEC;
in vec3 v_normalEC;
in vec3 v_tangentEC;
in vec3 v_bitangentEC;
in vec2 v_st;
void main()
{
vec3 positionToEyeEC = -v_positionEC;
mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC);
vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif
czm_materialInput materialInput;
materialInput.normalEC = normalEC;
materialInput.tangentToEyeMatrix = tangentToEyeMatrix;
materialInput.positionToEyeEC = positionToEyeEC;
materialInput.st = v_st;
czm_material material = czm_getMaterial(materialInput);
#ifdef FLAT
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var pL=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in vec3 tangent;
in vec3 bitangent;
in vec2 st;
in float batchId;
out vec3 v_positionEC;
out vec3 v_normalEC;
out vec3 v_tangentEC;
out vec3 v_bitangentEC;
out vec2 v_st;
void main()
{
vec4 p = czm_computePosition();
v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
v_normalEC = czm_normal * normal;
v_tangentEC = czm_normal * tangent;
v_bitangentEC = czm_normal * bitangent;
v_st = st;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var _L=`in vec3 v_positionEC;
in vec3 v_normalEC;
void main()
{
vec3 positionToEyeEC = -v_positionEC;
vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif
czm_materialInput materialInput;
materialInput.normalEC = normalEC;
materialInput.positionToEyeEC = positionToEyeEC;
czm_material material = czm_getMaterial(materialInput);
#ifdef FLAT
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var gL=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in float batchId;
out vec3 v_positionEC;
out vec3 v_normalEC;
void main()
{
vec4 p = czm_computePosition();
v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
v_normalEC = czm_normal * normal;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var yL=`in vec3 v_positionEC;
in vec3 v_normalEC;
in vec2 v_st;
void main()
{
vec3 positionToEyeEC = -v_positionEC;
vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif
czm_materialInput materialInput;
materialInput.normalEC = normalEC;
materialInput.positionToEyeEC = positionToEyeEC;
materialInput.st = v_st;
czm_material material = czm_getMaterial(materialInput);
#ifdef FLAT
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var bL=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in vec2 st;
in float batchId;
out vec3 v_positionEC;
out vec3 v_normalEC;
out vec2 v_st;
void main()
{
vec4 p = czm_computePosition();
v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
v_normalEC = czm_normal * normal;
v_st = st;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var f1e={ADD:ne.FUNC_ADD,SUBTRACT:ne.FUNC_SUBTRACT,REVERSE_SUBTRACT:ne.FUNC_REVERSE_SUBTRACT,MIN:ne.MIN,MAX:ne.MAX},Qa=Object.freeze(f1e);var d1e={ZERO:ne.ZERO,ONE:ne.ONE,SOURCE_COLOR:ne.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:ne.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:ne.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:ne.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:ne.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:ne.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:ne.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:ne.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:ne.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:ne.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:ne.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:ne.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:ne.SRC_ALPHA_SATURATE},vo=Object.freeze(d1e);var h1e={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Qa.ADD,equationAlpha:Qa.ADD,functionSourceRgb:vo.SOURCE_ALPHA,functionSourceAlpha:vo.ONE,functionDestinationRgb:vo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:vo.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Qa.ADD,equationAlpha:Qa.ADD,functionSourceRgb:vo.ONE,functionSourceAlpha:vo.ONE,functionDestinationRgb:vo.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:vo.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Qa.ADD,equationAlpha:Qa.ADD,functionSourceRgb:vo.SOURCE_ALPHA,functionSourceAlpha:vo.ONE,functionDestinationRgb:vo.ONE,functionDestinationAlpha:vo.ONE})},un=Object.freeze(h1e);var m1e={FRONT:ne.FRONT,BACK:ne.BACK,FRONT_AND_BACK:ne.FRONT_AND_BACK},Ti=Object.freeze(m1e);function kT(e){e=e??W.EMPTY_OBJECT,this.material=e.material,this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=e.closed??!1}Object.defineProperties(kT.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});kT.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),c(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(`
`)};kT.prototype.isTranslucent=function(){return c(this.material)&&this.material.isTranslucent()||!c(this.material)&&this.translucent};kT.prototype.getRenderState=function(){let e=this.isTranslucent(),t=We(this.renderState,!1);return e?(t.depthMask=!1,t.blending=un.ALPHA_BLEND):t.depthMask=!0,t};kT.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=un.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Ti.BACK}),c(n)&&(i=xt(n,i,!0)),i};var no=kT;var xL=`uniform sampler2D image;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec4 rampColor = texture(image, vec2(materialInput.aspect / (2.0 * czm_pi), 0.5));
rampColor = czm_gammaCorrect(rampColor);
material.diffuse = rampColor.rgb;
material.alpha = rampColor.a;
return material;
}
`;var TL=`uniform sampler2D image;
uniform float strength;
uniform vec2 repeat;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 st = materialInput.st;
vec2 centerPixel = fract(repeat * st);
float centerBump = texture(image, centerPixel).channel;
float imageWidth = float(imageDimensions.x);
vec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));
float rightBump = texture(image, rightPixel).channel;
float imageHeight = float(imageDimensions.y);
vec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));
float topBump = texture(image, leftPixel).channel;
vec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));
vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;
material.normal = normalEC;
material.diffuse = vec3(0.01);
return material;
}
`;var AL=`uniform vec4 lightColor;
uniform vec4 darkColor;
uniform vec2 repeat;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 st = materialInput.st;
float b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);
float scaledWidth = fract(repeat.s * st.s);
scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
float scaledHeight = fract(repeat.t * st.t);
scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
float value = min(scaledWidth, scaledHeight);
vec4 currentColor = mix(lightColor, darkColor, b);
vec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);
color = czm_gammaCorrect(color);
material.diffuse = color.rgb;
material.alpha = color.a;
return material;
}
`;var CL=`uniform vec4 lightColor;
uniform vec4 darkColor;
uniform vec2 repeat;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
float b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));
vec4 color = mix(lightColor, darkColor, b);
color = czm_gammaCorrect(color);
material.diffuse = color.rgb;
material.alpha = color.a;
return material;
}
`;var EL=`uniform sampler2D heights;
uniform sampler2D colors;
float getHeight(int idx, float invTexSize)
{
vec2 uv = vec2((float(idx) + 0.5) * invTexSize, 0.5);
#ifdef OES_texture_float
return texture(heights, uv).x;
#else
return czm_unpackFloat(texture(heights, uv));
#endif
}
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
float height = materialInput.height;
float invTexSize = 1.0 / float(heightsDimensions.x);
float minHeight = getHeight(0, invTexSize);
float maxHeight = getHeight(heightsDimensions.x - 1, invTexSize);
if (height < minHeight || height > maxHeight) {
material.diffuse = vec3(0.0);
material.alpha = 0.0;
return material;
}
int idxBelow = 0;
int idxAbove = heightsDimensions.x;
float heightBelow = minHeight;
float heightAbove = maxHeight;
const int maxIterations = 16;
for (int i = 0; i < maxIterations; i++) {
if (idxBelow >= idxAbove - 1) {
break;
}
int idxMid = (idxBelow + idxAbove) / 2;
float heightTex = getHeight(idxMid, invTexSize);
if (height > heightTex) {
idxBelow = idxMid;
heightBelow = heightTex;
} else {
idxAbove = idxMid;
heightAbove = heightTex;
}
}
float lerper = heightBelow == heightAbove ? 1.0 : (height - heightBelow) / (heightAbove - heightBelow);
vec2 colorUv = vec2(invTexSize * (float(idxBelow) + 0.5 + lerper), 0.5);
vec4 color = texture(colors, colorUv);
if (color.a > 0.0)
{
color.rgb /= color.a;
}
color.rgb = czm_gammaCorrect(color.rgb);
material.diffuse = color.rgb;
material.alpha = color.a;
return material;
}
`;var SL=`uniform vec4 color;
uniform float spacing;
uniform float width;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
float distanceToContour = mod(materialInput.height, spacing);
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
float dxc = abs(dFdx(materialInput.height));
float dyc = abs(dFdy(materialInput.height));
float dF = max(dxc, dyc) * czm_pixelRatio * width;
float alpha = (distanceToContour < dF) ? 1.0 : 0.0;
#else
float alpha = (distanceToContour < (czm_pixelRatio * width)) ? 1.0 : 0.0;
#endif
vec4 outColor = czm_gammaCorrect(vec4(color.rgb, alpha * color.a));
material.diffuse = outColor.rgb;
material.alpha = outColor.a;
return material;
}
`;var wL=`uniform sampler2D image;
uniform float minimumHeight;
uniform float maximumHeight;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
float scaledHeight = clamp((materialInput.height - minimumHeight) / (maximumHeight - minimumHeight), 0.0, 1.0);
vec4 rampColor = texture(image, vec2(scaledHeight, 0.5));
rampColor = czm_gammaCorrect(rampColor);
material.diffuse = rampColor.rgb;
material.alpha = rampColor.a;
return material;
}
`;var vL=`uniform vec4 fadeInColor;
uniform vec4 fadeOutColor;
uniform float maximumDistance;
uniform bool repeat;
uniform vec2 fadeDirection;
uniform vec2 time;
float getTime(float t, float coord)
{
float scalar = 1.0 / maximumDistance;
float q = distance(t, coord) * scalar;
if (repeat)
{
float r = distance(t, coord + 1.0) * scalar;
float s = distance(t, coord - 1.0) * scalar;
q = min(min(r, s), q);
}
return clamp(q, 0.0, 1.0);
}
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 st = materialInput.st;
float s = getTime(time.x, st.s) * fadeDirection.s;
float t = getTime(time.y, st.t) * fadeDirection.t;
float u = length(vec2(s, t));
vec4 color = mix(fadeInColor, fadeOutColor, u);
color = czm_gammaCorrect(color);
material.emission = color.rgb;
material.alpha = color.a;
return material;
}
`;var DL=`uniform vec4 color;
uniform float cellAlpha;
uniform vec2 lineCount;
uniform vec2 lineThickness;
uniform vec2 lineOffset;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 st = materialInput.st;
float scaledWidth = fract(lineCount.s * st.s - lineOffset.s);
scaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));
float scaledHeight = fract(lineCount.t * st.t - lineOffset.t);
scaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));
float value;
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
const float fuzz = 1.2;
vec2 thickness = (lineThickness * czm_pixelRatio) - 1.0;
vec2 dx = abs(dFdx(st));
vec2 dy = abs(dFdy(st));
vec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;
value = min(
smoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),
smoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));
#else
const float fuzz = 0.05;
vec2 range = 0.5 - (lineThickness * 0.05);
value = min(
1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),
1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));
#endif
float dRim = 1.0 - abs(dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC)));
float sRim = smoothstep(0.8, 1.0, dRim);
value *= (1.0 - sRim);
vec4 halfColor;
halfColor.rgb = color.rgb * 0.5;
halfColor.a = color.a * (1.0 - ((1.0 - cellAlpha) * value));
halfColor = czm_gammaCorrect(halfColor);
material.diffuse = halfColor.rgb;
material.emission = halfColor.rgb;
material.alpha = halfColor.a;
return material;
}
`;var PL=`uniform sampler2D image;
uniform float strength;
uniform vec2 repeat;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec4 textureValue = texture(image, fract(repeat * materialInput.st));
vec3 normalTangentSpace = textureValue.channels;
normalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;
normalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);
normalTangentSpace = normalize(normalTangentSpace);
vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;
material.normal = normalEC;
return material;
}
`;var IL=`uniform vec4 color;
float getPointOnLine(vec2 p0, vec2 p1, float x)
{
float slope = (p0.y - p1.y) / (p0.x - p1.x);
return slope * (x - p0.x) + p0.y;
}
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 st = materialInput.st;
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
float base = 1.0 - abs(fwidth(st.s)) * 10.0 * czm_pixelRatio;
#else
float base = 0.975;
#endif
vec2 center = vec2(1.0, 0.5);
float ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);
float ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);
float halfWidth = 0.15;
float s = step(0.5 - halfWidth, st.t);
s *= 1.0 - step(0.5 + halfWidth, st.t);
s *= 1.0 - step(base, st.s);
float t = step(base, materialInput.st.s);
t *= 1.0 - step(ptOnUpperLine, st.t);
t *= step(ptOnLowerLine, st.t);
float dist;
if (st.s < base)
{
float d1 = abs(st.t - (0.5 - halfWidth));
float d2 = abs(st.t - (0.5 + halfWidth));
dist = min(d1, d2);
}
else
{
float d1 = czm_infinity;
if (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)
{
d1 = abs(st.s - base);
}
float d2 = abs(st.t - ptOnUpperLine);
float d3 = abs(st.t - ptOnLowerLine);
dist = min(min(d1, d2), d3);
}
vec4 outsideColor = vec4(0.0);
vec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));
vec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);
outColor = czm_gammaCorrect(outColor);
material.diffuse = outColor.rgb;
material.alpha = outColor.a;
return material;
}
`;var OL=`uniform vec4 color;
uniform vec4 gapColor;
uniform float dashLength;
uniform float dashPattern;
in float v_polylineAngle;
const float maskLength = 16.0;
mat2 rotate(float rad) {
float c = cos(rad);
float s = sin(rad);
return mat2(
c, s,
-s, c
);
}
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 pos = rotate(v_polylineAngle) * gl_FragCoord.xy;
float dashPosition = fract(pos.x / (dashLength * czm_pixelRatio));
float maskIndex = floor(dashPosition * maskLength);
float maskTest = floor(dashPattern / pow(2.0, maskIndex));
vec4 fragColor = (mod(maskTest, 2.0) < 1.0) ? gapColor : color;
if (fragColor.a < 0.005) {
discard;
}
fragColor = czm_gammaCorrect(fragColor);
material.emission = fragColor.rgb;
material.alpha = fragColor.a;
return material;
}
`;var RL=`uniform vec4 color;
uniform float glowPower;
uniform float taperPower;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 st = materialInput.st;
float glow = glowPower / abs(st.t - 0.5) - (glowPower / 0.5);
if (taperPower <= 0.99999) {
glow *= min(1.0, taperPower / (0.5 - st.s * 0.5) - (taperPower / 0.5));
}
vec4 fragColor;
fragColor.rgb = max(vec3(glow - 1.0 + color.rgb), color.rgb);
fragColor.a = clamp(0.0, 1.0, glow) * color.a;
fragColor = czm_gammaCorrect(fragColor);
material.emission = fragColor.rgb;
material.alpha = fragColor.a;
return material;
}
`;var ML=`uniform vec4 color;
uniform vec4 outlineColor;
uniform float outlineWidth;
in float v_width;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec2 st = materialInput.st;
float halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;
float b = step(0.5 - halfInteriorWidth, st.t);
b *= 1.0 - step(0.5 + halfInteriorWidth, st.t);
float d1 = abs(st.t - (0.5 - halfInteriorWidth));
float d2 = abs(st.t - (0.5 + halfInteriorWidth));
float dist = min(d1, d2);
vec4 currentColor = mix(outlineColor, color, b);
vec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);
outColor = czm_gammaCorrect(outColor);
material.diffuse = outColor.rgb;
material.alpha = outColor.a;
return material;
}
`;var LL=`uniform vec4 color;
uniform vec4 rimColor;
uniform float width;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
float d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));
float s = smoothstep(1.0 - width, 1.0, d);
vec4 outColor = czm_gammaCorrect(color);
vec4 outRimColor = czm_gammaCorrect(rimColor);
material.diffuse = outColor.rgb;
material.emission = outRimColor.rgb * s;
material.alpha = mix(outColor.a, outRimColor.a, s);
return material;
}
`;var NL=`uniform sampler2D image;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec4 rampColor = texture(image, vec2(materialInput.slope / (czm_pi / 2.0), 0.5));
rampColor = czm_gammaCorrect(rampColor);
material.diffuse = rampColor.rgb;
material.alpha = rampColor.a;
return material;
}
`;var FL=`uniform vec4 evenColor;
uniform vec4 oddColor;
uniform float offset;
uniform float repeat;
uniform bool horizontal;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
float coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));
float value = fract((coord - offset) * (repeat * 0.5));
float dist = min(value, min(abs(value - 0.5), 1.0 - value));
vec4 currentColor = mix(evenColor, oddColor, step(0.5, value));
vec4 color = czm_antialias(evenColor, oddColor, currentColor, dist);
color = czm_gammaCorrect(color);
material.diffuse = color.rgb;
material.alpha = color.a;
return material;
}
`;var BL=`uniform vec4 waterColor;
uniform vec4 landColor;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
vec4 outColor = mix(landColor, waterColor, materialInput.waterMask);
outColor = czm_gammaCorrect(outColor);
material.diffuse = outColor.rgb;
material.alpha = outColor.a;
return material;
}
`;var kL=`uniform sampler2D specularMap;
uniform sampler2D normalMap;
uniform vec4 baseWaterColor;
uniform vec4 blendColor;
uniform float frequency;
uniform float animationSpeed;
uniform float amplitude;
uniform float specularIntensity;
uniform float fadeFactor;
czm_material czm_getMaterial(czm_materialInput materialInput)
{
czm_material material = czm_getDefaultMaterial(materialInput);
float time = czm_frameNumber * animationSpeed;
float fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);
float specularMapValue = texture(specularMap, materialInput.st).r;
vec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);
vec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));
normalTangentSpace.xy /= fade;
normalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);
normalTangentSpace = normalize(normalTangentSpace);
float tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);
material.alpha = mix(blendColor.a, baseWaterColor.a, specularMapValue) * specularMapValue;
material.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);
material.diffuse += (0.1 * tsPerturbationRatio);
material.diffuse = material.diffuse;
material.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);
material.specular = specularIntensity;
material.shininess = 10.0;
return material;
}
`;function Ye(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=e.minificationFilter??Yt.LINEAR,this._magnificationFilter=e.magnificationFilter??ui.LINEAR,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,p1e(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1}}),c(Ye._uniformList[this.type])||(Ye._uniformList[this.type]=Object.keys(this._uniforms))}Ye._uniformList={};Ye.fromType=function(e,t){if(!c(Ye._materialCache.getMaterial(e)))throw new C(`material with type '${e}' does not exist.`);let n=new Ye({fabric:{type:e}});if(c(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};Ye.prototype.isTranslucent=function(){if(c(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let o=t[i];if(typeof o=="function"?e=e&&o():e=e&&o,!e)break}return e};Ye.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,o=i.length;for(t=0;t<o;++t){let l=i[t];n=l.id;let u=l.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(y){return y.bufferView}),u=u[0]);let h=new Qt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;c(u.internalFormat)?p=new Rt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:h}):p=new Rt({context:e,source:u,sampler:h});let g=this._textures[n];c(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let y=this.uniforms[m];y.x=p._width,y.y=p._height}}i.length=0;let r=this._loadedCubeMaps;for(o=r.length,t=0;t<o;++t){let l=r[t];n=l.id;let u=l.images,f=new Go({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new Qt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}r.length=0;let s=this._updateFunctions;for(o=s.length,t=0;t<o;++t)s[t](this,e);let a=this.materials;for(let l in a)a.hasOwnProperty(l)&&a[l].update(e)};Ye.prototype.isDestroyed=function(){return!1};Ye.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return de(this)};function p1e(e,t){e=e??W.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=We(e.fabric??W.EMPTY_OBJECT),t._template.uniforms=We(t._template.uniforms??W.EMPTY_OBJECT),t._template.materials=We(t._template.materials??W.EMPTY_OBJECT),t.type=c(t._template.type)?t._template.type:jn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=Ye._materialCache.getMaterial(t.type);if(c(i)){let r=We(i.fabric,!0);t._template=xt(t._template,r,!0),n=i.translucent}b1e(t),c(i)||Ye._materialCache.addMaterial(t.type,t),T1e(t),S1e(t),v1e(t);let o=t._translucentFunctions.length===0?!0:void 0;if(n=n??o,n=e.translucent??n,c(n))if(typeof n=="function"){let r=function(){return n(t)};t._translucentFunctions.push(r)}else t._translucentFunctions.push(n)}function L6(e,t,n,i){if(c(e)){for(let o in e)if(e.hasOwnProperty(o)){let r=t.indexOf(o)!==-1;(i&&!r||!i&&r)&&n(o,t)}}}function jee(e,t){let n=`fabric: property name '${e}' is not valid. It should be `;for(let i=0;i<t.length;i++){let o=`'${t[i]}'`;n+=i===t.length-1?`or ${o}.`:`${o}, `}throw new C(n)}function _1e(e,t){let n=`fabric: uniforms and materials cannot share the same property '${e}'`;throw new C(n)}var g1e=["type","materials","uniforms","components","source"],y1e=["diffuse","specular","shininess","normal","emission","alpha"];function b1e(e){let t=e._template,n=t.uniforms,i=t.materials,o=t.components;if(c(o)&&c(t.source))throw new C("fabric: cannot have source and components in the same template.");L6(t,g1e,jee,!0),L6(o,y1e,jee,!0);let r=[];for(let s in i)i.hasOwnProperty(s)&&r.push(s);L6(n,r,_1e,!1)}function x1e(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function T1e(e){let t=e._template.components,n=e._template.source;if(c(n))e.shaderSource+=`${n}
`;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput)
{
`,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput);
`,c(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&x1e(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s};
`}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha};
`:e.shaderSource+=`material.${o} = ${t[o]};
`}e.shaderSource+=`return material;
}
`}}var Wee={mat2:Ri,mat3:J,mat4:F},A1e=/\.ktx2$/i;function C1e(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!c(r)||r===Ye.DefaultImageId;t=r;let l=n._textures[e],u,f;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&c(l)&&(l!==i.defaultTexture&&l.destroy(),l=void 0),!c(l)||l===i.defaultTexture){let p=new Qt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});l=new Rt({context:i,source:r,sampler:p}),n._textures[e]=l;return}l.copyFrom({source:r})}else c(l)||(n._textures[e]=i.defaultTexture);return}if(r instanceof Rt&&r!==l){n._texturePaths[e]=void 0;let p=n._textures[e];c(p)&&p!==n._defaultTexture&&p.destroy(),n._textures[e]=r,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=r._width,f.y=r._height);return}if(s&&c(l)&&a&&(l!==n._defaultTexture&&l.destroy(),l=void 0),c(l)||(n._texturePaths[e]=void 0,l=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,o.hasOwnProperty(u)&&(f=o[u],f.x=l._width,f.y=l._height)),a)return;let h=r instanceof we;if(!c(n._texturePaths[e])||h&&r.url!==n._texturePaths[e].url||!h&&r!==n._texturePaths[e]){if(typeof r=="string"||h){let p=h?r:we.createIfNeeded(r),g;A1e.test(p.url)?g=Xl(p.url):g=p.fetchImage(),Promise.resolve(g).then(function(m){n._loadedImages.push({id:e,image:m})}).catch(function(){c(l)&&l!==n._defaultTexture&&l.destroy(),n._textures[e]=n._defaultTexture})}else(r instanceof HTMLCanvasElement||r instanceof HTMLImageElement)&&n._loadedImages.push({id:e,image:r});n._texturePaths[e]=r}}}function E1e(e){return function(t,n){let i=t.uniforms[e];if(i instanceof Go){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}if(c(t._textures[e])||(t._texturePaths[e]=void 0,t._textures[e]=n.defaultCubeMap),i===Ye.DefaultCubeMapId)return;let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o!==t._texturePaths[e]){let r=[we.createIfNeeded(i.positiveX).fetchImage(),we.createIfNeeded(i.negativeX).fetchImage(),we.createIfNeeded(i.positiveY).fetchImage(),we.createIfNeeded(i.negativeY).fetchImage(),we.createIfNeeded(i.positiveZ).fetchImage(),we.createIfNeeded(i.negativeZ).fetchImage()];Promise.all(r).then(function(s){t._loadedCubeMaps.push({id:e,images:s})}),t._texturePaths[e]=o}}}function S1e(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&qee(e,n)}function qee(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=w1e(o);if(!c(r))throw new C(`fabric: uniform '${t}' has invalid type.`);let s;if(r==="channels"){if(s=gw(e,t,o,!1),s===0&&n)throw new C(`strict: shader source does not use channels '${t}'.`)}else{if(r==="sampler2D"){let u=`${t}Dimensions`;D1e(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},qee(e,u))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${r} ${t};`;e.shaderSource=u+e.shaderSource}let l=`${t}_${e._count++}`;if(s=gw(e,t,l),s===1&&n)throw new C(`strict: shader source does not use uniform '${t}'.`);if(e.uniforms[t]=o,r==="sampler2D")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(C1e(t));else if(r==="samplerCube")e._uniforms[l]=function(){return e._textures[t]},e._updateFunctions.push(E1e(t));else if(r.indexOf("mat")!==-1){let u=new Wee[r];e._uniforms[l]=function(){return Wee[r].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[l]=function(){return e.uniforms[t]}}}function w1e(e){let t=e.type;if(!c(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof we||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement)/^([rgba]){1,4}$/i.test(e)?t="channels":e===Ye.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function v1e(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new Ye({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=xt(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;gw(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`;if(gw(e,i,a)===0&&t)throw new C(`strict: shader source does not use material '${i}'.`)}}function gw(e,t,n,i){i=i??!0;let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(l,u,f){return u||f?l:(o+=1,n)}),o}function D1e(e,t,n){return gw(e,t,t,n)}Ye._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};Ye.DefaultImageId="czm_defaultImage";Ye.DefaultCubeMapId="czm_defaultCubeMap";Ye.ColorType="Color";Ye._materialCache.addMaterial(Ye.ColorType,{fabric:{type:Ye.ColorType,uniforms:{color:new G(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Ye.ImageType="Image";Ye._materialCache.addMaterial(Ye.ImageType,{fabric:{type:Ye.ImageType,uniforms:{image:Ye.DefaultImageId,repeat:new z(1,1),color:new G(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});Ye.DiffuseMapType="DiffuseMap";Ye._materialCache.addMaterial(Ye.DiffuseMapType,{fabric:{type:Ye.DiffuseMapType,uniforms:{image:Ye.DefaultImageId,channels:"rgb",repeat:new z(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Ye.AlphaMapType="AlphaMap";Ye._materialCache.addMaterial(Ye.AlphaMapType,{fabric:{type:Ye.AlphaMapType,uniforms:{image:Ye.DefaultImageId,channel:"a",repeat:new z(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});Ye.SpecularMapType="SpecularMap";Ye._materialCache.addMaterial(Ye.SpecularMapType,{fabric:{type:Ye.SpecularMapType,uniforms:{image:Ye.DefaultImageId,channel:"r",repeat:new z(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});Ye.EmissionMapType="EmissionMap";Ye._materialCache.addMaterial(Ye.EmissionMapType,{fabric:{type:Ye.EmissionMapType,uniforms:{image:Ye.DefaultImageId,channels:"rgb",repeat:new z(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});Ye.BumpMapType="BumpMap";Ye._materialCache.addMaterial(Ye.BumpMapType,{fabric:{type:Ye.BumpMapType,uniforms:{image:Ye.DefaultImageId,channel:"r",strength:.8,repeat:new z(1,1)},source:TL},translucent:!1});Ye.NormalMapType="NormalMap";Ye._materialCache.addMaterial(Ye.NormalMapType,{fabric:{type:Ye.NormalMapType,uniforms:{image:Ye.DefaultImageId,channels:"rgb",strength:.8,repeat:new z(1,1)},source:PL},translucent:!1});Ye.GridType="Grid";Ye._materialCache.addMaterial(Ye.GridType,{fabric:{type:Ye.GridType,uniforms:{color:new G(0,1,0,1),cellAlpha:.1,lineCount:new z(8,8),lineThickness:new z(1,1),lineOffset:new z(0,0)},source:DL},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});Ye.StripeType="Stripe";Ye._materialCache.addMaterial(Ye.StripeType,{fabric:{type:Ye.StripeType,uniforms:{horizontal:!0,evenColor:new G(1,1,1,.5),oddColor:new G(0,0,1,.5),offset:0,repeat:5},source:FL},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});Ye.CheckerboardType="Checkerboard";Ye._materialCache.addMaterial(Ye.CheckerboardType,{fabric:{type:Ye.CheckerboardType,uniforms:{lightColor:new G(1,1,1,.5),darkColor:new G(0,0,0,.5),repeat:new z(5,5)},source:AL},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Ye.DotType="Dot";Ye._materialCache.addMaterial(Ye.DotType,{fabric:{type:Ye.DotType,uniforms:{lightColor:new G(1,1,0,.75),darkColor:new G(0,1,1,.75),repeat:new z(5,5)},source:CL},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});Ye.WaterType="Water";Ye._materialCache.addMaterial(Ye.WaterType,{fabric:{type:Ye.WaterType,uniforms:{baseWaterColor:new G(.2,.3,.6,1),blendColor:new G(0,1,.699,1),specularMap:Ye.DefaultImageId,normalMap:Ye.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:kL},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});Ye.RimLightingType="RimLighting";Ye._materialCache.addMaterial(Ye.RimLightingType,{fabric:{type:Ye.RimLightingType,uniforms:{color:new G(1,0,0,.7),rimColor:new G(1,1,1,.4),width:.3},source:LL},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});Ye.FadeType="Fade";Ye._materialCache.addMaterial(Ye.FadeType,{fabric:{type:Ye.FadeType,uniforms:{fadeInColor:new G(1,0,0,1),fadeOutColor:new G(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new z(.5,.5)},source:vL},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});Ye.PolylineArrowType="PolylineArrow";Ye._materialCache.addMaterial(Ye.PolylineArrowType,{fabric:{type:Ye.PolylineArrowType,uniforms:{color:new G(1,1,1,1)},source:IL},translucent:!0});Ye.PolylineDashType="PolylineDash";Ye._materialCache.addMaterial(Ye.PolylineDashType,{fabric:{type:Ye.PolylineDashType,uniforms:{color:new G(1,0,1,1),gapColor:new G(0,0,0,0),dashLength:16,dashPattern:255},source:OL},translucent:!0});Ye.PolylineGlowType="PolylineGlow";Ye._materialCache.addMaterial(Ye.PolylineGlowType,{fabric:{type:Ye.PolylineGlowType,uniforms:{color:new G(0,.5,1,1),glowPower:.25,taperPower:1},source:RL},translucent:!0});Ye.PolylineOutlineType="PolylineOutline";Ye._materialCache.addMaterial(Ye.PolylineOutlineType,{fabric:{type:Ye.PolylineOutlineType,uniforms:{color:new G(1,1,1,1),outlineColor:new G(1,0,0,1),outlineWidth:1},source:ML},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});Ye.ElevationContourType="ElevationContour";Ye._materialCache.addMaterial(Ye.ElevationContourType,{fabric:{type:Ye.ElevationContourType,uniforms:{spacing:100,color:new G(1,0,0,1),width:1},source:SL},translucent:!1});Ye.ElevationRampType="ElevationRamp";Ye._materialCache.addMaterial(Ye.ElevationRampType,{fabric:{type:Ye.ElevationRampType,uniforms:{image:Ye.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:wL},translucent:!1});Ye.SlopeRampMaterialType="SlopeRamp";Ye._materialCache.addMaterial(Ye.SlopeRampMaterialType,{fabric:{type:Ye.SlopeRampMaterialType,uniforms:{image:Ye.DefaultImageId},source:NL},translucent:!1});Ye.AspectRampMaterialType="AspectRamp";Ye._materialCache.addMaterial(Ye.AspectRampMaterialType,{fabric:{type:Ye.AspectRampMaterialType,uniforms:{image:Ye.DefaultImageId},source:xL},translucent:!1});Ye.ElevationBandType="ElevationBand";Ye._materialCache.addMaterial(Ye.ElevationBandType,{fabric:{type:Ye.ElevationBandType,uniforms:{heights:Ye.DefaultImageId,colors:Ye.DefaultImageId},source:EL},translucent:!0});Ye.WaterMaskType="WaterMask";Ye._materialCache.addMaterial(Ye.WaterMaskType,{fabric:{type:Ye.WaterMaskType,source:BL,uniforms:{waterColor:new G(1,1,1,1),landColor:new G(0,0,0,0)}},translucent:!1});var Xi=Ye;function W0(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??W0.MaterialSupport.TEXTURED;this.material=c(e.material)?e.material:Xi.fromType(Xi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(W0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});W0.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;W0.prototype.isTranslucent=no.prototype.isTranslucent;W0.prototype.getRenderState=no.prototype.getRenderState;W0.MaterialSupport={BASIC:Object.freeze({vertexFormat:Ie.POSITION_AND_NORMAL,vertexShaderSource:gL,fragmentShaderSource:_L}),TEXTURED:Object.freeze({vertexFormat:Ie.POSITION_NORMAL_AND_ST,vertexShaderSource:bL,fragmentShaderSource:yL}),ALL:Object.freeze({vertexFormat:Ie.ALL,vertexShaderSource:pL,fragmentShaderSource:mL})};var so=W0;var UL=`in vec3 v_positionEC;
in vec3 v_normalEC;
in vec4 v_color;
void main()
{
vec3 positionToEyeEC = -v_positionEC;
vec3 normalEC = normalize(v_normalEC);
#ifdef FACE_FORWARD
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif
vec4 color = czm_gammaCorrect(v_color);
czm_materialInput materialInput;
materialInput.normalEC = normalEC;
materialInput.positionToEyeEC = positionToEyeEC;
czm_material material = czm_getDefaultMaterial(materialInput);
material.diffuse = color.rgb;
material.alpha = color.a;
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
}
`;var VL=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 normal;
in vec4 color;
in float batchId;
out vec3 v_positionEC;
out vec3 v_normalEC;
out vec4 v_color;
void main()
{
vec4 p = czm_computePosition();
v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
v_normalEC = czm_normal * normal;
v_color = color;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;var UT=`in vec4 v_color;
void main()
{
out_FragColor = czm_gammaCorrect(v_color);
}
`;var zL=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec4 color;
in float batchId;
out vec4 v_color;
void main()
{
vec4 p = czm_computePosition();
v_color = color;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;function mp(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?zL:VL,r=i?UT:UL,s=i?mp.FLAT_VERTEX_FORMAT:mp.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(mp.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});mp.VERTEX_FORMAT=Ie.POSITION_AND_NORMAL;mp.FLAT_VERTEX_FORMAT=Ie.POSITION_ONLY;mp.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;mp.prototype.isTranslucent=no.prototype.isTranslucent;mp.prototype.getRenderState=no.prototype.getRenderState;var rn=mp;function VT(e){this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(VT.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color")});VT.prototype.getType=function(e){return"Color"};var P1e=new Q;VT.prototype.getValue=function(e,t){return c(e)||(e=Q.now(P1e)),c(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,G.WHITE,t.color),t};VT.prototype.equals=function(e){return this===e||e instanceof VT&&Y.equals(this._color,e._color)};var Ut=VT;function Z_(e){e=e??W.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??ie.default,this._rectangle=e.rectangle??ce.MAX_VALUE,this._projection=new Oi(this._ellipsoid),this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1}Object.defineProperties(Z_.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Z_.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Z_.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Z_.prototype.rectangleToNativeRectangle=function(e,t){T.defined("rectangle",e);let n=O.toDegrees(e.west),i=O.toDegrees(e.south),o=O.toDegrees(e.east),r=O.toDegrees(e.north);return c(t)?(t.west=n,t.south=i,t.east=o,t.north=r,t):new ce(n,i,o,r)};Z_.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.tileXYToRectangle(e,t,n,i);return o.west=O.toDegrees(o.west),o.south=O.toDegrees(o.south),o.east=O.toDegrees(o.east),o.north=O.toDegrees(o.north),o};Z_.prototype.tileXYToRectangle=function(e,t,n,i){let o=this._rectangle,r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=o.width/r,l=e*a+o.west,u=(e+1)*a+o.west,f=o.height/s,h=o.north-t*f,p=o.north-(t+1)*f;return c(i)||(i=new ce(l,p,u,h)),i.west=l,i.south=p,i.east=u,i.north=h,i};Z_.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),s=i.width/o,a=i.height/r,l=e.longitude;i.east<i.west&&(l+=O.TWO_PI);let u=(l-i.west)/s|0;u>=o&&(u=o-1);let f=(i.north-e.latitude)/a|0;return f>=r&&(f=r-1),c(n)?(n.x=u,n.y=f,n):new z(u,f)};var Ki=Z_;var Yee=new d,Xee=new d,Kee=new he,N6=new d,I1e=new d,$ee=new le,O1e=new Ki,yw=[new he,new he,new he,new he],bw=new z,gr={};gr.initialize=function(){let e=gr._initPromise;return c(e)||(e=we.fetchJson(tn("Assets/approximateTerrainHeights.json")).then(function(t){gr._terrainHeights=t}),gr._initPromise=e),e};gr.getMinimumMaximumHeights=function(e,t){if(T.defined("rectangle",e),!c(gr._terrainHeights))throw new C("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=t??ie.default;let n=Zee(e),i=gr._defaultMinTerrainHeight,o=gr._defaultMaxTerrainHeight;if(c(n)){let r=`${n.level}-${n.x}-${n.y}`,s=gr._terrainHeights[r];c(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(ce.northeast(e,Kee),Yee),t.cartographicToCartesian(ce.southwest(e,Kee),Xee),d.midpoint(Xee,Yee,N6);let a=t.scaleToGeodeticSurface(N6,I1e);if(c(a)){let l=d.distance(N6,a);i=Math.min(i,-l)}else i=gr._defaultMinTerrainHeight}return i=Math.max(gr._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};gr.getBoundingSphere=function(e,t){if(T.defined("rectangle",e),!c(gr._terrainHeights))throw new C("You must call ApproximateTerrainHeights.initialize and wait for the promise to resolve before using this function");t=t??ie.default;let n=Zee(e),i=gr._defaultMaxTerrainHeight;if(c(n)){let r=`${n.level}-${n.x}-${n.y}`,s=gr._terrainHeights[r];c(s)&&(i=s[1])}let o=le.fromRectangle3D(e,t,0);return le.fromRectangle3D(e,t,i,$ee),le.union(o,$ee,o)};function Zee(e){he.fromRadians(e.east,e.north,0,yw[0]),he.fromRadians(e.west,e.north,0,yw[1]),he.fromRadians(e.east,e.south,0,yw[2]),he.fromRadians(e.west,e.south,0,yw[3]);let t=0,n=0,i=0,o=0,r=gr._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let l=0;l<4;++l){let u=yw[l];if(O1e.positionToTileXY(u,s,bw),l===0)i=bw.x,o=bw.y;else if(i!==bw.x||o!==bw.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}gr._terrainHeightsMaxLevel=6;gr._defaultMaxTerrainHeight=9e3;gr._defaultMinTerrainHeight=-1e5;gr._terrainHeights=void 0;gr._initPromise=void 0;Object.defineProperties(gr,{initialized:{get:function(){return c(gr._terrainHeights)}}});var fi=gr;function vc(e,t,n){this.minimum=d.clone(e??d.ZERO),this.maximum=d.clone(t??d.ZERO),c(n)?n=d.clone(n):n=d.midpoint(this.minimum,this.maximum,new d),this.center=n}vc.fromCorners=function(e,t,n){return T.defined("minimum",e),T.defined("maximum",t),c(n)||(n=new vc),n.minimum=d.clone(e,n.minimum),n.maximum=d.clone(t,n.maximum),n.center=d.midpoint(e,t,n.center),n};vc.fromPoints=function(e,t){if(c(t)||(t=new vc),!c(e)||e.length===0)return t.minimum=d.clone(d.ZERO,t.minimum),t.maximum=d.clone(d.ZERO,t.maximum),t.center=d.clone(d.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,l=e.length;for(let h=1;h<l;h++){let p=e[h],g=p.x,m=p.y,y=p.z;n=Math.min(g,n),r=Math.max(g,r),i=Math.min(m,i),s=Math.max(m,s),o=Math.min(y,o),a=Math.max(y,a)}let u=t.minimum;u.x=n,u.y=i,u.z=o;let f=t.maximum;return f.x=r,f.y=s,f.z=a,t.center=d.midpoint(u,f,t.center),t};vc.clone=function(e,t){if(c(e))return c(t)?(t.minimum=d.clone(e.minimum,t.minimum),t.maximum=d.clone(e.maximum,t.maximum),t.center=d.clone(e.center,t.center),t):new vc(e.minimum,e.maximum,e.center)};vc.equals=function(e,t){return e===t||c(e)&&c(t)&&d.equals(e.center,t.center)&&d.equals(e.minimum,t.minimum)&&d.equals(e.maximum,t.maximum)};var HL=new d;vc.intersectPlane=function(e,t){T.defined("box",e),T.defined("plane",t),HL=d.subtract(e.maximum,e.minimum,HL);let n=d.multiplyByScalar(HL,.5,HL),i=t.normal,o=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),r=d.dot(e.center,i)+t.distance;return r-o>0?Wt.INSIDE:r+o<0?Wt.OUTSIDE:Wt.INTERSECTING};vc.prototype.clone=function(e){return vc.clone(this,e)};vc.prototype.intersectPlane=function(e){return vc.intersectPlane(this,e)};vc.prototype.equals=function(e){return vc.equals(this,e)};var q0=vc;var F6=new se;function Lh(e,t){if(T.defined("origin",e),t=t??ie.default,e=t.scaleToGeodeticSurface(e),!c(e))throw new C("origin must not be at the center of the ellipsoid.");let n=Ot.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=d.fromCartesian4(F.getColumn(n,0,F6)),this._yAxis=d.fromCartesian4(F.getColumn(n,1,F6));let i=d.fromCartesian4(F.getColumn(n,2,F6));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties(Lh.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var R1e=new q0;Lh.fromPoints=function(e,t){T.defined("cartesians",e);let n=q0.fromPoints(e,R1e);return new Lh(n.center,t)};var Qee=new _n,GL=new d;Lh.prototype.projectPointOntoPlane=function(e,t){T.defined("cartesian",e);let n=Qee;n.origin=e,d.normalize(e,n.direction);let i=Qn.rayPlane(n,this._plane,GL);if(c(i)||(d.negate(n.direction,n.direction),i=Qn.rayPlane(n,this._plane,GL)),c(i)){let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),s=d.dot(this._yAxis,o);return c(t)?(t.x=r,t.y=s,t):new z(r,s)}};Lh.prototype.projectPointsOntoPlane=function(e,t){T.defined("cartesians",e),c(t)||(t=[]);let n=0,i=e.length;for(let o=0;o<i;o++){let r=this.projectPointOntoPlane(e[o],t[n]);c(r)&&(t[n]=r,n++)}return t.length=n,t};Lh.prototype.projectPointToNearestOnPlane=function(e,t){T.defined("cartesian",e),c(t)||(t=new z);let n=Qee;n.origin=e,d.clone(this._plane.normal,n.direction);let i=Qn.rayPlane(n,this._plane,GL);c(i)||(d.negate(n.direction,n.direction),i=Qn.rayPlane(n,this._plane,GL));let o=d.subtract(i,this._origin,i),r=d.dot(this._xAxis,o),s=d.dot(this._yAxis,o);return t.x=r,t.y=s,t};Lh.prototype.projectPointsToNearestOnPlane=function(e,t){T.defined("cartesians",e),c(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var M1e=new d;Lh.prototype.projectPointOntoEllipsoid=function(e,t){T.defined("cartesian",e),c(t)||(t=new d);let n=this._ellipsoid,i=this._origin,o=this._xAxis,r=this._yAxis,s=M1e;return d.multiplyByScalar(o,e.x,s),t=d.add(i,s,t),d.multiplyByScalar(r,e.y,s),d.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};Lh.prototype.projectPointsOntoEllipsoid=function(e,t){T.defined("cartesians",e);let n=e.length;c(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var is=Lh;function Mi(e,t){this.center=d.clone(e??d.ZERO),this.halfAxes=J.clone(t??J.ZERO)}Mi.packedLength=d.packedLength+J.packedLength;Mi.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,d.pack(e.center,t,n),J.pack(e.halfAxes,t,n+d.packedLength),t};Mi.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Mi),d.unpack(e,t,n.center),J.unpack(e,t+d.packedLength,n.halfAxes),n};var L1e=new d,N1e=new d,F1e=new d,B1e=new d,k1e=new d,U1e=new d,V1e=new J,z1e={unitary:new J,diagonal:new J};Mi.fromPoints=function(e,t){if(c(t)||(t=new Mi),!c(e)||e.length===0)return t.halfAxes=J.ZERO,t.center=d.ZERO,t;let n,i=e.length,o=d.clone(e[0],L1e);for(n=1;n<i;n++)d.add(o,e[n],o);let r=1/i;d.multiplyByScalar(o,r,o);let s=0,a=0,l=0,u=0,f=0,h=0,p;for(n=0;n<i;n++)p=d.subtract(e[n],o,N1e),s+=p.x*p.x,a+=p.x*p.y,l+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,h+=p.z*p.z;s*=r,a*=r,l*=r,u*=r,f*=r,h*=r;let g=V1e;g[0]=s,g[1]=a,g[2]=l,g[3]=a,g[4]=u,g[5]=f,g[6]=l,g[7]=f,g[8]=h;let m=J.computeEigenDecomposition(g,z1e),y=J.clone(m.unitary,t.halfAxes),b=J.getColumn(y,0,B1e),x=J.getColumn(y,1,k1e),A=J.getColumn(y,2,U1e),E=-Number.MAX_VALUE,S=-Number.MAX_VALUE,v=-Number.MAX_VALUE,P=Number.MAX_VALUE,M=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],E=Math.max(d.dot(b,p),E),S=Math.max(d.dot(x,p),S),v=Math.max(d.dot(A,p),v),P=Math.min(d.dot(b,p),P),M=Math.min(d.dot(x,p),M),R=Math.min(d.dot(A,p),R);b=d.multiplyByScalar(b,.5*(P+E),b),x=d.multiplyByScalar(x,.5*(M+S),x),A=d.multiplyByScalar(A,.5*(R+v),A);let L=d.add(b,x,t.center);d.add(L,A,L);let B=F1e;return B.x=E-P,B.y=S-M,B.z=v-R,d.multiplyByScalar(B,.5,B),J.multiplyByScale(t.halfAxes,B,t.halfAxes),t};var ote=new d,H1e=new d;function Jee(e,t,n,i,o,r,s,a,l,u,f){if(!c(o)||!c(r)||!c(s)||!c(a)||!c(l)||!c(u))throw new C("all extents (minimum/maximum X/Y/Z) are required.");c(f)||(f=new Mi);let h=f.halfAxes;J.setColumn(h,0,t,h),J.setColumn(h,1,n,h),J.setColumn(h,2,i,h);let p=ote;p.x=(o+r)/2,p.y=(s+a)/2,p.z=(l+u)/2;let g=H1e;g.x=(r-o)/2,g.y=(a-s)/2,g.z=(u-l)/2;let m=f.center;return p=J.multiplyByVector(h,p,p),d.add(e,p,m),J.multiplyByScale(h,g,h),f}var ete=new he,G1e=new d,j1e=new he,W1e=new he,q1e=new he,Y1e=new he,X1e=new he,K1e=new d,tte=new d,$1e=new d,nte=new d,Z1e=new d,Q1e=new z,J1e=new z,eRe=new z,tRe=new z,nRe=new z,iRe=new d,oRe=new d,rRe=new d,sRe=new d,aRe=new z,cRe=new d,lRe=new d,uRe=new d,fRe=new sn(d.UNIT_X,0);Mi.fromRectangle=function(e,t,n,i,o){if(!c(e))throw new C("rectangle is required");if(e.width<0||e.width>O.TWO_PI)throw new C("Rectangle width must be between 0 and 2 * pi");if(e.height<0||e.height>O.PI)throw new C("Rectangle height must be between 0 and pi");if(c(i)&&!O.equalsEpsilon(i.radii.x,i.radii.y,O.EPSILON15))throw new C("Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)");t=t??0,n=n??0,i=i??ie.default;let r,s,a,l,u,f,h;if(e.width<=O.PI){let M=ce.center(e,ete),R=i.cartographicToCartesian(M,G1e),L=new is(R,i);h=L.plane;let B=M.longitude,_=e.south<0&&e.north>0?0:M.latitude,w=he.fromRadians(B,e.north,n,j1e),D=he.fromRadians(e.west,e.north,n,W1e),I=he.fromRadians(e.west,_,n,q1e),N=he.fromRadians(e.west,e.south,n,Y1e),k=he.fromRadians(B,e.south,n,X1e),H=i.cartographicToCartesian(w,K1e),V=i.cartographicToCartesian(D,tte),j=i.cartographicToCartesian(I,$1e),U=i.cartographicToCartesian(N,nte),q=i.cartographicToCartesian(k,Z1e),X=L.projectPointToNearestOnPlane(H,Q1e),te=L.projectPointToNearestOnPlane(V,J1e),K=L.projectPointToNearestOnPlane(j,eRe),Z=L.projectPointToNearestOnPlane(U,tRe),ee=L.projectPointToNearestOnPlane(q,nRe);return r=Math.min(te.x,K.x,Z.x),s=-r,l=Math.max(te.y,X.y),a=Math.min(Z.y,ee.y),D.height=N.height=t,V=i.cartographicToCartesian(D,tte),U=i.cartographicToCartesian(N,nte),u=Math.min(sn.getPointDistance(h,V),sn.getPointDistance(h,U)),f=n,Jee(L.origin,L.xAxis,L.yAxis,L.zAxis,r,s,a,l,u,f,o)}let p=e.south>0,g=e.north<0,m=p?e.south:g?e.north:0,y=ce.center(e,ete).longitude,b=d.fromRadians(y,m,n,i,iRe);b.z=0;let A=Math.abs(b.x)<O.EPSILON10&&Math.abs(b.y)<O.EPSILON10?d.UNIT_X:d.normalize(b,oRe),E=d.UNIT_Z,S=d.cross(A,E,rRe);h=sn.fromPointNormal(b,A,fRe);let v=d.fromRadians(y+O.PI_OVER_TWO,m,n,i,sRe);s=d.dot(sn.projectPointOntoPlane(h,v,aRe),S),r=-s,l=d.fromRadians(0,e.north,g?t:n,i,cRe).z,a=d.fromRadians(0,e.south,p?t:n,i,lRe).z;let P=d.fromRadians(e.east,m,n,i,uRe);return u=sn.getPointDistance(h,P),f=0,Jee(b,S,E,A,r,s,a,l,u,f,o)};Mi.fromTransformation=function(e,t){return T.typeOf.object("transformation",e),c(t)||(t=new Mi),t.center=F.getTranslation(e,t.center),t.halfAxes=F.getMatrix3(e,t.halfAxes),t.halfAxes=J.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};Mi.clone=function(e,t){if(c(e))return c(t)?(d.clone(e.center,t.center),J.clone(e.halfAxes,t.halfAxes),t):new Mi(e.center,e.halfAxes)};Mi.intersectPlane=function(e,t){if(!c(e))throw new C("box is required.");if(!c(t))throw new C("plane is required.");let n=e.center,i=t.normal,o=e.halfAxes,r=i.x,s=i.y,a=i.z,l=Math.abs(r*o[J.COLUMN0ROW0]+s*o[J.COLUMN0ROW1]+a*o[J.COLUMN0ROW2])+Math.abs(r*o[J.COLUMN1ROW0]+s*o[J.COLUMN1ROW1]+a*o[J.COLUMN1ROW2])+Math.abs(r*o[J.COLUMN2ROW0]+s*o[J.COLUMN2ROW1]+a*o[J.COLUMN2ROW2]),u=d.dot(i,n)+t.distance;return u<=-l?Wt.OUTSIDE:u>=l?Wt.INSIDE:Wt.INTERSECTING};var rte=new d,ste=new d,ate=new d,dRe=new d,ite=new d,hRe=new d;Mi.distanceSquaredTo=function(e,t){if(!c(e))throw new C("box is required.");if(!c(t))throw new C("cartesian is required.");let n=d.subtract(t,e.center,ote),i=e.halfAxes,o=J.getColumn(i,0,rte),r=J.getColumn(i,1,ste),s=J.getColumn(i,2,ate),a=d.magnitude(o),l=d.magnitude(r),u=d.magnitude(s),f=!0,h=!0,p=!0;a>0?d.divideByScalar(o,a,o):f=!1,l>0?d.divideByScalar(r,l,r):h=!1,u>0?d.divideByScalar(s,u,s):p=!1;let g=!f+!h+!p,m,y,b;if(g===1){let S=o;m=r,y=s,h?p||(S=s,y=o):(S=r,m=o),b=d.cross(m,y,ite),S===o?o=b:S===r?r=b:S===s&&(s=b)}else if(g===2){m=o,h?m=r:p&&(m=s);let S=d.UNIT_Y;S.equalsEpsilon(m,O.EPSILON3)&&(S=d.UNIT_X),y=d.cross(m,S,dRe),d.normalize(y,y),b=d.cross(m,y,ite),d.normalize(b,b),m===o?(r=y,s=b):m===r?(s=y,o=b):m===s&&(o=y,r=b)}else g===3&&(o=d.UNIT_X,r=d.UNIT_Y,s=d.UNIT_Z);let x=hRe;x.x=d.dot(n,o),x.y=d.dot(n,r),x.z=d.dot(n,s);let A=0,E;return x.x<-a?(E=x.x+a,A+=E*E):x.x>a&&(E=x.x-a,A+=E*E),x.y<-l?(E=x.y+l,A+=E*E):x.y>l&&(E=x.y-l,A+=E*E),x.z<-u?(E=x.z+u,A+=E*E):x.z>u&&(E=x.z-u,A+=E*E),A};var mRe=new d,pRe=new d;Mi.computePlaneDistances=function(e,t,n,i){if(!c(e))throw new C("box is required.");if(!c(t))throw new C("position is required.");if(!c(n))throw new C("direction is required.");c(i)||(i=new $a);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,l=J.getColumn(a,0,rte),u=J.getColumn(a,1,ste),f=J.getColumn(a,2,ate),h=d.add(l,u,mRe);d.add(h,f,h),d.add(h,s,h);let p=d.subtract(h,t,pRe),g=d.dot(n,p);return o=Math.min(g,o),r=Math.max(g,r),d.add(s,l,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.add(s,l,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.add(s,l,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.add(h,u,h),d.add(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.add(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.subtract(h,u,h),d.add(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),d.subtract(s,l,h),d.subtract(h,u,h),d.subtract(h,f,h),d.subtract(h,t,p),g=d.dot(n,p),o=Math.min(g,o),r=Math.max(g,r),i.start=o,i.stop=r,i};var _Re=new d,gRe=new d,yRe=new d;Mi.computeCorners=function(e,t){T.typeOf.object("box",e),c(t)||(t=[new d,new d,new d,new d,new d,new d,new d,new d]);let n=e.center,i=e.halfAxes,o=J.getColumn(i,0,_Re),r=J.getColumn(i,1,gRe),s=J.getColumn(i,2,yRe);return d.clone(n,t[0]),d.subtract(t[0],o,t[0]),d.subtract(t[0],r,t[0]),d.subtract(t[0],s,t[0]),d.clone(n,t[1]),d.subtract(t[1],o,t[1]),d.subtract(t[1],r,t[1]),d.add(t[1],s,t[1]),d.clone(n,t[2]),d.subtract(t[2],o,t[2]),d.add(t[2],r,t[2]),d.subtract(t[2],s,t[2]),d.clone(n,t[3]),d.subtract(t[3],o,t[3]),d.add(t[3],r,t[3]),d.add(t[3],s,t[3]),d.clone(n,t[4]),d.add(t[4],o,t[4]),d.subtract(t[4],r,t[4]),d.subtract(t[4],s,t[4]),d.clone(n,t[5]),d.add(t[5],o,t[5]),d.subtract(t[5],r,t[5]),d.add(t[5],s,t[5]),d.clone(n,t[6]),d.add(t[6],o,t[6]),d.add(t[6],r,t[6]),d.subtract(t[6],s,t[6]),d.clone(n,t[7]),d.add(t[7],o,t[7]),d.add(t[7],r,t[7]),d.add(t[7],s,t[7]),t};var bRe=new J;Mi.computeTransformation=function(e,t){T.typeOf.object("box",e),c(t)||(t=new F);let n=e.center,i=J.multiplyByUniformScale(e.halfAxes,2,bRe);return F.fromRotationTranslation(i,n,t)};var xRe=new le;Mi.isOccluded=function(e,t){if(!c(e))throw new C("box is required.");if(!c(t))throw new C("occluder is required.");let n=le.fromOrientedBoundingBox(e,xRe);return!t.isBoundingSphereVisible(n)};Mi.prototype.intersectPlane=function(e){return Mi.intersectPlane(this,e)};Mi.prototype.distanceSquaredTo=function(e){return Mi.distanceSquaredTo(this,e)};Mi.prototype.computePlaneDistances=function(e,t,n){return Mi.computePlaneDistances(this,e,t,n)};Mi.prototype.computeCorners=function(e){return Mi.computeCorners(this,e)};Mi.prototype.computeTransformation=function(e){return Mi.computeTransformation(this,e)};Mi.prototype.isOccluded=function(e){return Mi.isOccluded(this,e)};Mi.equals=function(e,t){return e===t||c(e)&&c(t)&&d.equals(e.center,t.center)&&J.equals(e.halfAxes,t.halfAxes)};Mi.prototype.clone=function(e){return Mi.clone(this,e)};Mi.prototype.equals=function(e){return Mi.equals(this,e)};var Pn=Mi;var jL={};jL.getHeight=function(e,t,n){if(!Number.isFinite(t))throw new C("scale must be a finite number.");if(!Number.isFinite(n))throw new C("relativeHeight must be a finite number.");return(e-n)*t+n};var TRe=new he;jL.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,TRe);if(!c(r))return d.clone(e,o);let s=jL.getHeight(r.height,n,i);return d.fromRadians(r.longitude,r.latitude,s,t,o)};var Rr=jL;var WL=`in vec3 position3DHigh;
in vec3 position3DLow;
in float batchId;
#ifdef EXTRUDED_GEOMETRY
in vec3 extrudeDirection;
uniform float u_globeMinimumAltitude;
#endif // EXTRUDED_GEOMETRY
#ifdef PER_INSTANCE_COLOR
out vec4 v_color;
#endif // PER_INSTANCE_COLOR
#ifdef TEXTURE_COORDINATES
#ifdef SPHERICAL
out vec4 v_sphericalExtents;
#else // SPHERICAL
out vec2 v_inversePlaneExtents;
out vec4 v_westPlane;
out vec4 v_southPlane;
#endif // SPHERICAL
out vec3 v_uvMinAndSphericalLongitudeRotation;
out vec3 v_uMaxAndInverseDistance;
out vec3 v_vMaxAndInverseDistance;
#endif // TEXTURE_COORDINATES
void main()
{
vec4 position = czm_computePosition();
#ifdef EXTRUDED_GEOMETRY
float delta = min(u_globeMinimumAltitude, czm_geometricToleranceOverMeter * length(position.xyz));
delta *= czm_sceneMode == czm_sceneMode3D ? 1.0 : 0.0;
position = position + vec4(extrudeDirection * delta, 0.0);
#endif
#ifdef TEXTURE_COORDINATES
#ifdef SPHERICAL
v_sphericalExtents = czm_batchTable_sphericalExtents(batchId);
v_uvMinAndSphericalLongitudeRotation.z = czm_batchTable_longitudeRotation(batchId);
#else // SPHERICAL
#ifdef COLUMBUS_VIEW_2D
vec4 planes2D_high = czm_batchTable_planes2D_HIGH(batchId);
vec4 planes2D_low = czm_batchTable_planes2D_LOW(batchId);
vec2 idlSplitNewPlaneHiLow = vec2(EAST_MOST_X_HIGH - (WEST_MOST_X_HIGH - planes2D_high.w), EAST_MOST_X_LOW - (WEST_MOST_X_LOW - planes2D_low.w));
bool idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y > 0.0;
planes2D_high.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.w);
planes2D_low.w = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.w);
idlSplit = planes2D_high.x > planes2D_high.w && position3DLow.y < 0.0;
idlSplitNewPlaneHiLow = vec2(WEST_MOST_X_HIGH - (EAST_MOST_X_HIGH - planes2D_high.x), WEST_MOST_X_LOW - (EAST_MOST_X_LOW - planes2D_low.x));
planes2D_high.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.x, planes2D_high.x);
planes2D_low.x = czm_branchFreeTernary(idlSplit, idlSplitNewPlaneHiLow.y, planes2D_low.x);
vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.xy), vec3(0.0, planes2D_low.xy))).xyz;
vec3 northWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.x, planes2D_high.z), vec3(0.0, planes2D_low.x, planes2D_low.z))).xyz;
vec3 southEastCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, planes2D_high.w, planes2D_high.y), vec3(0.0, planes2D_low.w, planes2D_low.y))).xyz;
#else // COLUMBUS_VIEW_2D
vec3 southWestCorner = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(czm_batchTable_southWest_HIGH(batchId), czm_batchTable_southWest_LOW(batchId))).xyz;
vec3 northWestCorner = czm_normal * czm_batchTable_northward(batchId) + southWestCorner;
vec3 southEastCorner = czm_normal * czm_batchTable_eastward(batchId) + southWestCorner;
#endif // COLUMBUS_VIEW_2D
vec3 eastWard = southEastCorner - southWestCorner;
float eastExtent = length(eastWard);
eastWard /= eastExtent;
vec3 northWard = northWestCorner - southWestCorner;
float northExtent = length(northWard);
northWard /= northExtent;
v_westPlane = vec4(eastWard, -dot(eastWard, southWestCorner));
v_southPlane = vec4(northWard, -dot(northWard, southWestCorner));
v_inversePlaneExtents = vec2(1.0 / eastExtent, 1.0 / northExtent);
#endif // SPHERICAL
vec4 uvMinAndExtents = czm_batchTable_uvMinAndExtents(batchId);
vec4 uMaxVmax = czm_batchTable_uMaxVmax(batchId);
v_uMaxAndInverseDistance = vec3(uMaxVmax.xy, uvMinAndExtents.z);
v_vMaxAndInverseDistance = vec3(uMaxVmax.zw, uvMinAndExtents.w);
v_uvMinAndSphericalLongitudeRotation.xy = uvMinAndExtents.xy;
#endif // TEXTURE_COORDINATES
#ifdef PER_INSTANCE_COLOR
v_color = czm_batchTable_color(batchId);
#endif
gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position);
}
`;var Y0=`#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif
void main(void)
{
#ifdef VECTOR_TILE
out_FragColor = czm_gammaCorrect(u_highlightColor);
#else
out_FragColor = vec4(1.0);
#endif
czm_writeDepthClamp();
}
`;var cte={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};cte.NUMBER_OF_CLASSIFICATION_TYPES=3;var Un=Object.freeze(cte);var ARe={NEVER:ne.NEVER,LESS:ne.LESS,EQUAL:ne.EQUAL,LESS_OR_EQUAL:ne.LEQUAL,GREATER:ne.GREATER,NOT_EQUAL:ne.NOTEQUAL,GREATER_OR_EQUAL:ne.GEQUAL,ALWAYS:ne.ALWAYS},Dc=Object.freeze(ARe);function CRe(e,t){if(!c(e))throw new C("array is required.");if(!c(t)||t<1)throw new C("numberOfArrays must be greater than 0.");let n=[],i=e.length,o=0;for(;o<i;){let r=Math.ceil((i-o)/t--);n.push(e.slice(o,o+r)),o+=r}return n}var qL=CRe;function pp(e,t,n){if(!c(e))throw new C("context is required");if(!c(t))throw new C("attributes is required");if(!c(n))throw new C("numberOfInstances is required");if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=ERe(t),o=e.floatingPointTexture,r=i===Ue.FLOAT&&!o,s=SRe(t,r),a=wRe(s,t,r),l=Math.floor(ut.maximumTextureSize/a),u=Math.min(n,l),f=a*u,h=Math.ceil(n/u),p=1/f,g=p*.5,m=1/h,y=m*.5;this._textureDimensions=new z(f,h),this._textureStep=new se(p,g,m,y),this._pixelDatatype=r?Ue.UNSIGNED_BYTE:i,this._packFloats=r,this._offsets=s,this._stride=a,this._texture=void 0;let b=4*f*h;this._batchValues=i===Ue.FLOAT&&!r?new Float32Array(b):new Uint8Array(b),this._batchValuesDirty=!1}Object.defineProperties(pp.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function ERe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==$.UNSIGNED_BYTE){t=!0;break}return t?Ue.FLOAT:Ue.UNSIGNED_BYTE}function ute(e,t){let n=e[t].componentsPerAttribute;return n===2?z:n===3?d:n===4?se:Number}function SRe(e,t){let n=new Array(e.length),i=0,o=e.length;for(let r=0;r<o;++r){let a=e[r].componentDatatype;n[r]=i,a!==$.UNSIGNED_BYTE&&t?i+=4:++i}return n}function wRe(e,t,n){let i=e.length,o=e[i-1];return t[i-1].componentDatatype!==$.UNSIGNED_BYTE&&n?o+4:o+1}var xw=new se;function vRe(e,t,n){let i=se.unpack(e,t,xw),o=se.unpackFloat(i);i=se.unpack(e,t+4,xw);let r=se.unpackFloat(i);i=se.unpack(e,t+8,xw);let s=se.unpackFloat(i);i=se.unpack(e,t+12,xw);let a=se.unpackFloat(i);return se.fromElements(o,r,s,a,n)}function DRe(e,t,n){let i=se.packFloat(e.x,xw);se.pack(i,t,n),i=se.packFloat(e.y,i),se.pack(i,t,n+4),i=se.packFloat(e.z,i),se.pack(i,t,n+8),i=se.packFloat(e.w,i),se.pack(i,t,n+12)}var lte=new se;pp.prototype.getBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new C("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new C("attributeIndex is out of range");let i=this._attributes,o=this._offsets[t],s=4*this._stride*e+4*o,a;this._packFloats&&i[t].componentDatatype!==Ue.UNSIGNED_BYTE?a=vRe(this._batchValues,s,lte):a=se.unpack(this._batchValues,s,lte);let l=ute(i,t);return c(l.fromCartesian4)?l.fromCartesian4(a,n):c(l.clone)?l.clone(a,n):a.x};var PRe=[void 0,void 0,new z,new d,new se],IRe=new se;pp.prototype.setBatchedAttribute=function(e,t,n){if(e<0||e>=this._numberOfInstances)throw new C("instanceIndex is out of range.");if(t<0||t>=this._attributes.length)throw new C("attributeIndex is out of range");if(!c(n))throw new C("value is required.");let i=this._attributes,o=PRe[i[t].componentsPerAttribute],r=this.getBatchedAttribute(e,t,o),s=ute(this._attributes,t);if(c(s.equals)?s.equals(r,n):r===n)return;let l=IRe;l.x=c(n.x)?n.x:n,l.y=c(n.y)?n.y:0,l.z=c(n.z)?n.z:0,l.w=c(n.w)?n.w:0;let u=this._offsets[t],h=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==Ue.UNSIGNED_BYTE?DRe(l,this._batchValues,h):se.pack(l,this._batchValues,h),this._batchValuesDirty=!0};function ORe(e,t){let n=e._textureDimensions;e._texture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Qt.NEAREST,flipY:!1})}function RRe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}pp.prototype.update=function(e){c(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,c(this._texture)||ORe(this,e.context),RRe(this))};pp.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:xt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function MRe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep;
vec2 computeSt(float batchId)
{
float stepX = batchTextureStep.x;
float centerX = batchTextureStep.y;
float numberOfAttributes = float(${t});
return vec2(centerX + (batchId * numberOfAttributes * stepX), 0.5);
}
`:`uniform vec4 batchTextureStep;
uniform vec2 batchTextureDimensions;
vec2 computeSt(float batchId)
{
float stepX = batchTextureStep.x;
float centerX = batchTextureStep.y;
float stepY = batchTextureStep.z;
float centerY = batchTextureStep.w;
float numberOfAttributes = float(${t});
float xId = mod(batchId * numberOfAttributes, batchTextureDimensions.x);
float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x);
return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
}
`}function LRe(e){return e===1?"float":`vec${e}`}function NRe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function FRe(e,t){let i=e._attributes[t],o=i.componentsPerAttribute,r=i.functionName,s=LRe(o),a=NRe(o),l=e._offsets[t],u=`${s} ${r}(float batchId)
{
vec2 st = computeSt(batchId);
st.x += batchTextureStep.x * float(${l});
`;return e._packFloats&&i.componentDatatype!==Ue.UNSIGNED_BYTE?u+=`vec4 textureValue;
textureValue.x = czm_unpackFloat(texture(batchTexture, st));
textureValue.y = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x, 0.0)));
textureValue.z = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 2.0, 0.0)));
textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureStep.x * 3.0, 0.0)));
`:u+=` vec4 textureValue = texture(batchTexture, st);
`,u+=` ${s} value = textureValue${a};
`,e._pixelDatatype===Ue.UNSIGNED_BYTE&&i.componentDatatype===$.UNSIGNED_BYTE&&!i.normalize?u+=`value *= 255.0;
`:e._pixelDatatype===Ue.FLOAT&&i.componentDatatype===$.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0;
`),u+=` return value;
}
`,u}pp.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture;
`;t+=`${MRe(this)}
`;let n=e.length;for(let i=0;i<n;++i)t+=FRe(this,i);return function(i){let o=i.indexOf("void main"),r=i.substring(0,o),s=i.substring(o);return`${r}
${t}
${s}`}};pp.prototype.isDestroyed=function(){return!1};pp.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),de(this)};var zT=pp;function ml(e){this._ellipsoid=e??ie.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}Object.defineProperties(ml.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});ml.mercatorAngleToGeodeticLatitude=function(e){return O.PI_OVER_TWO-2*Math.atan(Math.exp(-e))};ml.geodeticLatitudeToMercatorAngle=function(e){e>ml.MaximumLatitude?e=ml.MaximumLatitude:e<-ml.MaximumLatitude&&(e=-ml.MaximumLatitude);let t=Math.sin(e);return .5*Math.log((1+t)/(1-t))};ml.MaximumLatitude=ml.mercatorAngleToGeodeticLatitude(Math.PI);ml.prototype.project=function(e,t){let n=this._semimajorAxis,i=e.longitude*n,o=ml.geodeticLatitudeToMercatorAngle(e.latitude)*n,r=e.height;return c(t)?(t.x=i,t.y=o,t.z=r,t):new d(i,o,r)};ml.prototype.unproject=function(e,t){if(!c(e))throw new C("cartesian is required");let n=this._oneOverSemimajorAxis,i=e.x*n,o=ml.mercatorAngleToGeodeticLatitude(e.y*n),r=e.z;return c(t)?(t.longitude=i,t.latitude=o,t.height=r,t):new he(i,o,r)};var Li=ml;function BRe(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r<o;++r)if(!F.equals(s,e[r].modelMatrix)){i=!0;break}}if(i)for(r=0;r<o;++r)c(e[r].geometry)&&Nn.transformToWorldCoordinates(e[r]);else F.multiplyTransformation(t,e[0].modelMatrix,t)}function B6(e,t){let n=e.attributes,i=n.position,o=i.values.length/i.componentsPerAttribute;n.batchId=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:1,values:new Float32Array(o)});let r=n.batchId.values;for(let s=0;s<o;++s)r[s]=t}function kRe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];c(i.geometry)?B6(i.geometry,n):c(i.westHemisphereGeometry)&&c(i.eastHemisphereGeometry)&&(B6(i.westHemisphereGeometry,n),B6(i.eastHemisphereGeometry,n))}}function URe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,o=e.scene3DOnly,r=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,l,u,f,h=t.length;for(l=0;l<h;++l)if(c(t[l].geometry)){f=t[l].geometry.primitiveType;break}for(l=1;l<h;++l)if(c(t[l].geometry)&&t[l].geometry.primitiveType!==f)throw new C("All instance geometries must have the same primitiveType.");if(BRe(t,a,o),!o)for(l=0;l<h;++l)c(t[l].geometry)&&Nn.splitLongitude(t[l]);if(kRe(t),r)for(l=0;l<h;++l){let g=t[l];c(g.geometry)?(Nn.reorderForPostVertexCache(g.geometry),Nn.reorderForPreVertexCache(g.geometry)):c(g.westHemisphereGeometry)&&c(g.eastHemisphereGeometry)&&(Nn.reorderForPostVertexCache(g.westHemisphereGeometry),Nn.reorderForPreVertexCache(g.westHemisphereGeometry),Nn.reorderForPostVertexCache(g.eastHemisphereGeometry),Nn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Nn.combineInstances(t);for(h=p.length,l=0;l<h;++l){u=p[l];let g=u.attributes;if(o)for(let m in g)g.hasOwnProperty(m)&&g[m].componentDatatype===$.DOUBLE&&Nn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in g)if(g.hasOwnProperty(m)&&g[m].componentDatatype===$.DOUBLE){let y=`${m}3D`,b=`${m}2D`;Nn.projectTo2D(u,m,y,b,n),c(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=le.fromVertices(u.attributes.position2D.values)),Nn.encodeAttribute(u,y,`${y}High`,`${y}Low`),Nn.encodeAttribute(u,b,`${b}High`,`${b}Low`)}s&&Nn.compressVertices(u)}if(!i){let g=[];for(h=p.length,l=0;l<h;++l)u=p[l],g=g.concat(Nn.fitToUnsignedShortIndices(u));p=g}return p}function k6(e,t,n,i){let o,r,s,a=i.length-1;if(a>=0){let u=i[a];o=u.offset+u.count,s=u.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let l=e.length;for(let u=0;u<l;++u){let h=e[u][t];if(!c(h))continue;let p=h.indices.length;o+p>r&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function VRe(e,t){let n=[];return k6(e,"geometry",t,n),k6(e,"westHemisphereGeometry",t,n),k6(e,"eastHemisphereGeometry",t,n),n}var _p={};_p.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=URe(e),t.length>0&&(n=Nn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=VRe(i,t))),c(i[0].attributes)&&c(i[0].attributes.offset)&&(s=new Array(o),a=!0));let l=new Array(o),u=new Array(o);for(let f=0;f<o;++f){let h=i[f],p=h.geometry;c(p)&&(l[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=h.geometry.offsetAttribute));let g=h.eastHemisphereGeometry,m=h.westHemisphereGeometry;c(g)&&c(m)&&(c(g.boundingSphere)&&c(m.boundingSphere)&&(l[f]=le.union(g.boundingSphere,m.boundingSphere)),c(g.boundingSphereCV)&&c(m.boundingSphereCV)&&(u[f]=le.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:r,offsetInstanceExtend:s,boundingSpheres:l,boundingSpheresCV:u}};function zRe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];c(o)&&c(o.values)&&t.push(o.values.buffer)}c(e.indices)&&t.push(e.indices.buffer)}function HRe(e,t){let n=e.length;for(let i=0;i<n;++i)zRe(e[i],t)}function GRe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let o=e[i];if(++t,!c(o))continue;let r=o.attributes;t+=7+2*le.packedLength+(c(o.indices)?o.indices.length:0);for(let s in r)if(r.hasOwnProperty(s)&&c(r[s])){let a=r[s];t+=5+a.values.length}}return t}_p.packCreateGeometryResults=function(e,t){let n=new Float64Array(GRe(e)),i=[],o={},r=e.length,s=0;n[s++]=r;for(let a=0;a<r;a++){let l=e[a],u=c(l);if(n[s++]=u?1:0,!u)continue;n[s++]=l.primitiveType,n[s++]=l.geometryType,n[s++]=l.offsetAttribute??-1;let f=c(l.boundingSphere)?1:0;n[s++]=f,f&&le.pack(l.boundingSphere,n,s),s+=le.packedLength;let h=c(l.boundingSphereCV)?1:0;n[s++]=h,h&&le.pack(l.boundingSphereCV,n,s),s+=le.packedLength;let p=l.attributes,g=[];for(let y in p)p.hasOwnProperty(y)&&c(p[y])&&(g.push(y),c(o[y])||(o[y]=i.length,i.push(y)));n[s++]=g.length;for(let y=0;y<g.length;y++){let b=g[y],x=p[b];n[s++]=o[b],n[s++]=x.componentDatatype,n[s++]=x.componentsPerAttribute,n[s++]=x.normalize?1:0,n[s++]=x.values.length,n.set(x.values,s),s+=x.values.length}let m=c(l.indices)?l.indices.length:0;n[s++]=m,m>0&&(n.set(l.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};_p.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){o[r++]=void 0;continue}let l=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let h,p;n[s++]===1&&(h=le.unpack(n,s)),s+=le.packedLength,n[s++]===1&&(p=le.unpack(n,s)),s+=le.packedLength;let y,b,x,A=new hn,E=n[s++];for(i=0;i<E;i++){let v=t[n[s++]],P=n[s++];x=n[s++];let M=n[s++]!==0;y=n[s++],b=$.createTypedArray(P,y);for(let R=0;R<y;R++)b[R]=n[s++];A[v]=new ve({componentDatatype:P,componentsPerAttribute:x,normalize:M,values:b})}let S;if(y=n[s++],y>0){let v=b.length/x;for(S=Fe.createTypedArray(v,y),i=0;i<y;i++)S[i]=n[s++]}o[r++]=new ct({primitiveType:l,geometryType:u,boundingSphere:h,boundingSphereCV:p,indices:S,attributes:A,offsetAttribute:f})}return o};function jRe(e,t){let n=e.length,i=new Float64Array(1+n*19),o=0;i[o++]=n;for(let r=0;r<n;r++){let s=e[r];if(F.pack(s.modelMatrix,i,o),o+=F.packedLength,c(s.attributes)&&c(s.attributes.offset)){let a=s.attributes.offset.value;i[o]=a[0],i[o+1]=a[1],i[o+2]=a[2]}o+=3}return t.push(i.buffer),i}function WRe(e){let t=e,n=new Array(t[0]),i=0,o=1;for(;o<t.length;){let r=F.unpack(t,o),s;o+=F.packedLength,c(t[o])&&(s={offset:new Ji(t[o],t[o+1],t[o+2])}),o+=3,n[i++]={modelMatrix:r,attributes:s}}return n}_p.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let o=0;o<i;o++)t.push(n[o].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:jRe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Oi,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};_p.unpackCombineGeometryParameters=function(e){let t=WRe(e.packedInstances),n=e.createGeometryResults,i=n.length,o=0;for(let a=0;a<i;a++){let l=_p.unpackCreateGeometryResults(n[a]),u=l.length;for(let f=0;f<u;f++){let h=l[f],p=t[o];p.geometry=h,++o}}let r=ie.clone(e.ellipsoid),s=e.isGeographic?new Oi(r):new Li(r);return{instances:t,ellipsoid:r,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:F.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function fte(e){let t=e.length,n=1+(le.packedLength+1)*t,i=new Float32Array(n),o=0;i[o++]=t;for(let r=0;r<t;++r){let s=e[r];c(s)?(i[o++]=1,le.pack(e[r],i,o)):i[o++]=0,o+=le.packedLength}return i}function dte(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=le.unpack(e,i)),++n,i+=le.packedLength;return t}_p.packCombineGeometryResults=function(e,t){c(e.geometries)&&HRe(e.geometries,t);let n=fte(e.boundingSpheres),i=fte(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};_p.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:dte(e.boundingSpheres),boundingSpheresCV:dte(e.boundingSpheresCV)}};var HT=_p;var qRe={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6},Mr=Object.freeze(qRe);var Ql={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Ql.NUMBER_OF_SHADOW_MODES=4;Ql.castShadows=function(e){return e===Ql.ENABLED||e===Ql.CAST_ONLY};Ql.receiveShadows=function(e){return e===Ql.ENABLED||e===Ql.RECEIVE_ONLY};Ql.fromCastReceive=function(e,t){return e&&t?Ql.ENABLED:e?Ql.CAST_ONLY:t?Ql.RECEIVE_ONLY:Ql.DISABLED};var Tn=Object.freeze(Ql);function yr(e){if(e=e??W.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=new F,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,c(this.rtcCenter)&&(!c(this.geometryInstances)||Array.isArray(this.geometryInstances)&&this.geometryInstances.length!==1))throw new C("Relative-to-center rendering only supports one geometry instance.");this.shadows=e.shadows??Tn.DISABLED,this._translucent=void 0,this._state=Mr.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(yr.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});function YRe(e){let t=e.length,n=[],i=e[0].attributes,o;for(o in i)if(i.hasOwnProperty(o)&&c(i[o])){let r=i[o],s=!0;for(let a=1;a<t;++a){let l=e[a].attributes[o];if(!c(l)||r.componentDatatype!==l.componentDatatype||r.componentsPerAttribute!==l.componentsPerAttribute||r.normalize!==l.normalize){s=!1;break}}s&&n.push(o)}return n}var XRe=new z,KRe=new d,Tte=new se;function Ate(e){let t=e.length;if(t===1)return e[0];if(t===2)return z.unpack(e,0,XRe);if(t===3)return d.unpack(e,0,KRe);if(t===4)return se.unpack(e,0,Tte)}function $Re(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],o=i.length;if(o===0)return;let r=YRe(i),s=r.length,a=[],l={},u={},f,p=i[0].attributes,g,m,y;for(g=0;g<s;++g)m=r[g],y=p[m],l[m]=g,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:y.componentDatatype,componentsPerAttribute:y.componentsPerAttribute,normalize:y.normalize});r.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:$.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:$.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:$.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:$.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:$.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),r.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:$.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let b=a.length,x=new zT(t,a,o);for(g=0;g<o;++g){let A=i[g];p=A.attributes;for(let M=0;M<s;++M){m=r[M],y=p[m];let R=Ate(y.value),L=l[m];x.setBatchedAttribute(g,L,R)}let E={primitive:A.pickPrimitive??e};c(A.id)&&(E.id=A.id);let S=t.createPickId(E);e._pickIds.push(S);let v=S.color,P=Tte;P.x=G.floatToByte(v.red),P.y=G.floatToByte(v.green),P.z=G.floatToByte(v.blue),P.w=G.floatToByte(v.alpha),x.setBatchedAttribute(g,b-1,P)}e._batchTable=x,e._batchTableAttributeIndices=l,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function ZRe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new ve({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function QRe(e){let t=e.attributes,n=new hn;for(let o in t)t.hasOwnProperty(o)&&c(t[o])&&(n[o]=ZRe(t[o]));let i;if(c(e.indices)){let o=e.indices;Array.isArray(o)?i=o.slice(0):i=new o.constructor(o)}return new ct({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:le.clone(e.boundingSphere)})}function JRe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:F.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var eMe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;yr._modifyShaderPosition=function(e,t,n){let i,o="",r="",s="";for(;(i=eMe.exec(t))!==null;){let a=i[1],l=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;l!=="vec4 czm_computePosition()"&&(o+=`${l};
`),c(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),o+=`uniform mat4 u_modifiedModelView;
`,r+=`in vec4 position;
`,s+=`${l}
{
return u_modifiedModelView * position;
}
`,t=t.replace(/czm_modelViewRelativeToEye\s+\*\s+/g,""),t=t.replace(/czm_modelViewProjectionRelativeToEye/g,"czm_projection")):n?s+=`${l}
{
return czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
}
`:(r+=`in vec3 ${a}2DHigh;
in vec3 ${a}2DLow;
`,s+=`${l}
{
vec4 p;
if (czm_morphTime == 1.0)
{
p = czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow);
}
else if (czm_morphTime == 0.0)
{
p = czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy);
}
else
{
p = czm_columbusViewMorph(
czm_translateRelativeToEye(${a}2DHigh.zxy, ${a}2DLow.zxy),
czm_translateRelativeToEye(${a}3DHigh, ${a}3DLow),
czm_morphTime);
}
return p;
}
`)}return[o,r,t,s].join(`
`)};yr._appendShowToShader=function(e,t){return c(e._batchTableAttributeIndices.show)?`${He.replaceMain(t,"czm_non_show_main")}
void main()
{
czm_non_show_main();
gl_Position *= czm_batchTable_show(batchId);
}`:t};yr._updateColorAttribute=function(e,t,n){if(!c(e._batchTableAttributeIndices.color)&&!c(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;if(n&&!c(e._batchTableAttributeIndices.depthFailColor))throw new C("A depthFailColor per-instance attribute is required when using a depth fail appearance that uses a color attribute.");let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function hte(e){return`${He.replaceMain(e,"czm_non_pick_main")}
out vec4 v_pickColor;
void main()
{
czm_non_pick_main();
v_pickColor = czm_batchTable_pickColor(batchId);
}`}function mte(e){return`in vec4 v_pickColor;
${e}`}yr._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};yr._appendOffsetToShader=function(e,t){if(!c(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId;
`;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),o=`vec4 $1 = czm_computePosition();
`;return o+=` if (czm_sceneMode == czm_sceneMode3D)
`,o+=` {
`,o+=" $1 = $1 + vec4(czm_batchTable_offset(batchId) * applyOffset, 0.0);",o+=` }
`,o+=` else
`,o+=` {
`,o+=" $1 = $1 + vec4(czm_batchTable_offset2D(batchId) * applyOffset, 0.0);",o+=` }
`,i=i.replace(/vec4\s+([A-Za-z0-9_]+)\s+=\s+czm_computePosition\(\);/g,o),i};yr._appendDistanceDisplayConditionToShader=function(e,t,n){if(!c(e._batchTableAttributeIndices.distanceDisplayCondition))return t;let i=He.replaceMain(t,"czm_non_distanceDisplayCondition_main"),o=`void main()
{
czm_non_distanceDisplayCondition_main();
vec2 distanceDisplayCondition = czm_batchTable_distanceDisplayCondition(batchId);
vec3 boundingSphereCenter3DHigh = czm_batchTable_boundingSphereCenter3DHigh(batchId);
vec3 boundingSphereCenter3DLow = czm_batchTable_boundingSphereCenter3DLow(batchId);
float boundingSphereRadius = czm_batchTable_boundingSphereRadius(batchId);
`;return n?o+=` vec4 centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
`:o+=` vec3 boundingSphereCenter2DHigh = czm_batchTable_boundingSphereCenter2DHigh(batchId);
vec3 boundingSphereCenter2DLow = czm_batchTable_boundingSphereCenter2DLow(batchId);
vec4 centerRTE;
if (czm_morphTime == 1.0)
{
centerRTE = czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow);
}
else if (czm_morphTime == 0.0)
{
centerRTE = czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy);
}
else
{
centerRTE = czm_columbusViewMorph(
czm_translateRelativeToEye(boundingSphereCenter2DHigh.zxy, boundingSphereCenter2DLow.zxy),
czm_translateRelativeToEye(boundingSphereCenter3DHigh, boundingSphereCenter3DLow),
czm_morphTime);
}
`,o+=` float radiusSq = boundingSphereRadius * boundingSphereRadius;
float distanceSq;
if (czm_sceneMode == czm_sceneMode2D)
{
distanceSq = czm_eyeHeight2D.y - radiusSq;
}
else
{
distanceSq = dot(centerRTE.xyz, centerRTE.xyz) - radiusSq;
}
distanceSq = max(distanceSq, 0.0);
float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;
float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;
float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0;
gl_Position *= show;
}`,`${i}
${o}`};function pte(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",l="compressedAttributes",u=`in ${a} ${l};`,f="",h="";if(i){f+=`vec2 st;
`;let m=s>1?`${l}.x`:l;h+=` st = czm_decompressTextureCoordinates(${m});
`}n&&o&&r?(f+=`vec3 normal;
vec3 tangent;
vec3 bitangent;
`,h+=` czm_octDecode(${l}.${i?"yz":"xy"}, normal, tangent, bitangent);
`):(n&&(f+=`vec3 normal;
`,h+=` normal = czm_octDecode(${l}${s>1?`.${i?"y":"x"}`:""});
`),o&&(f+=`vec3 tangent;
`,h+=` tangent = czm_octDecode(${l}.${i&&n?"z":"y"});
`),r&&(f+=`vec3 bitangent;
`,h+=` bitangent = czm_octDecode(${l}.${i&&n?"z":"y"});
`));let p=t;p=p.replace(/in\s+vec3\s+normal;/g,""),p=p.replace(/in\s+vec2\s+st;/g,""),p=p.replace(/in\s+vec3\s+tangent;/g,""),p=p.replace(/in\s+vec3\s+bitangent;/g,""),p=He.replaceMain(p,"czm_non_compressed_main");let g=`void main()
{
${h} czm_non_compressed_main();
}`;return[u,f,p,g].join(`
`)}function tMe(e){let t=He.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
czm_non_depth_clamp_main();
gl_Position = czm_depthClamp(gl_Position);}
`,t}function nMe(e){let t=He.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() {
czm_non_depth_clamp_main();
#if defined(LOG_DEPTH)
czm_writeLogDepth();
#else
czm_writeDepthClamp();
#endif
}
`,t}function _te(e,t){let n=e.vertexAttributes;for(let i in n)if(n.hasOwnProperty(i)&&!c(t[i]))throw new C(`Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '${i}', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.`)}function iMe(e,t){return function(){return e[t]}}var U6=Math.max(zt.hardwareConcurrency-1,1),YL,oMe=new bi("combineGeometry");function rMe(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===Mr.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,l=[],u=[];for(o=0;o<a;++o){if(i=n[o].geometry,s.push(n[o].id),c(i._workerName)&&c(i._workerPath)||!c(i._workerName)&&!c(i._workerPath))throw new C("Must define either _workerName or _workerPath for asynchronous geometry.");u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i})}if(!c(YL))for(YL=new Array(U6),o=0;o<U6;o++)YL[o]=new bi("createGeometry");let f;for(u=qL(u,U6),o=0;o<u.length;o++){let h=0,p=u[o],g=p.length;for(r=0;r<g;++r)f=p[r],i=f.geometry,c(i.constructor.pack)&&(f.offset=h,h+=i.constructor.packedLength??i.packedLength);let m;if(h>0){let y=new Float64Array(h);for(m=[y.buffer],r=0;r<g;++r)f=p[r],i=f.geometry,c(i.constructor.pack)&&(i.constructor.pack(i,y,f.offset),f.geometry=y)}l.push(YL[o].scheduleTask({subTasks:u[o]},m))}e._state=Mr.CREATING,Promise.all(l).then(function(h){e._createGeometryResults=h,e._state=Mr.CREATED}).catch(function(h){Aw(e,t,Mr.FAILED,h)})}else if(e._state===Mr.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let l=t.scene3DOnly,u=t.mapProjection,f=oMe.scheduleTask(HT.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:l,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=Mr.COMBINING,Promise.resolve(f).then(function(h){let p=HT.unpackCombineGeometryResults(h);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=F.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Mr.COMBINED):Aw(e,t,Mr.FAILED,void 0)}).catch(function(h){Aw(e,t,Mr.FAILED,h)})}}function sMe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,l=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;c(p.attributes)&&c(p.primitiveType)?g=QRe(p):g=p.constructor.createGeometry(p),o[l++]=JRe(s,g),r.push(s.id)}o.length=l;let u=t.scene3DOnly,f=t.mapProjection,h=HT.combineGeometry({instances:o,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=h.geometries,e._attributeLocations=h.attributeLocations,e.modelMatrix=F.clone(h.modelMatrix,e.modelMatrix),e._pickOffsets=h.pickOffsets,e._offsetInstanceExtend=h.offsetInstanceExtend,e._instanceBoundingSpheres=h.boundingSpheres,e._instanceBoundingSpheresCV=h.boundingSpheresCV,c(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=Mr.COMBINED):Aw(e,t,Mr.FAILED,void 0)}function aMe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!c(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!c(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new le;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let y=a[i],b=e._batchTable.getBatchedAttribute(i,n,new d);y=r[i].clone(y),wte(y,b,o[i])}let l=[],u=[],f=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||le.intersectPlane(y,sn.ORIGIN_ZX_PLANE)!==Wt.INTERSECTING?l.push(y):(u.push(y),f.push(y))}let h=l[0],p=f[0],g=u[0];for(i=1;i<l.length;i++)h=le.union(h,l[i]);for(i=1;i<f.length;i++)p=le.union(p,f[i]);for(i=1;i<u.length;i++)g=le.union(g,u[i]);let m=[];for(c(h)&&m.push(h),c(p)&&m.push(p),c(g)&&m.push(g),i=0;i<m.length;i++){let y=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=y,e._boundingSphereCV[i]=le.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}yr._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var gte=new Hn,Cte=new he,Ete=new d,Ste=new le;function cMe(e,t){if(!c(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,o=i.center3DHigh,r=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,l=i.radius,u=t.mapProjection,f=u.ellipsoid,h=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let m=0;m<g;++m){let y=p[m];if(!c(y))continue;let b=e.modelMatrix;c(b)&&(y=le.transform(y,b,Ste));let x=y.center,A=y.radius,E=Hn.fromCartesian(x,gte);if(h.setBatchedAttribute(m,o,E.high),h.setBatchedAttribute(m,r,E.low),!t.scene3DOnly){let S=f.cartesianToCartographic(x,Cte),v=u.project(S,Ete);E=Hn.fromCartesian(v,gte),h.setBatchedAttribute(m,s,E.high),h.setBatchedAttribute(m,a,E.low)}h.setBatchedAttribute(m,l,A)}e._batchTableBoundingSpheresUpdated=!0}var V6=new d,lMe=new d;function yte(e,t){if(!c(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,o=t.mapProjection,r=o.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,l=a.length;for(let u=0;u<l;++u){let f=a[u];if(!c(f))continue;let h=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(d.equals(h,d.ZERO)){s.setBatchedAttribute(u,i,d.ZERO);continue}let p=e.modelMatrix;c(p)&&(f=le.transform(f,p,Ste));let g=f.center;g=r.scaleToGeodeticSurface(g,lMe);let m=r.cartesianToCartographic(g,Cte),y=o.project(m,Ete),b=d.add(h,g,V6);m=r.cartesianToCartographic(b,m);let x=o.project(m,V6),A=d.subtract(x,y,V6),E=A.x;A.x=A.z,A.z=A.y,A.y=E,s.setBatchedAttribute(u,i,A)}e._batchTableOffsetsUpdated=!0}function uMe(e,t){let n=e._attributeLocations,i=e._geometries,o=t.scene3DOnly,r=t.context,s=[],a=i.length;for(let l=0;l<a;++l){let u=i[l];if(s.push(ni.fromGeometry({context:r,geometry:u,attributeLocations:n,bufferUsage:Be.STATIC_DRAW,interleave:e._interleave})),c(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(le.clone(u.boundingSphere)),e._boundingSphereWC.push(new le),!o){let f=u.boundingSphereCV.center,h=f.x,p=f.y,g=f.z;f.x=g,f.y=h,f.z=p,e._boundingSphereCV.push(le.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new le),e._boundingSphereMorph.push(new le)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,Aw(e,t,Mr.COMPLETE,void 0)}function fMe(e,t,n,i){let o=n.getRenderState(),r;i?(r=We(o,!1),r.cull={enabled:!0,face:Ti.BACK},e._frontFaceRS=ze.fromCache(r),r.cull.face=Ti.FRONT,e._backFaceRS=ze.fromCache(r)):(e._frontFaceRS=ze.fromCache(o),e._backFaceRS=e._frontFaceRS),r=We(o,!1),c(e._depthFailAppearance)&&(r.depthTest.enabled=!1),c(e._depthFailAppearance)&&(o=e._depthFailAppearance.getRenderState(),r=We(o,!1),r.depthTest.func=Dc.GREATER,i?(r.cull={enabled:!0,face:Ti.BACK},e._frontFaceDepthFailRS=ze.fromCache(r),r.cull.face=Ti.FRONT,e._backFaceDepthFailRS=ze.fromCache(r)):(e._frontFaceDepthFailRS=ze.fromCache(r),e._backFaceDepthFailRS=e._frontFaceRS))}function dMe(e,t,n){let i=t.context,o=e._attributeLocations,r=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);r=yr._appendOffsetToShader(e,r),r=yr._appendShowToShader(e,r),r=yr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=hte(r),r=yr._updateColorAttribute(e,r,!1),r=pte(e,r),r=yr._modifyShaderPosition(e,r,t.scene3DOnly);let s=n.getFragmentShaderSource();s=mte(s),e._sp=en.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),_te(e._sp,o),c(e._depthFailAppearance)&&(r=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),r=yr._appendShowToShader(e,r),r=yr._appendDistanceDisplayConditionToShader(e,r,t.scene3DOnly),r=hte(r),r=yr._updateColorAttribute(e,r,!0),r=pte(e,r),r=yr._modifyShaderPosition(e,r,t.scene3DOnly),r=tMe(r),s=e._depthFailAppearance.getFragmentShaderSource(),s=mte(s),s=nMe(s),e._spDepthFail=en.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o}),_te(e._spDepthFail,o))}var Tw=new F,bte=new d;function xte(e,t,n,i){let o=c(n)?n._uniforms:void 0,r={},s=t.uniforms;if(c(s)){for(let l in s)if(s.hasOwnProperty(l)){if(c(o)&&c(o[l]))throw new C(`Appearance and material have a uniform with the same name: ${l}`);r[l]=iMe(s,l)}}let a=xt(r,o);return a=e._batchTable.getUniformMapCallback()(a),c(e.rtcCenter)&&(a.u_modifiedModelView=function(){let l=i.context.uniformState.view;return F.multiply(l,e._modelMatrix,Tw),F.multiplyByPoint(Tw,e.rtcCenter,bte),F.setTranslation(Tw,bte,Tw),Tw}),a}function hMe(e,t,n,i,o,r,s,a){let l=xte(e,t,n,a),u;c(e._depthFailAppearance)&&(u=xte(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?De.TRANSLUCENT:De.OPAQUE,h=o?2:1;h*=c(e._depthFailAppearance)?2:1,r.length=e._va.length*h;let p=r.length,g=0;for(let m=0;m<p;++m){let y;o&&(y=r[m],c(y)||(y=r[m]=new Je({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceRS,y.shaderProgram=e._sp,y.uniformMap=l,y.pass=f,++m),y=r[m],c(y)||(y=r[m]=new Je({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceRS,y.shaderProgram=e._sp,y.uniformMap=l,y.pass=f,c(e._depthFailAppearance)&&(o&&(++m,y=r[m],c(y)||(y=r[m]=new Je({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++m,y=r[m],c(y)||(y=r[m]=new Je({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++g}}yr._updateBoundingVolumes=function(e,t,n,i){let o,r,s;if(i||!F.equals(n,e._modelMatrix))for(F.clone(n,e._modelMatrix),r=e._boundingSpheres.length,o=0;o<r;++o)s=e._boundingSpheres[o],c(s)&&(e._boundingSphereWC[o]=le.transform(s,n,e._boundingSphereWC[o]),t.scene3DOnly||(e._boundingSphere2D[o]=le.clone(e._boundingSphereCV[o],e._boundingSphere2D[o]),e._boundingSphere2D[o].center.x=0,e._boundingSphereMorph[o]=le.union(e._boundingSphereWC[o],e._boundingSphereCV[o])));let a=e.appearance.pixelSize;if(c(a))for(r=e._boundingSpheres.length,o=0;o<r;++o){s=e._boundingSpheres[o];let l=e._boundingSphereWC[o],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;l.radius=s.radius+f}};function mMe(e,t,n,i,o,r,s,a){if(t.mode!==oe.SCENE3D&&!F.equals(o,F.IDENTITY))throw new C("Primitive.modelMatrix is only supported in 3D mode.");yr._updateBoundingVolumes(e,t,o);let l;t.mode===oe.SCENE3D?l=e._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?l=e._boundingSphereCV:t.mode===oe.SCENE2D&&c(e._boundingSphere2D)?l=e._boundingSphere2D:c(e._boundingSphereMorph)&&(l=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let h=e.allowPicking,p=Tn.castShadows(e.shadows),g=Tn.receiveShadows(e.shadows),m=n.length,y=a?2:1;y*=c(e._depthFailAppearance)?2:1;for(let b=0;b<m;++b){let x=Math.floor(b/y),A=n[b];A.modelMatrix=o,A.boundingVolume=l[x],A.cull=r,A.debugShowBoundingVolume=s,A.castShadows=p,A.receiveShadows=g,h?A.pickId="v_pickColor":A.pickId=void 0,u.push(A)}}}yr.prototype.update=function(e){if(!c(this.geometryInstances)&&this._va.length===0||c(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!c(this.appearance)||e.mode!==oe.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(c(this._error))throw this._error;if(c(this.rtcCenter)&&!e.scene3DOnly)throw new C("RTC rendering is only available for 3D only scenes.");if(this._state===Mr.FAILED)return;let t=e.context;if(c(this._batchTable)||$Re(this,t),this._batchTable.attributes.length>0){if(ut.maximumVertexTextureImageUnits===0)throw new ae("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==Mr.COMPLETE&&this._state!==Mr.COMBINED&&(this.asynchronous?rMe(this,e):sMe(this,e)),this._state===Mr.COMBINED&&(cMe(this,e),yte(this,e),uMe(this,e)),!this.show||this._state!==Mr.COMPLETE)return;this._batchTableOffsetsUpdated||yte(this,e),this._recomputeBoundingSpheres&&aMe(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=c(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let l=this._appearance.isTranslucent();this._translucent!==l&&(this._translucent=l,o=!0),c(this._material)&&this._material.update(t);let u=n.closed&&l;o&&(this._createRenderStatesFunction??fMe)(this,t,n,u),r&&(this._createShaderProgramFunction??dMe)(this,e,n),(o||r)&&(this._createCommandsFunction??hMe)(this,n,i,l,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??mMe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var pMe=new le,_Me=new le;function wte(e,t,n){if(n===Zt.TOP){let i=le.clone(e,pMe),o=le.clone(e,_Me);o.center=d.add(o.center,t,o.center),e=le.union(i,o,e)}else n===Zt.ALL&&(e.center=d.add(e.center,t,e.center));return e}function gMe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=$.createTypedArray(o.componentDatatype,r);return c(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function yMe(e,t,n,i,o){return function(r){if(!c(r)||!c(r.length)||r.length<1||r.length>4)throw new C("value must be and array with length between 1 and 4.");let s=Ate(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var bMe=new d;function xMe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(c(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;c(r)&&wte(i,d.fromArray(r.get(),0,bMe),e._offsetInstanceExtend[n]),c(o)&&(i=le.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function TMe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}yr.prototype.getGeometryInstanceAttributes=function(e){if(!c(e))throw new C("id is required");if(!c(this._batchTable))throw new C("must call update before calling getGeometryInstanceAttributes");let t=this._perInstanceAttributeCache.get(e);if(c(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let u=0;u<r;++u){let f=(i+u)%r;if(e===o[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let l={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];l[u]={get:gMe(s,n,f),set:yMe(s,n,f,this,u)}}return xMe(this,l,n),TMe(this,l,n),Object.defineProperties(t,l),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};yr.prototype.isDestroyed=function(){return!1};yr.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,de(this)};function Aw(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){e._ready=e._state===Mr.COMPLETE||e._state===Mr.FAILED})}var In=yr;function AMe(e){if(e=e??W.EMPTY_OBJECT,!c(e.componentDatatype))throw new C("options.componentDatatype is required.");if(!c(e.componentsPerAttribute))throw new C("options.componentsPerAttribute is required.");if(e.componentsPerAttribute<1||e.componentsPerAttribute>4)throw new C("options.componentsPerAttribute must be between 1 and 4.");if(!c(e.value))throw new C("options.value is required.");this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Pc=AMe;var Cw=`#ifdef TEXTURE_COORDINATES
#ifdef SPHERICAL
in vec4 v_sphericalExtents;
#else // SPHERICAL
in vec2 v_inversePlaneExtents;
in vec4 v_westPlane;
in vec4 v_southPlane;
#endif // SPHERICAL
in vec3 v_uvMinAndSphericalLongitudeRotation;
in vec3 v_uMaxAndInverseDistance;
in vec3 v_vMaxAndInverseDistance;
#endif // TEXTURE_COORDINATES
#ifdef PER_INSTANCE_COLOR
in vec4 v_color;
#endif
#ifdef NORMAL_EC
vec3 getEyeCoordinate3FromWindowCoordinate(vec2 fragCoord, float logDepthOrDepth) {
vec4 eyeCoordinate = czm_windowToEyeCoordinates(fragCoord, logDepthOrDepth);
return eyeCoordinate.xyz / eyeCoordinate.w;
}
vec3 vectorFromOffset(vec4 eyeCoordinate, vec2 positiveOffset) {
vec2 glFragCoordXY = gl_FragCoord.xy;
float upOrRightLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY + positiveOffset) / czm_viewport.zw));
float downOrLeftLogDepth = czm_unpackDepth(texture(czm_globeDepthTexture, (glFragCoordXY - positiveOffset) / czm_viewport.zw));
bvec2 upOrRightInBounds = lessThan(glFragCoordXY + positiveOffset, czm_viewport.zw);
float useUpOrRight = float(upOrRightLogDepth > 0.0 && upOrRightInBounds.x && upOrRightInBounds.y);
float useDownOrLeft = float(useUpOrRight == 0.0);
vec3 upOrRightEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY + positiveOffset, upOrRightLogDepth);
vec3 downOrLeftEC = getEyeCoordinate3FromWindowCoordinate(glFragCoordXY - positiveOffset, downOrLeftLogDepth);
return (upOrRightEC - (eyeCoordinate.xyz / eyeCoordinate.w)) * useUpOrRight + ((eyeCoordinate.xyz / eyeCoordinate.w) - downOrLeftEC) * useDownOrLeft;
}
#endif // NORMAL_EC
void main(void)
{
#ifdef REQUIRES_EC
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw));
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
#endif
#ifdef REQUIRES_WC
vec4 worldCoordinate4 = czm_inverseView * eyeCoordinate;
vec3 worldCoordinate = worldCoordinate4.xyz / worldCoordinate4.w;
#endif
#ifdef TEXTURE_COORDINATES
vec2 uv;
#ifdef SPHERICAL
vec2 sphericalLatLong = czm_approximateSphericalCoordinates(worldCoordinate);
sphericalLatLong.y += v_uvMinAndSphericalLongitudeRotation.z;
sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
uv.x = (sphericalLatLong.y - v_sphericalExtents.y) * v_sphericalExtents.w;
uv.y = (sphericalLatLong.x - v_sphericalExtents.x) * v_sphericalExtents.z;
#else // SPHERICAL
uv.x = czm_planeDistance(v_westPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.x;
uv.y = czm_planeDistance(v_southPlane, eyeCoordinate.xyz / eyeCoordinate.w) * v_inversePlaneExtents.y;
#endif // SPHERICAL
#endif // TEXTURE_COORDINATES
#ifdef PICK
#ifdef CULL_FRAGMENTS
if (0.0 <= uv.x && uv.x <= 1.0 && 0.0 <= uv.y && uv.y <= 1.0 || logDepthOrDepth != 0.0) {
out_FragColor.a = 1.0;
czm_writeDepthClamp();
}
#else // CULL_FRAGMENTS
out_FragColor.a = 1.0;
#endif // CULL_FRAGMENTS
#else // PICK
#ifdef CULL_FRAGMENTS
if (uv.x <= 0.0 || 1.0 <= uv.x || uv.y <= 0.0 || 1.0 <= uv.y || logDepthOrDepth == 0.0) {
discard;
}
#endif
#ifdef NORMAL_EC
vec3 downUp = vectorFromOffset(eyeCoordinate, vec2(0.0, 1.0));
vec3 leftRight = vectorFromOffset(eyeCoordinate, vec2(1.0, 0.0));
vec3 normalEC = normalize(cross(leftRight, downUp));
#endif
#ifdef PER_INSTANCE_COLOR
vec4 color = czm_gammaCorrect(v_color);
#ifdef FLAT
out_FragColor = color;
#else // FLAT
czm_materialInput materialInput;
materialInput.normalEC = normalEC;
materialInput.positionToEyeEC = -eyeCoordinate.xyz;
czm_material material = czm_getDefaultMaterial(materialInput);
material.diffuse = color.rgb;
material.alpha = color.a;
out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
#endif // FLAT
out_FragColor.rgb *= out_FragColor.a;
#else // PER_INSTANCE_COLOR
czm_materialInput materialInput;
#ifdef USES_NORMAL_EC
materialInput.normalEC = normalEC;
#endif
#ifdef USES_POSITION_TO_EYE_EC
materialInput.positionToEyeEC = -eyeCoordinate.xyz;
#endif
#ifdef USES_TANGENT_TO_EYE
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(worldCoordinate, normalEC);
#endif
#ifdef USES_ST
materialInput.st.x = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_uMaxAndInverseDistance.xy, uv) * v_uMaxAndInverseDistance.z;
materialInput.st.y = czm_lineDistance(v_uvMinAndSphericalLongitudeRotation.xy, v_vMaxAndInverseDistance.xy, uv) * v_vMaxAndInverseDistance.z;
#endif
czm_material material = czm_getMaterial(materialInput);
#ifdef FLAT
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else // FLAT
out_FragColor = czm_phong(normalize(-eyeCoordinate.xyz), material, czm_lightDirectionEC);
#endif // FLAT
out_FragColor.rgb *= out_FragColor.a;
#endif // PER_INSTANCE_COLOR
czm_writeDepthClamp();
#endif // PICK
}
`;function rf(e,t,n){T.typeOf.bool("extentsCulling",e),T.typeOf.bool("planarExtents",t),T.typeOf.object("appearance",n),this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new z6;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new z6;if(o.requiresTextureCoordinates=e,n instanceof rn)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource}
${n.fragmentShaderSource}`;i.normalEC=r.indexOf("materialInput.normalEC")!==-1||r.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=r.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=r.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=r.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}rf.prototype.createFragmentShader=function(e){T.typeOf.bool("columbusView2D",e);let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof rn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof rn||(o=t.material.shaderSource),new He({defines:i,sources:[o,Cw]})};rf.prototype.createPickFragmentShader=function(e){T.typeOf.bool("columbusView2D",e);let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new He({defines:n,sources:[Cw],pickColorQualifier:"in"})};rf.prototype.createVertexShader=function(e,t,n,i){return T.defined("defines",e),T.typeOf.string("vertexShaderSource",t),T.typeOf.bool("columbusView2D",n),T.defined("mapProjection",i),Lte(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};rf.prototype.createPickVertexShader=function(e,t,n,i){return T.defined("defines",e),T.typeOf.string("vertexShaderSource",t),T.typeOf.bool("columbusView2D",n),T.defined("mapProjection",i),Lte(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var vte=new d,Dte=new he,Pte={high:0,low:0};function Lte(e,t,n,i,o,r,s,a){let l=i.slice();if(a.eastMostYhighDefine===""){let u=Dte;u.longitude=O.PI,u.latitude=0,u.height=0;let f=s.project(u,vte),h=Hn.encode(f.x,Pte);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`;let p=Dte;p.longitude=-O.PI,p.latitude=0,p.height=0;let g=s.project(p,vte);h=Hn.encode(g.x,Pte),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${h.high.toFixed(`${h.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${h.low.toFixed(`${h.low}`.length+1)}`}return n&&(l.push(a.eastMostYhighDefine),l.push(a.eastMostYlowDefine),l.push(a.westMostYhighDefine),l.push(a.westMostYlowDefine)),c(r)&&r instanceof rn&&l.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(l.push("TEXTURE_COORDINATES"),t||n||l.push("SPHERICAL"),n&&l.push("COLUMBUS_VIEW_2D")),new He({defines:l,sources:[o]})}function z6(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(z6.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function Ite(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/z.distance(t,e)}var CMe=[new z,new z,new z,new z];function Nte(e,t){let n=CMe,i=z.unpack(t,0,n[0]),o=z.unpack(t,2,n[1]),r=z.unpack(t,4,n[2]);e.uMaxVmax=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/Ite(i,o,r),a=1/Ite(i,r,o);e.uvMinAndExtents=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var Fte=new he,Bte=new d,EMe=new d,SMe=new d,XL={high:0,low:0};function kte(e,t,n){let i=Fte;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,Bte);i.latitude=e.north;let r=t.project(i,EMe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,SMe),a=[0,0,0,0],l=[0,0,0,0],u=Hn.encode(o.x,XL);a[0]=u.high,l[0]=u.low,u=Hn.encode(o.y,XL),a[1]=u.high,l[1]=u.low,u=Hn.encode(r.y,XL),a[2]=u.high,l[2]=u.low,u=Hn.encode(s.x,XL),a[3]=u.high,l[3]=u.low,n.planes2D_HIGH=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:l})}var wMe=new F,vMe=new F,Ote=new d,DMe=new he,PMe=[new he,new he,new he,new he,new he,new he,new he,new he];function IMe(e,t,n,i,o,r){let s=ce.center(e,DMe);s.height=n;let a=he.toCartesian(s,t,Ote),l=Ot.eastNorthUpToFixedFrame(a,t,wMe),u=F.inverse(l,vMe),f=e.west,h=e.east,p=e.north,g=e.south,m=PMe;m[0].latitude=g,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=h,m[3].latitude=g,m[3].longitude=h;let y=(f+h)*.5,b=(p+g)*.5;m[4].latitude=g,m[4].longitude=y,m[5].latitude=p,m[5].longitude=y,m[6].latitude=b,m[6].longitude=f,m[7].latitude=b,m[7].longitude=h;let x=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,E=Number.POSITIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let L=he.toCartesian(m[R],t,Ote);F.multiplyByPoint(u,L,L),L.z=0,x=Math.min(x,L.x),A=Math.max(A,L.x),E=Math.min(E,L.y),S=Math.max(S,L.y)}let v=i;v.x=x,v.y=E,v.z=0,F.multiplyByPoint(l,v,v);let P=o;P.x=A,P.y=E,P.z=0,F.multiplyByPoint(l,P,P),d.subtract(P,v,o);let M=r;M.x=x,M.y=S,M.z=0,F.multiplyByPoint(l,M,M),d.subtract(M,v,r)}var OMe=new d,RMe=new d,MMe=new Hn;rf.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){T.typeOf.object("boundingRectangle",e),T.defined("textureCoordinateRotationPoints",t),T.typeOf.object("ellipsoid",n),T.typeOf.object("projection",i);let r=Bte,s=OMe,a=RMe;IMe(e,n,o??0,r,s,a);let l={};Nte(l,t);let u=Hn.fromCartesian(r,MMe);return l.southWest_HIGH=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.high,[0,0,0])}),l.southWest_LOW=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(u.low,[0,0,0])}),l.eastward=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(s,[0,0,0])}),l.northward=new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:3,normalize:!1,value:d.pack(a,[0,0,0])}),kte(e,i,l),l};var LMe=new d;function Rte(e,t,n,i){let o=Fte;o.latitude=e,o.longitude=t,o.height=0;let r=he.toCartesian(o,n,LMe),s=Math.sqrt(r.x*r.x+r.y*r.y),a=O.fastApproximateAtan2(s,r.z),l=O.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=l,i}var Mte=new z;rf.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){T.typeOf.object("boundingRectangle",e),T.defined("textureCoordinateRotationPoints",t),T.typeOf.object("ellipsoid",n),T.typeOf.object("projection",i);let o=Rte(e.south,e.west,n,Mte),r=o.x,s=o.y,a=Rte(e.north,e.east,n,Mte),l=a.x,u=a.y,f=0;s>u&&(f=O.PI-s,s=-O.PI,u+=f),r-=O.EPSILON5,s-=O.EPSILON5,l+=O.EPSILON5,u+=O.EPSILON5;let h=1/(u-s),p=1/(l-r),g={sphericalExtents:new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,h]}),longitudeRotation:new Pc({componentDatatype:$.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return Nte(g,t),kte(e,i,g),g};rf.hasAttributesForTextureCoordinatePlanes=function(e){return c(e.southWest_HIGH)&&c(e.southWest_LOW)&&c(e.northward)&&c(e.eastward)&&c(e.planes2D_HIGH)&&c(e.planes2D_LOW)&&c(e.uMaxVmax)&&c(e.uvMinAndExtents)};rf.hasAttributesForSphericalExtents=function(e){return c(e.sphericalExtents)&&c(e.longitudeRotation)&&c(e.planes2D_HIGH)&&c(e.planes2D_LOW)&&c(e.uMaxVmax)&&c(e.uvMinAndExtents)};function NMe(e){return Math.max(e.width,e.height)>rf.MAX_WIDTH_FOR_PLANAR_EXTENTS}rf.shouldUseSphericalCoordinates=function(e){return T.typeOf.object("rectangle",e),NMe(e)};rf.MAX_WIDTH_FOR_PLANAR_EXTENTS=O.toRadians(1);var sf=rf;var FMe={NEVER:ne.NEVER,LESS:ne.LESS,EQUAL:ne.EQUAL,LESS_OR_EQUAL:ne.LEQUAL,GREATER:ne.GREATER,NOT_EQUAL:ne.NOTEQUAL,GREATER_OR_EQUAL:ne.GEQUAL,ALWAYS:ne.ALWAYS},Vn=Object.freeze(FMe);var BMe={ZERO:ne.ZERO,KEEP:ne.KEEP,REPLACE:ne.REPLACE,INCREMENT:ne.INCR,DECREMENT:ne.DECR,INVERT:ne.INVERT,INCREMENT_WRAP:ne.INCR_WRAP,DECREMENT_WRAP:ne.DECR_WRAP},ft=Object.freeze(BMe);var KL={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};KL.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:Vn.ALWAYS,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.REPLACE},backFunction:Vn.ALWAYS,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.REPLACE},reference:KL.CESIUM_3D_TILE_MASK,mask:KL.CESIUM_3D_TILE_MASK}};var kt=Object.freeze(KL);function X0(e){e=e??W.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??Un.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=e._extruded??!1,this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(X0.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});X0.isSupported=function(e){return e.context.stencilBuffer};function GT(e,t){let n=t?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:n,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Dc.LESS_OR_EQUAL},depthMask:!1}}function G6(e){return{stencilTest:{enabled:e,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}}var kMe={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function UMe(e,t,n,i){if(c(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=ze.fromCache(GT(o,!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(GT(o,!0)),e._rsColorPass=ze.fromCache(G6(o,!1)),e._rsPickPass=ze.fromCache(kMe)}function VMe(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection;
`,r=` extrudeDirection = czm_octDecode(${n}, 65535.0);
`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=He.replaceMain(s,"czm_non_compressed_main");let a=`void main()
{
${r} czm_non_compressed_main();
}`;return[i,o,s,a].join(`
`)}}function zMe(e,t){let n=t.context,i=e._primitive,o=WL;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=In._appendDistanceDisplayConditionToShader(i,o),o=In._modifyShaderPosition(e,o,t.scene3DOnly),o=In._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=VMe(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",l=new He({defines:[a],sources:[o]}),u=new He({sources:[Y0]}),f=e._primitive._attributeLocations,h=new sf(s,r,e.appearance);if(e._spStencil=en.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=He.createPickVertexShaderSource(o);m=In._appendShowToShader(i,m),m=In._updatePickColorAttribute(m);let y=h.createPickFragmentShader(!1),b=h.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=en.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:b,fragmentShaderSource:y,attributeLocations:f}),s){let x=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!c(x)){let A=h.createPickFragmentShader(!0),E=h.createPickVertexShader([a],m,!0,t.mapProjection);x=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:E,fragmentShaderSource:A,attributeLocations:f})}e._spPick2D=x}}else e._spPick=en.fromCache({context:n,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:f});o=In._appendShowToShader(i,o),l=new He({defines:[a],sources:[o]}),e._sp=en.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:f});let p=h.createFragmentShader(!1),g=h.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=en.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!c(m)){let y=h.createFragmentShader(!0),b=h.createVertexShader([a],o,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:b,fragmentShaderSource:y,attributeLocations:f})}e._spColor2D=m}}function HMe(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,l=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(o=0;o<i;o+=2){let g=n._va[a++];r=t[o],c(r)||(r=t[o]=new Je({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsStencilDepthPass,r.shaderProgram=e._sp,r.uniformMap=l,r.pass=De.TERRAIN_CLASSIFICATION,s=Je.shallowClone(r,r.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=De.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,r=t[o+1],c(r)||(r=t[o+1]=new Je({owner:e,primitiveType:n._primitiveType})),r.vertexArray=g,r.renderState=e._rsColorPass,r.shaderProgram=e._spColor,r.pass=De.TERRAIN_CLASSIFICATION;let y=e.appearance.material;if(c(y)&&(l=xt(l,y._uniforms)),r.uniformMap=l,s=Je.shallowClone(r,r.derivedCommands.tileset),s.pass=De.CESIUM_3D_TILE_CLASSIFICATION,r.derivedCommands.tileset=s,u){let b=Je.shallowClone(r,r.derivedCommands.appearance2D);b.shaderProgram=e._spColor2D,r.derivedCommands.appearance2D=b,b=Je.shallowClone(s,s.derivedCommands.appearance2D),b.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=b}}let f=e._commandsIgnoreShow,h=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let m=f[g]=Je.shallowClone(t[p],f[g]);m.shaderProgram=h,m.pass=De.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function GMe(e,t){let n=e._usePickOffsets,i=e._primitive,o=i._va.length*2,r,s=0,a;n&&(r=i._pickOffsets,o=r.length*2),t.length=o;let l,u,f,h=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(l=0;l<o;l+=2){let m=i._va[h++];if(n&&(a=r[s++],m=i._va[a.index]),u=t[l],c(u)||(u=t[l]=new Je({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=De.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=Je.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=De.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[l+1],c(u)||(u=t[l+1]=new Je({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=De.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=Je.shallowClone(u,u.derivedCommands.tileset),f.pass=De.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let y=Je.shallowClone(u,u.derivedCommands.pick2D);y.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=y,y=Je.shallowClone(f,f.derivedCommands.pick2D),y.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=y}}}function jMe(e,t,n,i,o,r,s){HMe(e,r),GMe(e,s)}function Ute(e,t){return Math.floor(e%t/2)}function H6(e,t,n,i,o,r){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,e.debugShowBoundingVolume=r,t.commandList.push(e)}function Vte(e,t,n,i,o){e.modelMatrix=n,e.boundingVolume=o,e.cull=i,t.commandList.push(e)}function WMe(e,t,n,i,o,r,s,a){let l=e._primitive;In._updateBoundingVolumes(l,t,o);let u;t.mode===oe.SCENE3D?u=l._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?u=l._boundingSphereCV:t.mode===oe.SCENE2D&&c(l._boundingSphere2D)?u=l._boundingSphere2D:c(l._boundingSphereMorph)&&(u=l._boundingSphereMorph);let f=e.classificationType,h=f!==Un.CESIUM_3D_TILE,p=f!==Un.TERRAIN,g=t.passes,m,y,b;if(g.render){let x=n.length;for(m=0;m<x;++m)y=u[Ute(m,x)],h&&(b=n[m],H6(b,t,o,r,y,s)),p&&(b=n[m].derivedCommands.tileset,H6(b,t,o,r,y,s));if(t.invertClassification){let A=e._commandsIgnoreShow,E=A.length;for(m=0;m<E;++m)y=u[m],b=A[m],H6(b,t,o,r,y,s)}}if(g.pick){let x=i.length,A=l._pickOffsets;for(m=0;m<x;++m){let E=A[Ute(m,x)];y=u[E.index],h&&(b=i[m],Vte(b,t,o,r,y)),p&&(b=i[m].derivedCommands.tileset,Vte(b,t,o,r,y))}}}X0.prototype.update=function(e){if(!c(this._primitive)&&!c(this.geometryInstances))return;let t=this.appearance;c(t)&&c(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!c(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s,a,l,u=!1,f=!0,h,p=!1,g=!1;for(r>0&&(l=o[0].attributes,p=sf.hasAttributesForSphericalExtents(l),g=sf.hasAttributesForTextureCoordinatePlanes(l),h=l.color),s=0;s<r;s++){a=o[s];let y=a.attributes.color;if(c(y))u=!0;else if(u)throw new C("All GeometryInstances must have color attributes to use per-instance color.");f=f&&c(y)&&jt.equals(h,y)}if(!f&&!p&&!g)throw new C("All GeometryInstances must have the same color attribute except via GroundPrimitives");if(u&&!c(t)&&(t=new rn({flat:!0}),this.appearance=t),!u&&t instanceof rn)throw new C("PerInstanceColorAppearance requires color GeometryInstanceAttributes on all GeometryInstances");if(c(t.material)&&!p&&!g)throw new C("Materials on ClassificationPrimitives are not supported except via GroundPrimitives");this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let m=new Array(r);for(s=0;s<r;++s)a=o[s],m[s]=new St({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=m,c(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(y,b){n._createBoundingVolumeFunction(y,b)}),i._createRenderStatesFunction=function(y,b,x,A){UMe(n,b)},i._createShaderProgramFunction=function(y,b,x){zMe(n,b)},i._createCommandsFunction=function(y,b,x,A,E,S,v){jMe(n,void 0,void 0,!0,!1,S,v)},c(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(y,b,x,A,E,S,v,P){n._updateAndQueueCommandsFunction(y,b,x,A,E,S,v,P)}:i._updateAndQueueCommandsFunction=function(y,b,x,A,E,S,v,P){WMe(n,b,x,A,E,S,v,P)},this._primitive=new In(i)}if(this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=ze.fromCache(GT(!1,!1)),this._rsStencilDepthPass3DTiles=ze.fromCache(GT(!1,!0)),this._rsColorPass=ze.fromCache(G6(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=ze.fromCache(GT(!0,!1)),this._rsStencilDepthPass3DTiles=ze.fromCache(GT(!0,!0)),this._rsColorPass=ze.fromCache(G6(!0))),this._primitive.appearance!==t){if(!this._hasSphericalExtentsAttribute&&!this._hasPlanarExtentsAttributes&&c(t.material))throw new C("Materials on ClassificationPrimitives are not supported except via GroundPrimitive");if(!this._hasPerColorAttribute&&t instanceof rn)throw new C("PerInstanceColorAppearance requires color GeometryInstanceAttribute");this._primitive.appearance=t}this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};X0.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};X0.prototype.isDestroyed=function(){return!1};X0.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,de(this)};var Ew=X0;var qMe={u_globeMinimumAltitude:function(){return 55e3}};function pl(e){e=e??W.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!c(t)&&c(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s<r;s++){let a=o[s].attributes;if(c(a)&&c(a.color)){t=new rn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??Un.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=fi._defaultMaxTerrainHeight,this._minTerrainHeight=fi._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:qMe}}Object.defineProperties(pl.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}});pl.isSupported=Ew.isSupported;function zte(e){return function(t,n){let i=n.maximumRadius,o=i/Math.cos(t*.5)-i;return e._maxHeight+o}}function Hte(e){return function(t,n){return e._minHeight}}var YMe=new d,XMe=new d,KMe=new d,$Me=new he,ZMe=new ce;function $L(e,t){let n=e.mapProjection.ellipsoid;if(!c(t.attributes)||!c(t.attributes.position3DHigh))return c(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,o=t.attributes.position3DLow.values,r=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let h=0;h<r;h+=3){let p=d.unpack(i,h,YMe),g=d.unpack(o,h,XMe),m=d.add(p,g,KMe),y=n.cartesianToCartographic(m,$Me),b=y.latitude,x=y.longitude;s=Math.min(s,b),a=Math.min(a,x),l=Math.max(l,b),u=Math.max(u,x)}let f=ZMe;return f.north=l,f.south=s,f.east=u,f.west=a,f}function QMe(e,t,n){let i=fi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function JMe(e,t,n){let i=t.mapProjection.ellipsoid,o=$L(t,n),r=Pn.fromRectangle(o,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(r),!t.scene3DOnly){let s=t.mapProjection,a=le.fromRectangleWithHeights2D(o,s,e._maxHeight,e._minHeight);d.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function j6(e,t){return Math.floor(e%t/2)}function W6(e,t,n,i,o,r,s){let a=e._primitive;n.mode!==oe.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function Gte(e,t,n,i,o,r){let s=e._primitive;n.mode!==oe.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=r,t.cull=o,n.commandList.push(t)}function eLe(e,t,n,i,o,r,s,a){let l;t.mode===oe.SCENE3D?l=e._boundingVolumes:l=e._boundingVolumes2D;let u=e.classificationType,f=u!==Un.CESIUM_3D_TILE,h=u!==Un.TERRAIN,p=t.passes,g=e._primitive,m,y,b;if(p.render){let x=n.length;for(m=0;m<x;++m)y=l[j6(m,x)],f&&(b=n[m],W6(e,b,t,o,r,y,s)),h&&(b=n[m].derivedCommands.tileset,W6(e,b,t,o,r,y,s));if(t.invertClassification){let A=g._commandsIgnoreShow,E=A.length;for(m=0;m<E;++m)y=l[m],b=A[m],W6(e,b,t,o,r,y,s)}}if(p.pick){let x=i.length,A;for(e._useFragmentCulling||(A=g._primitive._pickOffsets),m=0;m<x;++m){if(y=l[j6(m,x)],!e._useFragmentCulling){let E=A[j6(m,x)];y=l[E.index]}f&&(b=i[m],Gte(e,b,t,o,r,y)),h&&(b=i[m].derivedCommands.tileset,Gte(e,b,t,o,r,y))}}}pl.initializeTerrainHeights=function(){return fi.initialize()};pl.prototype.update=function(e){if(!c(this._primitive)&&!c(this.geometryInstances))return;if(!fi.initialized){if(!this.asynchronous)throw new C("For synchronous GroundPrimitives, you must call GroundPrimitive.initializeTerrainHeights() and wait for the returned promise to resolve.");pl.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!c(this._primitive)){let i=e.mapProjection.ellipsoid,o,r,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],l=a.length,u=new Array(l),f,h;for(f=0;f<l;++f){o=a[f],r=o.geometry;let y=$L(e,r);c(h)?c(y)&&ce.union(h,y,h):h=ce.clone(y);let b=o.id;if(c(b)&&c(y)){let x=fi.getBoundingSphere(y,i);this._boundingSpheresKeys.push(b),this._boundingSpheres.push(x)}if(s=r.constructor,!c(s)||!c(s.createShadowVolume))throw new C("Not all of the geometry instances have GroundPrimitive support.")}QMe(this,h,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=Rr.getHeight(this._minTerrainHeight,p,g),this._maxHeight=Rr.getHeight(this._maxTerrainHeight,p,g);let m=pl._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let y,b=!0;for(f=0;f<l;++f)if(o=a[f],r=o.geometry,h=$L(e,r),sf.shouldUseSphericalCoordinates(h)){b=!1;break}for(f=0;f<l;++f){o=a[f],r=o.geometry,s=r.constructor;let x=$L(e,r),A=r.textureCoordinateRotationPoints;b?y=sf.getPlanarTextureCoordinateAttributes(x,A,i,e.mapProjection,this._maxHeight):y=sf.getSphericalExtentGeometryInstanceAttributes(x,A,i,e.mapProjection);let E=o.attributes;for(let S in E)E.hasOwnProperty(S)&&(y[S]=E[S]);u[f]=new St({geometry:s.createShadowVolume(r,Hte(this),zte(this)),attributes:y,id:o.id})}}else for(f=0;f<l;++f)o=a[f],r=o.geometry,s=r.constructor,u[f]=new St({geometry:s.createShadowVolume(r,Hte(this),zte(this)),attributes:o.attributes,id:o.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,b){JMe(t,y,b)},n._updateAndQueueCommandsFunction=function(y,b,x,A,E,S,v,P){eLe(t,b,x,A,E,S,v,P)},this._primitive=new Ew(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};pl.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};pl.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};pl.prototype.isDestroyed=function(){return!1};pl.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};pl._supportsMaterials=function(e){return e.depthTexture};pl.supportsMaterials=function(e){return T.typeOf.object("scene",e),pl._supportsMaterials(e.frameState.context)};var _l=pl;function jT(){C.throwInstantiationError()}Object.defineProperties(jT.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError}});jT.prototype.getType=C.throwInstantiationError;jT.prototype.getValue=C.throwInstantiationError;jT.prototype.equals=C.throwInstantiationError;var tLe=new Q;jT.getValue=function(e,t,n){let i;return c(e)||(e=Q.now(tLe)),c(t)&&(i=t.getType(e),c(i))?((!c(n)||n.type!==i)&&(n=Xi.fromType(i)),t.getValue(e,n.uniforms),n):((!c(n)||n.type!==Xi.ColorType)&&(n=Xi.fromType(Xi.ColorType)),G.clone(G.WHITE,n.uniforms.color),n)};var or=jT;function K0(e,t,n){T.defined("geometryUpdater",e),T.defined("primitives",t),T.defined("orderedGroundPrimitives",n),this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}K0.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!Y.getValueOrDefault(t.show,n,!0)};K0.prototype._setOptions=C.throwInstantiationError;K0.prototype.update=function(e){T.defined("time",e);let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),l=this._options;if(!c(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Ut,h,p=t._getIsClosed(l);if(f)h=new rn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=or.getValue(e,u,this._material);this._material=g,h=new so({material:g,translucent:g.isTranslucent(),closed:p})}if(n)l.vertexFormat=rn.VERTEX_FORMAT,this._primitive=o.add(new _l({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:h,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),Y.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{l.vertexFormat=h.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(h.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new In({geometryInstances:g,appearance:h,asynchronous:!1,shadows:a}))}}if(!n&&c(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=Y.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new In({geometryInstances:u,appearance:new rn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};K0.prototype.getBoundingSphere=function(e){if(!c(e))throw new C("result is required.");let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return c(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),c(o)&&c(o.boundingSphere))?(le.clone(o.boundingSphere,e),lt.DONE):c(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),c(o)&&c(o.boundingSphere))?(le.clone(o.boundingSphere,e),lt.DONE):c(n)&&!n.ready||c(i)&&!i.ready?lt.PENDING:lt.FAILED};K0.prototype.isDestroyed=function(){return!1};K0.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),de(this)};var ii=K0;var jte={};function Sw(e,t){if(!c(e))throw new C("identifier is required.");c(jte[e])||(jte[e]=!0,console.warn(t??e))}Sw.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";Sw.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";Sw.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";Sw.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var dt=Sw;var nLe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3},Q_=Object.freeze(nLe);var iLe={NONE:0,GEODESIC:1,RHUMB:2},qt=Object.freeze(iLe);var Wte=O.EPSILON10;function oLe(e,t,n,i){if(T.defined("equalsEpsilon",t),!c(e))return;n=n??!1;let o=c(i),r=e.length;if(r<2)return e;let s,a=e[0],l,u,f=0,h=-1;for(s=1;s<r;++s)l=e[s],t(a,l,Wte)?(c(u)||(u=e.slice(0,s),f=s-1,h=0),o&&i.push(s)):(c(u)&&(u.push(l),f=s,o&&(h=i.length)),a=l);return n&&t(e[0],e[r-1],Wte)&&(o&&(c(u)?i.splice(h,0,f):i.push(r-1)),c(u)?u.length-=1:u=e.slice(0,-1)),c(u)?u:e}var xo=oLe;function rLe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,o=(n-i)/n,r=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-o)*Math.tan(e._start.latitude),l=1/Math.sqrt(1+a*a),u=l*a,f=Math.atan2(a,r),h=l*s,p=h*h,g=1-p,m=Math.sqrt(g),y=t/4,b=y*y,x=b*y,A=b*b,E=1+y-3*b/4+5*x/4-175*A/64,S=1-y+15*b/8-35*x/8,v=1-3*y+35*b/4,P=1-5*y,M=E*f-S*Math.sin(2*f)*y/2-v*Math.sin(4*f)*b/16-P*Math.sin(6*f)*x/48-Math.sin(8*f)*5*A/512,R=e._constants;R.a=n,R.b=i,R.f=o,R.cosineHeading=r,R.sineHeading=s,R.tanU=a,R.cosineU=l,R.sineU=u,R.sigma=f,R.sineAlpha=h,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=g,R.cosineAlpha=m,R.u2Over4=y,R.u4Over16=b,R.u6Over64=x,R.u8Over256=A,R.a0=E,R.a1=S,R.a2=v,R.a3=P,R.distanceRatio=M}function sLe(e,t){return e*t*(4+e*(4-3*t))/16}function qte(e,t,n,i,o,r,s){let a=sLe(e,n);return(1-a)*e*t*(i+a*o*(s+a*r*(2*s*s-1)))}function aLe(e,t,n,i,o,r,s){let a=(t-n)/t,l=r-i,u=Math.atan((1-a)*Math.tan(o)),f=Math.atan((1-a)*Math.tan(s)),h=Math.cos(u),p=Math.sin(u),g=Math.cos(f),m=Math.sin(f),y=h*g,b=h*m,x=p*m,A=p*g,E=l,S=O.TWO_PI,v=Math.cos(E),P=Math.sin(E),M,R,L,B,_;do{v=Math.cos(E),P=Math.sin(E);let U=b-A*v;L=Math.sqrt(g*g*P*P+U*U),R=x+y*v,M=Math.atan2(L,R);let q;L===0?(q=0,B=1):(q=y*P/L,B=1-q*q),S=E,_=R-2*x/B,isFinite(_)||(_=0),E=l+qte(a,q,B,M,L,R,_)}while(Math.abs(E-S)>O.EPSILON12);let w=B*(t*t-n*n)/(n*n),D=1+w*(4096+w*(w*(320-175*w)-768))/16384,I=w*(256+w*(w*(74-47*w)-128))/1024,N=_*_,k=I*L*(_+I*(R*(2*N-1)-I*_*(4*L*L-3)*(4*N-3)/6)/4),H=n*D*(M-k),V=Math.atan2(g*P,b-A*v),j=Math.atan2(h*P,b*v-A);e._distance=H,e._startHeading=V,e._endHeading=j,e._uSquared=w}var cLe=new d,q6=new d;function Yte(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,q6),cLe),r=d.normalize(i.cartographicToCartesian(n,q6),q6);T.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(d.angleBetween(o,r))-Math.PI),.0125),aLe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,rLe(e)}function ww(e,t,n){let i=n??ie.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,c(e)&&c(t)&&Yte(this,e,t,i)}Object.defineProperties(ww.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return T.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return T.defined("distance",this._distance),this._startHeading}},endHeading:{get:function(){return T.defined("distance",this._distance),this._endHeading}}});ww.prototype.setEndPoints=function(e,t){T.defined("start",e),T.defined("end",t),Yte(this,e,t,this._ellipsoid)};ww.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};ww.prototype.interpolateUsingSurfaceDistance=function(e,t){T.defined("distance",this._distance);let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),l=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),h=i*i,p=i*h,g=n.u8Over256,m=n.u2Over4,y=n.u6Over64,b=n.u4Over16,x=2*p*g*o/3+i*(1-m+7*b/4-15*y/4+579*g/64-(b-15*y/4+187*g/16)*o-(5*y/4-115*g/16)*r-29*g*s/16)+(m/2-b+71*y/32-85*g/16)*a+(5*b/16-5*y/4+383*g/96)*l-h*((y-11*g/2)*a+5*g*l/2)+(29*y/96-29*g/16)*u+539*g*f/1536,A=Math.asin(Math.sin(x)*n.cosineAlpha),E=Math.atan(n.a/n.b*Math.tan(A));x=x-n.sigma;let S=Math.cos(2*n.sigma+x),v=Math.sin(x),P=Math.cos(x),M=n.cosineU*P,R=n.sineU*v,B=Math.atan2(v*n.sineHeading,M-R*n.cosineHeading)-qte(n.f,n.sineAlpha,n.cosineSquaredAlpha,x,v,P,S);return c(t)?(t.longitude=this._start.longitude+B,t.latitude=E,t.height=0,t):new he(this._start.longitude+B,E,0)};var J_=ww;function X6(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,l=a*i,u=n,f=Math.sin(2*u),h=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),m=Math.sin(10*u),y=Math.sin(12*u);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*l/1048576)*u-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*l/524288)*f+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*l/8388608)*h-(35*r/3072+175*s/12288+3675*a/262144+13475*l/1048576)*p+(315*s/131072+2205*a/524288+43659*l/8388608)*g-(693*a/1310720+6237*l/5242880)*m+1001*l/8388608*y)}function lLe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,l=a*a,u=l*l,f=u*l,h=f*l,p=h*l,g=p*l,m=Math.sin(2*i),y=Math.cos(2*i),b=Math.sin(4*i),x=Math.cos(4*i),A=Math.sin(6*i),E=Math.cos(6*i),S=Math.sin(8*i),v=Math.cos(8*i),P=Math.sin(10*i),M=Math.cos(10*i),R=Math.sin(12*i);return i+i*l/4+7*i*u/64+15*i*f/256+579*i*h/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*o-561)*h/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*g/5242880)*y+(21*i*f/256+483*i*h/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*g/1048576)*x+(151*i*h/4096+4681*i*p/65536+1479*i*g/16384-453*r*g/32768)*E+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*M+(3*l/8+3*u/16+213*f/2048-3*o*f/64+255*h/4096-33*o*h/512+20861*p/524288-33*o*p/512+s*p/1024+28273*g/1048576-471*o*g/8192+9*s*g/4096)*m+(21*u/256+21*f/256+533*h/8192-21*o*h/512+197*p/4096-315*o*p/4096+584039*g/16777216-12517*o*g/131072+7*s*g/2048)*b+(151*f/6144+151*h/4096+5019*p/131072-453*o*p/16384+26965*g/786432-8607*o*g/131072)*A+(1097*h/131072+1097*p/65536+225797*g/10485760-1097*o*g/65536)*S+(8011*p/2621440+8011*g/1048576)*P+293393*g/251658240*R}function WT(e,t){if(e===0)return Math.log(Math.tan(.5*(O.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(O.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function uLe(e,t,n,i,o){let r=WT(e._ellipticity,n),s=WT(e._ellipticity,o);return Math.atan2(O.negativePiToPi(i-t),s-r)}function fLe(e,t,n,i,o,r,s){let a=e._heading,l=r-i,u=0;if(O.equalsEpsilon(Math.abs(a),O.PI_OVER_TWO,O.EPSILON8))if(t===n)u=t*Math.cos(o)*O.negativePiToPi(l);else{let f=Math.sin(o);u=t*Math.cos(o)*O.negativePiToPi(l)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=X6(e._ellipticity,t,o);u=(X6(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var dLe=new d,Y6=new d;function Xte(e,t,n,i){let o=d.normalize(i.cartographicToCartesian(t,Y6),dLe),r=d.normalize(i.cartographicToCartesian(n,Y6),Y6);T.typeOf.number.greaterThanOrEquals("value",Math.abs(Math.abs(d.angleBetween(o,r))-Math.PI),.0125);let s=i.maximumRadius,a=i.minimumRadius,l=s*s,u=a*a;e._ellipticitySquared=(l-u)/l,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=uLe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=fLe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Kte(e,t,n,i,o,r){if(n===0)return he.clone(e,r);let s=o*o,a,l,u;if(Math.abs(O.PI_OVER_TWO-Math.abs(t))>O.EPSILON8){let f=X6(o,i,e.latitude),h=n*Math.cos(t),p=f+h;if(l=lLe(p,o,i),Math.abs(t)<O.EPSILON10)a=O.negativePiToPi(e.longitude);else{let g=WT(o,e.latitude),m=WT(o,l);u=Math.tan(t)*(m-g),a=O.negativePiToPi(e.longitude+u)}}else{l=e.latitude;let f;if(o===0)f=i*Math.cos(e.latitude);else{let h=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*h*h)}u=n/f,t>0?a=O.negativePiToPi(e.longitude+u):a=O.negativePiToPi(e.longitude-u)}return c(r)?(r.longitude=a,r.latitude=l,r.height=0,r):new he(a,l,0)}function gp(e,t,n){let i=n??ie.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,c(e)&&c(t)&&Xte(this,e,t,i)}Object.defineProperties(gp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return T.defined("distance",this._distance),this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return T.defined("distance",this._distance),this._heading}}});gp.fromStartHeadingDistance=function(e,t,n,i,o){T.defined("start",e),T.defined("heading",t),T.defined("distance",n),T.typeOf.number.greaterThan("distance",n,0);let r=i??ie.default,s=r.maximumRadius,a=r.minimumRadius,l=s*s,u=a*a,f=Math.sqrt((l-u)/l);t=O.negativePiToPi(t);let h=Kte(e,t,n,r.maximumRadius,f);return!c(o)||c(i)&&!i.equals(o.ellipsoid)?new gp(e,h,r):(o.setEndPoints(e,h),o)};gp.prototype.setEndPoints=function(e,t){T.defined("start",e),T.defined("end",t),Xte(this,e,t,this._ellipsoid)};gp.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};gp.prototype.interpolateUsingSurfaceDistance=function(e,t){if(T.typeOf.number("distance",e),!c(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");return Kte(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};gp.prototype.findIntersectionWithLongitude=function(e,t){if(T.typeOf.number("intersectionLongitude",e),!c(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=O.negativePiToPi(e),O.equalsEpsilon(Math.abs(e),Math.PI,O.EPSILON14)&&(e=O.sign(r.longitude)*Math.PI),c(t)||(t=new he),Math.abs(O.PI_OVER_TWO-o)<=O.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(O.equalsEpsilon(Math.abs(O.PI_OVER_TWO-o),O.PI_OVER_TWO,O.EPSILON8))return O.equalsEpsilon(e,r.longitude,O.EPSILON12)?void 0:(t.longitude=e,t.latitude=O.PI_OVER_TWO*O.sign(O.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),l=Math.tan(.5*(O.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=r.latitude,h;do{h=f;let p=n*Math.sin(h),g=(1+p)/(1-p);f=2*Math.atan(l*Math.pow(g/u,n/2))-O.PI_OVER_TWO}while(!O.equalsEpsilon(f,h,O.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};gp.prototype.findIntersectionWithLatitude=function(e,t){if(T.typeOf.number("intersectionLatitude",e),!c(this._distance)||this._distance===0)throw new C("EllipsoidRhumbLine must have distinct start and end set.");let n=this._ellipticity,i=this._heading,o=this._start;if(O.equalsEpsilon(Math.abs(i),O.PI_OVER_TWO,O.EPSILON8))return;let r=WT(n,o.latitude),s=WT(n,e),a=Math.tan(i)*(s-r),l=O.negativePiToPi(o.longitude+a);return c(t)?(t.longitude=l,t.latitude=e,t.height=0,t):new he(l,e,0)};var Ja=gp;var nj=[Oi,Li],hLe=nj.length,pne=Math.cos(O.toRadians(30)),$te=Math.cos(O.toRadians(150)),_ne=0,gne=1e3;function tg(e){e=e??W.EMPTY_OBJECT;let t=e.positions;if(!c(t)||t.length<2)throw new C("At least two positions are required.");if(c(e.arcType)&&e.arcType!==qt.GEODESIC&&e.arcType!==qt.RHUMB)throw new C("Valid options for arcType are ArcType.GEODESIC and ArcType.RHUMB.");this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??qt.GEODESIC,this._ellipsoid=ie.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(tg.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ie.packedLength+1+1}}});tg.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<hLe;i++)if(t instanceof nj[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var mLe=new d,Zte=new d,Qte=new d;function tj(e,t,n,i,o){let r=Ic(i,e,0,mLe),s=Ic(i,e,n,Zte),a=Ic(i,t,0,Qte),l=yp(s,r,Zte),u=yp(a,r,Qte);return d.cross(u,l,o),d.normalize(o,o)}var pLe=new he,_Le=new d,gLe=new d,yLe=new d;function K6(e,t,n,i,o,r,s,a,l,u,f){if(o===0)return;let h;r===qt.GEODESIC?h=new J_(e,t,s):r===qt.RHUMB&&(h=new Ja(e,t,s));let p=h.surfaceDistance;if(p<o)return;let g=tj(e,t,i,s,yLe),m=Math.ceil(p/o),y=p/m,b=y,x=m-1,A=a.length;for(let E=0;E<x;E++){let S=h.interpolateUsingSurfaceDistance(b,pLe),v=Ic(s,S,n,_Le),P=Ic(s,S,i,gLe);d.pack(g,a,A),d.pack(v,l,A),d.pack(P,u,A),f.push(S.latitude),f.push(S.longitude),A+=3,b+=y}}var $6=new he;function Ic(e,t,n,i){return he.clone(t,$6),$6.height=n,he.toCartesian($6,e,i)}tg.pack=function(e,t,n){T.typeOf.object("value",e),T.defined("array",t);let i=n??0,o=e._positions,r=o.length;t[i++]=r;for(let s=0;s<r;++s){let a=o[s];d.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ie.pack(e._ellipsoid,t,i),i+=ie.packedLength,t[i++]=e._projectionIndex,t[i++]=e._scene3DOnly?1:0,t};tg.unpack=function(e,t,n){T.defined("array",e);let i=t??0,o=e[i++],r=new Array(o);for(let p=0;p<o;p++)r[p]=d.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,l=e[i++],u=ie.unpack(e,i);i+=ie.packedLength;let f=e[i++],h=e[i++]===1;return c(n)||(n=new tg({positions:r})),n._positions=r,n.granularity=s,n.loop=a,n.arcType=l,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=h,n};function yp(e,t,n){return d.subtract(e,t,n),d.normalize(n,n),n}function Jte(e,t,n,i){return i=yp(e,t,i),i=d.cross(i,n,i),i=d.normalize(i,i),i=d.cross(n,i,i),i}var bLe=new d,xLe=new d,TLe=new d,yne=new d,ALe=0,CLe=-1;function Z6(e,t,n,i,o){let r=yp(n,t,yne),s=Jte(e,t,r,bLe),a=Jte(i,t,r,xLe);if(O.equalsEpsilon(d.dot(s,a),CLe,O.EPSILON5))return o=d.cross(r,s,o),o=d.normalize(o,o),o;o=d.add(a,s,o),o=d.normalize(o,o);let l=d.cross(r,o,TLe);return d.dot(a,l)<ALe&&(o=d.negate(o,o)),o}var eN=sn.fromPointNormal(d.ZERO,d.UNIT_Y),ELe=new d,SLe=new d,wLe=new d,vLe=new d,DLe=new d,ZL=new d,QL=new he,ene=new he,tne=new he;tg.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,o=e.granularity,r=e.arcType,s=new nj[e._projectionIndex](i),a=_ne,l=gne,u,f,h=e._positions,p=h.length;p===2&&(n=!1);let g,m,y,b,x=new Ja(void 0,void 0,i),A,E,S,v=[h[0]];for(f=0;f<p-1;f++)g=h[f],m=h[f+1],A=Qn.lineSegmentPlane(g,m,eN,ZL),c(A)&&!d.equalsEpsilon(A,g,O.EPSILON7)&&!d.equalsEpsilon(A,m,O.EPSILON7)&&(e.arcType===qt.GEODESIC?v.push(d.clone(A)):e.arcType===qt.RHUMB&&(S=i.cartesianToCartographic(A,QL).longitude,y=i.cartesianToCartographic(g,QL),b=i.cartesianToCartographic(m,ene),x.setEndPoints(y,b),E=x.findIntersectionWithLongitude(S,tne),A=i.cartographicToCartesian(E,ZL),c(A)&&!d.equalsEpsilon(A,g,O.EPSILON7)&&!d.equalsEpsilon(A,m,O.EPSILON7)&&v.push(d.clone(A)))),v.push(m);n&&(g=h[p-1],m=h[0],A=Qn.lineSegmentPlane(g,m,eN,ZL),c(A)&&!d.equalsEpsilon(A,g,O.EPSILON7)&&!d.equalsEpsilon(A,m,O.EPSILON7)&&(e.arcType===qt.GEODESIC?v.push(d.clone(A)):e.arcType===qt.RHUMB&&(S=i.cartesianToCartographic(A,QL).longitude,y=i.cartesianToCartographic(g,QL),b=i.cartesianToCartographic(m,ene),x.setEndPoints(y,b),E=x.findIntersectionWithLongitude(S,tne),A=i.cartographicToCartesian(E,ZL),c(A)&&!d.equalsEpsilon(A,g,O.EPSILON7)&&!d.equalsEpsilon(A,m,O.EPSILON7)&&v.push(d.clone(A)))));let P=v.length,M=new Array(P);for(f=0;f<P;f++){let X=he.fromCartesian(v[f],i);X.height=0,M[f]=X}if(M=xo(M,he.equalsEpsilon),P=M.length,P<2)return;let R=[],L=[],B=[],_=[],w=ELe,D=SLe,I=wLe,N=vLe,k=DLe,H=M[0],V=M[1],j=M[P-1];for(w=Ic(i,j,a,w),N=Ic(i,V,a,N),D=Ic(i,H,a,D),I=Ic(i,H,l,I),n?k=Z6(w,D,I,N,k):k=tj(H,V,l,i,k),d.pack(k,L,0),d.pack(D,B,0),d.pack(I,_,0),R.push(H.latitude),R.push(H.longitude),K6(H,V,a,l,o,r,i,L,B,_,R),f=1;f<P-1;++f){w=d.clone(D,w),D=d.clone(N,D);let X=M[f];Ic(i,X,l,I),Ic(i,M[f+1],a,N),Z6(w,D,I,N,k),u=L.length,d.pack(k,L,u),d.pack(D,B,u),d.pack(I,_,u),R.push(X.latitude),R.push(X.longitude),K6(M[f],M[f+1],a,l,o,r,i,L,B,_,R)}let U=M[P-1],q=M[P-2];if(D=Ic(i,U,a,D),I=Ic(i,U,l,I),n){let X=M[0];w=Ic(i,q,a,w),N=Ic(i,X,a,N),k=Z6(w,D,I,N,k)}else k=tj(q,U,l,i,k);if(u=L.length,d.pack(k,L,u),d.pack(D,B,u),d.pack(I,_,u),R.push(U.latitude),R.push(U.longitude),n){for(K6(U,H,a,l,o,r,i,L,B,_,R),u=L.length,f=0;f<3;++f)L[u+f]=L[f],B[u+f]=B[f],_[u+f]=_[f];R.push(H.latitude),R.push(H.longitude)}return eNe(n,s,B,_,L,R,t)};var PLe=new d,ILe=new J,OLe=new Le;function nne(e,t,n,i){let o=yp(n,t,PLe),r=d.dot(o,e);if(r>pne||r<$te){let s=yp(i,n,yne),a=r<$te?O.PI_OVER_TWO:-O.PI_OVER_TWO,l=Le.fromAxisAngle(s,a,OLe),u=J.fromQuaternion(l,ILe);return J.multiplyByVector(u,e,e),!0}return!1}var ine=new he,RLe=new d,one=new d;function vw(e,t,n,i,o){let r=he.toCartesian(t,e._ellipsoid,RLe),s=d.add(r,n,one),a=!1,l=e._ellipsoid,u=l.cartesianToCartographic(s,ine);Math.abs(t.longitude-u.longitude)>O.PI_OVER_TWO&&(a=!0,s=d.subtract(r,n,one),u=l.cartesianToCartographic(s,ine)),u.height=0;let f=e.project(u,o);return o=d.subtract(f,i,o),o.z=0,o=d.normalize(o,o),a&&d.negate(o,o),o}var MLe=new d,rne=new d;function sne(e,t,n,i,o,r){let s=d.subtract(t,e,MLe);d.normalize(s,s);let a=n-_ne,l=d.multiplyByScalar(s,a,rne);d.add(e,l,o);let u=i-gne;l=d.multiplyByScalar(s,u,rne),d.add(t,l,r)}var LLe=new d;function JL(e,t){let n=sn.getPointDistance(eN,e),i=sn.getPointDistance(eN,t),o=LLe;O.equalsEpsilon(n,0,O.EPSILON2)?(o=yp(t,e,o),d.multiplyByScalar(o,O.EPSILON2,o),d.add(e,o,e)):O.equalsEpsilon(i,0,O.EPSILON2)&&(o=yp(e,t,o),d.multiplyByScalar(o,O.EPSILON2,o),d.add(t,o,t))}function NLe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(O.equalsEpsilon(n,O.PI,O.EPSILON11)){let o=O.sign(t.longitude);return e.longitude=o*(n-O.EPSILON11),1}else if(O.equalsEpsilon(i,O.PI,O.EPSILON11)){let o=O.sign(e.longitude);return t.longitude=o*(i-O.EPSILON11),2}return 0}var bne=new he,xne=new he,ane=new d,Q6=new d,cne=new d,lne=new d,FLe=new d,une=new d,BLe=[bne,xne],kLe=new ce,ULe=new d,VLe=new d,zLe=new d,HLe=new d,GLe=new d,jLe=new d,J6=new d,ej=new d,WLe=new d,qLe=new d,YLe=new d,fne=new d,XLe=new d,KLe=new d,$Le=new Hn,ZLe=new Hn,dne=new d,QLe=new d,hne=new d,JLe=[new le,new le],Tne=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],mne=Tne.length;function eNe(e,t,n,i,o,r,s){let a,l,u=t._ellipsoid,f=n.length/3-1,h=f*8,p=h*4,g=f*36,m=h>65535?new Uint32Array(g):new Uint16Array(g),y=new Float64Array(h*3),b=new Float32Array(p),x=new Float32Array(p),A=new Float32Array(p),E=new Float32Array(p),S=new Float32Array(p),v,P,M,R;s&&(v=new Float32Array(p),P=new Float32Array(p),M=new Float32Array(p),R=new Float32Array(h*2));let L=r.length/2,B=0,_=bne;_.height=0;let w=xne;w.height=0;let D=ane,I=Q6;if(s)for(l=0,a=1;a<L;a++)_.latitude=r[l],_.longitude=r[l+1],w.latitude=r[l+2],w.longitude=r[l+3],D=t.project(_,D),I=t.project(w,I),B+=d.distance(D,I),l+=2;let N=i.length/3;I=d.unpack(i,0,I);let k=0;for(l=3,a=1;a<N;a++)D=d.clone(I,D),I=d.unpack(i,l,I),k+=d.distance(D,I),l+=3;let H;l=3;let V=0,j=0,U=0,q=0,X=!1,te=d.unpack(n,0,lne),K=d.unpack(i,0,Q6),Z=d.unpack(o,0,une);if(e){let Ee=d.unpack(n,n.length-6,cne);nne(Z,Ee,te,K)&&(Z=d.negate(Z,Z))}let ee=0,me=0,xe=0;for(a=0;a<f;a++){let Ee=d.clone(te,cne),Ve=d.clone(K,ane),je=d.clone(Z,FLe);X&&(je=d.negate(je,je)),te=d.unpack(n,l,lne),K=d.unpack(i,l,Q6),Z=d.unpack(o,l,une),X=nne(Z,Ee,te,K),_.latitude=r[V],_.longitude=r[V+1],w.latitude=r[V+2],w.longitude=r[V+3];let it,Dt,Gt,$e;if(s){let hi=NLe(_,w);it=t.project(_,GLe),Dt=t.project(w,jLe);let $s=yp(Dt,it,dne);$s.y=Math.abs($s.y),Gt=J6,$e=ej,hi===0||d.dot($s,d.UNIT_Y)>pne?(Gt=vw(t,_,je,it,J6),$e=vw(t,w,Z,Dt,ej)):hi===1?($e=vw(t,w,Z,Dt,ej),Gt.x=0,Gt.y=O.sign(_.longitude-Math.abs(w.longitude)),Gt.z=0):(Gt=vw(t,_,je,it,J6),$e.x=0,$e.y=O.sign(_.longitude-w.longitude),$e.z=0)}let ln=d.distance(Ve,K),Vt=Hn.fromCartesian(Ee,$Le),Ct=d.subtract(te,Ee,WLe),gi=d.normalize(Ct,fne),an=d.subtract(Ve,Ee,qLe);an=d.normalize(an,an);let _e=d.cross(gi,an,fne);_e=d.normalize(_e,_e);let Ce=d.cross(an,je,XLe);Ce=d.normalize(Ce,Ce);let mn=d.subtract(K,te,YLe);mn=d.normalize(mn,mn);let mt=d.cross(Z,mn,KLe);mt=d.normalize(mt,mt);let to=ln/k,So=ee/k,Ks=0,vr,ps,Ne,ot=0,Xe=0;if(s){Ks=d.distance(it,Dt),vr=Hn.fromCartesian(it,ZLe),ps=d.subtract(Dt,it,dne),Ne=d.normalize(ps,QLe);let hi=Ne.x;Ne.x=Ne.y,Ne.y=-hi,ot=Ks/B,Xe=me/B}for(H=0;H<8;H++){let hi=q+H*4,$s=j+H*2,Hr=hi+3,ol=H<4?1:-1,ho=H===2||H===3||H===6||H===7?1:-1;d.pack(Vt.high,b,hi),b[Hr]=Ct.x,d.pack(Vt.low,x,hi),x[Hr]=Ct.y,d.pack(Ce,A,hi),A[Hr]=Ct.z,d.pack(mt,E,hi),E[Hr]=to*ol,d.pack(_e,S,hi);let Dr=So*ho;Dr===0&&ho<0&&(Dr=9),S[Hr]=Dr,s&&(v[hi]=vr.high.x,v[hi+1]=vr.high.y,v[hi+2]=vr.low.x,v[hi+3]=vr.low.y,M[hi]=-Gt.y,M[hi+1]=Gt.x,M[hi+2]=$e.y,M[hi+3]=-$e.x,P[hi]=ps.x,P[hi+1]=ps.y,P[hi+2]=Ne.x,P[hi+3]=Ne.y,R[$s]=ot*ol,Dr=Xe*ho,Dr===0&&ho<0&&(Dr=9),R[$s+1]=Dr)}let Ze=zLe,pt=HLe,Ht=ULe,bn=VLe,wo=ce.fromCartographicArray(BLe,kLe),yo=fi.getMinimumMaximumHeights(wo,u),ka=yo.minimumTerrainHeight,Ua=yo.maximumTerrainHeight;xe+=Math.abs(ka),xe+=Math.abs(Ua),sne(Ee,Ve,ka,Ua,Ze,Ht),sne(te,K,ka,Ua,pt,bn);let yi=d.multiplyByScalar(_e,O.EPSILON5,hne);d.add(Ze,yi,Ze),d.add(pt,yi,pt),d.add(Ht,yi,Ht),d.add(bn,yi,bn),JL(Ze,pt),JL(Ht,bn),d.pack(Ze,y,U),d.pack(pt,y,U+3),d.pack(bn,y,U+6),d.pack(Ht,y,U+9),yi=d.multiplyByScalar(_e,-2*O.EPSILON5,hne),d.add(Ze,yi,Ze),d.add(pt,yi,pt),d.add(Ht,yi,Ht),d.add(bn,yi,bn),JL(Ze,pt),JL(Ht,bn),d.pack(Ze,y,U+12),d.pack(pt,y,U+15),d.pack(bn,y,U+18),d.pack(Ht,y,U+21),V+=2,l+=3,j+=16,U+=24,q+=32,ee+=ln,me+=Ks}l=0;let ue=0;for(a=0;a<f;a++){for(H=0;H<mne;H++)m[l+H]=Tne[H]+ue;ue+=8,l+=mne}let ye=JLe;le.fromVertices(n,d.ZERO,3,ye[0]),le.fromVertices(i,d.ZERO,3,ye[1]);let Ae=le.fromBoundingSpheres(ye);Ae.radius+=xe/(f*2);let Pe={position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:eg(b),startLoAndForwardOffsetY:eg(x),startNormalAndForwardOffsetZ:eg(A),endNormalAndTextureCoordinateNormalizationX:eg(E),rightNormalAndTextureCoordinateNormalizationY:eg(S)};return s&&(Pe.startHiLo2D=eg(v),Pe.offsetAndRight2D=eg(P),Pe.startEndNormals2D=eg(M),Pe.texcoordNormalization2D=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new ct({attributes:Pe,indices:m,boundingSphere:Ae})}function eg(e){return new ve({componentDatatype:$.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}tg._projectNormal=vw;var qT=tg;var tN=`in vec4 v_startPlaneNormalEcAndHalfWidth;
in vec4 v_endPlaneNormalEcAndBatchId;
in vec4 v_rightPlaneEC;
in vec4 v_endEcAndStartEcX;
in vec4 v_texcoordNormalizationAndStartEcYZ;
#ifdef PER_INSTANCE_COLOR
in vec4 v_color;
#endif
void main(void)
{
float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
vec3 ecStart = vec3(v_endEcAndStartEcX.w, v_texcoordNormalizationAndStartEcYZ.zw);
if (logDepthOrDepth == 0.0) {
#ifdef DEBUG_SHOW_VOLUME
out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
return;
#else // DEBUG_SHOW_VOLUME
discard;
#endif // DEBUG_SHOW_VOLUME
}
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
eyeCoordinate /= eyeCoordinate.w;
float halfMaxWidth = v_startPlaneNormalEcAndHalfWidth.w * czm_metersPerPixel(eyeCoordinate);
float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
float distanceFromStart = czm_planeDistance(v_startPlaneNormalEcAndHalfWidth.xyz, -dot(ecStart, v_startPlaneNormalEcAndHalfWidth.xyz), eyeCoordinate.xyz);
float distanceFromEnd = czm_planeDistance(v_endPlaneNormalEcAndBatchId.xyz, -dot(v_endEcAndStartEcX.xyz, v_endPlaneNormalEcAndBatchId.xyz), eyeCoordinate.xyz);
if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
#ifdef DEBUG_SHOW_VOLUME
out_FragColor = vec4(1.0, 0.0, 0.0, 0.5);
return;
#else // DEBUG_SHOW_VOLUME
discard;
#endif // DEBUG_SHOW_VOLUME
}
vec3 alignedPlaneNormal;
alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_startPlaneNormalEcAndHalfWidth.xyz);
alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
distanceFromStart = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, ecStart), eyeCoordinate.xyz);
alignedPlaneNormal = cross(v_rightPlaneEC.xyz, v_endPlaneNormalEcAndBatchId.xyz);
alignedPlaneNormal = normalize(cross(alignedPlaneNormal, v_rightPlaneEC.xyz));
distanceFromEnd = czm_planeDistance(alignedPlaneNormal, -dot(alignedPlaneNormal, v_endEcAndStartEcX.xyz), eyeCoordinate.xyz);
#ifdef PER_INSTANCE_COLOR
out_FragColor = czm_gammaCorrect(v_color);
#else // PER_INSTANCE_COLOR
float s = clamp(distanceFromStart / (distanceFromStart + distanceFromEnd), 0.0, 1.0);
s = (s * v_texcoordNormalizationAndStartEcYZ.x) + v_texcoordNormalizationAndStartEcYZ.y;
float t = (widthwiseDistance + halfMaxWidth) / (2.0 * halfMaxWidth);
czm_materialInput materialInput;
materialInput.s = s;
materialInput.st = vec2(s, t);
materialInput.str = vec3(s, t, 0.0);
czm_material material = czm_getMaterial(materialInput);
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#endif // PER_INSTANCE_COLOR
out_FragColor.rgb *= out_FragColor.a;
czm_writeDepthClamp();
}
`;var nN=`in vec3 v_forwardDirectionEC;
in vec3 v_texcoordNormalizationAndHalfWidth;
in float v_batchId;
#ifdef PER_INSTANCE_COLOR
in vec4 v_color;
#else
in vec2 v_alignedPlaneDistances;
in float v_texcoordT;
#endif
float rayPlaneDistanceUnsafe(vec3 origin, vec3 direction, vec3 planeNormal, float planeDistance) {
return (-planeDistance - dot(planeNormal, origin)) / dot(planeNormal, direction);
}
void main(void)
{
vec4 eyeCoordinate = gl_FragCoord;
eyeCoordinate /= eyeCoordinate.w;
#ifdef PER_INSTANCE_COLOR
out_FragColor = czm_gammaCorrect(v_color);
#else // PER_INSTANCE_COLOR
float distanceFromStart = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, -v_forwardDirectionEC, v_forwardDirectionEC.xyz, v_alignedPlaneDistances.x);
float distanceFromEnd = rayPlaneDistanceUnsafe(eyeCoordinate.xyz, v_forwardDirectionEC, -v_forwardDirectionEC.xyz, v_alignedPlaneDistances.y);
distanceFromStart = max(0.0, distanceFromStart);
distanceFromEnd = max(0.0, distanceFromEnd);
float s = distanceFromStart / (distanceFromStart + distanceFromEnd);
s = (s * v_texcoordNormalizationAndHalfWidth.x) + v_texcoordNormalizationAndHalfWidth.y;
czm_materialInput materialInput;
materialInput.s = s;
materialInput.st = vec2(s, v_texcoordT);
materialInput.str = vec3(s, v_texcoordT, 0.0);
czm_material material = czm_getMaterial(materialInput);
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#endif // PER_INSTANCE_COLOR
}
`;var iN=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec4 startHiAndForwardOffsetX;
in vec4 startLoAndForwardOffsetY;
in vec4 startNormalAndForwardOffsetZ;
in vec4 endNormalAndTextureCoordinateNormalizationX;
in vec4 rightNormalAndTextureCoordinateNormalizationY;
in vec4 startHiLo2D;
in vec4 offsetAndRight2D;
in vec4 startEndNormals2D;
in vec2 texcoordNormalization2D;
in float batchId;
out vec3 v_forwardDirectionEC;
out vec3 v_texcoordNormalizationAndHalfWidth;
out float v_batchId;
#ifdef WIDTH_VARYING
out float v_width;
#endif
#ifdef ANGLE_VARYING
out float v_polylineAngle;
#endif
#ifdef PER_INSTANCE_COLOR
out vec4 v_color;
#else
out vec2 v_alignedPlaneDistances;
out float v_texcoordT;
#endif
void main()
{
v_batchId = batchId;
vec4 posRelativeToEye2D = czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw));
vec4 posRelativeToEye3D = czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz);
vec4 posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
vec3 posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
vec3 posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
vec3 startEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
vec4 startPlane2D;
vec4 startPlane3D;
startPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
startPlane3D.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
startPlane2D.w = -dot(startPlane2D.xyz, posEc2D);
startPlane3D.w = -dot(startPlane3D.xyz, posEc3D);
vec4 rightPlane2D;
vec4 rightPlane3D;
rightPlane2D.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
rightPlane3D.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
rightPlane2D.w = -dot(rightPlane2D.xyz, posEc2D);
rightPlane3D.w = -dot(rightPlane3D.xyz, posEc3D);
posRelativeToEye2D = posRelativeToEye2D + vec4(0.0, offsetAndRight2D.xy, 0.0);
posRelativeToEye3D = posRelativeToEye3D + vec4(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w, 0.0);
posRelativeToEye = czm_columbusViewMorph(posRelativeToEye2D, posRelativeToEye3D, czm_morphTime);
posEc2D = (czm_modelViewRelativeToEye * posRelativeToEye2D).xyz;
posEc3D = (czm_modelViewRelativeToEye * posRelativeToEye3D).xyz;
vec3 endEC = (czm_modelViewRelativeToEye * posRelativeToEye).xyz;
vec3 forwardEc3D = czm_normal * normalize(vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w));
vec3 forwardEc2D = czm_normal * normalize(vec3(0.0, offsetAndRight2D.xy));
vec4 endPlane2D;
vec4 endPlane3D;
endPlane2D.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
endPlane3D.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
endPlane2D.w = -dot(endPlane2D.xyz, posEc2D);
endPlane3D.w = -dot(endPlane3D.xyz, posEc3D);
v_forwardDirectionEC = normalize(endEC - startEC);
vec2 cleanTexcoordNormalization2D;
cleanTexcoordNormalization2D.x = abs(texcoordNormalization2D.x);
cleanTexcoordNormalization2D.y = czm_branchFreeTernary(texcoordNormalization2D.y > 1.0, 0.0, abs(texcoordNormalization2D.y));
vec2 cleanTexcoordNormalization3D;
cleanTexcoordNormalization3D.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
cleanTexcoordNormalization3D.y = rightNormalAndTextureCoordinateNormalizationY.w;
cleanTexcoordNormalization3D.y = czm_branchFreeTernary(cleanTexcoordNormalization3D.y > 1.0, 0.0, abs(cleanTexcoordNormalization3D.y));
v_texcoordNormalizationAndHalfWidth.xy = mix(cleanTexcoordNormalization2D, cleanTexcoordNormalization3D, czm_morphTime);
#ifdef PER_INSTANCE_COLOR
v_color = czm_batchTable_color(batchId);
#else // PER_INSTANCE_COLOR
v_alignedPlaneDistances.x = -dot(v_forwardDirectionEC, startEC);
v_alignedPlaneDistances.y = -dot(-v_forwardDirectionEC, endEC);
#endif // PER_INSTANCE_COLOR
#ifdef WIDTH_VARYING
float width = czm_batchTable_width(batchId);
float halfWidth = width * 0.5;
v_width = width;
v_texcoordNormalizationAndHalfWidth.z = halfWidth;
#else
float halfWidth = 0.5 * czm_batchTable_width(batchId);
v_texcoordNormalizationAndHalfWidth.z = halfWidth;
#endif
vec4 positionEc3D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position3DHigh, position3DLow);
float absStartPlaneDistance = abs(czm_planeDistance(startPlane3D, positionEc3D.xyz));
float absEndPlaneDistance = abs(czm_planeDistance(endPlane3D, positionEc3D.xyz));
vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane3D.xyz, endPlane3D.xyz);
vec3 upOrDown = normalize(cross(rightPlane3D.xyz, planeDirection));
vec3 normalEC = normalize(cross(planeDirection, upOrDown));
vec3 geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc3D));
geodeticSurfaceNormal *= float(0.0 <= rightNormalAndTextureCoordinateNormalizationY.w && rightNormalAndTextureCoordinateNormalizationY.w <= 1.0);
geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
positionEc3D.xyz += geodeticSurfaceNormal;
normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
positionEc3D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc3D)) * normalEC;
vec4 positionEc2D = czm_modelViewRelativeToEye * czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);
absStartPlaneDistance = abs(czm_planeDistance(startPlane2D, positionEc2D.xyz));
absEndPlaneDistance = abs(czm_planeDistance(endPlane2D, positionEc2D.xyz));
planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlane2D.xyz, endPlane2D.xyz);
upOrDown = normalize(cross(rightPlane2D.xyz, planeDirection));
normalEC = normalize(cross(planeDirection, upOrDown));
geodeticSurfaceNormal = normalize(cross(normalEC, forwardEc2D));
geodeticSurfaceNormal *= float(0.0 <= texcoordNormalization2D.y && texcoordNormalization2D.y <= 1.0);
geodeticSurfaceNormal *= MAX_TERRAIN_HEIGHT;
positionEc2D.xyz += geodeticSurfaceNormal;
normalEC *= sign(texcoordNormalization2D.x);
#ifndef PER_INSTANCE_COLOR
v_texcoordT = clamp(sign(texcoordNormalization2D.x), 0.0, 1.0);
#endif
positionEc2D.xyz += halfWidth * max(0.0, czm_metersPerPixel(positionEc2D)) * normalEC;
gl_Position = czm_projection * mix(positionEc2D, positionEc3D, czm_morphTime);
#ifdef ANGLE_VARYING
vec2 approxLineDirection = normalize(vec2(v_forwardDirectionEC.x, -v_forwardDirectionEC.y));
approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
#endif
}
`;var oN=`in vec3 position3DHigh;
in vec3 position3DLow;
#ifndef COLUMBUS_VIEW_2D
in vec4 startHiAndForwardOffsetX;
in vec4 startLoAndForwardOffsetY;
in vec4 startNormalAndForwardOffsetZ;
in vec4 endNormalAndTextureCoordinateNormalizationX;
in vec4 rightNormalAndTextureCoordinateNormalizationY;
#else
in vec4 startHiLo2D;
in vec4 offsetAndRight2D;
in vec4 startEndNormals2D;
in vec2 texcoordNormalization2D;
#endif
in float batchId;
out vec4 v_startPlaneNormalEcAndHalfWidth;
out vec4 v_endPlaneNormalEcAndBatchId;
out vec4 v_rightPlaneEC;
out vec4 v_endEcAndStartEcX;
out vec4 v_texcoordNormalizationAndStartEcYZ;
#ifdef WIDTH_VARYING
out float v_width;
#endif
#ifdef ANGLE_VARYING
out float v_polylineAngle;
#endif
#ifdef PER_INSTANCE_COLOR
out vec4 v_color;
#endif
void main()
{
#ifdef COLUMBUS_VIEW_2D
vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(vec3(0.0, startHiLo2D.xy), vec3(0.0, startHiLo2D.zw))).xyz;
vec3 forwardDirectionEC = czm_normal * vec3(0.0, offsetAndRight2D.xy);
vec3 ecEnd = forwardDirectionEC + ecStart;
forwardDirectionEC = normalize(forwardDirectionEC);
v_rightPlaneEC.xyz = czm_normal * vec3(0.0, offsetAndRight2D.zw);
v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);
vec4 startPlaneEC;
startPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.xy);
startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
vec4 endPlaneEC;
endPlaneEC.xyz = czm_normal * vec3(0.0, startEndNormals2D.zw);
endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);
v_texcoordNormalizationAndStartEcYZ.x = abs(texcoordNormalization2D.x);
v_texcoordNormalizationAndStartEcYZ.y = texcoordNormalization2D.y;
#else // COLUMBUS_VIEW_2D
vec3 ecStart = (czm_modelViewRelativeToEye * czm_translateRelativeToEye(startHiAndForwardOffsetX.xyz, startLoAndForwardOffsetY.xyz)).xyz;
vec3 offset = czm_normal * vec3(startHiAndForwardOffsetX.w, startLoAndForwardOffsetY.w, startNormalAndForwardOffsetZ.w);
vec3 ecEnd = ecStart + offset;
vec3 forwardDirectionEC = normalize(offset);
vec4 startPlaneEC;
startPlaneEC.xyz = czm_normal * startNormalAndForwardOffsetZ.xyz;
startPlaneEC.w = -dot(startPlaneEC.xyz, ecStart);
vec4 endPlaneEC;
endPlaneEC.xyz = czm_normal * endNormalAndTextureCoordinateNormalizationX.xyz;
endPlaneEC.w = -dot(endPlaneEC.xyz, ecEnd);
v_rightPlaneEC.xyz = czm_normal * rightNormalAndTextureCoordinateNormalizationY.xyz;
v_rightPlaneEC.w = -dot(v_rightPlaneEC.xyz, ecStart);
v_texcoordNormalizationAndStartEcYZ.x = abs(endNormalAndTextureCoordinateNormalizationX.w);
v_texcoordNormalizationAndStartEcYZ.y = rightNormalAndTextureCoordinateNormalizationY.w;
#endif // COLUMBUS_VIEW_2D
v_endEcAndStartEcX.xyz = ecEnd;
v_endEcAndStartEcX.w = ecStart.x;
v_texcoordNormalizationAndStartEcYZ.zw = ecStart.yz;
#ifdef PER_INSTANCE_COLOR
v_color = czm_batchTable_color(batchId);
#endif // PER_INSTANCE_COLOR
vec4 positionRelativeToEye = czm_computePosition();
vec4 positionEC = czm_modelViewRelativeToEye * positionRelativeToEye;
float absStartPlaneDistance = abs(czm_planeDistance(startPlaneEC, positionEC.xyz));
float absEndPlaneDistance = abs(czm_planeDistance(endPlaneEC, positionEC.xyz));
vec3 planeDirection = czm_branchFreeTernary(absStartPlaneDistance < absEndPlaneDistance, startPlaneEC.xyz, endPlaneEC.xyz);
vec3 upOrDown = normalize(cross(v_rightPlaneEC.xyz, planeDirection));
vec3 normalEC = normalize(cross(planeDirection, upOrDown));
upOrDown = cross(forwardDirectionEC, normalEC);
upOrDown = float(czm_sceneMode == czm_sceneMode3D) * upOrDown;
upOrDown = float(v_texcoordNormalizationAndStartEcYZ.y > 1.0 || v_texcoordNormalizationAndStartEcYZ.y < 0.0) * upOrDown;
upOrDown = min(GLOBE_MINIMUM_ALTITUDE, czm_geometricToleranceOverMeter * length(positionRelativeToEye.xyz)) * upOrDown;
positionEC.xyz += upOrDown;
v_texcoordNormalizationAndStartEcYZ.y = czm_branchFreeTernary(v_texcoordNormalizationAndStartEcYZ.y > 1.0, 0.0, abs(v_texcoordNormalizationAndStartEcYZ.y));
float width = czm_batchTable_width(batchId);
#ifdef WIDTH_VARYING
v_width = width;
#endif
v_startPlaneNormalEcAndHalfWidth.xyz = startPlaneEC.xyz;
v_startPlaneNormalEcAndHalfWidth.w = width * 0.5;
v_endPlaneNormalEcAndBatchId.xyz = endPlaneEC.xyz;
v_endPlaneNormalEcAndBatchId.w = batchId;
width = width * max(0.0, czm_metersPerPixel(positionEC));
width = width / dot(normalEC, v_rightPlaneEC.xyz);
#ifdef COLUMBUS_VIEW_2D
normalEC *= sign(texcoordNormalization2D.x);
#else
normalEC *= sign(endNormalAndTextureCoordinateNormalizationX.w);
#endif
positionEC.xyz += width * normalEC;
gl_Position = czm_depthClamp(czm_projection * positionEC);
#ifdef ANGLE_VARYING
vec2 approxLineDirection = normalize(vec2(forwardDirectionEC.x, -forwardDirectionEC.y));
approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && approxLineDirection.y == 0.0, -1.0, approxLineDirection.y);
v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y);
#endif
}
`;var rN=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 prevPosition3DHigh;
in vec3 prevPosition3DLow;
in vec3 nextPosition3DHigh;
in vec3 nextPosition3DLow;
in vec2 expandAndWidth;
in vec4 color;
in float batchId;
out vec4 v_color;
void main()
{
float expandDir = expandAndWidth.x;
float width = abs(expandAndWidth.y) + 0.5;
bool usePrev = expandAndWidth.y < 0.0;
vec4 p = czm_computePosition();
vec4 prev = czm_computePrevPosition();
vec4 next = czm_computeNextPosition();
float angle;
vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
gl_Position = czm_viewportOrthographic * positionWC;
v_color = color;
}
`;var af=`void clipLineSegmentToNearPlane(
vec3 p0,
vec3 p1,
out vec4 positionWC,
out bool clipped,
out bool culledByNearPlane,
out vec4 clippedPositionEC)
{
culledByNearPlane = false;
clipped = false;
vec3 p0ToP1 = p1 - p0;
float magnitude = length(p0ToP1);
vec3 direction = normalize(p0ToP1);
float endPoint0Distance = czm_currentFrustum.x + p0.z;
float denominator = -direction.z;
if (endPoint0Distance > 0.0 && abs(denominator) < czm_epsilon7)
{
culledByNearPlane = true;
}
else if (endPoint0Distance > 0.0)
{
float t = endPoint0Distance / denominator;
if (t < 0.0 || t > magnitude)
{
culledByNearPlane = true;
}
else
{
p0 = p0 + t * direction;
p0.z = min(p0.z, -czm_currentFrustum.x);
clipped = true;
}
}
clippedPositionEC = vec4(p0, 1.0);
positionWC = czm_eyeToWindowCoordinates(clippedPositionEC);
}
vec4 getPolylineWindowCoordinatesEC(vec4 positionEC, vec4 prevEC, vec4 nextEC, float expandDirection, float width, bool usePrevious, out float angle)
{
#ifdef POLYLINE_DASH
vec4 positionWindow = czm_eyeToWindowCoordinates(positionEC);
vec4 previousWindow = czm_eyeToWindowCoordinates(prevEC);
vec4 nextWindow = czm_eyeToWindowCoordinates(nextEC);
vec2 lineDir;
if (usePrevious) {
lineDir = normalize(positionWindow.xy - previousWindow.xy);
}
else {
lineDir = normalize(nextWindow.xy - positionWindow.xy);
}
angle = atan(lineDir.x, lineDir.y) - 1.570796327;
angle = floor(angle / czm_piOverFour + 0.5) * czm_piOverFour;
#endif
vec4 clippedPrevWC, clippedPrevEC;
bool prevSegmentClipped, prevSegmentCulled;
clipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, clippedPrevWC, prevSegmentClipped, prevSegmentCulled, clippedPrevEC);
vec4 clippedNextWC, clippedNextEC;
bool nextSegmentClipped, nextSegmentCulled;
clipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, clippedNextWC, nextSegmentClipped, nextSegmentCulled, clippedNextEC);
bool segmentClipped, segmentCulled;
vec4 clippedPositionWC, clippedPositionEC;
clipLineSegmentToNearPlane(positionEC.xyz, usePrevious ? prevEC.xyz : nextEC.xyz, clippedPositionWC, segmentClipped, segmentCulled, clippedPositionEC);
if (segmentCulled)
{
return vec4(0.0, 0.0, 0.0, 1.0);
}
vec2 directionToPrevWC = normalize(clippedPrevWC.xy - clippedPositionWC.xy);
vec2 directionToNextWC = normalize(clippedNextWC.xy - clippedPositionWC.xy);
if (prevSegmentCulled)
{
directionToPrevWC = -directionToNextWC;
}
else if (nextSegmentCulled)
{
directionToNextWC = -directionToPrevWC;
}
vec2 thisSegmentForwardWC, otherSegmentForwardWC;
if (usePrevious)
{
thisSegmentForwardWC = -directionToPrevWC;
otherSegmentForwardWC = directionToNextWC;
}
else
{
thisSegmentForwardWC = directionToNextWC;
otherSegmentForwardWC = -directionToPrevWC;
}
vec2 thisSegmentLeftWC = vec2(-thisSegmentForwardWC.y, thisSegmentForwardWC.x);
vec2 leftWC = thisSegmentLeftWC;
float expandWidth = width * 0.5;
if (!czm_equalsEpsilon(prevEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1) && !czm_equalsEpsilon(nextEC.xyz - positionEC.xyz, vec3(0.0), czm_epsilon1))
{
vec2 otherSegmentLeftWC = vec2(-otherSegmentForwardWC.y, otherSegmentForwardWC.x);
vec2 leftSumWC = thisSegmentLeftWC + otherSegmentLeftWC;
float leftSumLength = length(leftSumWC);
leftWC = leftSumLength < czm_epsilon6 ? thisSegmentLeftWC : (leftSumWC / leftSumLength);
vec2 u = -thisSegmentForwardWC;
vec2 v = leftWC;
float sinAngle = abs(u.x * v.y - u.y * v.x);
expandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);
}
vec2 offset = leftWC * expandDirection * expandWidth * czm_pixelRatio;
return vec4(clippedPositionWC.xy + offset, -clippedPositionWC.z, 1.0) * (czm_projection * clippedPositionEC).w;
}
vec4 getPolylineWindowCoordinates(vec4 position, vec4 previous, vec4 next, float expandDirection, float width, bool usePrevious, out float angle)
{
vec4 positionEC = czm_modelViewRelativeToEye * position;
vec4 prevEC = czm_modelViewRelativeToEye * previous;
vec4 nextEC = czm_modelViewRelativeToEye * next;
return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle);
}
`;var ij=`${af}
${rN}`,tNe=UT;zt.isInternetExplorer()||(ij=`#define CLIP_POLYLINE
${ij}`);function $0(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=$0.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??ij,this._fragmentShaderSource=e.fragmentShaderSource??tNe,this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties($0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});$0.VERTEX_FORMAT=Ie.POSITION_ONLY;$0.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;$0.prototype.isTranslucent=no.prototype.isTranslucent;$0.prototype.getRenderState=no.prototype.getRenderState;var os=$0;var sN=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 prevPosition3DHigh;
in vec3 prevPosition3DLow;
in vec3 nextPosition3DHigh;
in vec3 nextPosition3DLow;
in vec2 expandAndWidth;
in vec2 st;
in float batchId;
out float v_width;
out vec2 v_st;
out float v_polylineAngle;
void main()
{
float expandDir = expandAndWidth.x;
float width = abs(expandAndWidth.y) + 0.5;
bool usePrev = expandAndWidth.y < 0.0;
vec4 p = czm_computePosition();
vec4 prev = czm_computePrevPosition();
vec4 next = czm_computeNextPosition();
float angle;
vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle);
gl_Position = czm_viewportOrthographic * positionWC;
v_width = width;
v_st.s = st.s;
v_st.t = czm_writeNonPerspective(st.t, gl_Position.w);
v_polylineAngle = angle;
}
`;var YT=`#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif
in vec2 v_st;
void main()
{
czm_materialInput materialInput;
vec2 st = v_st;
st.t = czm_readNonPerspective(st.t, gl_FragCoord.w);
materialInput.s = st.s;
materialInput.st = st;
materialInput.str = vec3(st, 0.0);
czm_material material = czm_getMaterial(materialInput);
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#ifdef VECTOR_TILE
out_FragColor *= u_highlightColor;
#endif
czm_writeLogDepth();
}
`;var oj=`${af}
${sN}`,nNe=YT;zt.isInternetExplorer()||(oj=`#define CLIP_POLYLINE
${oj}`);function Z0(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Z0.VERTEX_FORMAT;this.material=c(e.material)?e.material:Xi.fromType(Xi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??oj,this._fragmentShaderSource=e.fragmentShaderSource??nNe,this._renderState=no.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Z0.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH
${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Z0.VERTEX_FORMAT=Ie.POSITION_AND_ST;Z0.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Z0.prototype.isTranslucent=no.prototype.isTranslucent;Z0.prototype.getRenderState=no.prototype.getRenderState;var Ea=Z0;function bp(e){e=e??W.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;c(t)||(t=new Ea),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??Un.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._debugShowShadowVolume=e.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Ane(!1),this._renderState3DTiles=Ane(!0),this._renderStateMorph=ze.fromCache({cull:{enabled:!0,face:Ti.FRONT},depthTest:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(bp.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});bp.initializeTerrainHeights=function(){return fi.initialize()};function iNe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()(oN);s=In._appendShowToShader(o,s),s=In._appendDistanceDisplayConditionToShader(o,s),s=In._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(iN);a=In._appendShowToShader(o,a),a=In._appendDistanceDisplayConditionToShader(o,a),a=In._modifyShaderPosition(e,a,t.scene3DOnly);let l=o._batchTable.getVertexShaderCallback()(tN),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",h="";c(n.material)?(h=c(n.material)?n.material.shaderSource:"",h.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),h.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new He({defines:u,sources:[s]}),m=new He({defines:p,sources:[h,l]});e._sp=en.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:r});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!c(y)){let x=new He({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:x,fragmentShaderSource:m,attributeLocations:r})}e._sp2D=y;let b=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!c(b)){let x=new He({defines:u.concat([`MAX_TERRAIN_HEIGHT ${fi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});l=o._batchTable.getVertexShaderCallback()(nN);let A=new He({defines:p,sources:[h,l]});b=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:x,fragmentShaderSource:A,attributeLocations:r})}e._spMorph=b}function Ane(e){return ze.fromCache({cull:{enabled:!0},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})}function oNe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let u=t instanceof os?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let h=0;h<a;h++){let p=s._va[h],g=o[h];c(g)||(g=o[h]=new Je({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=De.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=Je.shallowClone(g,g.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=De.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;let y=Je.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=e._sp2D,g.derivedCommands.color2D=y;let b=Je.shallowClone(m,m.derivedCommands.color2D);b.shaderProgram=e._sp2D,m.derivedCommands.color2D=b;let x=Je.shallowClone(g,g.derivedCommands.colorMorph);x.renderState=e._renderStateMorph,x.shaderProgram=e._spMorph,x.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=x}}function Cne(e,t,n,i,o,r,s){n.mode===oe.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==oe.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=r,t.cull=o,t.debugShowBoundingVolume=s,n.commandList.push(t)}function rNe(e,t,n,i,o,r,s){let a=e._primitive;In._updateBoundingVolumes(a,t,o);let l;t.mode===oe.SCENE3D?l=a._boundingSphereWC:t.mode===oe.COLUMBUS_VIEW?l=a._boundingSphereCV:t.mode===oe.SCENE2D&&c(a._boundingSphere2D)?l=a._boundingSphere2D:c(a._boundingSphereMorph)&&(l=a._boundingSphereMorph);let u=t.mode===oe.MORPHING,f=e.classificationType,h=f!==Un.CESIUM_3D_TILE,p=f!==Un.TERRAIN&&!u,g,m=t.passes;if(m.render||m.pick&&a.allowPicking){let y=n.length;for(let b=0;b<y;++b){let x=l[b];h&&(g=n[b],Cne(e,g,t,o,r,x,s)),p&&(g=n[b].derivedCommands.tileset,Cne(e,g,t,o,r,x,s))}}}bp.prototype.update=function(e){if(!c(this._primitive)&&!c(this.geometryInstances))return;if(!fi.initialized){if(!this.asynchronous)throw new C("For synchronous GroundPolylinePrimitives, you must call GroundPolylinePrimitives.initializeTerrainHeights() and wait for the returned promise to resolve.");bp.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!c(this._primitive)){let o=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],r=o.length,s=new Array(r),a;for(t=0;t<r;++t)if(a=o[t].attributes,!c(a)||!c(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<r;++t){let l=o[t];a={};let u=l.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);c(a.width)||(a.width=new Pc({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,value:[l.geometry.width]})),l.geometry._scene3DOnly=e.scene3DOnly,qT.setProjectionAndEllipsoid(l.geometry,e.mapProjection),s[t]=new St({geometry:l.geometry,attributes:a,id:l.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(l,u,f){iNe(n,u,f)},i._createCommandsFunction=function(l,u,f,h,p,g,m){oNe(n,u,f,h,g,m)},i._updateAndQueueCommandsFunction=function(l,u,f,h,p,g,m,y){rNe(n,u,f,h,p,g,m)},this._primitive=new In(i)}if(this.appearance instanceof os&&!this._hasPerInstanceColors)throw new C("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&c(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};bp.prototype.getGeometryInstanceAttributes=function(e){if(!c(this._primitive))throw new C("must call update before calling getGeometryInstanceAttributes");return this._primitive.getGeometryInstanceAttributes(e)};bp.isSupported=function(e){return e.frameState.context.depthTexture};bp.prototype.isDestroyed=function(){return!1};bp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,de(this)};var Nh=bp;var sNe=new z(1,1),aNe=!1,cNe=G.WHITE;function XT(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(XT.prototype,{isConstant:{get:function(){return Y.isConstant(this._image)&&Y.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:fe("image"),repeat:fe("repeat"),color:fe("color"),transparent:fe("transparent")});XT.prototype.getType=function(e){return"Image"};var lNe=new Q;XT.prototype.getValue=function(e,t){return c(e)||(e=Q.now(lNe)),c(t)||(t={}),t.image=Y.getValueOrUndefined(this._image,e),t.repeat=Y.getValueOrClonedDefault(this._repeat,e,sNe,t.repeat),t.color=Y.getValueOrClonedDefault(this._color,e,cNe,t.color),Y.getValueOrDefault(this._transparent,e,aNe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};XT.prototype.equals=function(e){return this===e||e instanceof XT&&Y.equals(this._image,e._image)&&Y.equals(this._repeat,e._repeat)&&Y.equals(this._color,e._color)&&Y.equals(this._transparent,e._transparent)};var Q0=XT;function uNe(e){if(e instanceof G)return new Ut(e);if(typeof e=="string"||e instanceof we||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Q0;return t.image=e,t}throw new C(`Unable to infer material type: ${e}`)}function fNe(e,t){return fe(e,t,uNe)}var No=fNe;function Dw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(Dw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),dimensions:fe("dimensions"),heightReference:fe("heightReference"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});Dw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Dw(this)};Dw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var KT=Dw;var dNe={FIXED:0,INERTIAL:1},zi=Object.freeze(dNe);function $T(){C.throwInstantiationError()}Object.defineProperties($T.prototype,{isConstant:{get:C.throwInstantiationError},definitionChanged:{get:C.throwInstantiationError},referenceFrame:{get:C.throwInstantiationError}});$T.prototype.getValue=C.throwInstantiationError;$T.prototype.getValueInReferenceFrame=C.throwInstantiationError;$T.prototype.equals=C.throwInstantiationError;var Ene=new J;$T.convertToReferenceFrame=function(e,t,n,i,o){if(!c(t))return t;if(c(o)||(o=new d),n===i)return d.clone(t,o);let r=Ot.computeIcrfToCentralBodyFixedMatrix(e,Ene);if(n===zi.INERTIAL)return J.multiplyByVector(r,t,o);if(n===zi.FIXED)return J.multiplyByVector(J.transpose(r,Ene),t,o)};var Fh=$T;function J0(e,t){this._definitionChanged=new pe,this._value=d.clone(e),this._referenceFrame=t??zi.FIXED}Object.defineProperties(J0.prototype,{isConstant:{get:function(){return!c(this._value)||this._referenceFrame===zi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var hNe=new Q;J0.prototype.getValue=function(e,t){return c(e)||(e=Q.now(hNe)),this.getValueInReferenceFrame(e,zi.FIXED,t)};J0.prototype.setValue=function(e,t){let n=!1;d.equals(this._value,e)||(n=!0,this._value=d.clone(e)),c(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};J0.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new C("time is required.");if(!c(t))throw new C("referenceFrame is required.");return Fh.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};J0.prototype.equals=function(e){return this===e||e instanceof J0&&d.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var gl=J0;function Pw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(Pw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),width:fe("width"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),cornerType:fe("cornerType"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});Pw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Pw(this)};Pw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var ZT=Pw;function mNe(e){return e}function pNe(e,t){return fe(e,t,mNe)}var yl=pNe;function Iw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(Iw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),length:fe("length"),topRadius:fe("topRadius"),bottomRadius:fe("bottomRadius"),heightReference:fe("heightReference"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),numberOfVerticalLines:fe("numberOfVerticalLines"),slices:fe("slices"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});Iw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Iw(this)};Iw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var QT=Iw;function Ow(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(Ow.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),semiMajorAxis:fe("semiMajorAxis"),semiMinorAxis:fe("semiMinorAxis"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),rotation:fe("rotation"),stRotation:fe("stRotation"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),numberOfVerticalLines:fe("numberOfVerticalLines"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});Ow.prototype.clone=function(e){return c(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Ow(this)};Ow.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var JT=Ow;function Rw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(Rw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),radii:fe("radii"),innerRadii:fe("innerRadii"),minimumClock:fe("minimumClock"),maximumClock:fe("maximumClock"),minimumCone:fe("minimumCone"),maximumCone:fe("maximumCone"),heightReference:fe("heightReference"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),stackPartitions:fe("stackPartitions"),slicePartitions:fe("slicePartitions"),subdivisions:fe("subdivisions"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});Rw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Rw(this)};Rw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var eA=Rw;function Mw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(Mw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),text:fe("text"),font:fe("font"),style:fe("style"),scale:fe("scale"),showBackground:fe("showBackground"),backgroundColor:fe("backgroundColor"),backgroundPadding:fe("backgroundPadding"),pixelOffset:fe("pixelOffset"),eyeOffset:fe("eyeOffset"),horizontalOrigin:fe("horizontalOrigin"),verticalOrigin:fe("verticalOrigin"),heightReference:fe("heightReference"),fillColor:fe("fillColor"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),translucencyByDistance:fe("translucencyByDistance"),pixelOffsetScaleByDistance:fe("pixelOffsetScaleByDistance"),scaleByDistance:fe("scaleByDistance"),distanceDisplayCondition:fe("distanceDisplayCondition"),disableDepthTestDistance:fe("disableDepthTestDistance")});Mw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new Mw(this)};Mw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var Bh=Mw;var _Ne=new d(1,1,1),gNe=d.ZERO,yNe=Le.IDENTITY;function Sne(e,t,n){this.translation=d.clone(e??gNe),this.rotation=Le.clone(t??yNe),this.scale=d.clone(n??_Ne)}Sne.prototype.equals=function(e){return this===e||c(e)&&d.equals(this.translation,e.translation)&&Le.equals(this.rotation,e.rotation)&&d.equals(this.scale,e.scale)};var eb=Sne;var rj=new eb;function Lw(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(Lw.prototype,{isConstant:{get:function(){return Y.isConstant(this._translation)&&Y.isConstant(this._rotation)&&Y.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:fe("translation"),rotation:fe("rotation"),scale:fe("scale")});var bNe=new Q;Lw.prototype.getValue=function(e,t){return c(e)||(e=Q.now(bNe)),c(t)||(t=new eb),t.translation=Y.getValueOrClonedDefault(this._translation,e,rj.translation,t.translation),t.rotation=Y.getValueOrClonedDefault(this._rotation,e,rj.rotation,t.rotation),t.scale=Y.getValueOrClonedDefault(this._scale,e,rj.scale,t.scale),t};Lw.prototype.equals=function(e){return this===e||e instanceof Lw&&Y.equals(this._translation,e._translation)&&Y.equals(this._rotation,e._rotation)&&Y.equals(this._scale,e._scale)};var tA=Lw;function xp(e,t){this._propertyNames=[],this._definitionChanged=new pe,c(e)&&this.merge(e,t)}Object.defineProperties(xp.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!Y.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});xp.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function xNe(e){return new Xn(e)}xp.prototype.addProperty=function(e,t,n){let i=this._propertyNames;if(!c(e))throw new C("propertyName is required.");if(i.indexOf(e)!==-1)throw new C(`${e} is already a registered property.`);i.push(e),Object.defineProperty(this,e,fe(e,!0,n??xNe)),c(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};xp.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);if(!c(e))throw new C("propertyName is required.");if(n===-1)throw new C(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var TNe=new Q;xp.prototype.getValue=function(e,t){c(e)||(e=Q.now(TNe)),c(t)||(t={});let n=this._propertyNames;for(let i=0,o=n.length;i<o;i++){let r=n[i];t[r]=Y.getValueOrUndefined(this[r],e,t[r])}return t};xp.prototype.merge=function(e,t){if(!c(e))throw new C("source is required.");let n=this._propertyNames,i=c(e._propertyNames)?e._propertyNames:Object.keys(e);for(let o=0,r=i.length;o<r;o++){let s=i[o],a=this[s],l=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),l!==void 0&&(a!==void 0?c(a)&&c(a.merge)&&a.merge(l):c(l)&&c(l.merge)&&c(l.clone)?this[s]=l.clone():this[s]=l)}};function ANe(e,t){let n=e._propertyNames,i=t._propertyNames,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;++r){let s=n[r];if(i.indexOf(s)===-1||!Y.equals(e[s],t[s]))return!1}return!0}xp.prototype.equals=function(e){return this===e||e instanceof xp&&ANe(this,e)};var bl=xp;function wne(e){return new tA(e)}function CNe(e){return new bl(e,wne)}function ENe(e){return new bl(e)}function SNe(e){return new bl(e)}function Nw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._environmentMapOptions=void 0,this._environmentMapOptionsSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(Nw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),uri:fe("uri"),scale:fe("scale"),enableVerticalExaggeration:fe("enableVerticalExaggeration"),minimumPixelSize:fe("minimumPixelSize"),maximumScale:fe("maximumScale"),incrementallyLoadTextures:fe("incrementallyLoadTextures"),runAnimations:fe("runAnimations"),clampAnimations:fe("clampAnimations"),shadows:fe("shadows"),heightReference:fe("heightReference"),silhouetteColor:fe("silhouetteColor"),silhouetteSize:fe("silhouetteSize"),color:fe("color"),colorBlendMode:fe("colorBlendMode"),colorBlendAmount:fe("colorBlendAmount"),imageBasedLightingFactor:fe("imageBasedLightingFactor"),environmentMapOptions:fe("environmentMapOptions",void 0,SNe),lightColor:fe("lightColor"),distanceDisplayCondition:fe("distanceDisplayCondition"),nodeTransformations:fe("nodeTransformations",void 0,CNe),articulations:fe("articulations",void 0,ENe),clippingPlanes:fe("clippingPlanes"),customShader:fe("customShader")});Nw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.environmentMapOptions=this.environmentMapOptions,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new Nw(this)};Nw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.uri=this.uri??e.uri,this.scale=this.scale??e.scale,this.enableVerticalExaggeration=this.enableVerticalExaggeration??e.enableVerticalExaggeration,this.minimumPixelSize=this.minimumPixelSize??e.minimumPixelSize,this.maximumScale=this.maximumScale??e.maximumScale,this.incrementallyLoadTextures=this.incrementallyLoadTextures??e.incrementallyLoadTextures,this.runAnimations=this.runAnimations??e.runAnimations,this.clampAnimations=this.clampAnimations??e.clampAnimations,this.shadows=this.shadows??e.shadows,this.heightReference=this.heightReference??e.heightReference,this.silhouetteColor=this.silhouetteColor??e.silhouetteColor,this.silhouetteSize=this.silhouetteSize??e.silhouetteSize,this.color=this.color??e.color,this.colorBlendMode=this.colorBlendMode??e.colorBlendMode,this.colorBlendAmount=this.colorBlendAmount??e.colorBlendAmount,this.imageBasedLightingFactor=this.imageBasedLightingFactor??e.imageBasedLightingFactor,this.environmentMapOptions=this.environmentMapOptions??e.environmentMapOptions,this.lightColor=this.lightColor??e.lightColor,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.clippingPlanes=this.clippingPlanes??e.clippingPlanes,this.customShader=this.customShader??e.customShader;let t=e.nodeTransformations;if(c(t)){let i=this.nodeTransformations;c(i)?i.merge(t):this.nodeTransformations=new bl(t,wne)}let n=e.articulations;if(c(n)){let i=this.articulations;c(i)?i.merge(n):this.articulations=new bl(n)}};var ng=Nw;function Fw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(Fw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),uri:fe("uri"),maximumScreenSpaceError:fe("maximumScreenSpaceError")});Fw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new Fw(this)};Fw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var nA=Fw;function Bw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(Bw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),leadTime:fe("leadTime"),trailTime:fe("trailTime"),width:fe("width"),resolution:fe("resolution"),material:No("material"),distanceDisplayCondition:fe("distanceDisplayCondition")});Bw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Bw(this)};Bw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.leadTime=this.leadTime??e.leadTime,this.trailTime=this.trailTime??e.trailTime,this.width=this.width??e.width,this.resolution=this.resolution??e.resolution,this.material=this.material??e.material,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var ig=Bw;function kw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(kw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),plane:fe("plane"),dimensions:fe("dimensions"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});kw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new kw(this)};kw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.plane=this.plane??e.plane,this.dimensions=this.dimensions??e.dimensions,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var aN=kw;function Uw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(Uw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),pixelSize:fe("pixelSize"),heightReference:fe("heightReference"),color:fe("color"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),scaleByDistance:fe("scaleByDistance"),translucencyByDistance:fe("translucencyByDistance"),distanceDisplayCondition:fe("distanceDisplayCondition"),disableDepthTestDistance:fe("disableDepthTestDistance"),splitDirection:fe("splitDirection")});Uw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e.splitDirection=this.splitDirection,e):new Uw(this)};Uw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.pixelSize=this.pixelSize??e.pixelSize,this.heightReference=this.heightReference??e.heightReference,this.color=this.color??e.color,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var iA=Uw;function wNe(e,t){this.positions=c(e)?e:[],this.holes=c(t)?t:[]}var ec=wNe;function vNe(e){return Array.isArray(e)&&(e=new ec(e)),new Xn(e)}function Vw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(Vw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),hierarchy:fe("hierarchy",void 0,vNe),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),stRotation:fe("stRotation"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),perPositionHeight:fe("perPositionHeight"),closeTop:fe("closeTop"),closeBottom:fe("closeBottom"),arcType:fe("arcType"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex"),textureCoordinates:fe("textureCoordinates")});Vw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new Vw(this)};Vw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.hierarchy=this.hierarchy??e.hierarchy,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.perPositionHeight=this.perPositionHeight??e.perPositionHeight,this.closeTop=this.closeTop??e.closeTop,this.closeBottom=this.closeBottom??e.closeBottom,this.arcType=this.arcType??e.arcType,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex,this.textureCoordinates=this.textureCoordinates??e.textureCoordinates};var kh=Vw;function zw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(zw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),width:fe("width"),granularity:fe("granularity"),material:No("material"),depthFailMaterial:No("depthFailMaterial"),arcType:fe("arcType"),clampToGround:fe("clampToGround"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});zw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new zw(this)};zw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.granularity=this.granularity??e.granularity,this.material=this.material??e.material,this.depthFailMaterial=this.depthFailMaterial??e.depthFailMaterial,this.arcType=this.arcType??e.arcType,this.clampToGround=this.clampToGround??e.clampToGround,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Oc=zw;function Hw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(Hw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),shape:fe("shape"),cornerType:fe("cornerType"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});Hw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new Hw(this)};Hw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.positions=this.positions??e.positions,this.shape=this.shape??e.shape,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var oA=Hw;function Gw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(Gw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),coordinates:fe("coordinates"),height:fe("height"),heightReference:fe("heightReference"),extrudedHeight:fe("extrudedHeight"),extrudedHeightReference:fe("extrudedHeightReference"),rotation:fe("rotation"),stRotation:fe("stRotation"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition"),classificationType:fe("classificationType"),zIndex:fe("zIndex")});Gw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new Gw(this)};Gw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.coordinates=this.coordinates??e.coordinates,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Uh=Gw;function jw(e){this._definitionChanged=new pe,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??W.EMPTY_OBJECT)}Object.defineProperties(jw.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:fe("show"),positions:fe("positions"),minimumHeights:fe("minimumHeights"),maximumHeights:fe("maximumHeights"),granularity:fe("granularity"),fill:fe("fill"),material:No("material"),outline:fe("outline"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth"),shadows:fe("shadows"),distanceDisplayCondition:fe("distanceDisplayCondition")});jw.prototype.clone=function(e){return c(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new jw(this)};jw.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.show=this.show??e.show,this.positions=this.positions??e.positions,this.minimumHeights=this.minimumHeights??e.minimumHeights,this.maximumHeights=this.maximumHeights??e.maximumHeights,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var og=jw;var DNe=new he,sj=[];function PNe(e){return new gl(e)}function INe(e){return fe(e,void 0,PNe)}function Ls(e,t){return fe(e,void 0,function(n){return n instanceof t?n:new t(n)})}function cf(e){e=e??W.EMPTY_OBJECT;let t=e.id;c(t)||(t=jn()),this._availability=void 0,this._id=t,this._definitionChanged=new pe,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??Q_.AUTODETECT,this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...sj],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function aj(e,t,n){let i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r._show;(!n&&s)!==(n&&s)&&aj(r,r._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(cf.prototype,{availability:yl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:yl("name"),show:{get:function(){return this._show},set:function(e){if(!c(e))throw new C("value is required.");if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&aj(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:yl("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!c(this.entityCollection)||this.entityCollection.show)&&(!c(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(c(t)){let o=t._children.indexOf(this);t._children.splice(o,1)}this._parent=e,c(e)&&e._children.push(this);let i=this.isShowing;n!==i&&aj(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Ls("billboard",wc),box:Ls("box",KT),corridor:Ls("corridor",ZT),cylinder:Ls("cylinder",QT),description:fe("description"),ellipse:Ls("ellipse",JT),ellipsoid:Ls("ellipsoid",eA),label:Ls("label",Bh),model:Ls("model",ng),tileset:Ls("tileset",nA),orientation:fe("orientation"),path:Ls("path",ig),plane:Ls("plane",aN),point:Ls("point",iA),polygon:Ls("polygon",kh),polyline:Ls("polyline",Oc),polylineVolume:Ls("polylineVolume",oA),properties:Ls("properties",bl),position:INe("position"),rectangle:Ls("rectangle",Uh),viewFrom:fe("viewFrom"),wall:Ls("wall",og)});cf.registerEntityType=function(e,t){Object.defineProperties(cf.prototype,{[e]:Ls(e,t)}),sj.includes(e)||sj.push(e)};cf.prototype.isAvailable=function(e){if(!c(e))throw new C("time is required.");let t=this._availability;return!c(t)||t.contains(e)};cf.prototype.addProperty=function(e){let t=this._propertyNames;if(!c(e))throw new C("propertyName is required.");if(t.indexOf(e)!==-1)throw new C(`${e} is already a registered property.`);if(e in this)throw new C(`${e} is a reserved property name.`);t.push(e),Object.defineProperty(this,e,yl(e,!0))};cf.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);if(!c(e))throw new C("propertyName is required.");if(n===-1)throw new C(`${e} is not a registered property.`);this._propertyNames.splice(n,1),delete this[e]};cf.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.name=this.name??e.name,this.availability=this.availability??e.availability;let t=this._propertyNames,n=c(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r==="parent"||r==="name"||r==="availability"||r==="children")continue;let s=this[r],a=e[r];!c(s)&&t.indexOf(r)===-1&&this.addProperty(r),c(a)&&(c(s)?c(s.merge)&&s.merge(a):c(a.merge)&&c(a.clone)?this[r]=a.clone():this[r]=a)}};var vne=new J,Dne=new d,Pne=new Le;cf.prototype.computeModelMatrix=function(e,t){T.typeOf.object("time",e);let n=Y.getValueOrUndefined(this._position,e,Dne);if(!c(n))return;let i=Y.getValueOrUndefined(this._orientation,e,Pne);return c(i)?t=F.fromRotationTranslation(J.fromQuaternion(i,vne),n,t):t=Ot.eastNorthUpToFixedFrame(n,void 0,t),t};cf.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,o){T.typeOf.object("time",e);let r=Y.getValueOrDefault(t,e,qe.NONE),s=Y.getValueOrUndefined(this._position,e,Dne);if(r===qe.NONE||!c(s)||d.equalsEpsilon(s,d.ZERO,O.EPSILON8))return this.computeModelMatrix(e,o);let a=i.cartesianToCartographic(s,DNe);r===qe.CLIP_TO_GROUND?a.height<n&&(a.height=n):of(r)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let l=Y.getValueOrUndefined(this._orientation,e,Pne);return c(l)?o=F.fromRotationTranslation(J.fromQuaternion(l,vne),s,o):o=Ot.eastNorthUpToFixedFrame(s,void 0,o),o};cf.supportsMaterialsforEntitiesOnTerrain=function(e){return _l.supportsMaterials(e)};cf.supportsPolylinesOnTerrain=function(e){return Nh.isSupported(e)};var rr=cf;var ONe=new Ut(G.WHITE),RNe=new Xn(!0),MNe=new Xn(!0),LNe=new Xn(!1),NNe=new Xn(G.BLACK),FNe=new Xn(Tn.DISABLED),BNe=new Xn(new Lt),kNe=new Xn(Un.BOTH);function Rc(e){T.defined("options.entity",e.entity),T.defined("options.scene",e.scene),T.defined("options.geometryOptions",e.geometryOptions),T.defined("options.geometryPropertyName",e.geometryPropertyName),T.defined("options.observedPropertyNames",e.observedPropertyNames);let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new pe,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=rr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Rc.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!c(this._entity.availability)&&Y.isConstant(this._showProperty)&&Y.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!c(this._entity.availability)&&Y.isConstant(this._showProperty)&&Y.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});Rc.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};Rc.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};Rc.prototype.createFillGeometryInstance=C.throwInstantiationError;Rc.prototype.createOutlineGeometryInstance=C.throwInstantiationError;Rc.prototype.isDestroyed=function(){return!1};Rc.prototype.destroy=function(){de(this)};Rc.prototype._isHidden=function(e,t){let n=t.show;return c(n)&&n.isConstant&&!n.getValue(Ge.MINIMUM_VALUE)};Rc.prototype._isOnTerrain=function(e,t){return!1};Rc.prototype._getIsClosed=function(e){return!0};Rc.prototype._isDynamic=C.throwInstantiationError;Rc.prototype._setStaticOptions=C.throwInstantiationError;Rc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!c(o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.fill,s=c(r)&&r.isConstant?r.getValue(Ge.MINIMUM_VALUE):!0,a=o.outline,l=c(a);if(l&&a.isConstant&&(l=a.getValue(Ge.MINIMUM_VALUE)),!s&&!l){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=o.show;if(this._isHidden(e,o)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=o.material??ONe,this._fillProperty=r??MNe,this._showProperty=u??RNe,this._showOutlineProperty=o.outline??LNe,this._outlineColorProperty=l?o.outlineColor??NNe:void 0,this._shadowsProperty=o.shadows??FNe,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??BNe,this._classificationTypeProperty=o.classificationType??kNe,this._fillEnabled=s;let f=this._isOnTerrain(e,o)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Ut);if(l&&f&&(dt(dt.geometryOutlines),l=!1),this._onTerrain=f,this._outlineEnabled=l,this._isDynamic(e,o))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,o),this._isClosed=this._getIsClosed(this._options);let h=o.outlineWidth;this._outlineWidth=c(h)?h.getValue(Ge.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Rc.prototype.createDynamicUpdater=function(e,t){if(T.defined("primitives",e),T.defined("groundPrimitives",t),!this._dynamic)throw new C("This instance does not represent dynamic geometry.");return new this.constructor.DynamicGeometryUpdater(this,e,t)};var oi=Rc;function rA(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new pe,this.setCallback(e,t)}Object.defineProperties(rA.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var UNe=new Q;rA.prototype.getValue=function(e,t){return c(e)||(e=Q.now(UNe)),this._callback(e,t)};rA.prototype.setCallback=function(e,t){if(!c(e))throw new C("callback is required.");if(!c(t))throw new C("isConstant is required.");let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};rA.prototype.equals=function(e){return this===e||e instanceof rA&&this._callback===e._callback&&this._isConstant===e._isConstant};var Vh=rA;var Ine=new d;function sA(e,t,n,i){T.defined("scene",e),T.defined("positionProperty",t),this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new d,this._cartographicPosition=new he,this._normal=new d,this._definitionChanged=new pe,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let o=this;if(c(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){o._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){o._updateClamping()})),t.isConstant){let r=t.getValue(Ge.MINIMUM_VALUE,Ine);if(!c(r)||d.equals(r,d.ZERO)||!c(e.globe))return;this._position=d.clone(r,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(r,this._normal)}}Object.defineProperties(sA.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});sA.prototype._updateClamping=function(){c(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(d.equals(t,d.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),o=e.getHeight(i,this._heightReference);c(o)?this._terrainHeight=o:this._terrainHeight=0;let r=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var VNe=new Q;sA.prototype.getValue=function(e,t){c(e)||(e=Q.now(VNe));let n=Y.getValueOrDefault(this._heightReference,e,qe.NONE),i=Y.getValueOrDefault(this._extrudedHeightReference,e,qe.NONE);if(n===qe.NONE&&!NT(i))return this._position=d.clone(d.ZERO,this._position),d.clone(d.ZERO,t);if(this._positionProperty.isConstant&&n!==qe.CLIP_TO_GROUND)return d.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,Ine);if(!c(r)||d.equals(r,d.ZERO)||!c(o.globe))return d.clone(d.ZERO,t);if(d.equalsEpsilon(this._position,r,O.EPSILON10)&&n!==qe.CLIP_TO_GROUND)return d.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=d.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);if(n===qe.CLIP_TO_GROUND){let l=o.globe.ellipsoid.cartesianToCartographic(r,scratchCarto);return this._terrainHeight>=l.height?d.multiplyByScalar(s,this._terrainHeight-l.height,t):d.clone(d.ZERO,t)}return d.multiplyByScalar(s,this._terrainHeight,t)};sA.prototype.isDestroyed=function(){return!1};sA.prototype.destroy=function(){return c(this._removeEventListener)&&this._removeEventListener(),c(this._removeModeListener)&&this._removeModeListener(),c(this._removeCallbackFunc)&&this._removeCallbackFunc(),de(this)};var aA=sA;function zNe(e,t,n,i){if(oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!c(o))return;c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(c(r)){let s=new Vh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new aA(this._scene,s,r)}}var rg=zNe;var One=d.ZERO,Rne=new d,HNe=new d,Mne=new G;function GNe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Jl(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new GNe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}c(Object.create)&&(Jl.prototype=Object.create(oi.prototype),Jl.prototype.constructor=Jl);Object.defineProperties(Jl.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Jl.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let a;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Mne)),c(a)||(a=G.WHITE),s.color=jt.fromColor(a)}return c(this._options.offsetAttribute)&&(s.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,One,Rne))),new St({id:t,geometry:Za.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};Jl.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Mne),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,One,Rne))),new St({id:t,geometry:Mh.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};Jl.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};Jl.prototype._isHidden=function(e,t){return!c(t.dimensions)||!c(e.position)||oi.prototype._isHidden.call(this,e,t)};Jl.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.dimensions.isConstant||!Y.isConstant(t.outlineWidth)};Jl.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==qe.NONE?Zt.ALL:void 0};Jl.prototype._onEntityPropertyChanged=rg;Jl.DynamicGeometryUpdater=cA;function cA(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(cA.prototype=Object.create(ii.prototype),cA.prototype.constructor=cA);cA.prototype._isHidden=function(e,t,n){let i=Y.getValueOrUndefined(e.position,n,HNe),o=this._options.dimensions;return!c(i)||!c(o)||ii.prototype._isHidden.call(this,e,t,n)};cA.prototype._setOptions=function(e,t,n){let i=Y.getValueOrDefault(t.heightReference,n,qe.NONE),o=this._options;o.dimensions=Y.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==qe.NONE?Zt.ALL:void 0};var cN=Jl;function tb(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??zi.FIXED,this._definitionChanged=new pe,this.setCallback(e,t)}Object.defineProperties(tb.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var jNe=new Q;tb.prototype.getValue=function(e,t){return c(e)||(e=Q.now(jNe)),this.getValueInReferenceFrame(e,zi.FIXED,t)};tb.prototype.setCallback=function(e,t){if(!c(e))throw new C("callback is required.");if(!c(t))throw new C("isConstant is required.");let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};tb.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new C("time is required.");if(!c(t))throw new C("referenceFrame is required.");let i=this._callback(e,n);return Fh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};tb.prototype.equals=function(e){return this===e||e instanceof tb&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var lN=tb;/*! @license DOMPurify 3.2.3 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.3/LICENSE */var{entries:Gne,setPrototypeOf:Lne,isFrozen:WNe,getPrototypeOf:qNe,getOwnPropertyDescriptor:YNe}=Object,{freeze:Lc,seal:lf,create:jne}=Object,{apply:hj,construct:mj}=typeof Reflect<"u"&&Reflect;Lc||(Lc=function(t){return t});lf||(lf=function(t){return t});hj||(hj=function(t,n,i){return t.apply(n,i)});mj||(mj=function(t,n){return new t(...n)});var uN=eu(Array.prototype.forEach),Nne=eu(Array.prototype.pop),Ww=eu(Array.prototype.push),dN=eu(String.prototype.toLowerCase),cj=eu(String.prototype.toString),Fne=eu(String.prototype.match),qw=eu(String.prototype.replace),XNe=eu(String.prototype.indexOf),KNe=eu(String.prototype.trim),gd=eu(Object.prototype.hasOwnProperty),Mc=eu(RegExp.prototype.test),Yw=$Ne(TypeError);function eu(e){return function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return hj(e,t,i)}}function $Ne(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return mj(e,n)}}function vi(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:dN;Lne&&Lne(e,null);let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(WNe(t)||(t[i]=r),o=r)}e[o]=!0}return e}function ZNe(e){for(let t=0;t<e.length;t++)gd(e,t)||(e[t]=null);return e}function nb(e){let t=jne(null);for(let[n,i]of Gne(e))gd(e,n)&&(Array.isArray(i)?t[n]=ZNe(i):i&&typeof i=="object"&&i.constructor===Object?t[n]=nb(i):t[n]=i);return t}function Xw(e,t){for(;e!==null;){let i=YNe(e,t);if(i){if(i.get)return eu(i.get);if(typeof i.value=="function")return eu(i.value)}e=qNe(e)}function n(){return null}return n}var Bne=Lc(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),lj=Lc(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),uj=Lc(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),QNe=Lc(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),fj=Lc(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),JNe=Lc(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),kne=Lc(["#text"]),Une=Lc(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),dj=Lc(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Vne=Lc(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),fN=Lc(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),eFe=lf(/\{\{[\w\W]*|[\w\W]*\}\}/gm),tFe=lf(/<%[\w\W]*|[\w\W]*%>/gm),nFe=lf(/\$\{[\w\W]*}/gm),iFe=lf(/^data-[\-\w.\u00B7-\uFFFF]+$/),oFe=lf(/^aria-[\-\w]+$/),Wne=lf(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),rFe=lf(/^(?:\w+script|data):/i),sFe=lf(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),qne=lf(/^html$/i),aFe=lf(/^[a-z][.\w]*(-[.\w]+)+$/i),zne=Object.freeze({__proto__:null,ARIA_ATTR:oFe,ATTR_WHITESPACE:sFe,CUSTOM_ELEMENT:aFe,DATA_ATTR:iFe,DOCTYPE_NAME:qne,ERB_EXPR:tFe,IS_ALLOWED_URI:Wne,IS_SCRIPT_OR_DATA:rFe,MUSTACHE_EXPR:eFe,TMPLIT_EXPR:nFe}),Kw={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,progressingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},cFe=function(){return typeof window>"u"?null:window},lFe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Hne=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Yne(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:cFe(),t=cn=>Yne(cn);if(t.version="3.2.3",t.removed=[],!e||!e.document||e.document.nodeType!==Kw.document)return t.isSupported=!1,t;let{document:n}=e,i=n,o=i.currentScript,{DocumentFragment:r,HTMLTemplateElement:s,Node:a,Element:l,NodeFilter:u,NamedNodeMap:f=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:h,DOMParser:p,trustedTypes:g}=e,m=l.prototype,y=Xw(m,"cloneNode"),b=Xw(m,"remove"),x=Xw(m,"nextSibling"),A=Xw(m,"childNodes"),E=Xw(m,"parentNode");if(typeof s=="function"){let cn=n.createElement("template");cn.content&&cn.content.ownerDocument&&(n=cn.content.ownerDocument)}let S,v="",{implementation:P,createNodeIterator:M,createDocumentFragment:R,getElementsByTagName:L}=n,{importNode:B}=i,_=Hne();t.isSupported=typeof Gne=="function"&&typeof E=="function"&&P&&P.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:w,ERB_EXPR:D,TMPLIT_EXPR:I,DATA_ATTR:N,ARIA_ATTR:k,IS_SCRIPT_OR_DATA:H,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:j}=zne,{IS_ALLOWED_URI:U}=zne,q=null,X=vi({},[...Bne,...lj,...uj,...fj,...kne]),te=null,K=vi({},[...Une,...dj,...Vne,...fN]),Z=Object.seal(jne(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ee=null,me=null,xe=!0,ue=!0,ye=!1,Ae=!0,Pe=!1,Ee=!0,Ve=!1,je=!1,it=!1,Dt=!1,Gt=!1,$e=!1,ln=!0,Vt=!1,Ct="user-content-",gi=!0,an=!1,_e={},Ce=null,mn=vi({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),mt=null,to=vi({},["audio","video","img","source","image","track"]),So=null,Ks=vi({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),vr="http://www.w3.org/1998/Math/MathML",ps="http://www.w3.org/2000/svg",Ne="http://www.w3.org/1999/xhtml",ot=Ne,Xe=!1,Ze=null,pt=vi({},[vr,ps,Ne],cj),Ht=vi({},["mi","mo","mn","ms","mtext"]),bn=vi({},["annotation-xml"]),wo=vi({},["title","style","font","a","script"]),yo=null,ka=["application/xhtml+xml","text/html"],Ua="text/html",yi=null,hi=null,$s=n.createElement("form"),Hr=function(Se){return Se instanceof RegExp||Se instanceof Function},ol=function(){let Se=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(hi&&hi===Se)){if((!Se||typeof Se!="object")&&(Se={}),Se=nb(Se),yo=ka.indexOf(Se.PARSER_MEDIA_TYPE)===-1?Ua:Se.PARSER_MEDIA_TYPE,yi=yo==="application/xhtml+xml"?cj:dN,q=gd(Se,"ALLOWED_TAGS")?vi({},Se.ALLOWED_TAGS,yi):X,te=gd(Se,"ALLOWED_ATTR")?vi({},Se.ALLOWED_ATTR,yi):K,Ze=gd(Se,"ALLOWED_NAMESPACES")?vi({},Se.ALLOWED_NAMESPACES,cj):pt,So=gd(Se,"ADD_URI_SAFE_ATTR")?vi(nb(Ks),Se.ADD_URI_SAFE_ATTR,yi):Ks,mt=gd(Se,"ADD_DATA_URI_TAGS")?vi(nb(to),Se.ADD_DATA_URI_TAGS,yi):to,Ce=gd(Se,"FORBID_CONTENTS")?vi({},Se.FORBID_CONTENTS,yi):mn,ee=gd(Se,"FORBID_TAGS")?vi({},Se.FORBID_TAGS,yi):{},me=gd(Se,"FORBID_ATTR")?vi({},Se.FORBID_ATTR,yi):{},_e=gd(Se,"USE_PROFILES")?Se.USE_PROFILES:!1,xe=Se.ALLOW_ARIA_ATTR!==!1,ue=Se.ALLOW_DATA_ATTR!==!1,ye=Se.ALLOW_UNKNOWN_PROTOCOLS||!1,Ae=Se.ALLOW_SELF_CLOSE_IN_ATTR!==!1,Pe=Se.SAFE_FOR_TEMPLATES||!1,Ee=Se.SAFE_FOR_XML!==!1,Ve=Se.WHOLE_DOCUMENT||!1,Dt=Se.RETURN_DOM||!1,Gt=Se.RETURN_DOM_FRAGMENT||!1,$e=Se.RETURN_TRUSTED_TYPE||!1,it=Se.FORCE_BODY||!1,ln=Se.SANITIZE_DOM!==!1,Vt=Se.SANITIZE_NAMED_PROPS||!1,gi=Se.KEEP_CONTENT!==!1,an=Se.IN_PLACE||!1,U=Se.ALLOWED_URI_REGEXP||Wne,ot=Se.NAMESPACE||Ne,Ht=Se.MATHML_TEXT_INTEGRATION_POINTS||Ht,bn=Se.HTML_INTEGRATION_POINTS||bn,Z=Se.CUSTOM_ELEMENT_HANDLING||{},Se.CUSTOM_ELEMENT_HANDLING&&Hr(Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Z.tagNameCheck=Se.CUSTOM_ELEMENT_HANDLING.tagNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&Hr(Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Z.attributeNameCheck=Se.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),Se.CUSTOM_ELEMENT_HANDLING&&typeof Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Z.allowCustomizedBuiltInElements=Se.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Pe&&(ue=!1),Gt&&(Dt=!0),_e&&(q=vi({},kne),te=[],_e.html===!0&&(vi(q,Bne),vi(te,Une)),_e.svg===!0&&(vi(q,lj),vi(te,dj),vi(te,fN)),_e.svgFilters===!0&&(vi(q,uj),vi(te,dj),vi(te,fN)),_e.mathMl===!0&&(vi(q,fj),vi(te,Vne),vi(te,fN))),Se.ADD_TAGS&&(q===X&&(q=nb(q)),vi(q,Se.ADD_TAGS,yi)),Se.ADD_ATTR&&(te===K&&(te=nb(te)),vi(te,Se.ADD_ATTR,yi)),Se.ADD_URI_SAFE_ATTR&&vi(So,Se.ADD_URI_SAFE_ATTR,yi),Se.FORBID_CONTENTS&&(Ce===mn&&(Ce=nb(Ce)),vi(Ce,Se.FORBID_CONTENTS,yi)),gi&&(q["#text"]=!0),Ve&&vi(q,["html","head","body"]),q.table&&(vi(q,["tbody"]),delete ee.tbody),Se.TRUSTED_TYPES_POLICY){if(typeof Se.TRUSTED_TYPES_POLICY.createHTML!="function")throw Yw('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Se.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Yw('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');S=Se.TRUSTED_TYPES_POLICY,v=S.createHTML("")}else S===void 0&&(S=lFe(g,o)),S!==null&&typeof v=="string"&&(v=S.createHTML(""));Lc&&Lc(Se),hi=Se}},ho=vi({},[...lj,...uj,...QNe]),Dr=vi({},[...fj,...JNe]),tp=function(Se){let Pt=E(Se);(!Pt||!Pt.tagName)&&(Pt={namespaceURI:ot,tagName:"template"});let pn=dN(Se.tagName),hr=dN(Pt.tagName);return Ze[Se.namespaceURI]?Se.namespaceURI===ps?Pt.namespaceURI===Ne?pn==="svg":Pt.namespaceURI===vr?pn==="svg"&&(hr==="annotation-xml"||Ht[hr]):!!ho[pn]:Se.namespaceURI===vr?Pt.namespaceURI===Ne?pn==="math":Pt.namespaceURI===ps?pn==="math"&&bn[hr]:!!Dr[pn]:Se.namespaceURI===Ne?Pt.namespaceURI===ps&&!bn[hr]||Pt.namespaceURI===vr&&!Ht[hr]?!1:!Dr[pn]&&(wo[pn]||!ho[pn]):!!(yo==="application/xhtml+xml"&&Ze[Se.namespaceURI]):!1},Gr=function(Se){Ww(t.removed,{element:Se});try{E(Se).removeChild(Se)}catch{b(Se)}},zu=function(Se,Pt){try{Ww(t.removed,{attribute:Pt.getAttributeNode(Se),from:Pt})}catch{Ww(t.removed,{attribute:null,from:Pt})}if(Pt.removeAttribute(Se),Se==="is")if(Dt||Gt)try{Gr(Pt)}catch{}else try{Pt.setAttribute(Se,"")}catch{}},Va=function(Se){let Pt=null,pn=null;if(it)Se="<remove></remove>"+Se;else{let Ta=Fne(Se,/^[\r\n\t ]+/);pn=Ta&&Ta[0]}yo==="application/xhtml+xml"&&ot===Ne&&(Se='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+Se+"</body></html>");let hr=S?S.createHTML(Se):Se;if(ot===Ne)try{Pt=new p().parseFromString(hr,yo)}catch{}if(!Pt||!Pt.documentElement){Pt=P.createDocument(ot,"template",null);try{Pt.documentElement.innerHTML=Xe?v:hr}catch{}}let Ha=Pt.body||Pt.documentElement;return Se&&pn&&Ha.insertBefore(n.createTextNode(pn),Ha.childNodes[0]||null),ot===Ne?L.call(Pt,Ve?"html":"body")[0]:Ve?Pt.documentElement:Ha},S0=function(Se){return M.call(Se.ownerDocument||Se,Se,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Zs=function(Se){return Se instanceof h&&(typeof Se.nodeName!="string"||typeof Se.textContent!="string"||typeof Se.removeChild!="function"||!(Se.attributes instanceof f)||typeof Se.removeAttribute!="function"||typeof Se.setAttribute!="function"||typeof Se.namespaceURI!="string"||typeof Se.insertBefore!="function"||typeof Se.hasChildNodes!="function")},rl=function(Se){return typeof a=="function"&&Se instanceof a};function za(cn,Se,Pt){uN(cn,pn=>{pn.call(t,Se,Pt,hi)})}let es=function(Se){let Pt=null;if(za(_.beforeSanitizeElements,Se,null),Zs(Se))return Gr(Se),!0;let pn=yi(Se.nodeName);if(za(_.uponSanitizeElement,Se,{tagName:pn,allowedTags:q}),Se.hasChildNodes()&&!rl(Se.firstElementChild)&&Mc(/<[/\w]/g,Se.innerHTML)&&Mc(/<[/\w]/g,Se.textContent)||Se.nodeType===Kw.progressingInstruction||Ee&&Se.nodeType===Kw.comment&&Mc(/<[/\w]/g,Se.data))return Gr(Se),!0;if(!q[pn]||ee[pn]){if(!ee[pn]&&Gu(pn)&&(Z.tagNameCheck instanceof RegExp&&Mc(Z.tagNameCheck,pn)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(pn)))return!1;if(gi&&!Ce[pn]){let hr=E(Se)||Se.parentNode,Ha=A(Se)||Se.childNodes;if(Ha&&hr){let Ta=Ha.length;for(let sl=Ta-1;sl>=0;--sl){let xh=y(Ha[sl],!0);xh.__removalCount=(Se.__removalCount||0)+1,hr.insertBefore(xh,x(Se))}}}return Gr(Se),!0}return Se instanceof l&&!tp(Se)||(pn==="noscript"||pn==="noembed"||pn==="noframes")&&Mc(/<\/no(script|embed|frames)/i,Se.innerHTML)?(Gr(Se),!0):(Pe&&Se.nodeType===Kw.text&&(Pt=Se.textContent,uN([w,D,I],hr=>{Pt=qw(Pt,hr," ")}),Se.textContent!==Pt&&(Ww(t.removed,{element:Se.cloneNode()}),Se.textContent=Pt)),za(_.afterSanitizeElements,Se,null),!1)},Hu=function(Se,Pt,pn){if(ln&&(Pt==="id"||Pt==="name")&&(pn in n||pn in $s))return!1;if(!(ue&&!me[Pt]&&Mc(N,Pt))){if(!(xe&&Mc(k,Pt))){if(!te[Pt]||me[Pt]){if(!(Gu(Se)&&(Z.tagNameCheck instanceof RegExp&&Mc(Z.tagNameCheck,Se)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(Se))&&(Z.attributeNameCheck instanceof RegExp&&Mc(Z.attributeNameCheck,Pt)||Z.attributeNameCheck instanceof Function&&Z.attributeNameCheck(Pt))||Pt==="is"&&Z.allowCustomizedBuiltInElements&&(Z.tagNameCheck instanceof RegExp&&Mc(Z.tagNameCheck,pn)||Z.tagNameCheck instanceof Function&&Z.tagNameCheck(pn))))return!1}else if(!So[Pt]){if(!Mc(U,qw(pn,V,""))){if(!((Pt==="src"||Pt==="xlink:href"||Pt==="href")&&Se!=="script"&&XNe(pn,"data:")===0&&mt[Se])){if(!(ye&&!Mc(H,qw(pn,V,"")))){if(pn)return!1}}}}}}return!0},Gu=function(Se){return Se!=="annotation-xml"&&Fne(Se,j)},ju=function(Se){za(_.beforeSanitizeAttributes,Se,null);let{attributes:Pt}=Se;if(!Pt||Zs(Se))return;let pn={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:te,forceKeepAttr:void 0},hr=Pt.length;for(;hr--;){let Ha=Pt[hr],{name:Ta,namespaceURI:sl,value:xh}=Ha,GS=yi(Ta),xc=Ta==="value"?xh:KNe(xh);if(pn.attrName=GS,pn.attrValue=xc,pn.keepAttr=!0,pn.forceKeepAttr=void 0,za(_.uponSanitizeAttribute,Se,pn),xc=pn.attrValue,Vt&&(GS==="id"||GS==="name")&&(zu(Ta,Se),xc=Ct+xc),Ee&&Mc(/((--!?|])>)|<\/(style|title)/i,xc)){zu(Ta,Se);continue}if(pn.forceKeepAttr||(zu(Ta,Se),!pn.keepAttr))continue;if(!Ae&&Mc(/\/>/i,xc)){zu(Ta,Se);continue}Pe&&uN([w,D,I],J$=>{xc=qw(xc,J$," ")});let Q$=yi(Se.nodeName);if(Hu(Q$,GS,xc)){if(S&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!sl)switch(g.getAttributeType(Q$,GS)){case"TrustedHTML":{xc=S.createHTML(xc);break}case"TrustedScriptURL":{xc=S.createScriptURL(xc);break}}try{sl?Se.setAttributeNS(sl,Ta,xc):Se.setAttribute(Ta,xc),Zs(Se)?Gr(Se):Nne(t.removed)}catch{}}}za(_.afterSanitizeAttributes,Se,null)},Oo=function cn(Se){let Pt=null,pn=S0(Se);for(za(_.beforeSanitizeShadowDOM,Se,null);Pt=pn.nextNode();)za(_.uponSanitizeShadowNode,Pt,null),es(Pt),ju(Pt),Pt.content instanceof r&&cn(Pt.content);za(_.afterSanitizeShadowDOM,Se,null)};return t.sanitize=function(cn){let Se=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Pt=null,pn=null,hr=null,Ha=null;if(Xe=!cn,Xe&&(cn="<!-->"),typeof cn!="string"&&!rl(cn))if(typeof cn.toString=="function"){if(cn=cn.toString(),typeof cn!="string")throw Yw("dirty is not a string, aborting")}else throw Yw("toString is not a function");if(!t.isSupported)return cn;if(je||ol(Se),t.removed=[],typeof cn=="string"&&(an=!1),an){if(cn.nodeName){let xh=yi(cn.nodeName);if(!q[xh]||ee[xh])throw Yw("root node is forbidden and cannot be sanitized in-place")}}else if(cn instanceof a)Pt=Va("<!---->"),pn=Pt.ownerDocument.importNode(cn,!0),pn.nodeType===Kw.element&&pn.nodeName==="BODY"||pn.nodeName==="HTML"?Pt=pn:Pt.appendChild(pn);else{if(!Dt&&!Pe&&!Ve&&cn.indexOf("<")===-1)return S&&$e?S.createHTML(cn):cn;if(Pt=Va(cn),!Pt)return Dt?null:$e?v:""}Pt&&it&&Gr(Pt.firstChild);let Ta=S0(an?cn:Pt);for(;hr=Ta.nextNode();)es(hr),ju(hr),hr.content instanceof r&&Oo(hr.content);if(an)return cn;if(Dt){if(Gt)for(Ha=R.call(Pt.ownerDocument);Pt.firstChild;)Ha.appendChild(Pt.firstChild);else Ha=Pt;return(te.shadowroot||te.shadowrootmode)&&(Ha=B.call(i,Ha,!0)),Ha}let sl=Ve?Pt.outerHTML:Pt.innerHTML;return Ve&&q["!doctype"]&&Pt.ownerDocument&&Pt.ownerDocument.doctype&&Pt.ownerDocument.doctype.name&&Mc(qne,Pt.ownerDocument.doctype.name)&&(sl="<!DOCTYPE "+Pt.ownerDocument.doctype.name+`>
`+sl),Pe&&uN([w,D,I],xh=>{sl=qw(sl,xh," ")}),S&&$e?S.createHTML(sl):sl},t.setConfig=function(){let cn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};ol(cn),je=!0},t.clearConfig=function(){hi=null,je=!1},t.isValidAttribute=function(cn,Se,Pt){hi||ol({});let pn=yi(cn),hr=yi(Se);return Hu(pn,hr,Pt)},t.addHook=function(cn,Se){typeof Se=="function"&&Ww(_[cn],Se)},t.removeHook=function(cn){return Nne(_[cn])},t.removeHooks=function(cn){_[cn]=[]},t.removeAllHooks=function(){_=Hne()},t}var Xne=Yne();var uFe=0,pj={};function zh(e,t){T.typeOf.string("html",e);let n,i=e;c(pj[i])?n=pj[i]:(n=uFe++,pj[i]=n),t=t??!1,this._id=n,this._html=e,this._showOnScreen=t,this._element=void 0}Object.defineProperties(zh.prototype,{html:{get:function(){return this._html}},id:{get:function(){return this._id}},showOnScreen:{get:function(){return this._showOnScreen},set:function(e){this._showOnScreen=e}},element:{get:function(){if(!c(this._element)){let e=Xne.sanitize(this._html),t=document.createElement("div");t.className="cesium-credit-wrapper",t._creditId=this._id,t.style.display="inline",t.innerHTML=e;let n=t.querySelectorAll("a");for(let i=0;i<n.length;i++)n[i].setAttribute("target","_blank");this._element=t}return this._element}}});zh.equals=function(e,t){return e===t||c(e)&&c(t)&&e._id===t._id&&e._showOnScreen===t._showOnScreen};zh.prototype.equals=function(e){return zh.equals(this,e)};zh.prototype.isIon=function(){return this.html.indexOf("ion-credit.png")!==-1};zh.getIonCredit=function(e){let t=c(e.collapsible)&&!e.collapsible;return new zh(e.html,t)};zh.clone=function(e){if(c(e))return new zh(e.html,e.showOnScreen)};var At=zh;function fFe(e,t){if(!c(e)||!c(t))throw new C("identifier and message are required.");dt(e,t)}var Ns=fFe;function ib(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new pe}Object.defineProperties(ib.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});ib.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function _j(e){e._cubeMapBuffers=void 0}ib.prototype.update=function(e){let{context:t}=e;if(!ib.isSupported(t))return;if(c(this._texture)){_j(this);return}if(!c(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);c(f)&&(_j(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!c(n)&&!this._loading){let f=this;Xl(this._url).then(function(h){f._cubeMapBuffers=h,f._loading=!1}).catch(function(h){f.isDestroyed()||f._errorEvent.raiseEvent(h)}),this._loading=!0}if(!c(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;c(i)||(i=t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT);let o=ke.RGBA,r=n.length;this._maximumMipmapLevel=r-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(r!==a){let f={};Object.values(Go.FaceName).forEach(h=>{f[h]=void 0});for(let h=r;h<a;h++)n.push(f)}let l=new Qt({minificationFilter:Yt.LINEAR_MIPMAP_LINEAR}),u=new Go({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:o,sampler:l});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};ib.prototype.isDestroyed=function(){return!1};ib.prototype.destroy=function(){return _j(this),this._texture=this._texture&&this._texture.destroy(),de(this)};var Hh=ib;function $w(e){e=e??W.EMPTY_OBJECT;let t=c(e.imageBasedLightingFactor)?z.clone(e.imageBasedLightingFactor):new z(1,1);T.typeOf.object("options.imageBasedLightingFactor",t),T.typeOf.number.greaterThanOrEquals("options.imageBasedLightingFactor.x",t.x,0),T.typeOf.number.lessThanOrEquals("options.imageBasedLightingFactor.x",t.x,1),T.typeOf.number.greaterThanOrEquals("options.imageBasedLightingFactor.y",t.y,0),T.typeOf.number.lessThanOrEquals("options.imageBasedLightingFactor.y",t.y,1),this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;if(c(n)&&(!Array.isArray(n)||n.length!==9))throw new C("options.sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.");this._sphericalHarmonicCoefficients=n,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentCubeMap=void 0,this._specularEnvironmentCubeMapDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousImageBasedLightingFactor=z.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties($w.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){T.typeOf.object("imageBasedLightingFactor",e),T.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.x",e.x,0),T.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.x",e.x,1),T.typeOf.number.greaterThanOrEquals("imageBasedLightingFactor.y",e.y,0),T.typeOf.number.lessThanOrEquals("imageBasedLightingFactor.y",e.y,1),this._previousImageBasedLightingFactor=z.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=z.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){if(c(e)&&(!Array.isArray(e)||e.length!==9))throw new C("sphericalHarmonicCoefficients must be an array of 9 Cartesian3 values.");this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentCubeMapDirty=this._specularEnvironmentCubeMapDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return c(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function dFe(e,t){if(Hh.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),c(e._specularEnvironmentMaps)){let n=new Hh(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}$w.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber)return;this._previousFrameNumber=e.frameNumber;let t=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;z.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=z.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||c(this._previousSphericalHarmonicCoefficients)!==c(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(dFe(this,t),this._specularEnvironmentCubeMapDirty=!1),c(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!c(this._specularEnvironmentCubeMap)&&c(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!c(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!c(this._sphericalHarmonicCoefficients)&&c(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!c(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!c(this._specularEnvironmentCubeMap)&&c(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!c(this._sphericalHarmonicCoefficients)&&c(e.sphericalHarmonicCoefficients)};$w.prototype.isDestroyed=function(){return!1};$w.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),de(this)};var lA=$w;var yj=jr(ql(),1);var gj,Kne="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJqdGkiOiJjNjVkZDYxOC01NmEwLTQ1ZmEtOGE2ZS1lYWUyODM4ZWQxYzQiLCJpZCI6MjU5LCJpYXQiOjE3NDYxMTA0Njl9.uyhPpCQKB1dodfbqTx0ZUPOLhnrSXd-qWixDxc4GYXk",hN={};hN.defaultAccessToken=Kne;hN.defaultServer=new we({url:"https://api.cesium.com/"});hN.getDefaultTokenCredit=function(e){if(e===Kne){if(!c(gj)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;gj=new At(t,!0)}return gj}};var Gh=hN;function Nc(e,t){T.defined("endpoint",e),T.defined("endpointResource",t);let n,i=e.externalType,o=c(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:hFe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new ae("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");we.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new yj.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o}c(Object.create)&&(Nc.prototype=Object.create(we.prototype),Nc.prototype.constructor=Nc);Nc.fromAssetId=function(e,t){let n=Nc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Nc(i,n)})};Object.defineProperties(Nc.prototype,{credits:{get:function(){return c(this._ionRoot)?this._ionRoot.credits:c(this._credits)?this._credits:(this._credits=Nc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Nc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(At.getIonCredit),i=Gh.getDefaultTokenCredit(t.queryParameters.access_token);return c(i)&&n.push(At.clone(i)),n};Nc.prototype.clone=function(e){let t=this._ionRoot??this;return c(e)||(e=new Nc(t._ionEndpoint,t._ionEndpointResource)),e=we.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Nc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},c(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return we.prototype.fetchImage.call(this,e)};Nc.prototype._makeRequest=function(e){return this._isExternal||new yj.default(this.url).authority()!==this._ionEndpointDomain?we.prototype._makeRequest.call(this,e):(c(e.headers)||(e.headers={}),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,e.headers["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e.headers["X-Cesium-Client-Version"]=CESIUM_VERSION),we.prototype._makeRequest.call(this,e))};Nc._createEndpointResource=function(e,t){T.defined("assetId",e),t=t??W.EMPTY_OBJECT;let n=t.server??Gh.defaultServer,i=t.accessToken??Gh.defaultAccessToken;n=we.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return c(i)&&(o.queryParameters={access_token:i}),n.getDerivedResource(o)};function hFe(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,o=typeof Image<"u";return!c(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(c(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){return n._ionEndpoint=r,r}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var uf=Nc;function jh(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(jh.prototype,{length:{get:function(){return this._length},set:function(e){T.typeOf.number.greaterThanOrEquals("length",e,0);let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});jh.prototype.get=function(e){return T.typeOf.number.lessThan("index",e,this._array.length),this._array[e]};jh.prototype.set=function(e,t){T.typeOf.number("index",e),e>=this._length&&(this.length=e+1),this._array[e]=t};jh.prototype.peek=function(){return this._array[this._length-1]};jh.prototype.push=function(e){let t=this.length++;this._array[t]=e};jh.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};jh.prototype.reserve=function(e){T.typeOf.number.greaterThanOrEquals("length",e,0),e>this._array.length&&(this._array.length=e)};jh.prototype.resize=function(e){T.typeOf.number.greaterThanOrEquals("length",e,0),this.length=e};jh.prototype.trim=function(e){e=e??this._length,this._array.length=e};var xl=jh;var Tp={X:0,Y:1,Z:2};Tp.Y_UP_TO_Z_UP=F.fromRotationTranslation(J.fromArray([1,0,0,0,0,1,0,-1,0]));Tp.Z_UP_TO_Y_UP=F.fromRotationTranslation(J.fromArray([1,0,0,0,0,-1,0,1,0]));Tp.X_UP_TO_Z_UP=F.fromRotationTranslation(J.fromArray([0,0,1,0,1,0,-1,0,0]));Tp.Z_UP_TO_X_UP=F.fromRotationTranslation(J.fromArray([0,0,-1,0,1,0,1,0,0]));Tp.X_UP_TO_Y_UP=F.fromRotationTranslation(J.fromArray([0,1,0,-1,0,0,0,0,1]));Tp.Y_UP_TO_X_UP=F.fromRotationTranslation(J.fromArray([0,-1,0,1,0,0,0,0,1]));Tp.fromName=function(e){return T.typeOf.string("name",e),Tp[e]};var Fo=Object.freeze(Tp);function $ne(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.metadata",e.metadata),this._metadata=e.metadata}Object.defineProperties($ne.prototype,{metadata:{get:function(){return this._metadata}}});var uA=$ne;function sg(e,t,n){if(!c(e))throw new C("uint8Array is required.");if(t<0)throw new C("byteOffset cannot be negative.");if(n<0)throw new C("byteLength cannot be negative.");if(t+n>e.byteLength)throw new C("sub-region exceeds array bounds.");return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),sg.decode(e)}sg.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};sg.decodeWithFromCharCode=function(e){let t="",n=mFe(e),i=n.length;for(let o=0;o<i;++o){let r=n[o];r<=65535?t+=String.fromCharCode(r):(r-=65536,t+=String.fromCharCode((r>>10)+55296,(r&1023)+56320))}return t};function Zw(e,t,n){return t<=e&&e<=n}function mFe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let l=0;l<a;++l){let u=e[l];if(i===0){if(Zw(u,0,127)){s.push(u);continue}if(Zw(u,194,223)){i=1,t=u&31;continue}if(Zw(u,224,239)){u===224&&(o=160),u===237&&(r=159),i=2,t=u&15;continue}if(Zw(u,240,244)){u===240&&(o=144),u===244&&(r=143),i=3,t=u&7;continue}throw new ae("String decoding failed.")}if(!Zw(u,o,r)){t=i=n=0,o=128,r=191,--l;continue}o=128,r=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?sg.decode=sg.decodeWithTextDecoder:sg.decode=sg.decodeWithFromCharCode;var tu=sg;function pFe(e,t){return t=t??0,tu(e,t,Math.min(4,e.length))}var Wh=pFe;function ff(e,t,n,i){this._tileset=e,this._tile=t,this._resource=n,c(i)||(i=[]),this._contents=i,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(ff.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].metadata=e}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e;let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].group=e}}});var Qw=Uint32Array.BYTES_PER_ELEMENT;ff.fromTileType=async function(e,t,n,i,o,r){o=o??0;let s=new Uint8Array(i),a=new DataView(i);o+=Qw;let l=a.getUint32(o,!0);if(l!==1)throw new ae(`Only Composite Tile version 1 is supported. Version ${l} is not.`);o+=Qw,o+=Qw;let u=a.getUint32(o,!0);o+=Qw;let f=n.queryParameters.compositeIndex;c(f)?f=`${f}_`:f="";let h=[];h.length=u;for(let m=0;m<u;++m){let y=Wh(s,o),b=a.getUint32(o+Qw*2,!0),x=r[y],A=`${f}${m}`,E=n.getDerivedResource({queryParameters:{compositeIndex:A}});if(c(x))h[m]=Promise.resolve(x(e,t,E,i,o));else throw new ae(`Unknown tile content type, ${y}, inside Composite tile`);o+=b}let p=await Promise.all(h);return new ff(e,t,n,p)};ff.prototype.hasProperty=function(e,t){return!1};ff.prototype.getFeature=function(e){};ff.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};ff.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};ff.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};ff.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let l=r[a].pick(e,t,n);if(!c(l))continue;let u=d.distance(e.origin,l);u<o&&(i=l,o=u)}if(c(i))return n};ff.prototype.isDestroyed=function(){return!1};ff.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return de(this)};var mN=ff;function _Fe(e,t,n){return JSON.parse(tu(e,t,n))}var sr=_Fe;function tc(e){T.typeOf.number("options.featuresLength",e.featuresLength),T.typeOf.object("options.owner",e.owner),this._id=jn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let o=Math.min(t,ut.maximumTextureSize),r=Math.ceil(t/ut.maximumTextureSize),s=1/o,a=s*.5,l=1/r,u=l*.5;n=new z(o,r),i=new se(s,a,l,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(tc.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return c(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),c(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});tc.DEFAULT_COLOR_VALUE=G.WHITE;tc.DEFAULT_SHOW_VALUE=!0;function Zne(e){let t=e._textureDimensions;return t.x*t.y*4}function Qne(e){if(!c(e._batchValues)){let t=Zne(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Jne(e){if(!c(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}function Jw(e,t){if(!c(e)||e<0||e>=t)throw new C(`batchId is required and between zero and featuresLength - 1 (${t}`-+").")}tc.prototype.setShow=function(e,t){if(Jw(e,this._featuresLength),T.typeOf.bool("show",t),t&&!c(this._showAlphaProperties))return;let n=Jne(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=Qne(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};tc.prototype.setAllShow=function(e){T.typeOf.bool("show",e);let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};tc.prototype.getShow=function(e){if(Jw(e,this._featuresLength),!c(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var gFe=new Array(4);tc.prototype.setColor=function(e,t){if(Jw(e,this._featuresLength),T.typeOf.object("color",t),G.equals(t,tc.DEFAULT_COLOR_VALUE)&&!c(this._batchValues))return;let n=t.toBytes(gFe),i=n[3],o=Qne(this),r=e*4,s=Jne(this),a=e*2;if(o[r]!==n[0]||o[r+1]!==n[1]||o[r+2]!==n[2]||s[a+1]!==i){o[r]=n[0],o[r+1]=n[1],o[r+2]=n[2];let l=s[a+1]!==255,u=s[a]!==0;o[r+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!l?++this._translucentFeaturesLength:!f&&l&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,c(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};tc.prototype.setAllColor=function(e){T.typeOf.object("color",e);let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};tc.prototype.getColor=function(e,t){if(Jw(e,this._featuresLength),T.typeOf.object("result",t),!c(this._batchValues))return G.clone(tc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,o=this._showAlphaProperties,r=e*2;return G.fromBytes(n[i],n[i+1],n[i+2],o[r+1],t)};tc.prototype.getPickColor=function(e){return Jw(e,this._featuresLength),this._pickIds[e]};function eie(e,t,n){let i=e._textureDimensions;return new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:Qt.NEAREST})}function yFe(e,t){let n=e._featuresLength;if(!c(e._pickTexture)&&n>0){let i=e._pickIds,o=Zne(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let l=0;l<n;++l){let u=t.createPickId(s.getFeature(l));i.push(u);let f=u.color,h=l*4;r[h]=G.floatToByte(f.red),r[h+1]=G.floatToByte(f.green),r[h+2]=G.floatToByte(f.blue),r[h+3]=G.floatToByte(f.alpha)}e._pickTexture=eie(e,t,r),c(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function bFe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}tc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&yFe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,c(this._batchTexture)||(this._batchTexture=eie(this,n,this._batchValues),c(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),bFe(this))};tc.prototype.isDestroyed=function(){return!1};tc.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return de(this)};var Tl=tc;var xFe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},TFe={SCALAR:void 0,VEC2:z,VEC3:d,VEC4:se,MAT2:Ri,MAT3:J,MAT4:F};function AFe(e){let t=e.componentType,n;typeof t=="string"?n=$.fromName(t):n=t;let i=xFe[e.type],o=TFe[e.type];return{componentsPerAttribute:i,classType:o,createArrayBufferView:function(r,s,a){return $.createArrayBufferView(n,r,s,i*a)}}}var df=AFe;function Ap(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,T.typeOf.object("options.extension",e.extension),CFe(this,e.extension,e.binaryBody),vFe(this)}Object.defineProperties(Ap.prototype,{byteLength:{get:function(){return this._byteLength}}});function CFe(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,l=t.classIds,u=t.parentCounts,f=t.parentIds,h=s,p=0;c(l.byteOffset)&&(l.componentType=l.componentType??$.UNSIGNED_SHORT,l.type=nn.SCALAR,r=df(l),l=r.createArrayBufferView(n.buffer,n.byteOffset+l.byteOffset,s),p+=l.byteLength);let g;if(c(u)){for(c(u.byteOffset)&&(u.componentType=u.componentType??$.UNSIGNED_SHORT,u.type=nn.SCALAR,r=df(u),u=r.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),g=new Uint16Array(s),h=0,i=0;i<s;++i)g[i]=h,h+=u[i];p+=g.byteLength}c(f)&&c(f.byteOffset)&&(f.componentType=f.componentType??$.UNSIGNED_SHORT,f.type=nn.SCALAR,r=df(f),f=r.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,h),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let x=a[i].length,A=a[i].instances,E=EFe(x,A,n);p+=SFe(E),a[i].instances=xt(E,A)}let y=new Array(m).fill(0),b=new Uint16Array(s);for(i=0;i<s;++i)o=l[i],b[i]=y[o],++y[o];p+=b.byteLength,e._classes=a,e._classIds=l,e._classIndexes=b,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function EFe(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(c(s)){let a=r.componentType,l=r.type;if(!c(a))throw new ae("componentType is required.");if(!c(l))throw new ae("type is required.");if(!c(n))throw new ae(`Property ${o} requires a batch table binary.`);let u=df(r),f=u.componentsPerAttribute,h=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);c(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:h}}}return i}function SFe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var wFe=[];function vFe(e){let t=wFe;t.length=0;let i=e._classIds.length;for(let o=0;o<i;++o)tie(e,o,t)}function tie(e,t,n){let i=e._parentCounts,o=e._parentIds,r=e._parentIndexes,a=e._classIds.length;if(!c(o))return;if(t>=a)throw new C(`Parent index ${t} exceeds the total number of instances: ${a}`);if(n.indexOf(t)>-1)throw new C("Circular dependency detected in the batch table hierarchy.");n.push(t);let l=c(i)?i[t]:1,u=c(i)?r[t]:t;for(let f=0;f<l;++f){let h=o[u+f];h!==t&&tie(e,h,n)}n.pop(t)}var DFe=[],PFe=[],IFe=0;function OFe(e,t,n){let i=e._classIds,o=e._parentCounts,r=e._parentIds,s=e._parentIndexes,a=i.length,l=DFe;l.length=Math.max(l.length,a);let u=++IFe,f=PFe;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),l[t]===u)continue;l[t]=u;let h=n(e,t);if(c(h))return h;let p=o[t],g=s[t];for(let m=0;m<p;++m){let y=r[g+m];y!==t&&f.push(y)}}}function RFe(e,t,n){let i=!0;for(;i;){let o=n(e,t);if(c(o))return o;let r=e._parentIds[t];i=r!==t,t=r}}function ev(e,t,n){let i=e._parentCounts,o=e._parentIds;if(c(o)){if(c(i))return OFe(e,t,n)}else return n(e,t);return RFe(e,t,n)}Ap.prototype.hasProperty=function(e,t){let n=ev(this,e,function(i,o){let r=i._classIds[o],s=i._classes[r].instances;if(c(s[t]))return!0});return c(n)};Ap.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let o=t[i].instances;if(c(o[e]))return!0}return!1};Ap.prototype.getPropertyIds=function(e,t){return t=c(t)?t:[],t.length=0,ev(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o].instances;for(let s in r)r.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};Ap.prototype.getProperty=function(e,t){return ev(this,e,function(n,i){let o=n._classIds[i],r=n._classes[o],s=n._classIndexes[i],a=r.instances[t];if(c(a))return c(a.typedArray)?MFe(a,s):We(a[s],!0)})};function MFe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Ap.prototype.setProperty=function(e,t,n){let i=ev(this,e,function(o,r){let s=o._classIds[r],a=o._classes[s],l=o._classIndexes[r],u=a.instances[t];if(c(u)){if(r!==e)throw new C(`Inherited property "${t}" is read-only.`);return c(u.typedArray)?LFe(u,l,n):u[l]=We(n,!0),!0}});return c(i)};function LFe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}Ap.prototype.isClass=function(e,t){let n=ev(this,e,function(i,o){let r=i._classIds[o];if(i._classes[r].name===t)return!0});return c(n)};Ap.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var fA=Ap;var NFe={HIGHLIGHT:0,REPLACE:1,MIX:2},nu=Object.freeze(NFe);var bj=Tl.DEFAULT_COLOR_VALUE,xj=Tl.DEFAULT_SHOW_VALUE;function po(e,t,n,i,o){this.featuresLength=t;let r;c(n)&&(r=n.extensions),this._extensions=r??{};let s=FFe(n);this._properties=s,this._batchTableHierarchy=BFe(this,n,i);let a=iie(t,s,i);this._binaryPropertiesByteLength=kFe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Tl({featuresLength:t,colorChangedCallback:o,owner:e,statistics:e.tileset.statistics})}po._deprecationWarning=Ns;Object.defineProperties(po.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return c(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function FFe(e){let t={};if(!c(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=We(e[n],!0));return t}function BFe(e,t,n){if(!c(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],o=t.HIERARCHY;if(c(o)&&(po._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=o,i=o),!!c(i))return new fA({extension:i,binaryBody:n})}function iie(e,t,n){let i;for(let o in t)if(t.hasOwnProperty(o)){let r=t[o],s=r.byteOffset;if(c(s)){let a=r.componentType,l=r.type;if(!c(a))throw new ae("componentType is required.");if(!c(l))throw new ae("type is required.");if(!c(n))throw new ae(`Property ${o} requires a batch table binary.`);let u=df(r),f=u.componentsPerAttribute,h=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);c(i)||(i={}),i[o]={typedArray:p,componentCount:f,type:h}}}return i}function kFe(e){if(!c(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}po.getBinaryProperties=function(e,t,n){return iie(e,t,n)};po.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};po.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};po.prototype.getShow=function(e){return this._batchTexture.getShow(e)};po.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};po.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};po.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};po.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var UFe=new G;po.prototype.applyStyle=function(e){if(!c(e)){this.setAllColor(bj),this.setAllShow(xj);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let o=t.getFeature(i),r=c(e.color)?e.color.evaluateColor(o,UFe)??bj:bj,s=c(e.show)?e.show.evaluate(o)??xj:xj;this.setColor(i,r),this.setShow(i,s)}};function VFe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function zFe(e,t,n){let i=e.typedArray,o=e.componentCount;o===1?i[t]=n:e.type.pack(n,i,t*o)}function dA(e,t){if(!c(e)||e<0||e>=t)throw new C(`batchId is required and must be between zero and featuresLength - 1 (${t}`-+").")}po.prototype.isClass=function(e,t){dA(e,this.featuresLength),T.typeOf.string("className",t);let n=this._batchTableHierarchy;return c(n)?n.isClass(e,t):!1};po.prototype.isExactClass=function(e,t){return T.typeOf.string("className",t),this.getExactClassName(e)===t};po.prototype.getExactClassName=function(e){dA(e,this.featuresLength);let t=this._batchTableHierarchy;if(c(t))return t.getClassName(e)};po.prototype.hasProperty=function(e,t){return dA(e,this.featuresLength),T.typeOf.string("name",t),c(this._properties[t])||c(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};po.prototype.hasPropertyBySemantic=function(){return!1};po.prototype.getPropertyIds=function(e,t){dA(e,this.featuresLength),t=c(t)?t:[],t.length=0;let n=Object.keys(this._properties);return t.push.apply(t,n),c(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n)),t};po.prototype.getPropertyBySemantic=function(e,t){};po.prototype.getProperty=function(e,t){if(dA(e,this.featuresLength),T.typeOf.string("name",t),c(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(c(i))return VFe(i,e)}let n=this._properties[t];if(c(n))return We(n[e],!0);if(c(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(c(i))return i}};po.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(dA(e,i),T.typeOf.string("name",t),c(this._batchTableBinaryProperties)){let r=this._batchTableBinaryProperties[t];if(c(r)){zFe(r,e,n);return}}if(c(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let o=this._properties[t];c(o)||(this._properties[t]=new Array(i),o=this._properties[t]),o[e]=We(n,!0)};function HFe(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep;
vec2 computeSt(float batchId)
{
float stepX = tile_textureStep.x;
float centerX = tile_textureStep.y;
return vec2(centerX + (batchId * stepX), 0.5);
}
`:`uniform vec4 tile_textureStep;
uniform vec2 tile_textureDimensions;
vec2 computeSt(float batchId)
{
float stepX = tile_textureStep.x;
float centerX = tile_textureStep.y;
float stepY = tile_textureStep.z;
float centerY = tile_textureStep.w;
float xId = mod(batchId, tile_textureDimensions.x);
float yId = floor(batchId / tile_textureDimensions.x);
return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
}
`}po.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(o){let r=oie(o,n,!1),s;return ut.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand;
`),s+=`uniform sampler2D tile_batchTexture;
out vec4 tile_featureColor;
out vec2 tile_featureSt;
void main()
{
vec2 st = computeSt(${t});
vec4 featureProperties = texture(tile_batchTexture, st);
tile_color(featureProperties);
float show = ceil(featureProperties.a);
gl_Position *= show;
`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0);
if (czm_pass == czm_passTranslucent)
{
if (!isStyleTranslucent && !tile_translucentCommand)
{
gl_Position *= 0.0;
}
}
else
{
if (isStyleTranslucent)
{
gl_Position *= 0.0;
}
}
`),s+=` tile_featureColor = featureProperties;
tile_featureSt = st;
}`):s=`out vec2 tile_featureSt;
void main()
{
tile_color(vec4(1.0));
tile_featureSt = computeSt(${t});
}`,`${r}
${HFe(i)}${s}`}};function nie(e,t){return e=He.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend;
void tile_color(vec4 tile_featureColor)
{
tile_main();
tile_featureColor = czm_gammaCorrect(tile_featureColor);
out_FragColor.a *= tile_featureColor.a;
float highlight = ceil(tile_colorBlend);
out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
}
`:`${e}void tile_color(vec4 tile_featureColor)
{
tile_main();
}
`}function GFe(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let u=o;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){r=u+1;break}}let l=`tile_diffuse_final(${e.slice(o,r)}, tile_diffuse)`;e=e.slice(0,o)+l+e.slice(r),i=o+l.length,o=e.indexOf(n,i)}return e}function oie(e,t,n){if(!c(t))return nie(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),o=e.match(i);if(!c(o))return nie(e,n);let r=o[0],s=o[2];e=He.replaceMain(e,"tile_main"),e=e.replace(r,"");let a=`bool isWhite(vec3 color)
{
return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
}
vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse)
{
vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend);
vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse;
return vec4(diffuse.rgb, sourceDiffuse.a);
}
`,l=` tile_featureColor = czm_gammaCorrect(tile_featureColor);
out_FragColor.a *= tile_featureColor.a;
float highlight = ceil(tile_colorBlend);
out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight);
`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,h=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,h),u=` vec4 source = ${f};
tile_diffuse = tile_diffuse_final(source, tile_featureColor);
tile_main();
`}else s==="sampler2D"&&(e=GFe(e,t),u=` tile_diffuse = tile_featureColor;
tile_main();
`);return e=`uniform float tile_colorBlend;
vec4 tile_diffuse = vec4(1.0);
${a}${r}
${e}
void tile_color(vec4 tile_featureColor)
{
${u}`,n&&(e+=l),e+=`}
`,e}po.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=oie(i,t,!0),ut.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture;
in vec2 tile_featureSt;
in vec4 tile_featureColor;
void main()
{
tile_color(tile_featureColor);
`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a;
`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand;
`),i+=`uniform sampler2D tile_pickTexture;
uniform sampler2D tile_batchTexture;
in vec2 tile_featureSt;
void main()
{
vec4 featureProperties = texture(tile_batchTexture, tile_featureSt);
if (featureProperties.a == 0.0) {
discard;
}
`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0);
if (czm_pass == czm_passTranslucent)
{
if (!isStyleTranslucent && !tile_translucentCommand)
{
discard;
}
}
else
{
if (isStyleTranslucent)
{
discard;
}
}
`),i+=` tile_color(featureProperties);
`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a;
`),i+=`}
`),i}};function jFe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===nu.HIGHLIGHT)return 0;if(n===nu.REPLACE)return 1;if(n===nu.MIX)return O.clamp(i,O.EPSILON4,1);throw new C(`Invalid color blend mode "${n}".`)}po.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return xt(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return jFe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};po.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var ag={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};po.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,l=WFe(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===De.COMPUTE)continue;let h=f.derivedCommands.tileset;(!c(h)||f.dirty)&&(h={},f.derivedCommands.tileset=h,h.originalCommand=qFe(f),f.dirty=!1);let p=h.originalCommand;l!==ag.ALL_OPAQUE&&f.pass!==De.TRANSLUCENT&&(c(h.translucent)||(h.translucent=YFe(p))),l!==ag.ALL_TRANSLUCENT&&f.pass!==De.TRANSLUCENT&&(c(h.opaque)||(h.opaque=XFe(p)),a&&(r||(c(h.zback)||(h.zback=$Fe(e.context,p)),s._backfaceCommands.push(h.zback)),(!c(h.stencil)||o._selectionDepth!==QFe(h.stencil))&&(f.renderState.depthMask?h.stencil=ZFe(p,o._selectionDepth):h.stencil=h.opaque)));let g=a?h.stencil:h.opaque,m=h.translucent;f.pass!==De.TRANSLUCENT?(l===ag.ALL_OPAQUE&&(n[u]=g),l===ag.ALL_TRANSLUCENT&&(n[u]=m),l===ag.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function WFe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?ag.ALL_OPAQUE:t===e.featuresLength?ag.ALL_TRANSLUCENT:ag.OPAQUE_AND_TRANSLUCENT}function qFe(e){let t=Je.shallowClone(e),n=t.pass===De.TRANSLUCENT;return t.uniformMap=c(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function YFe(e){let t=Je.shallowClone(e);return t.pass=De.TRANSLUCENT,t.renderState=JFe(e.renderState),t}function XFe(e){let t=Je.shallowClone(e);return t.renderState=e2e(e.renderState),t}function KFe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!c(n)){let i=t.fragmentShaderSource.clone();i.defines=c(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function $Fe(e,t){let n=Je.shallowClone(t),i=We(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Ti.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=kt.setCesium3DTileBit(),i.stencilMask=kt.CESIUM_3D_TILE_MASK,n.renderState=ze.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=We(t.uniformMap);let o=new z(5,5);return n.uniformMap.u_polygonOffset=function(){return o},n.shaderProgram=KFe(e,t.shaderProgram),n}function ZFe(e,t){let n=Je.shallowClone(e),i=We(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=kt.SKIP_LOD_MASK,i.stencilTest.reference=kt.CESIUM_3D_TILE_MASK|t<<kt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=ft.REPLACE,i.stencilTest.backFunction=Vn.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=ft.REPLACE,i.stencilMask=kt.CESIUM_3D_TILE_MASK|kt.SKIP_LOD_MASK,n.renderState=ze.fromCache(i),n}function QFe(e){return(e.renderState.stencilTest.reference&kt.SKIP_LOD_MASK)>>>kt.SKIP_LOD_BIT_SHIFT}function JFe(e){let t=We(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=un.ALPHA_BLEND,t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,ze.fromCache(t)}function e2e(e){let t=We(e,!0);return t.stencilTest=kt.setCesium3DTileBit(),t.stencilMask=kt.CESIUM_3D_TILE_MASK,ze.fromCache(t)}po.prototype.update=function(e,t){this._batchTexture.update(e,t)};po.prototype.isDestroyed=function(){return!1};po.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),de(this)};var cg=po;function t2e(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var Cp=t2e;var tv=`in vec3 position;
in float a_batchId;
uniform mat4 u_modifiedModelViewProjection;
void main()
{
gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0));
}
`;function hf(e,t){this._content=e,this._batchId=t,this._color=void 0}Object.defineProperties(hf.prototype,{show:{get:function(){return this._content.batchTable.getShow(this._batchId)},set:function(e){this._content.batchTable.setShow(this._batchId,e)}},color:{get:function(){return c(this._color)||(this._color=new G),this._content.batchTable.getColor(this._batchId,this._color)},set:function(e){this._content.batchTable.setColor(this._batchId,e)}},polylinePositions:{get:function(){if(c(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},featureId:{get:function(){return this._batchId}},pickId:{get:function(){return this._content.batchTable.getPickColor(this._batchId)}}});hf.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};hf.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};hf.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};hf.getPropertyInherited=function(e,t,n){let i=e.batchTable;if(c(i)){if(i.hasPropertyBySemantic(t,n))return i.getPropertyBySemantic(t,n);if(i.hasProperty(t,n))return i.getProperty(t,n)}let o=e.metadata;if(c(o)){if(o.hasPropertyBySemantic(n))return o.getPropertyBySemantic(n);if(o.hasProperty(n))return o.getProperty(n)}let r=e.tile,s=r.metadata;if(c(s)){if(s.hasPropertyBySemantic(n))return s.getPropertyBySemantic(n);if(s.hasProperty(n))return s.getProperty(n)}let a;if(c(r.implicitSubtree)&&(a=r.implicitSubtree.metadata),c(a)){if(a.hasPropertyBySemantic(n))return a.getPropertyBySemantic(n);if(a.hasProperty(n))return a.getProperty(n)}let l=c(e.group)?e.group.metadata:void 0;if(c(l)){if(l.hasPropertyBySemantic(n))return l.getPropertyBySemantic(n);if(l.hasProperty(n))return l.getProperty(n)}let u=e.tileset.metadata;if(c(u)){if(u.hasPropertyBySemantic(n))return u.getPropertyBySemantic(n);if(u.hasProperty(n))return u.getProperty(n)}};hf.prototype.getPropertyInherited=function(e){return hf.getPropertyInherited(this._content,this._batchId,e)};hf.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};hf.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};hf.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};hf.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var ta=hf;var Tj=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},Aj=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},Al=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,s,a,l,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},u=n;let f=h=>r.right_a&&h.right_a?i>h.prec:i<=h.prec;for(;o.length>2&&f(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),o.push(r,t)}for(l=o.length-1,t=o[l];l>1;)t={type:e.BINARY_EXP,operator:o[l-1].value,left:o[l-2],right:t},l-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=`
`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===e.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<o;s++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},n2e=new Tj;Object.assign(Al,{hooks:n2e,plugins:new Aj(Al),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Al.max_unop_len=Al.getMaxKeyLen(Al.unary_ops);Al.max_binop_len=Al.getMaxKeyLen(Al.binary_ops);var lg=e=>new Al(e).parse(),i2e=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Al).filter(e=>!i2e.includes(e)&&lg[e]===void 0).forEach(e=>{lg[e]=Al[e]});lg.Jsep=Al;var o2e="ConditionalExpression",r2e={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:o2e,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};lg.plugins.register(r2e);var s2e={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18},_t=Object.freeze(s2e);function yd(e,t){T.typeOf.string("expression",e),this._expression=e,e=b2e(e,t),e=T2e(x2e(e)),lg.addBinaryOp("=~",0),lg.addBinaryOp("!~",0);let n;try{n=lg(e)}catch(i){throw new ae(i)}this._runtimeAst=Ai(this,n)}Object.defineProperties(yd.prototype,{expression:{get:function(){return this._expression}}});var On={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new z],cartesian3Array:[new d],cartesian4Array:[new se],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new z),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new d),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};yd.prototype.evaluate=function(e,t){On.reset();let n=this._runtimeAst.evaluate(e);return t instanceof G&&n instanceof se?G.fromCartesian4(n,t):n instanceof z||n instanceof d||n instanceof se?n.clone(t):n};yd.prototype.evaluateColor=function(e,t){On.reset();let n=this._runtimeAst.evaluate(e);return G.fromCartesian4(n,t)};yd.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e}
{
return ${o};
}
`,o};yd.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};yd.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var a2e=["!","-","+"],rie=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],nv=/\${(.*?)}/g,c2e=/\\/g,l2e="@#%",u2e=/@#%/g,gN=new G,yN={abs:Fs(Math.abs),sqrt:Fs(Math.sqrt),cos:Fs(Math.cos),sin:Fs(Math.sin),tan:Fs(Math.tan),acos:Fs(Math.acos),asin:Fs(Math.asin),atan:Fs(Math.atan),radians:Fs(O.toRadians),degrees:Fs(O.toDegrees),sign:Fs(O.sign),floor:Fs(Math.floor),ceil:Fs(Math.ceil),round:Fs(Math.round),exp:Fs(Math.exp),exp2:Fs(d2e),log:Fs(Math.log),log2:Fs(h2e),fract:Fs(f2e),length:m2e,normalize:p2e},bN={atan2:pN(Math.atan2,!1),pow:pN(Math.pow,!1),min:pN(Math.min,!0),max:pN(Math.max,!0),distance:_2e,dot:g2e,cross:y2e},Sj={clamp:sie(O.clamp,!0),mix:sie(O.lerp,!0)};function f2e(e){return e-Math.floor(e)}function d2e(e){return Math.pow(2,e)}function h2e(e){return O.log2(e)}function Fs(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof z)return z.fromElements(e(n.x),e(n.y),On.getCartesian2());if(n instanceof d)return d.fromElements(e(n.x),e(n.y),e(n.z),On.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),On.getCartesian4());throw new ae(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function pN(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof z)return z.fromElements(e(i.x,o),e(i.y,o),On.getCartesian2());if(i instanceof d)return d.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),On.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),On.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof z&&o instanceof z)return z.fromElements(e(i.x,o.x),e(i.y,o.y),On.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),On.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),On.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function sie(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof z&&o instanceof z)return z.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),On.getCartesian2());if(i instanceof d&&o instanceof d)return d.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),On.getCartesian3());if(i instanceof se&&o instanceof se)return se.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),On.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof z&&o instanceof z&&r instanceof z)return z.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),On.getCartesian2());if(i instanceof d&&o instanceof d&&r instanceof d)return d.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),On.getCartesian3());if(i instanceof se&&o instanceof se&&r instanceof se)return se.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),On.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function m2e(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof z)return z.magnitude(t);if(t instanceof d)return d.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function p2e(e,t){if(typeof t=="number")return 1;if(t instanceof z)return z.normalize(t,On.getCartesian2());if(t instanceof d)return d.normalize(t,On.getCartesian3());if(t instanceof se)return se.normalize(t,On.getCartesian4());throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function _2e(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof z&&n instanceof z)return z.distance(t,n);if(t instanceof d&&n instanceof d)return d.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function g2e(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof z&&n instanceof z)return z.dot(t,n);if(t instanceof d&&n instanceof d)return d.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function y2e(e,t,n){if(t instanceof d&&n instanceof d)return d.cross(t,n,On.getCartesian3());throw new ae(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Tt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,O2e(this)}function b2e(e,t){if(!c(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;c(o)&&(e=e.replace(i,o))}return e}function x2e(e){return e.replace(c2e,l2e)}function Ej(e){return e.replace(u2e,"\\")}function T2e(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o<i)s=t.indexOf("'",o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(r>=0&&r<i)s=t.indexOf('"',r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new ae("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function A2e(e){let t=typeof e.value;if(e.value===null)return new Tt(_t.LITERAL_NULL,null);if(t==="boolean")return new Tt(_t.LITERAL_BOOLEAN,e.value);if(t==="number")return new Tt(_t.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Tt(_t.VARIABLE_IN_STRING,e.value):new Tt(_t.LITERAL_STRING,Ej(e.value))}function C2e(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let l=t.callee.object;if(o==="test"||o==="exec"){if(!c(l.callee)||l.callee.name!=="regExp")throw new ae(`${o} is not a function.`);return i===0?o==="test"?new Tt(_t.LITERAL_BOOLEAN,!1):new Tt(_t.LITERAL_NULL,null):(s=Ai(e,l),a=Ai(e,n[0]),new Tt(_t.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=Ai(e,l),new Tt(_t.FUNCTION_CALL,o,r);throw new ae(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Tt(_t.LITERAL_COLOR,o);if(r=Ai(e,n[0]),c(n[1])){let l=Ai(e,n[1]);return new Tt(_t.LITERAL_COLOR,o,[r,l])}return new Tt(_t.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ae(`${o} requires three arguments.`);return r=[Ai(e,n[0]),Ai(e,n[1]),Ai(e,n[2])],new Tt(_t.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ae(`${o} requires four arguments.`);return r=[Ai(e,n[0]),Ai(e,n[1]),Ai(e,n[2]),Ai(e,n[3])],new Tt(_t.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let l=0;l<i;++l)r[l]=Ai(e,n[l]);return new Tt(_t.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Tt(_t.LITERAL_BOOLEAN,!0):new Tt(_t.LITERAL_BOOLEAN,!1):(r=Ai(e,n[0]),new Tt(_t.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new ae(`${o} requires exactly one argument.`);return r=Ai(e,n[0]),new Tt(_t.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ae(`${o} does not take any argument.`);return new Tt(_t.UNARY,o)}else if(c(yN[o])){if(i!==1)throw new ae(`${o} requires exactly one argument.`);return r=Ai(e,n[0]),new Tt(_t.UNARY,o,r)}else if(c(bN[o])){if(i!==2)throw new ae(`${o} requires exactly two arguments.`);return s=Ai(e,n[0]),a=Ai(e,n[1]),new Tt(_t.BINARY,o,s,a)}else if(c(Sj[o])){if(i!==3)throw new ae(`${o} requires exactly three arguments.`);s=Ai(e,n[0]),a=Ai(e,n[1]);let l=Ai(e,n[2]);return new Tt(_t.TERNARY,o,s,a,l)}else{if(o==="Boolean")return i===0?new Tt(_t.LITERAL_BOOLEAN,!1):(r=Ai(e,n[0]),new Tt(_t.UNARY,o,r));if(o==="Number")return i===0?new Tt(_t.LITERAL_NUMBER,0):(r=Ai(e,n[0]),new Tt(_t.UNARY,o,r));if(o==="String")return i===0?new Tt(_t.LITERAL_STRING,""):(r=Ai(e,n[0]),new Tt(_t.UNARY,o,r));if(o==="regExp")return E2e(e,t)}}throw new ae(`Unexpected function call "${o}".`)}function E2e(e,t){let n=t.arguments;if(n.length===0)return new Tt(_t.LITERAL_REGEX,new RegExp);let i=Ai(e,n[0]),o;if(n.length>1){let r=Ai(e,n[1]);if(Cj(i)&&Cj(r)){try{o=new RegExp(Ej(String(i._value)),r._value)}catch(s){throw new ae(s)}return new Tt(_t.LITERAL_REGEX,o)}return new Tt(_t.REGEX,i,r)}if(Cj(i)){try{o=new RegExp(Ej(String(i._value)))}catch(r){throw new ae(r)}return new Tt(_t.LITERAL_REGEX,o)}return new Tt(_t.REGEX,i)}function S2e(e){if(P2e(e.name)){let t=I2e(e.name);return t.substr(0,8)==="tiles3d_"?new Tt(_t.BUILTIN_VARIABLE,t):new Tt(_t.VARIABLE,t)}else{if(e.name==="NaN")return new Tt(_t.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Tt(_t.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Tt(_t.LITERAL_UNDEFINED,void 0)}throw new ae(`${e.name} is not defined.`)}function w2e(e){let t=e.property.name;if(t==="PI")return new Tt(_t.LITERAL_NUMBER,Math.PI);if(t==="E")return new Tt(_t.LITERAL_NUMBER,Math.E)}function v2e(e){if(e.property.name==="POSITIVE_INFINITY")return new Tt(_t.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function D2e(e,t){if(t.object.name==="Math")return w2e(t);if(t.object.name==="Number")return v2e(t);let n,i=Ai(e,t.object);return t.computed?(n=Ai(e,t.property),new Tt(_t.MEMBER,"brackets",i,n)):(n=new Tt(_t.LITERAL_STRING,t.property.name),new Tt(_t.MEMBER,"dot",i,n))}function Cj(e){return e._type>=_t.LITERAL_NULL}function P2e(e){return e.substr(0,4)==="czm_"}function I2e(e){return e.substr(4)}function Ai(e,t){let n,i,o,r;if(t.type==="Literal")n=A2e(t);else if(t.type==="CallExpression")n=C2e(e,t);else if(t.type==="Identifier")n=S2e(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Ai(e,t.argument);if(a2e.indexOf(i)>-1)n=new Tt(_t.UNARY,i,s);else throw new ae(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=Ai(e,t.left),r=Ai(e,t.right),rie.indexOf(i)>-1)n=new Tt(_t.BINARY,i,o,r);else throw new ae(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=Ai(e,t.left),r=Ai(e,t.right),rie.indexOf(i)>-1&&(n=new Tt(_t.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=Ai(e,t.test);o=Ai(e,t.consequent),r=Ai(e,t.alternate),n=new Tt(_t.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=D2e(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Ai(e,t.elements[a]);n=new Tt(_t.ARRAY,s)}else throw t.type==="Compound"?new ae("Provide exactly one expression."):new ae("Cannot parse expression.");return n}function O2e(e){e._type===_t.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===_t.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===_t.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:c(yN[e._value])&&(e.evaluate=M2e(e._value)):e._type===_t.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:c(bN[e._value])&&(e.evaluate=L2e(e._value)):e._type===_t.TERNARY?e.evaluate=N2e(e._value):e._type===_t.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===_t.ARRAY?e.evaluate=e._evaluateArray:e._type===_t.VARIABLE?e.evaluate=e._evaluateVariable:e._type===_t.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===_t.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===_t.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===_t.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===_t.REGEX?e.evaluate=e._evaluateRegExp:e._type===_t.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=R2e):e.evaluate=e._evaluateLiteral}function R2e(e){return c(e)?e.content.tileset.timeSinceLoad:0}function M2e(e){let t=yN[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function L2e(e){let t=bN[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function N2e(e){let t=Sj[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function xN(e,t){if(c(e))return e.getPropertyInherited(t)}Tt.prototype._evaluateLiteral=function(){return this._value};Tt.prototype._evaluateLiteralColor=function(e){let t=gN,n=this._left;if(this._value==="color")c(n)?n.length>1?(G.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):G.fromCssColorString(n[0].evaluate(e),t):G.fromBytes(255,255,255,255,t);else if(this._value==="rgb")G.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;G.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?G.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&G.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,On.getCartesian4())};Tt.prototype._evaluateLiteralVector=function(e){let t=On.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let l=i[a].evaluate(e);if(typeof l=="number")t.push(l);else if(l instanceof z)t.push(l.x,l.y);else if(l instanceof d)t.push(l.x,l.y,l.z);else if(l instanceof se)t.push(l.x,l.y,l.z,l.w);else throw new ae(`${n} argument must be a vector or number. Argument is ${l}.`)}let r=t.length,s=parseInt(n.charAt(3));if(r===0)throw new ae(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new ae(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new ae(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return z.fromArray(t,0,On.getCartesian2());if(n==="vec3")return d.fromArray(t,0,On.getCartesian3());if(n==="vec4")return se.fromArray(t,0,On.getCartesian4())};Tt.prototype._evaluateLiteralString=function(){return this._value};Tt.prototype._evaluateVariableString=function(e){let t=this._value,n=nv.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=xN(e,o);c(r)||(r=""),t=t.replace(i,r),nv.lastIndex+=r.length-i.length,n=nv.exec(t)}return t};Tt.prototype._evaluateVariable=function(e){return xN(e,this._value)};function ob(e){return e._value==="feature"}Tt.prototype._evaluateMemberDot=function(e){if(ob(this._left))return xN(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!c(t))return;let n=this._right.evaluate(e);if(t instanceof z||t instanceof d||t instanceof se){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Tt.prototype._evaluateMemberBrackets=function(e){if(ob(this._left))return xN(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!c(t))return;let n=this._right.evaluate(e);if(t instanceof z||t instanceof d||t instanceof se){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Tt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Tt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Tt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof z)return z.negate(t,On.getCartesian2());if(t instanceof d)return d.negate(t,On.getCartesian3());if(t instanceof se)return se.negate(t,On.getCartesian4());if(typeof t=="number")return-t;throw new ae(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Tt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof z||t instanceof d||t instanceof se||typeof t=="number"))throw new ae(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Tt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Tt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Tt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Tt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Tt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ae(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Tt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ae(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Tt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.add(t,n,On.getCartesian2());if(n instanceof d&&t instanceof d)return d.add(t,n,On.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,On.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new ae(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.subtract(t,n,On.getCartesian2());if(n instanceof d&&t instanceof d)return d.subtract(t,n,On.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,On.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new ae(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.multiplyComponents(t,n,On.getCartesian2());if(n instanceof z&&typeof t=="number")return z.multiplyByScalar(n,t,On.getCartesian2());if(t instanceof z&&typeof n=="number")return z.multiplyByScalar(t,n,On.getCartesian2());if(n instanceof d&&t instanceof d)return d.multiplyComponents(t,n,On.getCartesian3());if(n instanceof d&&typeof t=="number")return d.multiplyByScalar(n,t,On.getCartesian3());if(t instanceof d&&typeof n=="number")return d.multiplyByScalar(t,n,On.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,On.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,On.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,On.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new ae(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.divideComponents(t,n,On.getCartesian2());if(t instanceof z&&typeof n=="number")return z.divideByScalar(t,n,On.getCartesian2());if(n instanceof d&&t instanceof d)return d.divideComponents(t,n,On.getCartesian3());if(t instanceof d&&typeof n=="number")return d.divideByScalar(t,n,On.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,On.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,On.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new ae(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof z&&t instanceof z)return z.fromElements(t.x%n.x,t.y%n.y,On.getCartesian2());if(n instanceof d&&t instanceof d)return d.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,On.getCartesian3());if(n instanceof se&&t instanceof se)return se.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,On.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new ae(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof z&&t instanceof z||n instanceof d&&t instanceof d||n instanceof se&&t instanceof se?t.equals(n):t===n};Tt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof z&&t instanceof z||n instanceof d&&t instanceof d||n instanceof se&&t instanceof se?!t.equals(n):t!==n};Tt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new ae(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Tt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Tt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Tt.prototype._evaluateIsExactClass=function(e){return c(e)?e.isExactClass(this._left.evaluate(e)):!1};Tt.prototype._evaluateIsClass=function(e){return c(e)?e.isClass(this._left.evaluate(e)):!1};Tt.prototype._evaluateGetExactClassName=function(e){if(c(e))return e.getExactClassName()};Tt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Tt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Tt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Tt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";c(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new ae(o)}return i};Tt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ae(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Tt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new ae(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new ae(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Tt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ae(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return c(i)?i[1]:null};Tt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof z||t instanceof d||t instanceof se)return String(t);throw new ae(`Unexpected function call "${this._value}".`)};function aie(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==_t.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return G.fromHsl(i,o,r,s,gN)}function cie(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==_t.LITERAL_NUMBER)return;let i=gN;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function ug(e){return e%1===0?e.toFixed(1):e.toString()}function F2e(e){let t=ug(e.red),n=ug(e.green),i=ug(e.blue);return`vec3(${t}, ${n}, ${i})`}function _N(e){let t=ug(e.red),n=ug(e.green),i=ug(e.blue),o=ug(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function lie(e,t,n,i){let o=e.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=e[s].getShaderExpression(t,n,i);return r}function uie(e,t){return c(t[e])?t[e]:yd.NULL_SENTINEL}yd.NULL_SENTINEL="czm_infinity";Tt.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,l=this._value;c(this._left)&&(Array.isArray(this._left)?o=lie(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),c(this._right)&&(r=this._right.getShaderExpression(e,t,this)),c(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(l=lie(this._value,e,t,this));let u,f,h;switch(a){case _t.VARIABLE:return ob(this)?void 0:uie(l,e);case _t.UNARY:if(l==="Boolean")return`bool(${o})`;if(l==="Number")return`float(${o})`;if(l==="round")return`floor(${o} + 0.5)`;if(c(yN[l]))return`${l}(${o})`;if(l==="isNaN")return`(${o} != ${o})`;if(l==="isFinite")return`(abs(${o}) < czm_infinity)`;if(l==="String"||l==="isExactClass"||l==="isClass"||l==="getExactClassName")throw new ae(`Error generating style shader: "${l}" is not supported.`);return l+o;case _t.BINARY:return l==="%"?`mod(${o}, ${r})`:l==="==="?`(${o} == ${r})`:l==="!=="?`(${o} != ${r})`:l==="atan2"?`atan(${o}, ${r})`:c(bN[l])?`${l}(${o}, ${r})`:`(${o} ${l} ${r})`;case _t.TERNARY:if(c(Sj[l]))return`${l}(${o}, ${r}, ${s})`;break;case _t.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case _t.MEMBER:return ob(this._left)?uie(r,e):r==="r"||r==="x"||r==="0.0"?`${o}[0]`:r==="g"||r==="y"||r==="1.0"?`${o}[1]`:r==="b"||r==="z"||r==="2.0"?`${o}[2]`:r==="a"||r==="w"||r==="3.0"?`${o}[3]`:`${o}[int(${r})]`;case _t.FUNCTION_CALL:throw new ae(`Error generating style shader: "${l}" is not supported.`);case _t.ARRAY:if(l.length===4)return`vec4(${l[0]}, ${l[1]}, ${l[2]}, ${l[3]})`;if(l.length===3)return`vec3(${l[0]}, ${l[1]}, ${l[2]})`;if(l.length===2)return`vec2(${l[0]}, ${l[1]})`;throw new ae("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case _t.REGEX:throw new ae("Error generating style shader: Regular expressions are not supported.");case _t.VARIABLE_IN_STRING:throw new ae("Error generating style shader: Converting a variable to a string is not supported.");case _t.LITERAL_NULL:return yd.NULL_SENTINEL;case _t.LITERAL_BOOLEAN:return l?"true":"false";case _t.LITERAL_NUMBER:return ug(l);case _t.LITERAL_STRING:if(c(n)&&n._type===_t.MEMBER&&(l==="r"||l==="g"||l==="b"||l==="a"||l==="x"||l==="y"||l==="z"||l==="w"||ob(n._left)))return l;if(i=G.fromCssColorString(l,gN),c(i))return F2e(i);throw new ae("Error generating style shader: String literals are not supported.");case _t.LITERAL_COLOR:if(u=o,l==="color"){if(c(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(l==="rgb")return i=cie(this),c(i)?_N(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(l==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=cie(this),c(i)?_N(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(l==="hsl")return i=aie(this),c(i)?_N(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(l==="hsla")return i=aie(this),c(i)?(i.alpha!==1&&(t.translucent=!0),_N(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case _t.LITERAL_VECTOR:if(!c(o))throw new C("left should always be defined for type ExpressionNodeType.LITERAL_VECTOR");f=o.length,h=`${l}(`;for(let p=0;p<f;++p)h+=o[p],p<f-1&&(h+=", ");return h+=")",h;case _t.LITERAL_REGEX:throw new ae("Error generating style shader: Regular expressions are not supported.");case _t.LITERAL_UNDEFINED:return yd.NULL_SENTINEL;case _t.BUILTIN_VARIABLE:if(l==="tiles3d_tileset_time")return l}};Tt.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(c(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);else this._left.getVariables(e,this);if(c(this._right)&&this._right.getVariables(e,this),c(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);let a;switch(r){case _t.VARIABLE:ob(this)||e.push(s);break;case _t.VARIABLE_IN_STRING:for(a=nv.exec(s);a!==null;)e.push(a[1]),a=nv.exec(s);break;case _t.LITERAL_STRING:c(t)&&t._type===_t.MEMBER&&ob(t._left)&&e.push(s);break}};var bd=yd;function Ep(e){e=e??W.EMPTY_OBJECT,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=e.center??d.ZERO,this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=G.clone(G.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=e.classificationType??Un.BOTH,this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(Ep.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var B2e={position:0,a_batchId:1};function k2e(e,t){if(c(e._va))return;let n=bt.createVertexBuffer({context:t,typedArray:e._positions,usage:Be.STATIC_DRAW}),i=bt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Be.STATIC_DRAW}),o=bt.createIndexBuffer({context:t,typedArray:e._indices,usage:Be.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:$.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:$.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new ni({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new ni({context:t,attributes:r,indexBuffer:bt.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Be.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function U2e(e,t){if(c(e._sp))return;let n=e._batchTable,i=e._attributeLocations??B2e,o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(c(r)){e._sp=en.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=He.replaceMain(s,"czm_non_pick_main"),s=`${s}void main()
{
czm_non_pick_main();
out_FragColor = ${o};
}
`,e._spPick=en.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(tv),l=n.getFragmentShaderCallback(!1,void 0,!0)(Y0);o=n.getPickId();let u=new He({sources:[a]}),f=new He({defines:["VECTOR_TILE"],sources:[l]});e._sp=en.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new He({sources:[tv]}),f=new He({defines:["VECTOR_TILE"],sources:[Y0]}),e._spStencil=en.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),l=He.replaceMain(l,"czm_non_pick_main"),l=`${l}
void main()
{
czm_non_pick_main();
out_FragColor = ${o};
}
`;let h=new He({sources:[a]}),p=new He({defines:["VECTOR_TILE"],sources:[l]});e._spPick=en.fromCache({context:t,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:i})}function fie(e){let t=e?Vn.EQUAL:Vn.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:t,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Dc.LESS_OR_EQUAL},depthMask:!1}}var V2e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},z2e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function H2e(e){c(e._rsStencilDepthPass)||(e._rsStencilDepthPass=ze.fromCache(fie(!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(fie(!0)),e._rsColorPass=ze.fromCache(V2e),e._rsPickPass=ze.fromCache(z2e))}var rb=new F,die=new d;function G2e(e,t){if(c(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return F.clone(i,rb),F.multiplyByPoint(rb,e._center,die),F.setTranslation(rb,die,rb),F.multiply(o,rb,rb),rb},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function wj(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,l=r.length;for(let u=0;u<l;++u){let f=r[u],h=s[f],p=i[h],g=o[h],m=new e.constructor(e.buffer,a*p,g);t.set(m,n),i[h]=n,n+=g}return n}function j2e(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),l=[a],u=wj(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(G.equals(f.color,a.color))u=wj(n,s,u,i,o,f.batchIds,r),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let h=u;u=wj(n,s,u,i,o,f.batchIds,r),f.offset=h,f.count=u-h,l.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=l}function vj(e,t,n,i,o,r,s){let a=e.bytesPerIndex,l=r.length;for(let u=0;u<l;++u){let f=r[u],h=s[f],p=i[h],g=o[h];t.copyFromBuffer(e,p*a,n*a,g*a),i[h]=n,n+=g}return n}function W2e(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,l=e._vaSwap.indexBuffer,u=vj(a,l,0,n,i,r.batchIds,o);for(r.offset=0,r.count=u;t.length>0;){let h=t.pop();if(G.equals(h.color,r.color))u=vj(a,l,u,n,i,h.batchIds,o),r.batchIds=r.batchIds.concat(h.batchIds),r.count=u-r.offset;else{let p=u;u=vj(a,l,u,n,i,h.batchIds,o),h.offset=p,h.count=u-p,s.push(h),r=h}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function q2e(e,t){return t.color.toRgba()-e.color.toRgba()}function Y2e(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s<i;++s){let l=n[s].color.toRgba();if(c(r[l])){o=!0;break}else r[l]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(q2e),t.webgl2?W2e(e,n):j2e(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function X2e(e,t){let n=Y2e(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(c(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,l=e._sp,u=e._modelMatrix??F.IDENTITY,f=e._uniformMap,h=e._boundingVolume;for(let p=0;p<r;++p){let g=o[p].offset,m=o[p].count,y=i[p*2];c(y)||(y=i[p*2]=new Je({owner:e})),y.vertexArray=a,y.modelMatrix=u,y.offset=g,y.count=m,y.renderState=e._rsStencilDepthPass,y.shaderProgram=l,y.uniformMap=f,y.boundingVolume=h,y.cull=!1,y.pass=De.TERRAIN_CLASSIFICATION;let b=Je.shallowClone(y,y.derivedCommands.tileset);b.renderState=e._rsStencilDepthPass3DTiles,b.pass=De.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=b;let x=i[p*2+1];c(x)||(x=i[p*2+1]=new Je({owner:e})),x.vertexArray=a,x.modelMatrix=u,x.offset=g,x.count=m,x.renderState=e._rsColorPass,x.shaderProgram=l,x.uniformMap=f,x.boundingVolume=h,x.cull=!1,x.pass=De.TERRAIN_CLASSIFICATION;let A=Je.shallowClone(x,x.derivedCommands.tileset);A.pass=De.CESIUM_3D_TILE_CLASSIFICATION,x.derivedCommands.tileset=A}e._commandsDirty=!0}function K2e(e,t){if(e.classificationType===Un.TERRAIN||!t.invertClassification||c(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,s=i.length=r/2,a=0;for(let l=0;l<s;++l){let u=i[l]=Je.shallowClone(n[a],i[l]);u.shaderProgram=o,u.pass=De.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function $2e(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,o=e._spStencil,r=e._spPick,s=e._modelMatrix??F.IDENTITY,a=e._uniformMap;for(let l=0;l<t;++l){let u=e._indexOffsets[l],f=e._indexCounts[l],h=c(e._boundingVolumes)?e._boundingVolumes[l]:e.boundingVolume,p=n[l*2];c(p)||(p=n[l*2]=new Je({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=h,p.pass=De.TERRAIN_CLASSIFICATION;let g=Je.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=De.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let m=n[l*2+1];c(m)||(m=n[l*2+1]=new Je({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=r,m.uniformMap=a,m.boundingVolume=h,m.pass=De.TERRAIN_CLASSIFICATION;let y=Je.shallowClone(m,m.derivedCommands.tileset);y.pass=De.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=y}e._pickCommandsDirty=!1}Ep.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new ta(e,r)}};Ep.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Z2e(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let s=n[o],a=t[s];a.show=!0,a.color=G.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=G.clone(G.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var Q2e=new G,J2e=G.WHITE,eBe=!0,tBe=/\$/;Ep.prototype.applyStyle=function(e,t){if(!c(e)){Z2e(this,t);return}let n=e.color,i=n instanceof bd&&!tBe.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],l=t[a];l.color=c(e.color)?e.color.evaluateColor(l,Q2e):J2e,l.show=c(e.show)?e.show.evaluate(l):eBe}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=G.clone(G.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};Ep.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!c(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],l=this._batchedIndices,u=l.length,f;for(f=0;f<u;++f){let y=l[f].offset,b=l[f].count;if(s>=y&&s<y+b)break}l.push(new Cp({color:G.clone(t),offset:s,count:a,batchIds:[e]}));let h=[],p=[],g=l[f].batchIds,m=g.length;for(let y=0;y<m;++y){let b=g[y];if(b===e)continue;let x=n[b];o[x]<s?h.push(b):p.push(b)}p.length!==0&&l.push(new Cp({color:G.clone(l[f].color),offset:s+a,count:l[f].offset+l[f].count-(s+a),batchIds:p})),h.length!==0?(l[f].count=s-l[f].offset,l[f].batchIds=h):l.splice(f,1),this._batchDirty=!0};function hie(e,t,n,i){let o=e.classificationType,r=o!==Un.CESIUM_3D_TILE,s=o!==Un.TERRAIN,a=t.commandList,l=n.length,u,f;for(f=0;f<l;++f)r&&(u=n[f],u.pass=De.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=De.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!c(i)))for(l=i.length,f=0;f<l;++f)a.push(i[f])}function nBe(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=De.OPAQUE,n.push(r)}}function iBe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;c(e._rsWireframe)||(e._rsWireframe=ze.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Me.LINES):(n=e._rsColorPass,i=Me.TRIANGLES);let o=e._commands,r=o.length;for(let s=0;s<r;s+=2){let a=o[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}Ep.prototype.update=function(e){let t=e.context;k2e(this,t),U2e(this,t),H2e(this),G2e(this,t);let n=e.passes;n.render&&(X2e(this,t),K2e(this,e),iBe(this),this._debugWireframe?nBe(e,this._commands):hie(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&($2e(this),hie(this,e,this._pickCommands))};Ep.prototype.isDestroyed=function(){return!1};Ep.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),de(this)};var hA=Ep;function iu(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,c(this._center)||(c(this._boundingVolume)?this._center=d.clone(this._boundingVolume.center):this._center=d.clone(d.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Un.BOTH}Object.defineProperties(iu.prototype,{trianglesLength:{get:function(){return c(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return c(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});iu.packedBoxLength=F.packedLength+d.packedLength;iu.packedCylinderLength=F.packedLength+2;iu.packedEllipsoidLength=F.packedLength+d.packedLength;iu.packedSphereLength=d.packedLength+1;function oBe(e){let t=new Float64Array(F.packedLength+d.packedLength),n=0;return d.pack(e._center,t,n),n+=d.packedLength,F.pack(e._modelMatrix,t,n),t}function rBe(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let l=0;l<o;++l)r[l]=le.unpack(t,n),n+=le.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let l=0;l<s;++l){let u=G.unpack(t,n);n+=G.packedLength;let f=t[n++],h=t[n++],p=t[n++],g=new Array(p);for(let m=0;m<p;++m)g[m]=t[n++];a[l]=new Cp({color:u,offset:f,count:h,batchIds:g})}return i}var sBe=new bi("createVectorTileGeometries",5),aBe=new G;function cBe(e){if(!c(e._primitive)&&!c(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,l=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!c(u)){let m=0;c(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),c(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),m+=o.length),c(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),c(e._spheres)&&(a=e._sphere=a.slice(),l=e._sphereBatchIds=l.slice(),m+=l.length),u=e._batchTableColors=new Uint32Array(m);let y=e._batchTable;for(let b=0;b<m;++b){let x=y.getColor(b,aBe);u[b]=x.toRgba()}f=e._packedBuffer=oBe(e)}let h=[];c(t)&&h.push(t.buffer,n.buffer),c(i)&&h.push(i.buffer,o.buffer),c(r)&&h.push(r.buffer,s.buffer),c(a)&&h.push(a.buffer,l.buffer),h.push(u.buffer,f.buffer);let p={boxes:c(t)?t.buffer:void 0,boxBatchIds:c(t)?n.buffer:void 0,cylinders:c(i)?i.buffer:void 0,cylinderBatchIds:c(i)?o.buffer:void 0,ellipsoids:c(r)?r.buffer:void 0,ellipsoidBatchIds:c(r)?s.buffer:void 0,spheres:c(a)?a.buffer:void 0,sphereBatchIds:c(a)?l.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=sBe.scheduleTask(p,h);return c(g)?g.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);rBe(e,y)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),lBe(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function lBe(e){c(e._primitive)||(e._primitive=new hA({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:e._pickObject??e}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}iu.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};iu.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};iu.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};iu.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};iu.prototype.update=function(e){if(!this._ready){if(c(this._promise)||(this._promise=cBe(this)),c(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};iu.prototype.isDestroyed=function(){return!1};iu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var fg=iu;function qh(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,dBe(this,i,o)}Object.defineProperties(qh.prototype,{featuresLength:{get:function(){return c(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return c(this._geometries)?this._geometries.trianglesLength:0}},geometryByteLength:{get:function(){return c(this._geometries)?this._geometries.geometryByteLength:0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return c(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function uBe(e){return function(t,n){c(e._geometries)&&e._geometries.updateCommands(t,n)}}function fBe(e,t){let n,i,o,r,s,a=e.BOXES_LENGTH??0,l=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(a>0&&c(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(l>0&&c(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,l)}if(u>0&&c(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,u)}if(f>0&&c(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,f)}let h=c(n)||c(i)||c(o)||c(r),p=a>0&&!c(n)||l>0&&!c(i)||u>0&&!c(o)||f>0&&!c(r);if(h&&p)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!c(n)&&!c(i)&&!c(o)&&!c(r)){let m=0;if(!c(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!c(i)&&l>0)for(i=new Uint16Array(l),s=0;s<l;++s)i[s]=m++;if(!c(o)&&u>0)for(o=new Uint16Array(u),s=0;s<u;++s)o[s]=m++;if(!c(r)&&f>0)for(r=new Uint16Array(f),s=0;s<f;++s)r[s]=m++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var sb=Uint32Array.BYTES_PER_ELEMENT;function dBe(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=sb;let r=o.getUint32(n,!0);if(r!==1)throw new ae(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=sb;let s=o.getUint32(n,!0);if(n+=sb,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=sb,a===0)throw new ae("Feature table must have a byte length greater than zero");let l=o.getUint32(n,!0);n+=sb;let u=o.getUint32(n,!0);n+=sb;let f=o.getUint32(n,!0);n+=sb;let h=sr(i,n,a);n+=a;let p=new Uint8Array(t,n,l);n+=l;let g,m;u>0&&(g=sr(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let y=h.BOXES_LENGTH??0,b=h.CYLINDERS_LENGTH??0,x=h.ELLIPSOIDS_LENGTH??0,A=h.SPHERES_LENGTH??0,E=y+b+x+A,S=new cg(e,E,g,m,uBe(e));if(e._batchTable=S,E===0)return;let v=e.tile.computedTransform,P;c(h.RTC_CENTER)&&(P=d.unpack(h.RTC_CENTER),F.multiplyByPoint(v,P,P));let M=fBe(h,p);if(y>0||b>0||x>0||A>0){let R,L,B,_;if(y>0){let w=p.byteOffset+h.BOXES.byteOffset;R=new Float32Array(p.buffer,w,fg.packedBoxLength*y)}if(b>0){let w=p.byteOffset+h.CYLINDERS.byteOffset;L=new Float32Array(p.buffer,w,fg.packedCylinderLength*b)}if(x>0){let w=p.byteOffset+h.ELLIPSOIDS.byteOffset;B=new Float32Array(p.buffer,w,fg.packedEllipsoidLength*x)}if(A>0){let w=p.byteOffset+h.SPHERES.byteOffset;_=new Float32Array(p.buffer,w,fg.packedSphereLength*A)}return e._geometries=new fg({boxes:R,boxBatchIds:M.boxes,cylinders:L,cylinderBatchIds:M.cylinders,ellipsoids:B,ellipsoidBatchIds:M.ellipsoids,spheres:_,sphereBatchIds:M.spheres,center:P,modelMatrix:v,batchTable:S,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function mie(e){let t=e.featuresLength;if(!c(e._features)&&t>0){let n=new Array(t);c(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}qh.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};qh.prototype.getFeature=function(e){let t=this.featuresLength;if(!c(e)||e<0||e>=t)throw new C(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return mie(this),this._features[e]};qh.prototype.applyDebugSettings=function(e,t){c(this._geometries)&&this._geometries.applyDebugSettings(e,t)};qh.prototype.applyStyle=function(e){mie(this),c(this._geometries)&&this._geometries.applyStyle(e,this._features)};qh.prototype.update=function(e,t){c(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(t)),c(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(e,t),this._ready=!0)};qh.prototype.pick=function(e,t,n){};qh.prototype.isDestroyed=function(){return!1};qh.prototype.destroy=function(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),de(this)};var TN=qh;var Dj={};Dj.encode2D=function(e,t,n){let i=Math.pow(2,e);if(T.typeOf.number("level",e),T.typeOf.number("x",t),T.typeOf.number("y",n),e<1)throw new C("Hilbert level cannot be less than 1.");if(t<0||t>=i||n<0||n>=i)throw new C("Invalid coordinates for given level.");let o={x:t,y:n},r,s,a,l=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,l+=BigInt((3*r^s)*a*a),pie(i,o,r,s);return l};Dj.decode2D=function(e,t){if(T.typeOf.number("level",e),T.typeOf.bigint("index",t),e<1)throw new C("Hilbert level cannot be less than 1.");if(t<BigInt(0)||t>=BigInt(Math.pow(4,e)))throw new C("Hilbert index exceeds valid maximum for given level.");let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s<n;s*=2)o=1&Number(a/BigInt(2)),r=1&Number(a^BigInt(o)),pie(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function pie(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let o=t.x;t.x=t.y,t.y=o}var iv=Dj;var pg=30,hBe=1<<pg,mBe=1<<pg+1>>>0,Pj=2*pg+1,dg=4,yie=[],bie=[],pBe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],hg=1,mA=2,AN=[hg,0,0,hg|mA];function ar(e){if(!zt.supportsBigInt())throw new ae("S2 required BigInt support");if(!c(e))throw new C("cell ID is required.");if(!ar.isValidId(e))throw new C("cell ID is invalid.");this._cellId=e,this._level=ar.getLevel(e)}ar.fromToken=function(e){if(T.typeOf.string("token",e),!ar.isValidToken(e))throw new C("token is invalid.");return new ar(ar.getIdFromToken(e))};ar.isValidId=function(e){return T.typeOf.bigint("cellId",e),!(e<=0||e>>BigInt(Pj)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};ar.isValidToken=function(e){return T.typeOf.string("token",e),/^[0-9a-fA-F]{1,16}$/.test(e)?ar.isValidId(ar.getIdFromToken(e)):!1};ar.getIdFromToken=function(e){return T.typeOf.string("token",e),BigInt("0x"+e+"0".repeat(16-e.length))};ar.getTokenFromId=function(e){T.typeOf.bigint("cellId",e);let t=Math.floor(SBe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};ar.getLevel=function(e){if(T.typeOf.bigint("cellId",e),!ar.isValidId(e))throw new C;let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return pg-(t>>1)};ar.prototype.getChild=function(e){if(T.typeOf.number("index",e),e<0||e>3)throw new C("child index must be in the range [0-3].");if(this._level===30)throw new C("cannot get child of leaf cell.");let t=Aie(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new ar(n)};ar.prototype.getParent=function(){if(this._level===0)throw new C("cannot get parent of root cell.");let e=Aie(this._cellId)<<BigInt(2);return new ar(this._cellId&~e+BigInt(1)|e)};ar.prototype.getParentAtLevel=function(e){if(this._level===0||e<0||this._level<e)throw new C("cannot get parent at invalid level.");let t=CBe(e);return new ar(this._cellId&-t|t)};ar.prototype.getCenter=function(e){e=e??ie.WGS84;let t=_Be(this._cellId,this._level);t=d.normalize(t,t);let n=new he.fromCartesian(t,ie.UNIT_SPHERE);return he.toCartesian(n,e,new d)};ar.prototype.getVertex=function(e,t){if(T.typeOf.number("index",e),e<0||e>3)throw new C("vertex index must be in the range [0-3].");t=t??ie.WGS84;let n=gBe(this._cellId,this._level,e);n=d.normalize(n,n);let i=new he.fromCartesian(n,ie.UNIT_SPHERE);return he.toCartesian(i,t,new d)};ar.fromFacePositionLevel=function(e,t,n){if(T.typeOf.bigint("position",t),e<0||e>5)throw new C("Invalid S2 Face (must be within 0-5)");if(n<0||n>pg)throw new C("Invalid level (must be within 0-30)");if(t<0||t>=Math.pow(4,n))throw new C("Invalid Hilbert position for level");let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),o=t.toString(2),r=Array(2*n-o.length+1).join("0"),s=Array(Pj-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new ar(a)};function _Be(e,t){let n=yBe(e,t);return bBe(n[0],n[1],n[2])}function gBe(e,t,n){let i=xie(e,t),o=xBe([i[1],i[2]],t),r=n>>1&1;return Tie(i[0],o[0][r^n&1],o[1][r])}function yBe(e,t){let n=xie(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),l=s?1:a?2:0,u=(o<<1)+l,f=(r<<1)+l;return[i,u,f]}function xie(e){yie.length===0&&ABe();let t=Number(e>>BigInt(Pj)),n=t&hg,i=(1<<dg)-1,o=0,r=0;for(let s=7;s>=0;s--){let l=(1<<2*(s===7?pg-7*dg:dg))-1;n+=Number(e>>BigInt(s*2*dg+1)&BigInt(l))<<2,n=bie[n];let u=s*dg;o+=n>>dg+2<<u,r+=(n>>2&i)<<u,n&=hg|mA}return[t,o,r]}function bBe(e,t,n){let i=_ie(t),o=_ie(n),r=CN(i),s=CN(o);return Tie(e,r,s)}function Tie(e,t,n){switch(e){case 0:return new d(1,t,n);case 1:return new d(-t,1,n);case 2:return new d(-t,-n,1);case 3:return new d(-1,-n,-t);case 4:return new d(n,-1,-t);default:return new d(n,t,-1)}}function CN(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function _ie(e){return 1/mBe*e}function xBe(e,t){let n=[[],[]],i=TBe(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=CN(gie(r)),n[o][1]=CN(gie(s))}return n}function TBe(e){return 1<<pg-e>>>0}function gie(e){return 1/hBe*e}function mg(e,t,n,i,o,r){if(e===dg){let s=(t<<dg)+n;yie[(s<<2)+i]=(o<<2)+r,bie[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=pBe[r];mg(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^AN[0]),mg(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^AN[1]),mg(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^AN[2]),mg(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^AN[3])}}function ABe(){mg(0,0,0,0,0,0),mg(0,0,0,hg,0,hg),mg(0,0,0,mA,0,mA),mg(0,0,0,hg|mA,0,hg|mA)}function Aie(e){return e&~e+BigInt(1)}function CBe(e){return BigInt(1)<<BigInt(2*(pg-e))}var EBe=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function SBe(e){return EBe[(-e&e)%BigInt(67)]}var _g=ar;function wBe(e,t){return c(e)&&c(e.extensions)&&c(e.extensions[t])}var ri=wBe;function Ij(e){let t=e.lengthBits,n=e.availableCount;T.typeOf.number("options.lengthBits",t);let i=e.constant,o=e.bitstream;if(c(i))n=t;else{let r=Math.ceil(t/8);if(o.length!==r)throw new ae(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let s=e.computeAvailableCountEnabled??!1;!c(n)&&s&&(n=vBe(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function vBe(e,t){let n=0;for(let i=0;i<t;i++){let o=i>>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(Ij.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});Ij.prototype.getBit=function(e){if(e<0||e>=this._lengthBits)throw new C("Bit index out of bounds.");if(c(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var ov=Ij;function Sp(e){e=e??W.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;T.typeOf.object("options.metadataTable",t),T.typeOf.object("options.class",n),T.typeOf.number("options.entityId",i),T.typeOf.object("options.propertyTableJson",o),this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(Sp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Sp.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Sp.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Sp.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Sp.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Sp.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Sp.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Sp.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var rv=Sp;var EN={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};EN.getBranchingFactor=function(e){switch(e){case EN.OCTREE:return 8;case EN.QUADTREE:return 4;default:throw new C("subdivisionScheme is not a valid value.")}};var cr=Object.freeze(EN);function na(){}Object.defineProperties(na.prototype,{class:{get:function(){C.throwInstantiationError()}}});na.prototype.hasProperty=function(e){C.throwInstantiationError()};na.prototype.hasPropertyBySemantic=function(e){C.throwInstantiationError()};na.prototype.getPropertyIds=function(e){C.throwInstantiationError()};na.prototype.getProperty=function(e){C.throwInstantiationError()};na.prototype.setProperty=function(e,t){C.throwInstantiationError()};na.prototype.getPropertyBySemantic=function(e){C.throwInstantiationError()};na.prototype.setPropertyBySemantic=function(e,t){C.throwInstantiationError()};na.hasProperty=function(e,t,n){if(T.typeOf.string("propertyId",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n),c(t[e]))return!0;let i=n.properties;if(!c(i))return!1;let o=i[e];return!!(c(o)&&c(o.default))};na.hasPropertyBySemantic=function(e,t,n){T.typeOf.string("semantic",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n);let i=n.propertiesBySemantic;if(!c(i))return!1;let o=i[e];return c(o)};na.getPropertyIds=function(e,t,n){T.typeOf.object("properties",e),T.typeOf.object("classDefinition",t),n=c(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&c(e[o])&&n.push(o);let i=t.properties;if(c(i))for(let o in i)i.hasOwnProperty(o)&&!c(e[o])&&c(i[o].default)&&n.push(o);return n};na.getProperty=function(e,t,n){if(T.typeOf.string("propertyId",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n),!c(n.properties[e]))throw new C(`Class definition missing property ${e}`);let i=n.properties[e],o=t[e];Array.isArray(o)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!c(o)&&c(i.default))return o=We(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(c(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};na.setProperty=function(e,t,n,i){if(T.typeOf.string("propertyId",e),T.defined("value",t),T.typeOf.object("properties",n),T.typeOf.object("classDefinition",i),!c(n[e]))return!1;Array.isArray(t)&&(t=t.slice());let o,r=i.properties;return c(r)&&(o=r[e]),c(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};na.getPropertyBySemantic=function(e,t,n){T.typeOf.string("semantic",e),T.typeOf.object("properties",t),T.typeOf.object("classDefinition",n);let i=n.propertiesBySemantic;if(!c(i))return;let o=i[e];if(c(o))return na.getProperty(o.id,t,n)};na.setPropertyBySemantic=function(e,t,n,i){T.typeOf.string("semantic",e),T.defined("value",t),T.typeOf.object("properties",n),T.typeOf.object("classDefinition",i);let o=i.propertiesBySemantic;if(!c(o))return!1;let r=i.propertiesBySemantic[e];return c(r)?na.setProperty(r.id,t,n,i):!1};var Bn=na;function wp(e){e=e??W.EMPTY_OBJECT;let t=e.subtreeMetadata,n=e.class;T.typeOf.object("options.subtreeMetadata",t),T.typeOf.object("options.class",n);let i=c(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(wp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});wp.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};wp.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};wp.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};wp.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};wp.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};wp.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};wp.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var SN=wp;var Mt={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"};Mt.getMinimum=function(e){switch(T.typeOf.string("type",e),e){case Mt.INT8:return-128;case Mt.UINT8:return 0;case Mt.INT16:return-32768;case Mt.UINT16:return 0;case Mt.INT32:return-2147483648;case Mt.UINT32:return 0;case Mt.INT64:return zt.supportsBigInt()?BigInt("-9223372036854775808"):-Math.pow(2,63);case Mt.UINT64:return zt.supportsBigInt()?BigInt(0):0;case Mt.FLOAT32:return-34028234663852886e22;case Mt.FLOAT64:return-Number.MAX_VALUE}};Mt.getMaximum=function(e){switch(T.typeOf.string("type",e),e){case Mt.INT8:return 127;case Mt.UINT8:return 255;case Mt.INT16:return 32767;case Mt.UINT16:return 65535;case Mt.INT32:return 2147483647;case Mt.UINT32:return 4294967295;case Mt.INT64:return zt.supportsBigInt()?BigInt("9223372036854775807"):Math.pow(2,63)-1;case Mt.UINT64:return zt.supportsBigInt()?BigInt("18446744073709551615"):Math.pow(2,64)-1;case Mt.FLOAT32:return 34028234663852886e22;case Mt.FLOAT64:return Number.MAX_VALUE}};Mt.isIntegerType=function(e){switch(T.typeOf.string("type",e),e){case Mt.INT8:case Mt.UINT8:case Mt.INT16:case Mt.UINT16:case Mt.INT32:case Mt.UINT32:case Mt.INT64:case Mt.UINT64:return!0;default:return!1}};Mt.isUnsignedIntegerType=function(e){switch(T.typeOf.string("type",e),e){case Mt.UINT8:case Mt.UINT16:case Mt.UINT32:case Mt.UINT64:return!0;default:return!1}};Mt.isVectorCompatible=function(e){switch(T.typeOf.string("type",e),e){case Mt.INT8:case Mt.UINT8:case Mt.INT16:case Mt.UINT16:case Mt.INT32:case Mt.UINT32:case Mt.FLOAT32:case Mt.FLOAT64:return!0;default:return!1}};Mt.normalize=function(e,t){if(typeof e!="number"&&typeof e!="bigint")throw new C("value must be a number or a BigInt");if(!Mt.isIntegerType(t))throw new C("type must be an integer type");return Math.max(Number(e)/Number(Mt.getMaximum(t)),-1)};Mt.unnormalize=function(e,t){if(T.typeOf.number("value",e),!Mt.isIntegerType(t))throw new C("type must be an integer type");let n=Mt.getMaximum(t),i=Mt.isUnsignedIntegerType(t)?0:-n;return e=O.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===Mt.INT64||t===Mt.UINT64)&&zt.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};Mt.applyValueTransform=function(e,t,n){return n*e+t};Mt.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};Mt.getSizeInBytes=function(e){switch(T.typeOf.string("type",e),e){case Mt.INT8:case Mt.UINT8:return 1;case Mt.INT16:case Mt.UINT16:return 2;case Mt.INT32:case Mt.UINT32:return 4;case Mt.INT64:case Mt.UINT64:return 8;case Mt.FLOAT32:return 4;case Mt.FLOAT64:return 8}};Mt.fromComponentDatatype=function(e){switch(T.typeOf.number("componentDatatype",e),e){case $.BYTE:return Mt.INT8;case $.UNSIGNED_BYTE:return Mt.UINT8;case $.SHORT:return Mt.INT16;case $.UNSIGNED_SHORT:return Mt.UINT16;case $.INT:return Mt.INT32;case $.UNSIGNED_INT:return Mt.UINT32;case $.FLOAT:return Mt.FLOAT32;case $.DOUBLE:return Mt.FLOAT64}};Mt.toComponentDatatype=function(e){switch(T.typeOf.string("type",e),e){case Mt.INT8:return $.BYTE;case Mt.UINT8:return $.UNSIGNED_BYTE;case Mt.INT16:return $.SHORT;case Mt.UINT16:return $.UNSIGNED_SHORT;case Mt.INT32:return $.INT;case Mt.UINT32:return $.UNSIGNED_INT;case Mt.FLOAT32:return $.FLOAT;case Mt.FLOAT64:return $.DOUBLE}};var Nt=Object.freeze(Mt);var Bo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};Bo.isVectorType=function(e){switch(T.typeOf.string("type",e),e){case Bo.VEC2:case Bo.VEC3:case Bo.VEC4:return!0;default:return!1}};Bo.isMatrixType=function(e){switch(T.typeOf.string("type",e),e){case Bo.MAT2:case Bo.MAT3:case Bo.MAT4:return!0;default:return!1}};Bo.getComponentCount=function(e){switch(T.typeOf.string("type",e),e){case Bo.SCALAR:case Bo.STRING:case Bo.ENUM:case Bo.BOOLEAN:return 1;case Bo.VEC2:return 2;case Bo.VEC3:return 3;case Bo.VEC4:return 4;case Bo.MAT2:return 4;case Bo.MAT3:return 9;case Bo.MAT4:return 16;default:throw new C(`Invalid metadata type ${e}`)}};Bo.getMathType=function(e){switch(e){case Bo.VEC2:return z;case Bo.VEC3:return d;case Bo.VEC4:return se;case Bo.MAT2:return Ri;case Bo.MAT3:return J;case Bo.MAT4:return F;default:return}};var at=Object.freeze(Bo);function Sa(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.type;T.typeOf.string("options.id",t),T.typeOf.string("options.type",n);let i=e.componentType,o=e.enumType,r=c(i)&&Nt.isIntegerType(i)&&(e.normalized??!1);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=c(o)?o.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=We(e.min,!0),this._max=We(e.max,!0),this._normalized=r;let s=We(e.offset,!0),a=We(e.scale,!0),l=c(s)||c(a),u=!0;c(s)||(s=this.expandConstant(0,u)),c(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=l,this._noData=We(e.noData,!0),this._default=We(e.default,!0),this._required=e.required??!0,this._extras=We(e.extras,!0),this._extensions=We(e.extensions,!0)}Sa.fromJson=function(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.property;T.typeOf.string("options.id",t),T.typeOf.object("options.property",n),T.typeOf.string("options.property.type",n.type);let i=DBe(n),o=PBe(n,e.enums),r;return c(i)?i?r=c(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new Sa({id:t,type:o.type,componentType:o.componentType,enumType:o.enumType,isArray:o.isArray,isVariableLengthArray:o.isVariableLengthArray,arrayLength:o.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:r,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(Sa.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function DBe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===at.SCALAR||at.isMatrixType(t)||at.isVectorType(t))return!1;if(c(Nt[t]))return!0;if(c(e.noData)||c(e.scale)||c(e.offset)||c(e.required)||c(e.count)||c(e.array)||c(e.optional))return!1}function PBe(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!c(s)):e.array?(r=!0,s=e.count,a=!c(e.count)):(r=!1,s=void 0,a=!1);let l;if(c(e.enumType)&&(l=t[e.enumType]),n===at.ENUM)return{type:n,componentType:void 0,enumType:l,valueType:l.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===at.ENUM)return{type:i,componentType:void 0,enumType:l,valueType:l.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===at.SCALAR||at.isMatrixType(n)||at.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===at.BOOLEAN||n===at.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===at.BOOLEAN||i===at.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(c(i)&&c(Nt[i]))return{type:at.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(c(Nt[n]))return{type:at.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s};throw new C(`unknown metadata type {type: ${n}, componentType: ${i})`)}Sa.prototype.normalize=function(e){return this._normalized?Oj(e,this._valueType,Nt.normalize):e};Sa.prototype.unnormalize=function(e){return this._normalized?Oj(e,this._valueType,Nt.unnormalize):e};Sa.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Sa.valueTransformInPlace(e,this._offset,this._scale,Nt.applyValueTransform)};Sa.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Sa.valueTransformInPlace(e,this._offset,this._scale,Nt.unapplyValueTransform)};Sa.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,o=at.getComponentCount(this._type),r=n&&o>1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};Sa.prototype.handleNoData=function(e){let t=this._noData;if(!c(t))return e;if(!wie(e,t))return e};function wie(e,t){if(!Array.isArray(e))return e===t;if(!Array.isArray(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!wie(e[n],t[n]))return!1;return!0}Sa.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=at.getMathType(this._type),i=this._isArray,o=at.getComponentCount(this._type),r=i&&o>1;return c(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Sa.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=at.getMathType(this._type),i=this._isArray,o=at.getComponentCount(this._type),r=i&&o>1;return c(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Sa.prototype.validate=function(e){if(!(!c(e)&&c(this._default)))return this._required&&!c(e)?"required property must have a value":this._isArray?IBe(this,e):vie(this,e)};function IBe(e,t){if(!Array.isArray(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let o=vie(e,t[i]);if(c(o))return o}}function vie(e,t){let n=e._type,i=e._componentType,o=e._enumType,r=e._normalized;return at.isVectorType(n)?OBe(t,n,i):at.isMatrixType(n)?RBe(t,n,i):n===at.STRING?MBe(t):n===at.BOOLEAN?LBe(t):n===at.ENUM?NBe(t,o):FBe(t,i,r)}function OBe(e,t,n){if(!Nt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===at.VEC2&&!(e instanceof z))return`vector value ${e} must be a Cartesian2`;if(t===at.VEC3&&!(e instanceof d))return`vector value ${e} must be a Cartesian3`;if(t===at.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function RBe(e,t,n){if(!Nt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===at.MAT2&&!(e instanceof Ri))return`matrix value ${e} must be a Matrix2`;if(t===at.MAT3&&!(e instanceof J))return`matrix value ${e} must be a Matrix3`;if(t===at.MAT4&&!(e instanceof F))return`matrix value ${e} must be a Matrix4`}function MBe(e){if(typeof e!="string")return wN(e,at.STRING)}function LBe(e){if(typeof e!="boolean")return wN(e,at.BOOLEAN)}function NBe(e,t){let n=typeof e;if(c(t))return n!=="string"||!c(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function FBe(e,t,n){let i=typeof e;switch(t){case Nt.INT8:case Nt.UINT8:case Nt.INT16:case Nt.UINT16:case Nt.INT32:case Nt.UINT32:case Nt.FLOAT32:case Nt.FLOAT64:return i!=="number"?wN(e,t):isFinite(e)?Eie(e,t,n):Sie(e,t);case Nt.INT64:case Nt.UINT64:return i!=="number"&&i!=="bigint"?wN(e,t):i==="number"&&!isFinite(e)?Sie(e,t):Eie(e,t,n)}}function wN(e,t){return`value ${e} does not match type ${t}`}function Cie(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function Eie(e,t,n){if(n){let i=Nt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Cie(e,t,n):void 0}if(e<Nt.getMinimum(t)||e>Nt.getMaximum(t))return Cie(e,t,n)}function Sie(e,t){return`value ${e} of type ${t} must be finite`}function Oj(e,t,n){if(!Array.isArray(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=Oj(e[i],t,n);return e}Sa.valueTransformInPlace=function(e,t,n,i){if(!Array.isArray(e))return i(e,t,n);for(let o=0;o<e.length;o++)e[o]=Sa.valueTransformInPlace(e[o],t[o],n[o],i);return e};var vp=Sa;function sv(e){e=e??W.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews;T.typeOf.number.greaterThan("options.count",t,0),T.typeOf.object("options.property",n),T.typeOf.object("options.classProperty",i),T.typeOf.object("options.bufferViews",o);let r=i.type,s=i.isArray,a=i.isVariableLengthArray,l=i.valueType,u=i.enumType,f=r===at.STRING,h=r===at.BOOLEAN,p=0,g;if(a){let _=n.arrayOffsetType??n.offsetType;_=Nt[_]??Nt.UINT32;let w=n.arrayOffsets??n.arrayOffsetBufferView;g=new Rj(o[w],_,t+1),p+=g.typedArray.byteLength}let m=at.getComponentCount(r),y;a?y=g.get(t)-g.get(0):s?y=t*i.arrayLength:y=t;let b=m*y,x;if(f){let _=n.stringOffsetType??n.offsetType;_=Nt[_]??Nt.UINT32;let w=n.stringOffsets??n.stringOffsetBufferView;x=new Rj(o[w],_,b+1),p+=x.typedArray.byteLength}(f||h)&&(l=Nt.UINT8);let A;f?A=x.get(b)-x.get(0):h?A=Math.ceil(b/8):A=b;let E=n.values??n.bufferView,S=new Rj(o[E],l,A);p+=S.typedArray.byteLength;let v=n.offset,P=n.scale,M=i.hasValueTransform||c(v)||c(P);v=v??i.offset,P=P??i.scale,v=Die(v),P=Die(P);let R,L,B=this;f?R=function(_){return UBe(_,B._values,B._stringOffsets)}:h?(R=function(_){return VBe(_,B._values)},L=function(_,w){zBe(_,B._values,w)}):c(u)?(R=function(_){let w=B._values.get(_);return u.namesByValue[w]},L=function(_,w){let D=u.valuesByName[w];B._values.set(_,D)}):(R=function(_){return B._values.get(_)},L=function(_,w){B._values.set(_,w)}),this._arrayOffsets=g,this._stringOffsets=x,this._values=S,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=v,this._scale=P,this._hasValueTransform=M,this._getValue=R,this._setValue=L,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(sv.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}}});sv.prototype.get=function(e){Pie(this,e);let t=BBe(this,e);return t=this._classProperty.handleNoData(t),c(t)?(t=this._classProperty.normalize(t),t=KBe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};sv.prototype.set=function(e,t){let n=this._classProperty;T.defined("value",t),Pie(this,e);let i=n.validate(t);if(c(i))throw new C(i);t=n.packVectorAndMatrixTypes(t),t=$Be(this,t),t=n.unnormalize(t),kBe(this,e,t)};sv.prototype.getTypedArray=function(){if(c(this._values))return this._values.typedArray};function Die(e){if(!Array.isArray(e))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?t.push.apply(t,i):t.push(i)}return t}function Pie(e,t){let n=e._count;if(!c(t)||t<0||t>=n){let i=n-1;throw new C(`index is required and between zero and count - 1. Actual value: ${i}`)}}function BBe(e,t){Oie(e)&&Rie(e);let n=e._classProperty,i=n.isArray,o=n.type,r=at.getComponentCount(o);if(c(e._unpackedValues)){let s=e._unpackedValues[t];return i?We(s,!0):s}return!i&&r===1?e._getValue(t):Iie(e,n,t)}function Iie(e,t,n){let i,o;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),o=e._arrayOffsets.get(n+1)-i;let s=at.getComponentCount(t.type);i*=s,o*=s}else{let a=(t.arrayLength??1)*e._vectorComponentCount;i=n*a,o=a}let r=new Array(o);for(let s=0;s<o;s++)r[s]=e._getValue(i+s);return r}function kBe(e,t,n){YBe(e,t,n)&&Rie(e);let i=e._classProperty,o=i.isArray,r=i.type,s=at.getComponentCount(r);if(c(e._unpackedValues)){i.isArray&&(n=We(n,!0)),e._unpackedValues[t]=n;return}if(!o&&s===1){e._setValue(t,n);return}let a,l;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),l=e._arrayOffsets.get(t+1)-a;else{let f=(i.arrayLength??1)*e._vectorComponentCount;a=t*f,l=f}for(let u=0;u<l;++u)e._setValue(a+u,n[u])}function UBe(e,t,n){let i=n.get(e),o=n.get(e+1)-i;return tu(t.typedArray,i,o)}function VBe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function zBe(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<<o:t.typedArray[i]&=~(1<<o)}function HBe(e,t){let n=t.dataView,i=e*8,o=0,r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let l=n.getUint8(i+a);r&&(s?l!==0&&(l=~(l-1)&255,s=!1):l=~l&255),o+=l*Math.pow(256,a)}return r&&(o=-o),o}function GBe(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let l=n.getUint8(i+a);r&&(s?l!==0&&(l=~(l-1)&255,s=!1):l=~l&255),o+=BigInt(l)*(BigInt(1)<<BigInt(a*8))}return r&&(o=-o),o}function jBe(e,t){let n=t.dataView,i=e*8,o=n.getUint32(i,!0),r=n.getUint32(i+4,!0);return o+4294967296*r}function WBe(e,t){let n=t.dataView,i=e*8,o=BigInt(n.getUint32(i,!0)),r=BigInt(n.getUint32(i+4,!0));return o+BigInt(4294967296)*r}function qBe(e){switch(e){case Nt.INT8:return $.BYTE;case Nt.UINT8:return $.UNSIGNED_BYTE;case Nt.INT16:return $.SHORT;case Nt.UINT16:return $.UNSIGNED_SHORT;case Nt.INT32:return $.INT;case Nt.UINT32:return $.UNSIGNED_INT;case Nt.FLOAT32:return $.FLOAT;case Nt.FLOAT64:return $.DOUBLE}}function Oie(e){if(c(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===at.STRING||i===Nt.INT64&&!zt.supportsBigInt64Array()||i===Nt.UINT64&&!zt.supportsBigUint64Array()}function YBe(e,t,n){if(Oie(e))return!0;let i=e._arrayOffsets;if(c(i)){let o=i.get(t+1)-i.get(t),r=n.length;if(o!==r)return!0}return!1}function Rie(e){e._unpackedValues=XBe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function XBe(e){let t=e._count,n=new Array(t),i=e._classProperty,o=i.isArray,r=i.type,s=at.getComponentCount(r);if(!o&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=Iie(e,i,a);return n}function KBe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:vp.valueTransformInPlace(t,e._offset,e._scale,Nt.applyValueTransform)}function $Be(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:vp.valueTransformInPlace(t,e._offset,e._scale,Nt.unapplyValueTransform)}function Rj(e,t,n){let i=this,o,r,s;if(t===Nt.INT64)zt.supportsBigInt()?zt.supportsBigInt64Array()?(o=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,l){i.typedArray[a]=BigInt(l)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return GBe(a,i)}):(dt("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return HBe(a,i)});else if(t===Nt.UINT64)zt.supportsBigInt()?zt.supportsBigUint64Array()?(o=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,l){i.typedArray[a]=BigInt(l)}):(o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return WBe(a,i)}):(dt("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),o=new Uint8Array(e.buffer,e.byteOffset,n*8),r=function(a){return jBe(a,i)});else{let a=qBe(t);o=$.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(l,u){i.typedArray[l]=u}}c(r)||(r=function(a){return i.typedArray[a]}),this.typedArray=o,this.dataView=new DataView(o.buffer,o.byteOffset),this.get=r,this.set=s,this._componentType=t}var vN=sv;function xd(e){e=e??W.EMPTY_OBJECT;let t=e.count,n=e.class;T.typeOf.number.greaterThan("options.count",t,0),T.typeOf.object("options.class",n);let i=0,o={};if(c(e.properties)){for(let r in e.properties)if(e.properties.hasOwnProperty(r)){let s=new vN({count:t,property:e.properties[r],classProperty:n.properties[r],bufferViews:e.bufferViews});o[r]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=o,this._byteLength=i}Object.defineProperties(xd.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}}});xd.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};xd.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};xd.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};xd.prototype.getProperty=function(e,t){T.typeOf.string("propertyId",t);let n=this._properties[t],i;return c(n)?i=n.get(e):i=ZBe(this._class,t),i};xd.prototype.setProperty=function(e,t,n){T.typeOf.string("propertyId",t);let i=this._properties[t];return c(i)?(i.set(e,n),!0):!1};xd.prototype.getPropertyBySemantic=function(e,t){T.typeOf.string("semantic",t);let n,i=this._class.propertiesBySemantic;if(c(i)&&(n=i[t]),c(n))return this.getProperty(e,n.id)};xd.prototype.setPropertyBySemantic=function(e,t,n){T.typeOf.string("semantic",t);let i,o=this._class.propertiesBySemantic;return c(o)&&(i=o[t]),c(i)?this.setProperty(e,i.id,n):!1};xd.prototype.getPropertyTypedArray=function(e){T.typeOf.string("propertyId",e);let t=this._properties[e];if(c(t))return t.getTypedArray()};xd.prototype.getPropertyTypedArrayBySemantic=function(e){T.typeOf.string("semantic",e);let t,n=this._class.propertiesBySemantic;if(c(n)&&(t=n[e]),c(t))return this.getPropertyTypedArray(t.id)};function ZBe(e,t){let n=e.properties;if(!c(n))return;let i=n[t];if(c(i)&&c(i.default)){let o=i.default;return i.isArray&&(o=We(o,!0)),o=i.normalize(o),i.unpackVectorAndMatrixTypes(o)}}var Td=xd;function gg(){}Object.defineProperties(gg.prototype,{cacheKey:{get:function(){C.throwInstantiationError()}}});gg.prototype.load=function(){C.throwInstantiationError()};gg.prototype.unload=function(){};gg.prototype.process=function(e){return!1};gg.prototype.getError=function(e,t){T.typeOf.string("errorMessage",e),c(t)&&c(t.message)&&(e+=`
${t.message}`);let n=new ae(e);return c(t)&&(n.stack=`Original stack:
${t.stack}
Handler stack:
${n.stack}`),n};gg.prototype.isDestroyed=function(){return!1};gg.prototype.destroy=function(){return this.unload(),de(this)};var $i=gg;var QBe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5},gt=Object.freeze(QBe);function Dp(e){e=e??W.EMPTY_OBJECT;let t=e.typedArray,n=e.resource,i=e.cacheKey;if(c(t)===c(n))throw new C("One of options.typedArray and options.resource must be defined.");this._typedArray=t,this._resource=n,this._cacheKey=i,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(Dp.prototype=Object.create($i.prototype),Dp.prototype.constructor=Dp);Object.defineProperties(Dp.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});Dp.prototype.load=async function(){return c(this._promise)?this._promise:c(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=JBe(this),this._promise)};async function JBe(e){let t=e._resource;e._state=gt.LOADING;try{let n=await Dp._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=gt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}Dp._fetchArrayBuffer=function(e){return e.fetchArrayBuffer()};Dp.prototype.unload=function(){this._typedArray=void 0};var pA=Dp;var Sin=function(){var e="b9H79TebbbeJq9Geueu9Geub9Gbb9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiKLdilevlevlooroowwvwbDDbelve9Weiiviebeoweuec:G:Qdkr;RiOo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbe8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbdE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UbiY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbl8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbv8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UboE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbra9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbwL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbDK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbqL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbkE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9Wbsa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbzK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbHl79IV9RbODwebcekdQXq;A9pLdbk;QqeKu8Jjjjjbcjo9Rgv8Kjjjjbcbhodnalcefae0mbabcbRbN:kjjbc:GeV86bbavcjdfcbcjdzNjjjb8AdnaiTmbavcjdfadalz:tjjjb8Akabaefhrabcefhwavalfcbcbcjdal9RalcFe0EzNjjjb8Aavavcjdfalz:tjjjbhDcj;abal9Uc;WFbGgecjdaecjd6Ehqcbhkindndnaiak9nmbaDcjlfcbcjdzNjjjb8Aaqaiak9Rakaqfai6Egxcsfgecl4cifcd4hmadakal2fhPdndndnaec9WGgsTmbcbhzaPhHawhOxekdnaxmbalheinaraw9Ram6miawcbamzNjjjbamfhwaecufgembxvkkcbhAaPhOinaDaAfRbbhCaDcjlfheaOhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkaraw9Ram6mdaOcefhOawcbamzNjjjbamfhwaAcefgAal9hmbxlkkindnaxTmbaDazfRbbhCaDcjlfheaHhoaxhXinaeaoRbbgQaC9RgCcetaCcKtcK91cr4786bbaoalfhoaecefheaQhCaXcufgXmbkkaraO9Ram6mearaOcbamzNjjjbgLamfgw9RcK6mecbhKaDcjlfhOinaDcjlfaKfhYcwhAczhQceheindndnaegXce9hmbcuhoaYRbbmecbhodninaogecsSmeaecefhoaOaefcefRbbTmbkkcucbaecs6EhoxekaXcethocuaXtc;:bGcFb7hCcbheinaoaCaOaefRbb9nfhoaecefgecz9hmbkkaoaQaoaQ6geEhQaXaAaeEhAaXcetheaXcl6mbkdndndndnaAcufPdiebkaLaKco4fgeaeRbbcdciaAclSEaKci4coGtV86bbaAcw9hmeawaY8Pbb83bbawcwfaYcwf8Pbb83bbawczfhwxdkaLaKco4fgeaeRbbceaKci4coGtV86bbkdncwaA9Tg8Ambinawcb86bbawcefhwxbkkcuaAtcu7hYcbhEaOh3ina3hea8AhCcbhoinaeRbbgQaYcFeGgXaQaX6EaoaAtVhoaecefheaCcufgCmbkawao86bba3a8Afh3awcefhwaEa8AfgEcz6mbkcbheindnaOaefRbbgoaX6mbawao86bbawcefhwkaecefgecz9hmbkkdnaKczfgKas9pmbaOczfhOaraw9RcL0mekkaKas6meawTmeaHcefhHawhOazcefgzalSmixbkkcbhoxikcbhoaraw9Ralcaalca0E6mddnalc8F0mbawcbcaal9RgezNjjjbaefhwkawaDcjdfalz:tjjjbalfab9RhoxdkaDaPaxcufal2falz:tjjjb8Aaxakfhkawmbkcbhokavcjof8Kjjjjbaok9heeuaecaaeca0Eabcj;abae9Uc;WFbGgdcjdadcjd6Egdfcufad9Uae2adcl4cifcd4adV2fcefkmbcbabBdN:kjjbk:zse5u8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaici9UgocHfae0mbabcbyd:e:kjjbgrc;GeV86bbalc;abfcFecjezNjjjb8AalcUfgw9cu83ibalc8WfgD9cu83ibalcyfgq9cu83ibalcafgk9cu83ibalcKfgx9cu83ibalczfgm9cu83ibal9cu83iwal9cu83ibabaefc9WfhPabcefgsaofhednaiTmbcmcsarcb9kgzEhHcbhOcbhAcbhCcbhXcbhQindnaeaP9nmbcbhvxikaQcufhvadaCcdtfgLydbhKaLcwfydbhYaLclfydbh8AcbhEdndndninalc;abfavcsGcitfgoydlh3dndndnaoydbgoaK9hmba3a8ASmekdnaoa8A9hmba3aY9hmbaEcefhExekaoaY9hmea3aK9hmeaEcdfhEkaEc870mdaXcufhvaLaEciGcx2goc:y1jjbfydbcdtfydbh3aLaocN1jjbfydbcdtfydbh8AaLaoc:q1jjbfydbcdtfydbhKcbhodnindnalavcsGcdtfydba39hmbaohYxdkcuhYavcufhvaocefgocz9hmbkkaOa3aOSgvaYce9iaYaH9oVgoGfhOdndndncbcsavEaYaoEgvcs9hmbarce9imba3a3aAa3cefaASgvEgAcefSmecmcsavEhvkasavaEcdtc;WeGV86bbavcs9hmea3aA9Rgvcetavc8F917hvinaeavcFb0crtavcFbGV86bbaecefheavcje6hoavcr4hvaoTmbka3hAxvkcPhvasaEcdtcPV86bba3hAkavTmiavaH9omicdhocehEaQhYxlkavcufhvaEclfgEc;ab9hmbkkdnaLceaYaOSceta8AaOSEcx2gvc:q1jjbfydbcdtfydbgKTaLavcN1jjbfydbcdtfydbg8AceSGaLavc:y1jjbfydbcdtfydbg3cdSGaOcb9hGazGg5ce9hmbaw9cu83ibaD9cu83ibaq9cu83ibak9cu83ibax9cu83ibam9cu83ibal9cu83iwal9cu83ibcbhOkcbhEaXcufgvhodnindnalaocsGcdtfydba8A9hmbaEhYxdkcuhYaocufhoaEcefgEcz9hmbkkcbhodnindnalavcsGcdtfydba39hmbaohExdkcuhEavcufhvaocefgocz9hmbkkaOaKaOSg8EfhLdndnaYcm0mbaYcefhYxekcbcsa8AaLSgvEhYaLavfhLkdndnaEcm0mbaEcefhExekcbcsa3aLSgvEhEaLavfhLkc9:cua8EEh8FcbhvaEaYcltVgacFeGhodndndninavcj1jjbfRbbaoSmeavcefgvcz9hmbxdkka5aKaO9havcm0VVmbasavc;WeV86bbxekasa8F86bbaeaa86bbaecefhekdna8EmbaKaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombkaKhAkdnaYcs9hmba8AaA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka8AhAkdnaEcs9hmba3aA9Rgvcetavc8F917hvinaeavcFb0gocrtavcFbGV86bbavcr4hvaecefheaombka3hAkalaXcdtfaKBdbaXcefcsGhvdndnaYPzbeeeeeeeeeeeeeebekalavcdtfa8ABdbaXcdfcsGhvkdndnaEPzbeeeeeeeeeeeeeebekalavcdtfa3BdbavcefcsGhvkcihoalc;abfaQcitfgEaKBdlaEa8ABdbaQcefcsGhYcdhEavhXaLhOxekcdhoalaXcdtfa3BdbcehEaXcefcsGhXaQhYkalc;abfaYcitfgva8ABdlava3Bdbalc;abfaQaEfcsGcitfgva3BdlavaKBdbascefhsaQaofcsGhQaCcifgCai6mbkkcbhvaeaP0mbcbhvinaeavfavcj1jjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meceadtae6mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd:e:kjjbk:ydewu8Jjjjjbcz9Rhlcbhvdnaicvfae0mbcbhvabcbRb:e:kjjbc;qeV86bbal9cb83iwabcefhoabaefc98fhrdnaiTmbcbhwcbhDindnaoar6mbcbskadaDcdtfydbgqalcwfawaqav9Rgvavc8F91gv7av9Rc507gwcdtfgkydb9Rgvc8E91c9:Gavcdt7awVhvinaoavcFb0gecrtavcFbGV86bbavcr4hvaocefhoaembkakaqBdbaqhvaDcefgDai9hmbkkcbhvaoar0mbaocbBbbaoab9RclfhvkavkBeeucbhddninadcefgdc8F0meceadtae6mbkkadcwfcFeGcr9Uab2cvfk:bvli99dui99ludnaeTmbcuadcetcuftcu7:Yhvdndncuaicuftcu7:YgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhrdndnakJbbbb9GTmbaxhqxekJbbjZar:l:tgqaq:maxJbbbb9GEhqJbbjZax:l:tgxax:marJbbbb9GEhrkdndnalcxfIdbgxJbbj:;axJbbj:;9GEgkJbbjZakJbbjZ9FEavNJbbbZJbbb:;axJbbbb9GEMgx:lJbbb9p9DTmbax:Ohmxekcjjjj94hmkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEaoNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaifgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaDfgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkalczfhlaiclfhiaDcwfhDaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:YgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;3viDue99eu8Jjjjjbcjd9Rgo8Kjjjjbadcd4hrdndndndnavcd9hmbadcl6meaohwarhDinawc:CuBdbawclfhwaDcufgDmbkaeTmiadcl6mdarcdthqalhkcbhxinaohwakhDarhminawawydbgPcbaDIdbgs:8cL4cFeGc:cufasJbbbb9BEgzaPaz9kEBdbaDclfhDawclfhwamcufgmmbkakaqfhkaxcefgxaeSmixbkkaeTmdxekaeTmekarcdthkavce9hhqadcl6hdcbhxindndndnaqmbadmdc:CuhDalhwarhminaDcbawIdbgs:8cL4cFeGc:cufasJbbbb9BEgPaDaP9kEhDawclfhwamcufgmmbxdkkc:CuhDdndnavPleddbdkadmdaohwalhmarhPinawcbamIdbgs:8cL4cFeGgzc;:bazc;:b9kEc:cufasJbbbb9BEBdbamclfhmawclfhwaPcufgPmbxdkkadmecbhwarhminaoawfcbalawfIdbgs:8cL4cFeGgPc8AaPc8A9kEc:cufasJbbbb9BEBdbawclfhwamcufgmmbkkadmbcbhwarhPinaDhmdnavceSmbaoawfydbhmkdndnalawfIdbgscjjj;8iamai9RcefgmcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:Ohzxekcjjjj94hzkabawfazcFFFrGamcKtVBdbawclfhwaPcufgPmbkkabakfhbalakfhlaxcefgxae9hmbkkaocjdf8Kjjjjbk;HqdCui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;KbzNjjjb8AcbhodnadTmbcbhoaiTmbdnabae9hmbavcuadcdtgradcFFFFi0Ecbyd:m:kjjbHjjjjbbgeBd:SeavceBd:mdaeabarz:tjjjb8Akavc:GefcwfcbBdbav9cb83i:Geavc:Gefaeadaiavc:Sefz:njjjbavyd:Gehwadci9UgDcbyd:m:kjjbHjjjjbbhravc:Sefavyd:mdgqcdtfarBdbavaqcefgkBd:mdarcbaDzNjjjbhxavc:SefakcdtfcuaicdtaicFFFFi0Ecbyd:m:kjjbHjjjjbbgmBdbavaqcdfgPBd:mdawhramhkinakalIdbalarydbgscwascw6Ecdtfc;ebfIdbMUdbarclfhrakclfhkaicufgimbkavc:SefaPcdtfcuaDcdtadcFFFF970Ecbyd:m:kjjbHjjjjbbgPBdbdnadci6mbaehraPhkaDhiinakamarydbcdtfIdbamarclfydbcdtfIdbMamarcwfydbcdtfIdbMUdbarcxfhrakclfhkaicufgimbkkaqcifhoavc;qbfhzavhravyd:KehHavyd:OehOcbhscbhkcbhAcehCinarhXcihQaeakci2gLcdtfgrydbhdarclfydbhqabaAcx2fgicwfarcwfydbgKBdbaiclfaqBdbaiadBdbaxakfce86bbazaKBdwazaqBdlazadBdbaPakcdtfcbBdbdnasTmbcihQaXhiinazaQcdtfaiydbgrBdbaQaraK9harad9haraq9hGGfhQaiclfhiascufgsmbkkaAcefhAcbhsinaOaHaeasaLfcdtfydbcdtgifydbcdtfgKhrawaifgqydbgdhidnadTmbdninarydbakSmearclfhraicufgiTmdxbkkaraKadcdtfc98fydbBdbaqaqydbcufBdbkascefgsci9hmbkdndnaQTmbcuhkJbbbbhYcbhqavyd:KehKavyd:OehLindndnawazaqcdtfydbcdtgsfydbgrmbaqcefhqxekaqcs0hiamasfgdIdbh8AadalcbaqcefgqaiEcdtfIdbalarcwarcw6Ecdtfc;ebfIdbMgEUdbaEa8A:thEarcdthiaLaKasfydbcdtfhrinaParydbgscdtfgdaEadIdbMg8AUdba8AaYaYa8A9DgdEhYasakadEhkarclfhraic98fgimbkkaqaQ9hmbkakcu9hmekaCaD9pmdindnaxaCfRbbmbaChkxdkaDaCcefgC9hmbxikkaQczaQcz6EhsazhraXhzakcu9hmbkkaocdtavc:Seffc98fhrdninaoTmearydbcbyd1:kjjbH:bjjjbbarc98fhraocufhoxbkkavc:qdf8Kjjjjbk;IlevucuaicdtgvaicFFFFi0Egocbyd:m:kjjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd:m:kjjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavzNjjjb8Aadci9UhDdnadTmbabydbhoaehladhrinaoalydbcdtfgvavydbcefBdbalclfhlarcufgrmbkkdnaiTmbabydbhlabydlhrcbhvaihoinaravBdbarclfhralydbavfhvalclfhlaocufgombkkdnadci6mbabydlhrabydwhvcbhlinaecwfydbhoaeclfydbhdaraeydbcdtfgwawydbgwcefBdbavawcdtfalBdbaradcdtfgdadydbgdcefBdbavadcdtfalBdbaraocdtfgoaoydbgocefBdbavaocdtfalBdbaecxfheaDalcefgl9hmbkkdnaiTmbabydlheabydbhlinaeaeydbalydb9RBdbalclfhlaeclfheaicufgimbkkkQbabaeadaic:01jjbz:mjjjbkQbabaeadaic:C:jjjbz:mjjjbk9DeeuabcFeaicdtzNjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Wkivuo99lu8Jjjjjbc;W;Gb9Rgl8Kjjjjbcbhvalcj;Gbfcbc;KbzNjjjb8AalcuadcdtadcFFFFi0Egocbyd:m:kjjbHjjjjbbgrBdj9GalceBd;G9GalcFFF;7rBdwal9cFFF;7;3FF:;Fb83dbalcFFF97Bd;S9Gal9cFFF;7FFF:;u83d;K9Gaicd4hwdndnadmbJFFuFhDJFFuuhqJFFuuhkJFFuFhxJFFuuhmJFFuFhPxekawcdthsaehzincbhiinalaifgHazaifIdbgDaHIdbgxaxaD9EEUdbalc;K;GbfaifgHaDaHIdbgxaxaD9DEUdbaiclfgicx9hmbkazasfhzavcefgvad9hmbkalIdwhqalId;S9GhDalIdlhkalId;O9GhxalIdbhmalId;K9GhPkdndnadTmbJbbbbJbbjZJbbbbaPam:tgPaPJbbbb9DEgPaxak:tgxaxaP9DEgxaDaq:tgDaDax9DEgD:vaDJbbbb9BEhDawcdthsarhHadhzindndnaDaeIdbam:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcv2c;j:KM;jbGhvdndnaDaeclfIdbak:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcq2cM;j:KMeGavVhvdndnaDaecwfIdbaq:tNJb;au9eNJbbbZMgx:lJbbb9p9DTmbax:Ohixekcjjjj94hikaHavaicztaicwtcj;GiGVaicsGVc:p;G:dKGcH2c;d;H:WKGcC2c:KM;j:KdGVBdbaeasfheaHclfhHazcufgzmbkalcbcj;GbzNjjjbhiarhHadheinaiaHydbgzcFrGcx2fgvavydbcefBdbaiazcq4cFrGcx2fgvavydlcefBdlaiazcC4cFrGcx2fgzazydwcefBdwaHclfhHaecufgembxdkkalcbcj;GbzNjjjb8AkcbhHcbhzcbhecbhvinalaHfgiydbhsaiazBdbaicwfgwydbhOawavBdbaiclfgiydbhwaiaeBdbasazfhzaOavfhvawaefheaHcxfgHcj;Gb9hmbkcbhHalaocbyd:m:kjjbHjjjjbbgiBd:e9GdnadTmbabhzinazaHBdbazclfhzadaHcefgH9hmbkabhHadhzinalaraHydbgecdtfydbcFrGcx2fgvavydbgvcefBdbaiavcdtfaeBdbaHclfhHazcufgzmbkaihHadhzinalaraHydbgecdtfydbcq4cFrGcx2fgvavydlgvcefBdlabavcdtfaeBdbaHclfhHazcufgzmbkabhHadhzinalaraHydbgecdtfydbcC4cFrGcx2fgvavydwgvcefBdwaiavcdtfaeBdbaHclfhHazcufgzmbkcbhHinabaiydbcdtfaHBdbaiclfhiadaHcefgH9hmbkkclhidninaic98Smealcj;Gbfaifydbcbyd1:kjjbH:bjjjbbaic98fhixbkkalc;W;Gbf8Kjjjjbk9teiucbcbyd:q:kjjbgeabcifc98GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:kjjbgeabcrfc94GfgbBd:q:kjjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd:q:kjjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd:q:kjjbfgdBd:q:kjjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akkk:Iddbcjwk:edb4:h9w9N94:P:gW:j9O:ye9Pbbbbbbebbbdbbbebbbdbbbbbbbdbbbbbbbebbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:bc:eqkzebbbebbbdbbba:vbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(0),n.exports.meshopt_encodeIndexVersion(1)});function o(g){for(var m=new Uint8Array(g.length),y=0;y<g.length;++y){var b=g.charCodeAt(y);m[y]=b>96?b-97:b>64?b-39:b+4}for(var x=0,y=0;y<g.length;++y)m[x++]=m[y]<60?t[m[y]]:(m[y]-60)*64+m[++y];return m.buffer.slice(0,x)}function r(g){if(!g)throw new Error("Assertion failed")}function s(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function a(g,m,y,b){var x=n.exports.sbrk,A=x(m.length*4),E=x(y*4),S=new Uint8Array(n.exports.memory.buffer),v=s(m);S.set(v,A),b&&b(A,A,m.length,y);var P=g(E,A,m.length,y);S=new Uint8Array(n.exports.memory.buffer);var M=new Uint32Array(y);new Uint8Array(M.buffer).set(S.subarray(E,E+y*4)),v.set(S.subarray(A,A+m.length*4)),x(A-x(0));for(var R=0;R<m.length;++R)m[R]=M[m[R]];return[M,P]}function l(g,m,y,b){var x=n.exports.sbrk,A=x(y*4),E=x(y*b),S=new Uint8Array(n.exports.memory.buffer);S.set(s(m),E),g(A,E,y,b),S=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(y);return new Uint8Array(v.buffer).set(S.subarray(A,A+y*4)),x(A-x(0)),v}function u(g,m,y,b,x){var A=n.exports.sbrk,E=A(m),S=A(b*x),v=new Uint8Array(n.exports.memory.buffer);v.set(s(y),S);var P=g(E,m,S,b,x),M=new Uint8Array(P);return M.set(v.subarray(E,E+P)),A(E-A(0)),M}function f(g){for(var m=0,y=0;y<g.length;++y){var b=g[y];m=m<b?b:m}return m}function h(g,m){if(r(m==2||m==4),m==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var y=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(y)}function p(g,m,y,b,x,A,E){var S=n.exports.sbrk,v=S(y*b),P=S(y*A),M=new Uint8Array(n.exports.memory.buffer);M.set(s(m),P),g(v,y,b,x,P,E);var R=new Uint8Array(y*b);return R.set(M.subarray(v,v+y*b)),S(v-S(0)),R}return{ready:i,supported:!0,reorderMesh:function(g,m,y){var b=m?y?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,f(g)+1,b)},reorderPoints:function(g,m){return r(g instanceof Float32Array),r(g.length%m==0),r(m>=3),l(n.exports.meshopt_spatialSortRemap,g,g.length/m,m*4)},encodeVertexBuffer:function(g,m,y){r(y>0&&y<=256),r(y%4==0);var b=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBuffer,b,g,m,y)},encodeIndexBuffer:function(g,m,y){r(y==2||y==4),r(m%3==0);var b=h(g,y),x=n.exports.meshopt_encodeIndexBufferBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexBuffer,x,b,m,4)},encodeIndexSequence:function(g,m,y){r(y==2||y==4);var b=h(g,y),x=n.exports.meshopt_encodeIndexSequenceBound(m,f(b)+1);return u(n.exports.meshopt_encodeIndexSequence,x,b,m,4)},encodeGltfBuffer:function(g,m,y,b){var x={ATTRIBUTES:this.encodeVertexBuffer,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(x[b]),x[b](g,m,y)},encodeFilterOct:function(g,m,y,b){return r(y==4||y==8),r(b>=1&&b<=16),p(n.exports.meshopt_encodeFilterOct,g,m,y,b,16)},encodeFilterQuat:function(g,m,y,b){return r(y==8),r(b>=4&&b<=16),p(n.exports.meshopt_encodeFilterQuat,g,m,y,b,16)},encodeFilterExp:function(g,m,y,b,x){r(y>0&&y%4==0),r(b>=1&&b<=24);var A={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return p(n.exports.meshopt_encodeFilterExp,g,m,y,b,y,x?A[x]:1)}}}();var Mie=function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuikqbeeedddillviebeoweuec:q:Odkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbol79IV9Rbrq;w8Wqdbk;esezu8Jjjjjbcj;eb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Radz1jjjbhwcj;abad9Uc;WFbGgocjdaocjd6EhDaicefhocbhqdnindndndnaeaq9nmbaDaeaq9RaqaDfae6Egkcsfglcl4cifcd4hxalc9WGgmTmecbhPawcjdfhsaohzinaraz9Rax6mvarazaxfgo9RcK6mvczhlcbhHinalgic9WfgOawcj;cbffhldndndndndnazaOco4fRbbaHcoG4ciGPlbedibkal9cb83ibalcwf9cb83ibxikalaoRblaoRbbgOco4gAaAciSgAE86bbawcj;cbfaifglcGfaoclfaAfgARbbaOcl4ciGgCaCciSgCE86bbalcVfaAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc7faAaCfgARbbaOciGgOaOciSgOE86bbalctfaAaOfgARbbaoRbegOco4gCaCciSgCE86bbalc91faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc4faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc93faAaCfgARbbaOciGgOaOciSgOE86bbalc94faAaOfgARbbaoRbdgOco4gCaCciSgCE86bbalc95faAaCfgARbbaOcl4ciGgCaCciSgCE86bbalc96faAaCfgARbbaOcd4ciGgCaCciSgCE86bbalc97faAaCfgARbbaOciGgOaOciSgOE86bbalc98faAaOfgORbbaoRbigoco4gAaAciSgAE86bbalc99faOaAfgORbbaocl4ciGgAaAciSgAE86bbalc9:faOaAfgORbbaocd4ciGgAaAciSgAE86bbalcufaOaAfglRbbaociGgoaociSgoE86bbalaofhoxdkalaoRbwaoRbbgOcl4gAaAcsSgAE86bbawcj;cbfaifglcGfaocwfaAfgARbbaOcsGgOaOcsSgOE86bbalcVfaAaOfgORbbaoRbegAcl4gCaCcsSgCE86bbalc7faOaCfgORbbaAcsGgAaAcsSgAE86bbalctfaOaAfgORbbaoRbdgAcl4gCaCcsSgCE86bbalc91faOaCfgORbbaAcsGgAaAcsSgAE86bbalc4faOaAfgORbbaoRbigAcl4gCaCcsSgCE86bbalc93faOaCfgORbbaAcsGgAaAcsSgAE86bbalc94faOaAfgORbbaoRblgAcl4gCaCcsSgCE86bbalc95faOaCfgORbbaAcsGgAaAcsSgAE86bbalc96faOaAfgORbbaoRbvgAcl4gCaCcsSgCE86bbalc97faOaCfgORbbaAcsGgAaAcsSgAE86bbalc98faOaAfgORbbaoRbogAcl4gCaCcsSgCE86bbalc99faOaCfgORbbaAcsGgAaAcsSgAE86bbalc9:faOaAfgORbbaoRbrgocl4gAaAcsSgAE86bbalcufaOaAfglRbbaocsGgoaocsSgoE86bbalaofhoxekalao8Pbb83bbalcwfaocwf8Pbb83bbaoczfhokdnaiam9pmbaHcdfhHaiczfhlarao9RcL0mekkaiam6mvaoTmvdnakTmbawaPfRbbhHawcj;cbfhlashiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkkascefhsaohzaPcefgPad9hmbxikkcbc99arao9Radcaadca0ESEhoxlkaoaxad2fhCdnakmbadhlinaoTmlarao9Rax6mlaoaxfhoalcufglmbkaChoxekcbhmawcjdfhAinarao9Rax6miawamfRbbhHawcj;cbfhlaAhiakhOinaialRbbgzce4cbazceG9R7aHfgH86bbaiadfhialcefhlaOcufgOmbkaAcefhAaoaxfhoamcefgmad9hmbkaChokabaqad2fawcjdfakad2z1jjjb8Aawawcjdfakcufad2fadz1jjjb8Aakaqfhqaombkc9:hoxekc9:hokavcj;ebf8Kjjjjbaok;cseHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecjez:jjjjb8AavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk;oiliui99iue99dnaeTmbcbhiabhlindndnJ;Zl81Zalcof8UebgvciV:Y:vgoal8Ueb:YNgrJb;:FSNJbbbZJbbb:;arJbbbb9GEMgw:lJbbb9p9DTmbaw:OhDxekcjjjj94hDkalclf8Uebhqalcdf8UebhkabaiavcefciGfcetfaD87ebdndnaoak:YNgwJb;:FSNJbbbZJbbb:;awJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavciGfgkcd7cetfaD87ebdndnaoaq:YNgoJb;:FSNJbbbZJbbb:;aoJbbbb9GEMgx:lJbbb9p9DTmbax:OhDxekcjjjj94hDkabaiavcufciGfcetfaD87ebdndnJbbjZararN:tawawN:taoaoN:tgrJbbbbarJbbbb9GE:rJb;:FSNJbbbZMgr:lJbbb9p9DTmbar:Ohvxekcjjjj94hvkabakcetfav87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkkkebcjwklzNbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuikqbbebeedddilve9Weeeviebeoweuec:q:6dkr;leDo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949Wbwl79IV9RbDq:p9sqlbzik9:evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaec:q:yjjbfai86bbaecitc:q1jjbfab8Piw83ibaecefgecjd9hmbkk:N8JlHud97euo978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnadcefal0mbcuhoaiRbbc:Ge9hmbavaialfgrad9Rad;8qbbcj;abad9UhlaicefhodnaeTmbadTmbalc;WFbGglcjdalcjd6EhwcbhDinawaeaD9RaDawfae6Egqcsfglc9WGgkci2hxakcethmalcl4cifcd4hPabaDad2fhsakc;ab6hzcbhHincbhOaohAdndninaraA9RaP6meavcj;cbfaOak2fhCaAaPfhocbhidnazmbarao9Rc;Gb6mbcbhlinaCalfhidndndndndnaAalco4fRbbgXciGPlbedibkaipxbbbbbbbbbbbbbbbbpklbxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklbaoczfhokdndndndndnaXcd4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklzxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklzaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklzaoczfhokdndndndndnaXcl4ciGPlbedibkaipxbbbbbbbbbbbbbbbbpklaxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spklaaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaiaopbbbpklaaoczfhokdndndndndnaXco4Plbedibkaipxbbbbbbbbbbbbbbbbpkl8WxikaiaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaoclfaYpQbfaXc:q:yjjbfRbbfhoxdkaiaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibaXc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgXcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkl8WaocwfaYpQbfaXc:q:yjjbfRbbfhoxekaiaopbbbpkl8Waoczfhokalc;abfhialcjefak0meaihlarao9Rc;Fb0mbkkdnaiak9pmbaici4hlinarao9RcK6miaCaifhXdndndndndnaAaico4fRbbalcoG4ciGPlbedibkaXpxbbbbbbbbbbbbbbbbpkbbxikaXaopbblaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLgQcdp:meaQpmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9ogLpxiiiiiiiiiiiiiiiip8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaoclfaYpQbfaKc:q:yjjbfRbbfhoxdkaXaopbbwaopbbbgQclp:meaQpmbzeHdOiAlCvXoQrLpxssssssssssssssssp9ogLpxssssssssssssssssp8JgQp5b9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibaKc:q:yjjbfpbbbgYaYpmbbbbbbbbbbbbbbbbaQp5e9cjF;8;4;W;G;ab9:9cU1:NgKcitc:q1jjbfpbibp9UpmbedilvorzHOACXQLpPaLaQp9spkbbaocwfaYpQbfaKc:q:yjjbfRbbfhoxekaXaopbbbpkbbaoczfhokalcdfhlaiczfgiak6mbkkaoTmeaohAaOcefgOclSmdxbkkc9:hoxlkdnakTmbavcjdfaHfhiavaHfpbdbhYcbhXinaiavcj;cbfaXfglpblbgLcep9TaLpxeeeeeeeeeeeeeeeegQp9op9Hp9rgLalakfpblbg8Acep9Ta8AaQp9op9Hp9rg8ApmbzeHdOiAlCvXoQrLgEalamfpblbg3cep9Ta3aQp9op9Hp9rg3alaxfpblbg5cep9Ta5aQp9op9Hp9rg5pmbzeHdOiAlCvXoQrLg8EpmbezHdiOAlvCXorQLgQaQpmbedibedibedibediaYp9UgYp9AdbbaiadfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaEa8EpmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwKDYq8AkEx3m5P8Es8FgLa3a5pmwKDYq8AkEx3m5P8Es8Fg8ApmbezHdiOAlvCXorQLgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfglaYaLa8ApmwDKYqk8AExm35Ps8E8FgQaQpmbedibedibedibedip9UgYp9AdbbaladfglaYaQaQpmlvorlvorlvorlvorp9UgYp9AdbbaladfglaYaQaQpmwDqkwDqkwDqkwDqkp9UgYp9AdbbaladfglaYaQaQpmxmPsxmPsxmPsxmPsp9UgYp9AdbbaladfhiaXczfgXak6mbkkaHclfgHad6mbkasavcjdfaqad2;8qbbavavcjdfaqcufad2fad;8qbbaqaDfgDae6mbkkcbc99arao9Radcaadca0ESEhokavcj;kbf8Kjjjjbaokwbz:bjjjbk::seHu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnaeci9UgrcHfal0mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgwce0mbavc;abfcFecje;8kbavcUf9cu83ibavc8Wf9cu83ibavcyf9cu83ibavcaf9cu83ibavcKf9cu83ibavczf9cu83ibav9cu83iwav9cu83ibaialfc9WfhDaicefgqarfhidnaeTmbcmcsawceSEhkcbhxcbhmcbhPcbhwcbhlindnaiaD9nmbc9:hoxikdndnaqRbbgoc;Ve0mbavc;abfalaocu7gscl4fcsGcitfgzydlhrazydbhzdnaocsGgHak9pmbavawasfcsGcdtfydbaxaHEhoaHThsdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkaxasfhxcdhHavawcdtfaoBdbawasfhwcehsalhOxdkdndnaHcsSmbaHc987aHamffcefhoxekaicefhoai8SbbgHcFeGhsdndnaHcu9mmbaohixekaicvfhiascFbGhscrhHdninao8SbbgOcFbGaHtasVhsaOcu9kmeaocefhoaHcrfgHc8J9hmbxdkkaocefhikasce4cbasceG9R7amfhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhHavawcdtfaoBdbcehsawcefhwalhOaohmxekdnaocpe0mbaxcefgHavawaDaocsGfRbbgocl49RcsGcdtfydbaocz6gzEhravawao9RcsGcdtfydbaHazfgAaocsGgHEhoaHThCdndnadcd9hmbabaPcetfgHax87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHaxBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfaxBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgOaxBdlaOarBdbavawazfgwcsGcdtfaoBdbalcefcsGhOawaCfhwaxhzaAaCfhxxekaxcbaiRbbgOEgzaoc;:eSgHfhraOcsGhCaOcl4hAdndnaOcs0mbarcefhoxekarhoavawaA9RcsGcdtfydbhrkdndnaCmbaocefhxxekaohxavawaO9RcsGcdtfydbhokdndnaHTmbaicefhHxekaicdfhHai8SbegscFeGhzdnascu9kmbaicofhXazcFbGhzcrhidninaH8SbbgscFbGaitazVhzascu9kmeaHcefhHaicrfgic8J9hmbkaXhHxekaHcefhHkazce4cbazceG9R7amfgmhzkdndnaAcsSmbaHhsxekaHcefhsaH8SbbgicFeGhrdnaicu9kmbaHcvfhXarcFbGhrcrhidninas8SbbgHcFbGaitarVhraHcu9kmeascefhsaicrfgic8J9hmbkaXhsxekascefhskarce4cbarceG9R7amfgmhrkdndnaCcsSmbashixekascefhias8SbbgocFeGhHdnaocu9kmbascvfhXaHcFbGhHcrhodninai8SbbgscFbGaotaHVhHascu9kmeaicefhiaocrfgoc8J9hmbkaXhixekaicefhikaHce4cbaHceG9R7amfgmhokdndnadcd9hmbabaPcetfgHaz87ebaHclfao87ebaHcdfar87ebxekabaPcdtfgHazBdbaHcwfaoBdbaHclfarBdbkcdhsavawcdtfazBdbavawcefgwcsGcdtfarBdbcihHavc;abfalcitfgXazBdlaXarBdbavawaOcz6aAcsSVfgwcsGcdtfaoBdbawaCTaCcsSVfhwalcefcsGhOkaqcefhqavc;abfaOcitfgOarBdlaOaoBdbavc;abfalasfcsGcitfgraoBdlarazBdbawcsGhwalaHfcsGhlaPcifgPae6mbkkcbc99aiaDSEhokavc;aef8Kjjjjbaok:flevu8Jjjjjbcz9Rhvc9:hodnaecvfal0mbcuhoaiRbbc;:eGc;qe9hmbav9cb83iwaicefhraialfc98fhwdnaeTmbdnadcdSmbcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcdtfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfglBdbaoalBdbaDcefgDae9hmbxdkkcbhDindnaraw6mbc9:skarcefhoar8SbbglcFeGhidndnalcu9mmbaohrxekarcvfhraicFbGhicrhldninao8SbbgdcFbGaltaiVhiadcu9kmeaocefhoalcrfglc8J9hmbxdkkaocefhrkabaDcetfaic8Etc8F91aicd47avcwfaiceGcdtVgoydbfgl87ebaoalBdbaDcefgDae9hmbkkcbc99arawSEhokaok:wPliuo97eue978Jjjjjbca9Rhiaec98Ghldndnadcl9hmbdnalTmbcbhvabhdinadadpbbbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDpxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbadczfhdavclfgval6mbkkalaeSmeaipxbbbbbbbbbbbbbbbbgqpklbaiabalcdtfgdaeciGglcdtgv;8qbbdnalTmbaiaipblbgocKp:RecKp:Sep;6egraocwp:RecKp:Sep;6earp;Geaoczp:RecKp:Sep;6egwp;Gep;Kep;LegDaqp:2egqarpxbbbjbbbjbbbjbbbjgkp9op9rp;Kegrpxbb;:9cbb;:9cbb;:9cbb;:9cararp;MeaDaDp;Meawaqawakp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFbbbFbbbFbbbFbbbp9oaopxbbbFbbbFbbbFbbbFp9op9qarawp;Meaqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaDawp;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpklbkadaiav;8qbbskdnalTmbcbhvabhdinadczfgxaxpbbbgopxbbbbbbFFbbbbbbFFgkp9oadpbbbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpkbbadaDakp9oaoarpmbezHdiOAlvCXorQLp9qpkbbadcafhdavclfgval6mbkkalaeSmbaiaeciGgvcitgdfcbcaad9R;8kbaiabalcitfglad;8qbbdnavTmbaiaipblzgopxbbbbbbFFbbbbbbFFgkp9oaipblbgDaopmbediwDqkzHOAKY8AEgwczp:Reczp:Sep;6egraDaopmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eawczp:Sep;6egwp;Gearp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egqarpxbbbjbbbjbbbjbbbjgmp9op9rp;Kegrpxb;:FSb;:FSb;:FSb;:FSararp;Meaoaop;Meawaqawamp9op9rp;Kegrarp;Mep;Kep;Kep;Jep;Negwp;Mepxbbn0bbn0bbn0bbn0gqp;KepxFFbbFFbbFFbbFFbbp9oaoawp;Meaqp;Keczp:Rep9qgoarawp;Meaqp;KepxFFbbFFbbFFbbFFbbp9ogrpmwDKYqk8AExm35Ps8E8Fp9qpklzaiaDakp9oaoarpmbezHdiOAlvCXorQLp9qpklbkalaiad;8qbbkk;4wllue97euv978Jjjjjbc8W9Rhidnaec98GglTmbcbhvabhoinaiaopbbbgraoczfgwpbbbgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklbaopxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblbpEb:T:j83ibaocwfarp5eaipblbpEe:T:j83ibawaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblbpEd:T:j83ibaocKfakp5eaipblbpEi:T:j83ibaocafhoavclfgval6mbkkdnalaeSmbaiaeciGgvcitgofcbcaao9R;8kbaiabalcitfgwao;8qbbdnavTmbaiaipblbgraipblzgDpmlvorxmPsCXQL358E8Fgqczp:Segkclp:RepklaaipxbbjZbbjZbbjZbbjZpx;Zl81Z;Zl81Z;Zl81Z;Zl81Zakpxibbbibbbibbbibbbp9qp;6ep;NegkaraDpmbediwDqkzHOAKY8AEgrczp:Reczp:Sep;6ep;MegDaDp;Meakarczp:Sep;6ep;Megxaxp;Meakaqczp:Reczp:Sep;6ep;Megqaqp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jepxb;:FSb;:FSb;:FSb;:FSgkp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbgmp9oaxakp;Mearp;Keczp:Rep9qgxaDakp;Mearp;Keamp9oaqakp;Mearp;Keczp:Rep9qgkpmbezHdiOAlvCXorQLgrp5baipblapEb:T:j83ibaiarp5eaipblapEe:T:j83iwaiaxakpmwDKYqk8AExm35Ps8E8Fgkp5baipblapEd:T:j83izaiakp5eaipblapEi:T:j83iKkawaiao;8qbbkk:Pddiue978Jjjjjbc;ab9Rhidnadcd4ae2glc98GgvTmbcbheabhdinadadpbbbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbadczfhdaeclfgeav6mbkkdnavalSmbaialciGgecdtgdVcbc;abad9R;8kbaiabavcdtfgvad;8qbbdnaeTmbaiaipblbgocwp:Recwp:Sep;6eaocep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepklbkavaiad;8qbbkk9teiucbcbydj1jjbgeabcifc98GfgbBdj1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkkebcjwklz:Dbb",n=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]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?a(t):a(e),r,s=WebAssembly.instantiate(o,{}).then(function(x){r=x.instance,r.exports.__wasm_call_ctors()});function a(x){for(var A=new Uint8Array(x.length),E=0;E<x.length;++E){var S=x.charCodeAt(E);A[E]=S>96?S-97:S>64?S-39:S+4}for(var v=0,E=0;E<x.length;++E)A[v++]=A[E]<60?i[A[E]]:(A[E]-60)*64+A[++E];return A.buffer.slice(0,v)}function l(x,A,E,S,v,P,M){var R=x.exports.sbrk,L=S+3&-4,B=R(L*v),_=R(P.length),w=new Uint8Array(x.exports.memory.buffer);w.set(P,_);var D=A(B,S,v,_,P.length);if(D==0&&M&&M(B,L,v),E.set(w.subarray(B,B+S*v)),R(B-R(0)),D!=0)throw new Error("Malformed buffer data: "+D)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},h=[],p=0;function g(x){var A={object:new Worker(x),pending:0,requests:{}};return A.object.onmessage=function(E){var S=E.data;A.pending-=S.count,A.requests[S.id][S.action](S.value),delete A.requests[S.id]},A}function m(x){for(var A="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(o)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+b.name+";"+l.toString()+b.toString(),E=new Blob([A],{type:"text/javascript"}),S=URL.createObjectURL(E),v=h.length;v<x;++v)h[v]=g(S);for(var v=x;v<h.length;++v)h[v].object.postMessage({});h.length=x,URL.revokeObjectURL(S)}function y(x,A,E,S,v){for(var P=h[0],M=1;M<h.length;++M)h[M].pending<P.pending&&(P=h[M]);return new Promise(function(R,L){var B=new Uint8Array(E),_=++p;P.pending+=x,P.requests[_]={resolve:R,reject:L},P.object.postMessage({id:_,count:x,size:A,source:B,mode:S,filter:v},[B.buffer])})}function b(x){var A=x.data;if(!A.id)return self.close();self.ready.then(function(E){try{var S=new Uint8Array(A.count*A.size);l(E,E.exports[A.mode],S,A.count,A.size,A.source,E.exports[A.filter]),self.postMessage({id:A.id,count:A.count,action:"resolve",value:S},[S.buffer])}catch(v){self.postMessage({id:A.id,count:A.count,action:"reject",value:v})}})}return{ready:s,supported:!0,useWorkers:function(x){m(x)},decodeVertexBuffer:function(x,A,E,S,v){l(r,r.exports.meshopt_decodeVertexBuffer,x,A,E,S,r.exports[u[v]])},decodeIndexBuffer:function(x,A,E,S){l(r,r.exports.meshopt_decodeIndexBuffer,x,A,E,S)},decodeIndexSequence:function(x,A,E,S){l(r,r.exports.meshopt_decodeIndexSequence,x,A,E,S)},decodeGltfBuffer:function(x,A,E,S,v,P){l(r,r.exports[f[v]],x,A,E,S,r.exports[u[P]])},decodeGltfBufferAsync:function(x,A,E,S,v){return h.length>0?y(x,A,E,f[S],u[v]):s.then(function(){var P=new Uint8Array(x*A);return l(r,r.exports[f[S]],P,x,A,E,r.exports[u[v]]),P})}}}();var Din=function(){var e="b9H79Tebbbe9Hk9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gvuuuuue999Gquuuuuuu99uueu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9GiuuueuizsdilvoirwDbqqbeqlve9Weiiviebeoweuecj:Pdkr:Tewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bl8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bvQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7boX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2Wbra9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbwl79IV9RbDDwebcekdmxq;UMesdbk:kfvKue99euY99Qu8Jjjjjbc;W;qb9Rgs8Kjjjjbcbhzascxfcbc;Kbz:ljjjb8AdnabaeSmbabaeadcdtz:kjjjb8AkdnamcdGTmbalcrfci4gHcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhAcbhlcbhednadTmbcbhlabheadhHinaAaeydbgOci4fgCaCRbbgCceaOcrGgOtV86bbaCcu7aO4ceGalfhlaeclfheaHcufgHmbkcualcdtalcFFFFi0Ehekaecbyd;S1jjbHjjjjbbhzascxfasyd2gecdtfazBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhQdnadTmbaecufhCcbhLinabaXcdtfgKydbgAc:v;t;h;Ev2hOcbhedndninaQaOaCGgOcdtfgYydbgHcuSmeazaHcdtfydbaASmdaecefgeaOfhOaeaC9nmbxdkkazaLcdtfaABdbaYaLBdbaLhHaLcefhLkaKaHBdbaXcefgXad9hmbkkaQcbyd;O1jjbH:bjjjbbasasyd2cufBd2kcualcefgecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbh8Aascxfasyd2gecdtfa8ABdbasa8ABdlasaecefBd2cuadcitadcFFFFe0Ecbyd;S1jjbHjjjjbbhEascxfasyd2gecdtfaEBdbasaEBdwasaecefBd2asclfabadalcbz:cjjjbcualcdtg3alcFFFFi0Eg5cbyd;S1jjbHjjjjbbhQascxfasyd2gecdtfaQBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Eascxfasyd2gecdtfa8EBdbasaecefBd2alcd4alfhOcehHinaHgecethHaeaO6mbkcbhLcuaecdtgOaecFFFFi0Ecbyd;S1jjbHjjjjbbhHascxfasyd2gCcdtfaHBdbasaCcefBd2aHcFeaOz:ljjjbhXdnalTmbavcd4hCaecufhHinaLhednazTmbazaLcdtfydbhekaiaeaC2cdtfgeydlgOcH4aO7c:F:b:DD2aeydbgOcH4aO7c;D;O:B8J27aeydwgecH4ae7c:3F;N8N27aHGheaLcdth8FdndndndndnazTmbaza8FfhKcbhOinaXaecdtfgYydbgAcuSmlaiazaAcdtfydbaC2cdtfaiaKydbaC2cdtfcxz:ojjjbTmiaOcefgOaefaHGheaOaH9nmbxdkkaiaLaC2cdtfhKcbhOinaXaecdtfgYydbgAcuSmiaiaAaC2cdtfaKcxz:ojjjbTmdaOcefgOaefaHGheaOaH9nmbkkcbhYkaYydbgecu9hmekaYaLBdbaLhekaQa8FfaeBdbaLcefgLal9hmbkcbhea8EhHinaHaeBdbaHclfhHalaecefge9hmbkcbheaQhHa8EhOindnaeaHydbgCSmbaOa8EaCcdtfgCydbBdbaCaeBdbkaHclfhHaOclfhOalaecefge9hmbkkcbhaaXcbyd;O1jjbH:bjjjbbasasyd2cufBd2alcbyd;S1jjbHjjjjbbhXascxfasyd2gecdtfaXBdbasaecefBd2a5cbyd;S1jjbHjjjjbbheascxfasyd2gHcdtfaeBdbasaHcefBd2a5cbyd;S1jjbHjjjjbbhHascxfasyd2gOcdtfaHBdbasaOcefBd2aecFea3z:ljjjbhhaHcFea3z:ljjjbhgdnalTmbaEcwfh8Jindna8AaagOcefgacdtfydbgCa8AaOcdtgefydbgHSmbaCaH9Rh8FaEaHcitfh3agaefh8KahaefhLcbhAindndna3aAcitfydbgYaO9hmbaLaOBdba8KaOBdbxekdna8AaYcdtg8LfgeclfydbgHaeydbgeSmbaEaecitgCfydbaOSmeaHae9Rh8Maecu7aHfhKa8JaCfhHcbheinaKaeSmeaecefheaHydbhCaHcwfhHaCaO9hmbkaea8M6mekaga8LfgeaOaYaeydbcuSEBdbaLaYaOaLydbcuSEBdbkaAcefgAa8F9hmbkkaaal9hmbkaQhHa8EhOaghCahhAcbheindndnaeaHydbgY9hmbdnaeaOydbgY9hmbaAydbhYdnaCydbgKcu9hmbaYcu9hmbaXaefcb86bbxikaXaefhLdnaeaKSmbaeaYSmbaLce86bbxikaLcl86bbxdkdnaea8EaYcdtgKfydb9hmbdnaCydbgLcuSmbaeaLSmbaAydbg8FcuSmbaea8FSmbagaKfydbg3cuSmba3aYSmbahaKfydbgKcuSmbaKaYSmbdnaQaLcdtfydbgYaQaKcdtfydb9hmbaYaQa8FcdtfydbgKSmbaKaQa3cdtfydb9hmbaXaefcd86bbxlkaXaefcl86bbxikaXaefcl86bbxdkaXaefcl86bbxekaXaefaXaYfRbb86bbkaHclfhHaOclfhOaCclfhCaAclfhAalaecefge9hmbkdnaqTmbdndnazTmbazheaQhHalhOindnaqaeydbfRbbTmbaXaHydbfcl86bbkaeclfheaHclfhHaOcufgOmbxdkkaQhealhHindnaqRbbTmbaXaeydbfcl86bbkaqcefhqaeclfheaHcufgHmbkkaQhealhOaXhHindnaXaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaOcufgOmbkkamceGTmbaXhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcualcx2alc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhaascxfasyd2gecdtfaaBdbasaecefBd2aaaialavazz:djjjbh8NdndnaDmbcbhycbh8Jxekcbh8JawhecbhHindnaeIdbJbbbb9ETmbasc;Wbfa8JcdtfaHBdba8Jcefh8JkaeclfheaDaHcefgH9hmbkcua8Jal2gecdtaecFFFFi0Ecbyd;S1jjbHjjjjbbhyascxfasyd2gecdtfayBdbasaecefBd2alTmba8JTmbarcd4hLdnazTmba8JcdthicbhYayhKinaoazaYcdtfydbaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbxdkka8JcdthicbhYayhKinaoaYaL2cdtfhAasc;WbfheaKhHa8JhOinaHaAaeydbcdtgCfIdbawaCfIdbNUdbaeclfheaHclfhHaOcufgOmbkaKaifhKaYcefgYal9hmbkkcualc8S2gHalc;D;O;f8U0EgCcbyd;S1jjbHjjjjbbheascxfasyd2gOcdtfaeBdbasaOcefBd2aecbaHz:ljjjbhqdndndndna8JTmbaCcbyd;S1jjbHjjjjbbhvascxfasyd2gecdtfavBdbcehOasaecefBd2avcbaHz:ljjjb8Acua8Jal2gecltgHaecFFFFb0Ecbyd;S1jjbHjjjjbbhrascxfasyd2gecdtfarBdbasaecefBd2arcbaHz:ljjjb8AadmexikcbhvadTmecbhrkcbhAabhHindnaaaHclfydbgYcx2fgeIdbaaaHydbgKcx2fgOIdbg8P:tgIaaaHcwfydbgLcx2fgCIdlaOIdlg8R:tg8SNaCIdba8P:tgRaeIdla8R:tg8UN:tg8Va8VNa8UaCIdwaOIdwg8W:tg8XNa8SaeIdwa8W:tg8UN:tg8Sa8SNa8UaRNa8XaIN:tgIaINMM:rgRJbbbb9ETmba8VaR:vh8VaIaR:vhIa8SaR:vh8SkaqaQaKcdtfydbc8S2fgea8SaR:rgRa8SNNg8UaeIdbMUdbaeaIaRaINg8YNg8XaeIdlMUdlaea8VaRa8VNg8ZNg80aeIdwMUdwaea8Ya8SNg8YaeIdxMUdxaea8Za8SNg81aeIdzMUdzaea8ZaINg8ZaeIdCMUdCaea8SaRa8Va8WNa8Sa8PNa8RaINMM:mg8RNg8PNg8SaeIdKMUdKaeaIa8PNgIaeId3MUd3aea8Va8PNg8VaeIdaMUdaaea8Pa8RNg8PaeId8KMUd8KaeaRaeIdyMUdyaqaQaYcdtfydbc8S2fgea8UaeIdbMUdbaea8XaeIdlMUdlaea80aeIdwMUdwaea8YaeIdxMUdxaea81aeIdzMUdzaea8ZaeIdCMUdCaea8SaeIdKMUdKaeaIaeId3MUd3aea8VaeIdaMUdaaea8PaeId8KMUd8KaeaRaeIdyMUdyaqaQaLcdtfydbc8S2fgea8UaeIdbMUdbaea8XaeIdlMUdlaea80aeIdwMUdwaea8YaeIdxMUdxaea81aeIdzMUdzaea8ZaeIdCMUdCaea8SaeIdKMUdKaeaIaeId3MUd3aea8VaeIdaMUdaaea8PaeId8KMUd8KaeaRaeIdyMUdyaHcxfhHaAcifgAad6mbkcbhiabhKinabaicdtfhYcbhHinaXaYaHc:G1jjbfydbcdtfydbgOfRbbhedndnaXaKaHfydbgCfRbbgAc99fcFeGcpe0mbaeceSmbaecd9hmekdnaAcufcFeGce0mbahaCcdtfydbaO9hmekdnaecufcFeGce0mbagaOcdtfydbaC9hmekdnaAcv2aefcj1jjbfRbbTmbaQaOcdtfydbaQaCcdtfydb0mekJbbacJbbacJbbjZaeceSEaAceSEh8ZdnaaaYaHc:K1jjbfydbcdtfydbcx2fgeIdwaaaCcx2fgAIdwg8R:tg8VaaaOcx2fgLIdwa8R:tg8Sa8SNaLIdbaAIdbg8W:tgIaINaLIdlaAIdlg8U:tgRaRNMMg8PNa8Va8SNaeIdba8W:tg80aINaRaeIdla8U:tg8YNMMg8Xa8SN:tg8Va8VNa80a8PNa8XaIN:tg8Sa8SNa8Ya8PNa8XaRN:tgIaINMM:rgRJbbbb9ETmba8VaR:vh8VaIaR:vhIa8SaR:vh8SkaqaQaCcdtfydbc8S2fgea8Sa8Za8P:rNgRa8SNNg8XaeIdbMUdbaeaIaRaINg8ZNg80aeIdlMUdlaea8VaRa8VNg8PNg8YaeIdwMUdwaea8Za8SNg8ZaeIdxMUdxaea8Pa8SNg81aeIdzMUdzaea8PaINgBaeIdCMUdCaea8SaRa8Va8RNa8Sa8WNa8UaINMM:mg8RNg8PNg8SaeIdKMUdKaeaIa8PNgIaeId3MUd3aea8Va8PNg8VaeIdaMUdaaea8Pa8RNg8PaeId8KMUd8KaeaRaeIdyMUdyaqaQaOcdtfydbc8S2fgea8XaeIdbMUdbaea80aeIdlMUdlaea8YaeIdwMUdwaea8ZaeIdxMUdxaea81aeIdzMUdzaeaBaeIdCMUdCaea8SaeIdKMUdKaeaIaeId3MUd3aea8VaeIdaMUdaaea8PaeId8KMUd8KaeaRaeIdyMUdykaHclfgHcx9hmbkaKcxfhKaicifgiad6mbkdna8JTmbcbhKinJbbbbh8WaaabaKcdtfgeclfydbgLcx2fgHIdwaaaeydbgicx2fgOIdwg8Y:tgIaINaHIdbaOIdbg81:tg8Va8VNaHIdlaOIdlgB:tgRaRNMMg8Zaaaecwfydbg8Fcx2fgeIdwa8Y:tg8PNaIaIa8PNa8VaeIdba81:tg8RNaRaeIdlaB:tg8UNMMg8SN:tJbbbbJbbjZa8Za8Pa8PNa8Ra8RNa8Ua8UNMMg80Na8Sa8SN:tg8X:va8XJbbbb9BEg8XNh83a80aINa8Pa8SN:ta8XNhUa8Za8UNaRa8SN:ta8XNh85a80aRNa8Ua8SN:ta8XNh86a8Za8RNa8Va8SN:ta8XNh87a80a8VNa8Ra8SN:ta8XNh88a8Va8UNa8RaRN:tg8Sa8SNaRa8PNa8UaIN:tg8Sa8SNaIa8RNa8Pa8VN:tg8Sa8SNMM:rJbbbZNh8Sayaia8J2g3cdtfhHaya8Fa8J2gwcdtfhOayaLa8J2g8LcdtfhCa8Y:mh89aB:mh8:a81:mhZcbhAa8JhYJbbbbh8UJbbbbh8XJbbbbh8ZJbbbbh80Jbbbbh8YJbbbbh81JbbbbhBJbbbbhnJbbbbhcinasc;WbfaAfgecwfa8SaUaCIdbaHIdbg8P:tgRNa83aOIdba8P:tg8RNMgINUdbaeclfa8Sa86aRNa85a8RNMg8VNUdbaea8Sa88aRNa87a8RNMgRNUdbaecxfa8Sa89aINa8:a8VNa8PaZaRNMMMg8PNUdba8SaIa8VNNa80Mh80a8SaIaRNNa8YMh8Ya8Sa8VaRNNa81Mh81a8Sa8Pa8PNNa8WMh8Wa8SaIa8PNNa8UMh8Ua8Sa8Va8PNNa8XMh8Xa8SaRa8PNNa8ZMh8Za8SaIaINNaBMhBa8Sa8Va8VNNanMhna8SaRaRNNacMhcaHclfhHaCclfhCaOclfhOaAczfhAaYcufgYmbkavaic8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyavaLc8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyava8Fc8S2fgeacaeIdbMUdbaeanaeIdlMUdlaeaBaeIdwMUdwaea81aeIdxMUdxaea8YaeIdzMUdzaea80aeIdCMUdCaea8ZaeIdKMUdKaea8XaeId3MUd3aea8UaeIdaMUdaaea8WaeId8KMUd8Kaea8SaeIdyMUdyara3cltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkara8LcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkarawcltfhYcbhHa8JhCinaYaHfgeasc;WbfaHfgOIdbaeIdbMUdbaeclfgAaOclfIdbaAIdbMUdbaecwfgAaOcwfIdbaAIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaCcufgCmbkaKcifgKad6mbkkcbhOxekcehOcbhrkcbh8FdndnamcwGg9cmbJbbbbh8ZcbhJcbhocbhCxekcbhea5cbyd;S1jjbHjjjjbbhCascxfasyd2gHcdtfaCBdbasaHcefBd2dnalTmbaChHinaHaeBdbaHclfhHalaecefge9hmbkkdnaOmbcbhiinabaicdtfhLcbhKinaQaLaKcdtgec:G1jjbfydbcdtfydbcdtfydbhHdnaCaQaLaefydbcdtfydbgOcdtfgAydbgeaOSmbinaAaCaegOcdtfgYydbgeBdbaYhAaOae9hmbkkdnaCaHcdtfgAydbgeaHSmbinaAaCaegHcdtfgYydbgeBdbaYhAaHae9hmbkkdnaOaHSmbaCaOaHaOaH0EcdtfaOaHaOaH6EBdbkaKcefgKci9hmbkaicifgiad6mbkkcbhJdnalTmbcbhYindnaQaYcdtgefydbaY9hmbaYhHdnaCaefgKydbgeaYSmbaKhOinaOaCaegHcdtfgAydbgeBdbaAhOaHae9hmbkkaKaHBdbkaYcefgYal9hmbkcbheaQhOaChHcbhJindndnaeaOydbgA9hmbdnaeaHydbgA9hmbaHaJBdbaJcefhJxdkaHaCaAcdtfydbBdbxekaHaCaAcdtfydbBdbkaOclfhOaHclfhHalaecefge9hmbkkcuaJcltgeaJcjjjjiGEcbyd;S1jjbHjjjjbbhoascxfasyd2gHcdtfaoBdbasaHcefBd2aocbaez:ljjjbhAdnalTmbaChOaahealhYinaecwfIdbh8SaeclfIdbhIaAaOydbcltfgHaeIdbaHIdbMUdbaHclfgKaIaKIdbMUdbaHcwfgKa8SaKIdbMUdbaHcxfgHaHIdbJbbjZMUdbaOclfhOaecxfheaYcufgYmbkkdnaJTmbaAheaJhHinaecxfgOIdbh8SaOcbBdbaeaeIdbJbbbbJbbjZa8S:va8SJbbbb9BEg8SNUdbaeclfgOa8SaOIdbNUdbaecwfgOa8SaOIdbNUdbaeczfheaHcufgHmbkkdnalTmbaChOaahealhYinaAaOydbcltfgHcxfgKaecwfIdbaHcwfIdb:tg8Sa8SNaeIdbaHIdb:tg8Sa8SNaeclfIdbaHclfIdb:tg8Sa8SNMMg8SaKIdbgIaIa8S9DEUdbaOclfhOaecxfheaYcufgYmbkkdnaJmbcbhJJFFuuh8ZxekaAcxfheaAhHaJhOinaHaeIdbUdbaeczfheaHclfhHaOcufgOmbkJFFuuh8ZaAheaJhHinaeIdbg8Sa8Za8Za8S9EEh8ZaeclfheaHcufgHmbkkasydlh9ednalTmba9eclfhea9eydbhAaXhHalhYcbhOincbaeydbgKaA9RaHRbbcpeGEaOfhOaHcefhHaeclfheaKhAaYcufgYmbkaOce4h8Fkcuada8F9RcifgTcx2aTc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbhDascxfasyd2gecdtfaDBdbasaecefBd2cuaTcdtaTcFFFFi0Ecbyd;S1jjbHjjjjbbhSascxfasyd2gecdtfaSBdbasaecefBd2a5cbyd;S1jjbHjjjjbbh8Mascxfasyd2gecdtfa8MBdbasaecefBd2alcbyd;S1jjbHjjjjbbh9hascxfasyd2gecdtfa9hBdbasaecefBd2axaxNa8NJbbjZamclGEg83a83N:vhcJbbbbhndnadak9nmbdnaTci6mba8Jclth9iaDcwfh6JbbbbhBJbbbbhninasclfabadalaQz:cjjjbabh8FcbhEcbh5inaba5cdtfh3cbheindnaQa8FaefydbgOcdtgifydbgYaQa3aec:W1jjbfydbcdtfydbgHcdtgwfydbgKSmbaXaHfRbbgLcv2aXaOfRbbgAfc;a1jjbfRbbg8AaAcv2aLfg8Lc;a1jjbfRbbg8KVcFeGTmbdnaKaY9nmba8Lcj1jjbfRbbcFeGmekaAcufhYdnaAaL9hmbaYcFeGce0mbahaifydbaH9hmekdndnaAclSmbaLcl9hmekdnaYcFeGce0mbahaifydbaH9hmdkaLcufcFeGce0mbagawfydbaO9hmekaDaEcx2fgAaHaOa8KcFeGgYEBdlaAaOaHaYEBdbaAaYa8AGcb9hBdwaEcefhEkaeclfgecx9hmbkdna5cifg5ad9pmba8Fcxfh8FaEcifaT9nmekkaETmdcbhiinJbbbbJbbjZaqaQaDaicx2fgAydlgKaAydbgYaAydwgHEgLcdtfydbc8S2fgeIdyg8S:va8SJbbbb9BEaeIdwaaaYaKaHEg8Fcx2fgHIdwgRNaeIdzaHIdbg8PNaeIdaMg8Sa8SMMaRNaeIdlaHIdlg8RNaeIdCaRNaeId3Mg8Sa8SMMa8RNaeIdba8PNaeIdxa8RNaeIdKMg8Sa8SMMa8PNaeId8KMMM:lNh80JbbbbJbbjZaqaQaYcdtfydbc8S2fgeIdyg8S:va8SJbbbb9BEaeIdwaaaKcx2fgHIdwg8VNaeIdzaHIdbg8WNaeIdaMg8Sa8SMMa8VNaeIdlaHIdlg8UNaeIdCa8VNaeId3Mg8Sa8SMMa8UNaeIdba8WNaeIdxa8UNaeIdKMg8Sa8SMMa8WNaeId8KMMM:lNh8YaAcwfh3aAclfhwdna8JTmbavaYc8S2fgOIdwa8VNaOIdza8WNaOIdaMg8Sa8SMMa8VNaOIdla8UNaOIdCa8VNaOId3Mg8Sa8SMMa8UNaOIdba8WNaOIdxa8UNaOIdKMg8Sa8SMMa8WNaOId8KMMMh8SayaKa8J2cdtfhHaraYa8J2cltfheaOIdyh8Xa8JhOinaHIdbgIaIa8XNaecxfIdba8VaecwfIdbNa8WaeIdbNa8UaeclfIdbNMMMgIaIM:tNa8SMh8SaHclfhHaeczfheaOcufgOmbkavaLc8S2fgOIdwaRNaOIdza8PNaOIdaMgIaIMMaRNaOIdla8RNaOIdCaRNaOId3MgIaIMMa8RNaOIdba8PNaOIdxa8RNaOIdKMgIaIMMa8PNaOId8KMMMhIaya8Fa8J2cdtfhHaraLa8J2cltfheaOIdyh8Wa8JhOinaHIdbg8Va8Va8WNaecxfIdbaRaecwfIdbNa8PaeIdbNa8RaeclfIdbNMMMg8Va8VM:tNaIMhIaHclfhHaeczfheaOcufgOmbka80aI:lMh80a8Ya8S:lMh8YkawaKa8Fa8Ya809FgeEBdbaAaYaLaeEBdba3a8Ya80aeEUdbaicefgiaE9hmbkasc;Wbfcbcj;qbz:ljjjb8Aa6heaEhHinasc;WbfaeydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbcefBdbaecxfheaHcufgHmbkcbhecbhHinasc;WbfaefgOydbhAaOaHBdbaAaHfhHaeclfgecj;qb9hmbkcbhea6hHinasc;WbfaHydbcA4cF8FGgOcFAaOcFA6EcdtfgOaOydbgOcefBdbaSaOcdtfaeBdbaHcxfhHaEaecefge9hmbkadak9RgOci9Uh9kdnalTmbcbhea8MhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh0a9hcbalz:ljjjbh9maOcO9Uh9na9kce4h9oasydwh9pcbh8KcbhwdninaDaSawcdtfydbcx2fg3Idwg8Sac9Emea8Ka9k9pmeJFFuuhIdna9oaE9pmbaDaSa9ocdtfydbcx2fIdwJbb;aZNhIkdna8SaI9ETmba8San9ETmba8Ka9n0mdkdna9maQa3ydlgicdtg9qfydbgAfg9rRbba9maQa3ydbgLcdtg9sfydbgHfg9tRbbVmbaXaLfRbbh9udna9eaHcdtfgeclfydbgOaeydbgeSmbaOae9RhKa9paecitfheaaaAcx2fg8Lcwfh5a8Lclfh9vaaaHcx2fg8Acwfh9wa8Aclfh9xcbhHceh8Fdnindna8MaeydbcdtfydbgOaASmba8MaeclfydbcdtfydbgYaASmbaOaYSmbaaaYcx2fgYIdbaaaOcx2fgOIdbg8V:tg8Sa9xIdbaOIdlgR:tg8WNa8AIdba8V:tg8UaYIdlaR:tgIN:tg8Pa8Sa9vIdbaR:tg8XNa8LIdba8V:tg80aIN:tgRNaIa9wIdbaOIdwg8R:tg8YNa8WaYIdwa8R:tg8VN:tg8WaIa5Idba8R:tg81Na8Xa8VN:tgINa8Va8UNa8Ya8SN:tg8Ra8Va80Na81a8SN:tg8SNMMa8Pa8PNa8Wa8WNa8Ra8RNMMaRaRNaIaINa8Sa8SNMMN:rJbbj8:N9FmdkaecwfheaHcefgHaK6h8FaKaH9hmbkka8FceGTmba9ocefh9oxeka3cwfhHdndndndna9uc9:fPdebdkaLheina8MaecdtgefaiBdba8EaefydbgeaL9hmbxikkdnagahaha9sfydbaiSEa8Ea9sfydbgLcdtfydbgecu9hmba8Ea9qfydbheka8Ma9sfaiBdbaehika8MaLcdtfaiBdbka9tce86bba9rce86bbaHIdbg8Sanana8S9DEhna0cefh0cecda9uceSEa8Kfh8KkawcefgwaE9hmbkka0TmddnalTmbcbhKcbhiindna8MaicdtgefydbgOaiSmbaQaOcdtfydbh8FdnaiaQaefydb9hg3mbaqa8Fc8S2fgeaqaic8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdyka8JTmbavaOc8S2fgeavaic8S2gwfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9iaO2hLarhHa8JhAinaHaLfgeaHaKfgOIdbaeIdbMUdbaeclfgYaOclfIdbaYIdbMUdbaecwfgYaOcwfIdbaYIdbMUdbaecxfgeaOcxfIdbaeIdbMUdbaHczfhHaAcufgAmbka3mbJbbbbJbbjZaqawfgeIdyg8S:va8SJbbbb9BEaeIdwaaa8Fcx2fgHIdwg8SNaeIdzaHIdbgINaeIdaMg8Va8VMMa8SNaeIdlaHIdlg8VNaeIdCa8SNaeId3Mg8Sa8SMMa8VNaeIdbaINaeIdxa8VNaeIdKMg8Sa8SMMaINaeId8KMMM:lNg8SaBaBa8S9DEhBkaKa9ifhKaicefgial9hmbkcbhHahheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOahaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkcbhHagheindnaeydbgOcuSmbdnaHa8MaOcdtgAfydbgO9hmbcuhOagaAfydbgAcuSmba8MaAcdtfydbhOkaeaOBdbkaeclfhealaHcefgH9hmbkkaBana8JEhBcbhYabhecbhKindna8MaeydbcdtfydbgHa8MaeclfydbcdtfydbgOSmbaHa8MaecwfydbcdtfydbgASmbaOaASmbabaYcdtfgLaHBdbaLcwfaABdbaLclfaOBdbaYcifhYkaecxfheaKcifgKad6mbkdndna9cTmbaYak9nmba8ZaB9FTmbcbhdabhecbhHindnaoaCaeydbgOcdtfydbcdtfIdbaB9ETmbabadcdtfgAaOBdbaAclfaeclfydbBdbaAcwfaecwfydbBdbadcifhdkaecxfheaHcifgHaY6mbkJFFuuh8ZaJTmeaoheaJhHJFFuuh8SinaeIdbgIa8Sa8SaI9EEg8Va8SaIaB9EgOEh8Sa8Va8ZaOEh8ZaeclfheaHcufgHmbxdkkaYhdkadak0mbxdkkasclfabadalaQz:cjjjbkdndnadak0mbadhOxekdna9cmbadhOxekdna8Zac9FmbadhOxekina8ZJbb;aZNg8Saca8Sac9DEh8VJbbbbh8SdnaJTmbaoheaJhHinaeIdbgIa8SaIa8V9FEa8SaIa8S9EEh8SaeclfheaHcufgHmbkkcbhOabhecbhHindnaoaCaeydbgAcdtfydbcdtfIdba8V9ETmbabaOcdtfgYaABdbaYclfaeclfydbBdbaYcwfaecwfydbBdbaOcifhOkaecxfheaHcifgHad6mbkJFFuuh8ZdnaJTmbaoheaJhHJFFuuhIinaeIdbgRaIaIaR9EEg8PaIaRa8V9EgAEhIa8Pa8ZaAEh8ZaeclfheaHcufgHmbkkdnaOad9hmbadhOxdka8Sanana8S9DEhnaOak9nmeaOhda8Zac9FmbkkdnamcjjjjlGTmbazmbaOTmbcbhQabheinaXaeydbgAfRbbc3thKaecwfgLydbhHdndnahaAcdtg8FfydbaeclfgiydbgCSmbcbhYagaCcdtfydbaA9hmekcjjjj94hYkaeaKaYVaAVBdbaXaCfRbbc3thKdndnahaCcdtfydbaHSmbcbhYagaHcdtfydbaC9hmekcjjjj94hYkaiaKaYVaCVBdbaXaHfRbbc3thYdndnahaHcdtfydbaASmbcbhCaga8FfydbaH9hmekcjjjj94hCkaLaYaCVaHVBdbaecxfheaQcifgQaO6mbkkdnazTmbaOTmbaOheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPa83an:rNUdbkasyd2gecdtascxffc98fhHdninaeTmeaHydbcbyd;O1jjbH:bjjjbbaHc98fhHaecufhexbkkasc;W;qbf8KjjjjbaOk;Yieouabydlhvabydbclfcbaicdtz:ljjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk;Podvuv998Jjjjjbca9RgvcFFF;7rBd3av9cFFF;7;3FF:;Fb83dCavcFFF97Bdzav9cFFF;7FFF:;u83dwdnadTmbaicd4hodnabmbdnalTmbcbhrinaealarcdtfydbao2cdtfhwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxikkaocdthrcbhwincbhiinavcCfaifgDaeaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkaearfheawcefgwad9hmbxdkkdnalTmbcbhrinabarcx2fgiaealarcdtfydbao2cdtfgwIdbUdbaiawIdlUdlaiawIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkarcefgrad9hmbxdkkaocdthlcbhraehwinabarcx2fgiaearao2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinavcCfaifgDawaifIdbgqaDIdbgkakaq9EEUdbavcwfaifgDaqaDIdbgkakaq9DEUdbaiclfgicx9hmbkawalfhwarcefgrad9hmbkkJbbbbavIdwavIdCgk:tgqaqJbbbb9DEgqavIdxavIdKgx:tgmamaq9DEgqavIdzavId3gm:tgPaPaq9DEhPdnabTmbadTmbJbbbbJbbjZaP:vaPJbbbb9BEhqinabaqabIdbak:tNUdbabclfgvaqavIdbax:tNUdbabcwfgvaqavIdbam:tNUdbabcxfhbadcufgdmbkkaPk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbk:nCoDud99rue99lul998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:ljjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd;S1jjbHjjjjbbgqBdxawceBd2aqaeadaicbz:djjjb8AawcuadcdtadcFFFFi0Egkcbyd;S1jjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd;S1jjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhmcbhCadhXcbhQinaChLaeamgKcufaeaK9iEaPgDcefaeaD9kEhYdndnadTmbaYcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdbaONJbbbZMg8A:lJbbb9p9DTmba8A:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbh5cbh8Eindna3axa8EcdtfydbgCcm4aC7c:v;t;h;Ev2gics4ai7aAGgmcdtfgEydbgecuSmbaeaCSmbcehiina3amaifaAGgmcdtfgEydbgecuSmeaicefhiaeaC9hmbkkaEaCBdba5aecuSfh5a8Ecefg8Ead9hmbxdkkazcFeasz:ljjjb8Acbh5kaDaYa5ar0giEhPaLa5aiEhCdna5arSmbaYaKaiEgmaP9Rcd9imbdndnaQcl0mbdnaX:ZgOaL:Zg8A:taY:Yg8FaD:Y:tgaa8FaK:Y:tgha5:ZggaH:tNNNaOaH:tahNa8Aag:tNa8AaH:taaNagaO:tNM:va8FMJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPamfcd9Theka5aXaiEhXaQcefgQcs9hmekkdndnaCmbcihicbhDxekcbhiawakcbyd;S1jjbHjjjjbbg8EBdKawclBd2aPcuf:Yh8AdndnadTmbaqhiaxheadhmindndnaiIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhCxekcjjjj94hCkaCcCthCdndnaiclfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaEcqtaCVhCdndnaicwfIdba8ANJbbbZMgO:lJbbb9p9DTmbaO:OhExekcjjjj94hEkaeaCaEVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:ljjjbh3cbhDcbh5inaxa5cdtgYfydbgCcm4aC7c:v;t;h;Ev2gics4ai7hecbhidndnina3aeaAGgmcdtfgEydbgecuSmednaxaecdtgEfydbaCSmbaicefgiamfheaiaA9nmekka8EaEfydbhixekaEa5BdbaDhiaDcefhDka8EaYfaiBdba5cefg5ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:ljjjb8AcbhDcbhekawaecbyd;S1jjbHjjjjbbgeBd3awcvBd2aecbaiz:ljjjbhEavcd4hxdnadTmbdnalTmbaxcdth3a8EhCalheaqhmadhAinaEaCydbc32fgiamIdbaiIdbMUdbaiamclfIdbaiIdlMUdlaiamcwfIdbaiIdwMUdwaiaeIdbaiIdxMUdxaiaeclfIdbaiIdzMUdzaiaecwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaCclfhCaea3fheamcxfhmaAcufgAmbxdkka8EhmaqheadhCinaEamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaCcufgCmbkkdnaDTmbaEhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhCawcuaDcdtgYaDcFFFFi0Egicbyd;S1jjbHjjjjbbgeBdaawcoBd2awaicbyd;S1jjbHjjjjbbg3Bd8KaecFeaYz:ljjjbh5dnadTmbJbbjZJbbjZa8A:vaPceSEaoNgOaONh8Aaxcdthxalheina8Aaec;C1jjbalEgmIdwaEa8EydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna5aAcdtgifgmydbcuSmba3aifIdbaO9ETmekamaCBdba3aifaOUdbka8Eclfh8EaeaxfheaqcxfhqadaCcefgC9hmbkkaba5aYz:kjjjb8AcrhikaicdthiinaiTmeaic98fgiawcxffydbcbyd;O1jjbH:bjjjbbxbkkawc;Wbf8KjjjjbaDk:Odieui99iu8Jjjjjbca9RgicFFF;7rBd3ai9cFFF;7;3FF:;Fb83dCaicFFF97Bdzai9cFFF;7FFF:;u83dwdndnaembJbbjFhlJbbjFhvJbbjFhoxekadcd4cdthrcbhwincbhdinaicCfadfgDabadfIdbglaDIdbgvaval9EEUdbaicwfadfgDalaDIdbgvaval9DEUdbadclfgdcx9hmbkabarfhbawcefgwae9hmbkaiIdzaiId3:thoaiIdxaiIdK:thvaiIdwaiIdC:thlkJbbbbalalJbbbb9DEglavaval9DEglaoaoal9DEk9DeeuabcFeaicdtz:ljjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcifc98GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;W1jjbgeabcrfc94GfgbBd;W1jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd;W1jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd;W1jjbfgdBd;W1jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk6eiucbhidnadTmbdninabRbbglaeRbbgv9hmeaecefheabcefhbadcufgdmbxdkkalav9Rhikaikk:bedbcjwk9Oeeebeebebbeeebebbbbbebebbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbbbbbbbbbbc;OwkxebbbdbbbjNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var y=new Uint8Array(m.length),b=0;b<m.length;++b){var x=m.charCodeAt(b);y[b]=x>96?x-97:x>64?x-39:x+4}for(var A=0,b=0;b<m.length;++b)y[A++]=y[b]<60?t[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,A)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}function a(m,y,b){var x=n.exports.sbrk,A=x(y.length*4),E=x(b*4),S=new Uint8Array(n.exports.memory.buffer),v=s(y);S.set(v,A);var P=m(E,A,y.length,b);S=new Uint8Array(n.exports.memory.buffer);var M=new Uint32Array(b);new Uint8Array(M.buffer).set(S.subarray(E,E+b*4)),v.set(S.subarray(A,A+y.length*4)),x(A-x(0));for(var R=0;R<y.length;++R)y[R]=M[y[R]];return[M,P]}function l(m){for(var y=0,b=0;b<m.length;++b){var x=m[b];y=y<x?x:y}return y}function u(m,y,b,x,A,E,S,v,P){var M=n.exports.sbrk,R=M(4),L=M(b*4),B=M(A*E),_=M(b*4),w=new Uint8Array(n.exports.memory.buffer);w.set(s(x),B),w.set(s(y),_);var D=m(L,_,b,B,A,E,S,v,P,R);w=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(D);s(I).set(w.subarray(L,L+D*4));var N=new Float32Array(1);return s(N).set(w.subarray(R,R+4)),M(R-M(0)),[I,N[0]]}function f(m,y,b,x,A,E,S,v,P,M,R,L,B){var _=n.exports.sbrk,w=_(4),D=_(b*4),I=_(A*E),N=_(A*v),k=_(P.length*4),H=_(b*4),V=M?_(A):0,j=new Uint8Array(n.exports.memory.buffer);j.set(s(x),I),j.set(s(S),N),j.set(s(P),k),j.set(s(y),H),M&&j.set(s(M),V);var U=m(D,H,b,I,A,E,N,v,k,P.length,V,R,L,B,w);j=new Uint8Array(n.exports.memory.buffer);var q=new Uint32Array(U);s(q).set(j.subarray(D,D+U*4));var X=new Float32Array(1);return s(X).set(j.subarray(w,w+4)),_(w-_(0)),[q,X[0]]}function h(m,y,b,x){var A=n.exports.sbrk,E=A(b*x),S=new Uint8Array(n.exports.memory.buffer);S.set(s(y),E);var v=m(E,b,x);return A(E-A(0)),v}function p(m,y,b,x,A,E,S,v){var P=n.exports.sbrk,M=P(v*4),R=P(b*x),L=P(b*E),B=new Uint8Array(n.exports.memory.buffer);B.set(s(y),R),A&&B.set(s(A),L);var _=m(M,R,b,x,L,E,S,v);B=new Uint8Array(n.exports.memory.buffer);var w=new Uint32Array(_);return s(w).set(B.subarray(M,M+_*4)),P(M-P(0)),w}var g={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,_InternalDebug:1<<30};return{ready:i,supported:!0,useExperimentalFeatures:!1,compactMesh:function(m){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0);var y=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return a(n.exports.meshopt_optimizeVertexFetchRemap,y,l(m)+1)},simplify:function(m,y,b,x,A,E){r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),r(x>=0&&x<=m.length),r(x%3==0),r(A>=0);for(var S=0,v=0;v<(E?E.length:0);++v)r(E[v]in g),r(this.useExperimentalFeatures||E[v]!="Prune"),S|=g[E[v]];var P=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),M=u(n.exports.meshopt_simplify,P,m.length,y,y.length/b,b*4,x,A,S);return M[0]=m instanceof Uint32Array?M[0]:new m.constructor(M[0]),M},simplifyWithAttributes:function(m,y,b,x,A,E,S,v,P,M){r(this.useExperimentalFeatures),r(m instanceof Uint32Array||m instanceof Int32Array||m instanceof Uint16Array||m instanceof Int16Array),r(m.length%3==0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),r(x instanceof Float32Array),r(x.length%A==0),r(A>=0),r(S==null||S instanceof Uint8Array),r(S==null||S.length==y.length/b),r(v>=0&&v<=m.length),r(v%3==0),r(P>=0),r(Array.isArray(E)),r(A>=E.length),r(E.length<=32);for(var R=0;R<E.length;++R)r(E[R]>=0);for(var L=0,R=0;R<(M?M.length:0);++R)r(M[R]in g),L|=g[M[R]];var B=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m),_=f(n.exports.meshopt_simplifyWithAttributes,B,m.length,y,y.length/b,b*4,x,A*4,new Float32Array(E),S?new Uint8Array(S):null,v,P,L);return _[0]=m instanceof Uint32Array?_[0]:new m.constructor(_[0]),_},getScale:function(m,y){return r(m instanceof Float32Array),r(m.length%y==0),r(y>=3),h(n.exports.meshopt_simplifyScale,m,m.length/y,y*4)},simplifyPoints:function(m,y,b,x,A,E){return r(this.useExperimentalFeatures),r(m instanceof Float32Array),r(m.length%y==0),r(y>=3),r(b>=0&&b<=m.length/y),x?(r(x instanceof Float32Array),r(x.length%A==0),r(A>=3),r(m.length/y==x.length/A),p(n.exports.meshopt_simplifyPoints,m,m.length/y,y*4,x,A*4,E,b)):p(n.exports.meshopt_simplifyPoints,m,m.length/y,y*4,void 0,0,0,b)}}}();var Iin=function(){var e="b9H79Tebbbefx9Geueu9Geub9Gbb9Giuuueu9Gkuuuuuuuuuu99eu9Gvuuuuueu9Gkuuuuuuuuu9999eu9Gruuuuuuub9Gkuuuuuuuuuuueu9Gouuuuuub9Giuuub9GluuuubiOHdilvorwDqrkbiibeilve9Weiiviebeoweuec:q:Odkr:Yewo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeX9TW79O9V9Wt9F9I919P29K9nW79O2Wt7bd39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7br39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bDL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2Wtbql79IV9RbkDwebcekdsPq;L9kHdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:oAlPue99eux998Jjjjjbc:We9Rgk8Kjjjjbakc;mbfcbc;Kbz:njjjb8AakcuaocdtgxaocFFFFi0Egmcbyd:e1jjbHjjjjbbgPBd9makceBd:SeakaPBdnakamcbyd:e1jjbHjjjjbbgsBd9qakcdBd:SeakasBd9eakcualcdtalcFFFFi0Ecbyd:e1jjbHjjjjbbgzBd9uakazBd9iakciBd:SeaPcbaxz:njjjbhHalci9UhOdnalTmbaihPalhAinaHaPydbcdtfgCaCydbcefBdbaPclfhPaAcufgAmbkkdnaoTmbcbhPashAaHhCaohXinaAaPBdbaAclfhAaCydbaPfhPaCclfhCaXcufgXmbkkdnalci6mbcbhPaihAinaAcwfydbhCaAclfydbhXasaAydbcdtfgQaQydbgQcefBdbazaQcdtfaPBdbasaXcdtfgXaXydbgXcefBdbazaXcdtfaPBdbasaCcdtfgCaCydbgCcefBdbazaCcdtfaPBdbaAcxfhAaOaPcefgP9hmbkkdnaoTmbaHhAashPaohCinaPaPydbaAydb9RBdbaAclfhAaPclfhPaCcufgCmbkkakamcbyd:e1jjbHjjjjbbgPBd9yakclBd:SeaPaHaxz:mjjjbhmakaOcbyd:e1jjbHjjjjbbgPBd9CakcvBd:SeaPcbaOz:njjjbhLakcuaOcK2alcjjjjd0Ecbyd:e1jjbHjjjjbbgKBd9GakcoBd:SeJbbbbhYdnalci6g8Ambarcd4hxaihAaKhPaOhrJbbbbhEinavaAclfydbax2cdtfgCIdlh3avaAydbax2cdtfgXIdlhYavaAcwfydbax2cdtfgQIdlh5aCIdwh8EaXIdwh8FaQIdwhaaPaCIdbghaXIdbggMaQIdbg8JMJbbnn:vUdbaPclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8KaCIdwh8LaXIdwh8MaPcxfa3aY:tg3aaa8F:tgaNa5aY:tg5a8Ea8F:tg8EN:tgYJbbbbJbbjZahag:tgha5Na8Jag:tgga3N:tg8Fa8FNaYaYNa8EagNaaahN:tgYaYNMM:rgg:vagJbbbb9BEg3NUdbaPczfaYa3NUdbaPcCfa8Fa3NUdbaPcwfa8Ka8Ma8LMMJbbnn:vUdbaEagMhEaAcxfhAaPcKfhParcufgrmbkaEaO:Z:vJbbbZNhYkakcuaOcdtalcFFFF970Ecbyd:e1jjbHjjjjbbgCBd9KakcrBd:SeaYaD:ZN:rhYdna8AmbcbhPaChAinaAaPBdbaAclfhAaOaPcefgP9hmbkkaYJbbbZNh8MakcuaOcltalcFFFFd0Ecbyd:e1jjbHjjjjbbg8ABd9OakcwBd:Secba8AaKaCaOz:djjjb8Aakaocbyd:e1jjbHjjjjbbgPBd2aPcFeaoz:njjjbhrakc8Wfcwf9cb83ibak9cb83i8WcbhPJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgcbhlinJbbbbh3dnaPTmbJbbjZaP:Z:vh3kaka8Ea3NgaUdaaka5a3NghUd3akaEa3Ng8JUdKJbbbbh3dnagagNaYaYNa8Fa8FNMMg8KJbbbb9BmbJbbjZa8K:r:vh3kakaga3NUd8Saka8Fa3NUdyakaYa3NUd8Kdndndnakyd8WgQakydUgAakcKfaeaiakc;abfaKamara8Maqz:ejjjbgCcuSmbdnaPaD9pmbaAaraiaCcx2fgXydbfRbbcFeSfaraXclfydbfRbbcFeSfaraXcwfydbfRbbcFeSfaw9nmdkaQaAcbaeaiakc;abfaKamara8MJbbbbz:ejjjbgCcu9hmekakaaUdCakahUdzaka8JUdxakcuBdwakcFFF;7rBdla8AcbaKaLakcxfakcwfakclfz:fjjjbakydwgCcuSmekdnakc8WfaiaCcx2fgOydbgPaOclfydbgAaOcwfydbgXarabaeadalawaDz:gjjjbTmbalcefhlJbbbbhEJbbbbh5Jbbbbh8EJbbbbhYJbbbbh8FJbbbbhgkamaPcdtfgPaPydbcufBdbamaAcdtfgPaPydbcufBdbamaXcdtfgPaPydbcufBdbcbhXinazasaOaXcdtfydbcdtgAfydbcdtfgxhPaHaAfgvydbgQhAdnaQTmbdninaPydbaCSmeaPclfhPaAcufgATmdxbkkaPaxaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbkaKaCcK2fgPIdbh3aPIdlhaaPIdwhhaPIdxh8JaPIdzh8KaPIdCh8LaLaCfce86bbaga8LMhga8Fa8KMh8FaYa8JMhYa8EahMh8Ea5aaMh5aEa3MhEakyd88hPxekkdnaPTmbdnakyd80gAaPci2fgCciGTmbadaCfcbaPaAcu7fciGcefz:njjjb8AkabalcltfgPak8Pi8W83dbaPcwfakc8Wfcwf8Pib83dbalcefhlkcahPdninaPc98Smeakc;mbfaPfydbcbydj1jjbH:bjjjbbaPc98fhPxbkkakc:Wef8Kjjjjbalk;3vivuv99lu8Jjjjjbca9Rgv8Kjjjjbdndnalcw0mbaiydbhoaeabcitfgralcdtcufBdlaraoBdbdnalcd6mbaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkkalabfhrxekcbhDavczfcwfcbBdbav9cb83izavcwfcbBdbav9cb83ibJbbjZhqJbbjZhkinadaiaDcdtfydbcK2fhwcbhrinavczfarfgoawarfIdbgxaoIdbgm:tgPakNamMgmUdbavarfgoaPaxam:tNaoIdbMUdbarclfgrcx9hmbkJbbjZaqJbbjZMgq:vhkaDcefgDal9hmbkcbhoadcbcecdavIdlgxavIdwgm9GEgravIdbgPam9GEaraPax9GEgscdtgrfhzavczfarfIdbhxaihralhwinaiaocdtfgDydbhHaDarydbgOBdbaraHBdbarclfhraoazaOcK2fIdbax9Dfhoawcufgwmbkaeabcitfhrdndnaocv6mbaoalc98f6mekaraiydbBdbaralcdtcufBdlaiclfhoalcufhwarcxfhrinaoydbhDarcuBdbarc98faDBdbarcwfhraoclfhoawcufgwmbkalabfhrxekaraxUdbaeabcitfgrarydlc98GasVBdlabcefaeadaiaoz:djjjbhwararydlciGawabcu7fcdtVBdlawaeadaiaocdtfalao9Rz:djjjbhrkavcaf8Kjjjjbark;Bloeue99vue99Due99dndnaembcuhkxekJbbjZaq:thxaiabcdtfhmavydbhPavydlhsavydwhzcbhHJFFuuhOcvhbcuhkindnaPamaHcdtfydbcdtgvfydbgATmbazasavfydbcdtfhiindndnawalaiydbgCcx2fgvclfydbgXfRbbcFeSawavydbgQfRbbcFeSfawavcwfydbgLfRbbcFeSfgKmbcbhvxekcehvaraQcdtfydbgYceSmbcehvaraXcdtfydbg8AceSmbcehvaraLcdtfydbgEceSmbdna8AcdSaYcdSfaEcdSfcd6mbaKcefhvxekaKcdfhvkdnavab9kmbdndnadTmbaoaCcK2fgQIdwadIdw:tg3a3NaQIdbadIdb:tg3a3NaQIdladIdl:tg3a3NMM:raD:vaxNJbbjZMJ9VO:d86JbbjZaQIdCadIdCNaQIdxadIdxNaQIdzadIdzNMMaqN:tg3a3J9VO:d869DENh3xekaraQcdtfydbaraXcdtfydbfaraLcdtfydbfc99f:Zh3kaCakavab6a3aO9DVgQEhkavabaQEhba3aOaQEhOkaiclfhiaAcufgAmbkkaHcefgHae9hmbkkakk;bddlue99dndndnabaecitfgrydlgwciGgDci9hmbarclfhqxekinabcbawcd4gwalaDcdtfIdbabaecitfIdb:tgkJbbbb9FEgDaecefgefadaialavaoz:fjjjbak:laoIdb9FTmdabaDaw7aefgecitfgrydlgwciGgDci9hmbkarclfhqkabaecitfhecuhbindnaiaeydbgDfRbbmbadaDcK2fgrIdwalIdw:tgkakNarIdbalIdb:tgkakNarIdlalIdl:tgkakNMM:rgkaoIdb9DTmbaoakUdbavaDBdbaqydbhwkaecwfheabcefgbawcd46mbkkk;yleoudnaladfgkRbbcFeSalaefgxRbbgmcFeSfabydwgPfalaifgsRbbcFeSfaD0abydxaq9pVgzce9hmbavawcltfgmab8Pdb83dbamcwfabcwfgm8Pdb83dbdndnamydbmbcbhqxekcbhDaohminalamabydbcdtfydbfcFe86bbamclfhmaDcefgDabydwgq6mbkkdnabydxglci2gDabydlgmfgPciGTmbaraPfcbalamcu7fciGcefz:njjjb8Aabydxci2hDabydlhmabydwhqkab9cb83dwababydbaqfBdbabaDcifc98GamfBdlaxRbbhmcbhPkdnamcFeGcFe9hmbaxaP86bbababydwgmcefBdwaoabydbcdtfamcdtfaeBdbkdnakRbbcFe9hmbakabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfadBdbkdnasRbbcFe9hmbasabydw86bbababydwgmcefBdwaoabydbcdtfamcdtfaiBdbkarabydlfabydxci2faxRbb86bbarabydlfabydxci2fcefakRbb86bbarabydlfabydxci2fcdfasRbb86bbababydxcefBdxazk;Ckovud99euv99eul998Jjjjjbc:G;ae9Rgo8KjjjjbdndnadTmbavcd4hrcbhwcbhDindnaiaeclfydbar2cdtfgvIdbaiaeydbar2cdtfgqIdbgk:tgxaiaecwfydbar2cdtfgmIdlaqIdlgP:tgsNamIdbak:tgzavIdlaP:tgPN:tgkakNaPamIdwaqIdwgH:tgONasavIdwaH:tgHN:tgPaPNaHazNaOaxN:tgxaxNMM:rgsJbbbb9Bmbaoc:G:qefawcx2fgAakas:vUdwaAaxas:vUdlaAaPas:vUdbaocafawc8K2fgAaq8Pdb83dbaAav8Pdb83dxaAam8Pdb83dKaAcwfaqcwfydbBdbaAcCfavcwfydbBdbaAcafamcwfydbBdbawcefhwkaecxfheaDcifgDad6mbkab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbawTmeao9cb83iKao9cb83izaoczfaocafawci2z1jjjbaoIdKhCaoIdChXaoIdzhQao9cb83iwao9cb83ibaoaoc:G:qefawz1jjjbJbbjZhkaoIdwgPJbbbbJbbjZaPaPNaoIdbgPaPNaoIdlgsasNMM:rgx:vaxJbbbb9BEgzNhxasazNhsaPazNhzaoc:G:qefheawhvinaecwfIdbaxNaeIdbazNasaeclfIdbNMMgPakaPak9DEhkaecxfheavcufgvmbkabaCUdwabaXUdlabaQUdbabaoId3UdxdndnakJ;n;m;m899FmbJbbbbhPaoc:G:qefheaocafhvinaCavcwfIdb:taecwfIdbgHNaQavIdb:taeIdbgONaXavclfIdb:taeclfIdbgLNMMaxaHNazaONasaLNMM:vgHaPaHaP9EEhPavc8KfhvaecxfheawcufgwmbkabazUd3abc8KfaxUdbabcafasUdbabcKfaCaxaPN:tUdbabcCfaXasaPN:tUdbabaQazaPN:tUdzabJbbjZakakN:t:rgkUdydndnaxJbbj:;axJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;axJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohexekcjjjj94hekabc8Ufae86bbdndnasJbbj:;asJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;asJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkabcRfav86bbdndnazJbbj:;azJbbj:;9GEgPJbbjZaPJbbjZ9FEJbb;:9cNJbbbZJbbb:;azJbbbb9GEMgP:lJbbb9p9DTmbaP:Ohqxekcjjjj94hqkabaq86b8SdndnaecKtcK91:YJbb;:9c:vax:t:lavcKtcK91:YJbb;:9c:vas:t:laqcKtcK91:YJbb;:9c:vaz:t:lakMMMJbb;:9cNJbbjZMgk:lJbbb9p9DTmbak:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dbabcyf9cb83dbabcaf9cb83dbabcKf9cb83dbabczf9cb83dbabcwf9cb83dbkaoc:G;aef8Kjjjjbk:mvdouq99cbhi8Jjjjjbca9RglczfcwfcbBdbal9cb83izalcwfcbBdbal9cb83ibdnadTmbcbhvinaeaifhocbhrinalczfarfgwavawydbgwaoarfIdbgDaearawcx2ffIdb9DEBdbalarfgwavawydbgwaDaearawcx2ffIdb9EEBdbarclfgrcx9hmbkaicxfhiavcefgvad9hmbkkJbbbbhDcbhrcbhicbhvinaealarfydbcx2fgwIdwaealczfarfydbcx2fgoIdw:tgqaqNawIdbaoIdb:tgqaqNawIdlaoIdl:tgqaqNMMgqaDaqaD9EgwEhDavaiawEhiarclfhravcefgvci9hmbkaealczfaicdtgvfydbcx2fgrIdwaealavfydbcx2fglIdwMJbbbZNhqarIdlalIdlMJbbbZNhkarIdbalIdbMJbbbZNhxaD:rJbbbZNhDdnadTmbindnaecwfIdbgmaq:tgPaPNaeIdbgsax:tgPaPNaeclfIdbgzak:tgPaPNMMgPaDaDN9ETmbaqaDaP:rgH:vJbbbZNJbbbZMgPNamJbbjZaP:tgONMhqakaPNazaONMhkaxaPNasaONMhxaDaHMJbbbZNhDkaecxfheadcufgdmbkkabaDUdxabaqUdwabakUdlabaxUdbkjeeiu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwdnaiTmbawceawce0EhDarhiinaiaeadRbbcdtfydbBdbadcefhdaiclfhiaDcufgDmbkkabarawaladaoz:hjjjbarcj8Wf8Kjjjjbk:Ylequ8Jjjjjbcjx9Rgl8Kjjjjbcbhvalcjqfcbaiz:njjjb8AdndnadTmbcjehoaehrincuhwarhDcuhqavhkdninawakaoalcjqfaDcefRbbfRbb9RcFeGci6aoalcjqfaDRbbfRbb9RcFeGci6faoalcjqfaDcdfRbbfRbb9RcFeGci6fgxaq9mgmEhwdnammbaxce0mdkaxaqaxaq9kEhqaDcifhDadakcefgk9hmbkkaeawci2fgDcdfRbbhqaDcefRbbhxaDRbbhkaeavci2fgDcifaDawav9Rci2z:qjjjb8Aakalcjqffaocefgo86bbaxalcjqffao86bbaDcdfaq86bbaDcefax86bbaDak86bbaqalcjqffao86bbarcifhravcefgvad9hmbkalcFeaiz:njjjbhoadci2gDceaDce0EhqcbhxindnaoaeRbbgkfgwRbbgDcFe9hmbawax86bbaocjdfaxcdtfabakcdtfydbBdbaxhDaxcefhxkaeaD86bbaecefheaqcufgqmbkaxcdthDxekcbhDkabalcjdfaDz:mjjjb8Aalcjxf8Kjjjjbk9teiucbcbyd11jjbgeabcifc98GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd11jjbgeabcrfc94GfgbBd11jjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik9:eiuZbhedndncbyd11jjbgdaecztgi9nmbcuheadai9RcFFifcz4nbcuSmekadhekcbabae9Rcifc98Gcbyd11jjbfgdBd11jjbdnadZbcztge9nmbadae9RcFFifcz4nb8Akk:;Deludndndnadch9pmbabaeSmdaeabadfgi9Rcbadcet9R0mekabaead;8qbbxekaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocd4cefciGgiTmbaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglcd4cefcrGgdTmbavadcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiaeydlBdlaiaeydwBdwaiaeydxBdxaiaeydzBdzaiaeydCBdCaiaeydKBdKaiaeyd3Bd3aecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaiaeRbe86beaiaeRbd86bdaiaeRbi86biaiaeRbl86blaiaeRbv86bvaiaeRbo86boaiaeRbr86braicwfhiaecwfhealc94fglmbkkabkkAebcjwkxebbbdbbbzNbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(m){n=m.instance,n.exports.__wasm_call_ctors()});function o(m){for(var y=new Uint8Array(m.length),b=0;b<m.length;++b){var x=m.charCodeAt(b);y[b]=x>96?x-97:x>64?x-39:x+4}for(var A=0,b=0;b<m.length;++b)y[A++]=y[b]<60?t[y[b]]:(y[b]-60)*64+y[++b];return y.buffer.slice(0,A)}function r(m){if(!m)throw new Error("Assertion failed")}function s(m){return new Uint8Array(m.buffer,m.byteOffset,m.byteLength)}var a=48,l=16;function u(m,y){var b=m.meshlets[y*4+0],x=m.meshlets[y*4+1],A=m.meshlets[y*4+2],E=m.meshlets[y*4+3];return{vertices:m.vertices.subarray(b,b+A),triangles:m.triangles.subarray(x,x+E*3)}}function f(m,y,b,x,A,E,S){var v=n.exports.sbrk,P=n.exports.meshopt_buildMeshletsBound(m.length,A,E),M=v(P*l),R=v(P*A*4),L=v(P*E*3),B=v(m.byteLength),_=v(y.byteLength),w=new Uint8Array(n.exports.memory.buffer);w.set(s(m),B),w.set(s(y),_);var D=n.exports.meshopt_buildMeshlets(M,R,L,B,m.length,_,b,x,A,E,S);w=new Uint8Array(n.exports.memory.buffer);for(var I=w.subarray(M,M+D*l),N=new Uint32Array(I.buffer,I.byteOffset,I.byteLength/4).slice(),k=0;k<D;++k){var H=N[k*4+0],V=N[k*4+1],b=N[k*4+2],j=N[k*4+3];n.exports.meshopt_optimizeMeshlet(R+H*4,L+V,j,b)}var U=N[(D-1)*4+0],q=N[(D-1)*4+1],X=N[(D-1)*4+2],te=N[(D-1)*4+3],K=U+X,Z=q+(te*3+3&-4),ee={meshlets:N,vertices:new Uint32Array(w.buffer,R,K).slice(),triangles:new Uint8Array(w.buffer,L,Z*3).slice(),meshletCount:D};return v(M-v(0)),ee}function h(m){var y=new Float32Array(n.exports.memory.buffer,m,a/4);return{centerX:y[0],centerY:y[1],centerZ:y[2],radius:y[3],coneApexX:y[4],coneApexY:y[5],coneApexZ:y[6],coneAxisX:y[7],coneAxisY:y[8],coneAxisZ:y[9],coneCutoff:y[10]}}function p(m,y,b,x){var A=n.exports.sbrk,E=[],S=A(y.byteLength),v=A(m.vertices.byteLength),P=A(m.triangles.byteLength),M=A(a),R=new Uint8Array(n.exports.memory.buffer);R.set(s(y),S),R.set(s(m.vertices),v),R.set(s(m.triangles),P);for(var L=0;L<m.meshletCount;++L){var B=m.meshlets[L*4+0],_=m.meshlets[L*4+0+1],w=m.meshlets[L*4+0+3];n.exports.meshopt_computeMeshletBounds(M,v+B*4,P+_,w,S,b,x),E.push(h(M))}return A(S-A(0)),E}function g(m,y,b,x){var A=n.exports.sbrk,E=A(a),S=A(m.byteLength),v=A(y.byteLength),P=new Uint8Array(n.exports.memory.buffer);P.set(s(m),S),P.set(s(y),v),n.exports.meshopt_computeClusterBounds(E,S,m.length,v,b,x);var M=h(E);return A(E-A(0)),M}return{ready:i,supported:!0,buildMeshlets:function(m,y,b,x,A,E){r(m.length%3==0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),r(x<=255||x>0),r(A<=512),r(A%4==0),E=E||0;var S=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return f(S,y,y.length/b,b*4,x,A,E)},computeClusterBounds:function(m,y,b){r(m.length%3==0),r(m.length/3<=512),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3);var x=m.BYTES_PER_ELEMENT==4?m:new Uint32Array(m);return g(x,y,y.length/b,b*4)},computeMeshletBounds:function(m,y,b){return r(m.meshletCount!=0),r(y instanceof Float32Array),r(y.length%b==0),r(b>=3),p(m,y,y.length/b,b*4)},extractMeshlet:function(m,y){return r(y>=0&&y<m.meshletCount),u(m,y)}}}();function ab(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.bufferViewId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.number("options.bufferViewId",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r);let a=n.bufferViews[i],l=a.buffer,u=a.byteOffset,f=a.byteLength,h=!1,p,g,m,y;if(ri(a,"EXT_meshopt_compression")){let x=a.extensions.EXT_meshopt_compression;l=x.buffer,u=x.byteOffset??0,f=x.byteLength,h=!0,p=x.byteStride,g=x.count,m=x.mode,y=x.filter??"NONE"}let b=n.buffers[l];this._hasMeshopt=h,this._meshoptByteStride=p,this._meshoptCount=g,this._meshoptMode=m,this._meshoptFilter=y,this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._buffer=b,this._bufferId=l,this._byteOffset=u,this._byteLength=f,this._cacheKey=s,this._bufferLoader=void 0,this._typedArray=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(ab.prototype=Object.create($i.prototype),ab.prototype.constructor=ab);Object.defineProperties(ab.prototype,{cacheKey:{get:function(){return this._cacheKey}},typedArray:{get:function(){return this._typedArray}}});async function e3e(e){try{let t=t3e(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let o=e._meshoptCount,r=e._meshoptByteStride,s=new Uint8Array(o*r);Mie.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=gt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load buffer view",t)}}ab.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=e3e(this),this._promise)};function t3e(e){let t=e._resourceCache,n=e._buffer;if(c(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId})}ab.prototype.unload=function(){c(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0};var av=ab;function Lr(){}Lr._maxDecodingConcurrency=Math.max(zt.hardwareConcurrency-1,1);Lr._decoderTaskProcessor=void 0;Lr._taskProcessorReady=!1;Lr._error=void 0;Lr._getDecoderTaskProcessor=function(){if(!c(Lr._decoderTaskProcessor)){let e=new bi("decodeDraco",Lr._maxDecodingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(t){t?Lr._taskProcessorReady=!0:Lr._error=new ae("Draco decoder could not be initialized.")}).catch(t=>{Lr._error=t}),Lr._decoderTaskProcessor=e}return Lr._decoderTaskProcessor};Lr.decodePointCloud=function(e){let t=Lr._getDecoderTaskProcessor();if(c(Lr._error))throw Lr._error;if(Lr._taskProcessorReady)return t.scheduleTask(e,[e.buffer.buffer])};Lr.decodeBufferView=function(e){let t=Lr._getDecoderTaskProcessor();if(c(Lr._error))throw Lr._error;if(Lr._taskProcessorReady)return t.scheduleTask(e,[e.array.buffer])};var yg=Lr;var Jn={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID"};function n3e(e){switch(e){case Jn.POSITION:return"positionMC";case Jn.NORMAL:return"normalMC";case Jn.TANGENT:return"tangentMC";case Jn.TEXCOORD:return"texCoord";case Jn.COLOR:return"color";case Jn.JOINTS:return"joints";case Jn.WEIGHTS:return"weights";case Jn.FEATURE_ID:return"featureId";default:throw new C("semantic is not a valid value.")}}Jn.hasSetIndex=function(e){switch(T.typeOf.string("semantic",e),e){case Jn.POSITION:case Jn.NORMAL:case Jn.TANGENT:return!1;case Jn.TEXCOORD:case Jn.COLOR:case Jn.JOINTS:case Jn.WEIGHTS:case Jn.FEATURE_ID:return!0;default:throw new C("semantic is not a valid value.")}};Jn.fromGltfSemantic=function(e){T.typeOf.string("gltfSemantic",e);let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return Jn.POSITION;case"NORMAL":return Jn.NORMAL;case"TANGENT":return Jn.TANGENT;case"TEXCOORD":return Jn.TEXCOORD;case"COLOR":return Jn.COLOR;case"JOINTS":return Jn.JOINTS;case"WEIGHTS":return Jn.WEIGHTS;case"_FEATURE_ID":return Jn.FEATURE_ID}};Jn.fromPntsSemantic=function(e){switch(T.typeOf.string("pntsSemantic",e),e){case"POSITION":case"POSITION_QUANTIZED":return Jn.POSITION;case"RGBA":case"RGB":case"RGB565":return Jn.COLOR;case"NORMAL":case"NORMAL_OCT16P":return Jn.NORMAL;case"BATCH_ID":return Jn.FEATURE_ID;default:throw new C("pntsSemantic is not a valid value.")}};Jn.getGlslType=function(e){switch(T.typeOf.string("semantic",e),e){case Jn.POSITION:case Jn.NORMAL:case Jn.TANGENT:return"vec3";case Jn.TEXCOORD:return"vec2";case Jn.COLOR:return"vec4";case Jn.JOINTS:return"ivec4";case Jn.WEIGHTS:return"vec4";case Jn.FEATURE_ID:return"int";default:throw new C("semantic is not a valid value.")}};Jn.getVariableName=function(e,t){T.typeOf.string("semantic",e);let n=n3e(e);return c(t)&&(n+=`_${t}`),n};var ht=Object.freeze(Jn);function bg(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.primitive,o=e.draco,r=e.gltfResource,s=e.baseResource,a=e.cacheKey;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.object("options.primitive",i),T.typeOf.object("options.draco",o),T.typeOf.object("options.gltfResource",r),T.typeOf.object("options.baseResource",s),this._resourceCache=t,this._gltfResource=r,this._baseResource=s,this._gltf=n,this._primitive=i,this._draco=o,this._cacheKey=a,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=gt.UNLOADED,this._promise=void 0,this._dracoError=void 0}c(Object.create)&&(bg.prototype=Object.create($i.prototype),bg.prototype.constructor=bg);Object.defineProperties(bg.prototype,{cacheKey:{get:function(){return this._cacheKey}},decodedData:{get:function(){return this._decodedData}}});async function i3e(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Lie(e,n)}}bg.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=i3e(this),this._promise)};function Lie(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load Draco",t)}async function o3e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=gt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var cb={};cb[ht.POSITION]="POSITION";cb[ht.NORMAL]="NORMAL";cb[ht.COLOR]="COLOR";cb[ht.TEXCOORD]="TEX_COORD";function r3e(e){for(let t in cb)if(cb.hasOwnProperty(t)&&e.startsWith(t))return cb[t]}bg.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.PROCESSING||(c(this._dracoError)&&Lie(this,this._dracoError),!c(this._bufferViewTypedArray))||c(this._decodePromise))return!1;let t=this._draco,n=this._primitive,i=this._gltf,o=i.bufferViews,r=t.bufferView,s=o[r],a=t.attributes,l=[];for(let h in n.attributes)if(n.attributes.hasOwnProperty(h)){let p=r3e(h);c(p)&&i.accessors[n.attributes[h]].componentType===$.FLOAT&&(l.includes(p)||l.push(p))}let u={array:new Uint8Array(this._bufferViewTypedArray),bufferView:s,compressedAttributes:a,dequantizeInShader:!0,attributesToSkipTransform:l},f=yg.decodeBufferView(u);if(!c(f))return!1;this._decodePromise=o3e(this,f)};bg.prototype.unload=function(){c(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0};var cv=bg;function s3e(e){let t=e.uint8Array,n=e.format,i=e.request,o=e.flipY??!1,r=e.skipColorSpaceConversion??!1;T.typeOf.object("uint8Array",t),T.typeOf.string("format",n);let s=new Blob([t],{type:n}),a;return we.supportsImageBitmapOptions().then(function(l){return l?Promise.resolve(we.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new we({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(l){return c(a)&&window.URL.revokeObjectURL(a),l}).catch(function(l){return c(a)&&window.URL.revokeObjectURL(a),Promise.reject(l)})}var _A=s3e;function Pp(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.imageId,o=e.gltfResource,r=e.baseResource,s=e.cacheKey;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.number("options.imageId",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r);let a=n.images[i],l=a.bufferView,u=a.uri;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._bufferViewId=l,this._uri=u,this._cacheKey=s,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(Pp.prototype=Object.create($i.prototype),Pp.prototype.constructor=Pp);Object.defineProperties(Pp.prototype,{cacheKey:{get:function(){return this._cacheKey}},image:{get:function(){return this._image}},mipLevels:{get:function(){return this._mipLevels}}});Pp.prototype.load=function(){return c(this._promise)?this._promise:c(this._bufferViewId)?(this._promise=a3e(this),this._promise):(this._promise=c3e(this),this._promise)};function Nie(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function a3e(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await u3e(i);if(e.isDestroyed())return;let r=Nie(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(n){return e.isDestroyed()?void 0:Fie(e,n,"Failed to load embedded image")}}async function c3e(e){e._state=gt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await d3e(i);if(e.isDestroyed())return;let r=Nie(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=gt.READY,e}catch(o){return e.isDestroyed()?void 0:Fie(e,o,`Failed to load image: ${n}`)}}function Fie(e,t,n){return e.unload(),e._state=gt.FAILED,Promise.reject(e.getError(n,t))}function l3e(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new ae("Image format is not recognized")}async function u3e(e){let t=l3e(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Xl(n)}return Pp._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var f3e=/(^data:image\/ktx2)|(\.ktx2$)/i;function d3e(e){let t=e.getUrlComponent(!1,!0);return f3e.test(t)?Xl(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}Pp.prototype.unload=function(){c(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0};Pp._loadImageFromTypedArray=_A;var lv=Pp;var h3e={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3},wa=Object.freeze(h3e);function xg(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.accessorId,o=e.gltfResource,r=e.baseResource,s=e.primitive,a=e.draco,l=e.cacheKey,u=e.asynchronous??!0,f=e.loadBuffer??!1,h=e.loadTypedArray??!1;if(T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.number("options.accessorId",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r),!f&&!h)throw new C("At least one of loadBuffer and loadTypedArray must be true.");let p=n.accessors[i].componentType;this._resourceCache=t,this._gltfResource=o,this._baseResource=r,this._gltf=n,this._accessorId=i,this._indexDatatype=p,this._primitive=s,this._draco=a,this._cacheKey=l,this._asynchronous=u,this._loadBuffer=f,this._loadTypedArray=h,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(xg.prototype=Object.create($i.prototype),xg.prototype.constructor=xg);Object.defineProperties(xg.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},indexDatatype:{get:function(){return this._indexDatatype}}});var m3e=new Lj;xg.prototype.load=async function(){return c(this._promise)?this._promise:c(this._draco)?(this._promise=p3e(this),this._promise):(this._promise=_3e(this),this._promise)};async function p3e(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=gt.LOADED,e)}catch(n){if(e.isDestroyed())return;Mj(e,n)}}async function _3e(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=gt.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=g3e(e,a),e._state=gt.PROCESSING,e}catch(s){if(e.isDestroyed())return;Mj(e,s)}}function g3e(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Fe.getSizeInBytes(s),l=t.buffer,u=t.byteOffset+o.byteOffset;if(u%a!==0){let h=r*a,p=new Uint8Array(l,u,h);l=new Uint8Array(p).buffer,u=0,Ns("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===Fe.UNSIGNED_BYTE?f=new Uint8Array(l,u,r):s===Fe.UNSIGNED_SHORT?f=new Uint16Array(l,u,r):s===Fe.UNSIGNED_INT&&(f=new Uint32Array(l,u,r)),f}function Mj(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load index buffer",t)}function Lj(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}Lj.prototype.set=function(e,t,n){this.typedArray=e,this.indexDatatype=t,this.context=n};Lj.prototype.execute=function(){this.buffer=Bie(this.typedArray,this.indexDatatype,this.context)};function Bie(e,t,n){let i=bt.createIndexBuffer({typedArray:e,context:n,usage:Be.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}xg.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;let t=this._typedArray,n=this._indexDatatype;if(c(this._dracoLoader))try{this._dracoLoader.process(e)&&(t=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=t,n=$.fromTypedArray(t),this._indexDatatype=n)}catch(o){Mj(this,o)}if(!c(t))return!1;let i;if(this._loadBuffer&&this._asynchronous){let o=m3e;if(o.set(t,n,e.context),!e.jobScheduler.execute(o,wa.BUFFER))return!1;i=o.buffer}else this._loadBuffer&&(i=Bie(t,n,e.context));return this.unload(),this._buffer=i,this._typedArray=this._loadTypedArray?t:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};xg.prototype.unload=function(){c(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;c(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),c(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0};var uv=xg;function y3e(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Bs=y3e;function b3e(e,t){return c(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var br=b3e;function Xt(){}Xt.objectLegacy=function(e,t){if(c(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(c(o))return o}}};Xt.object=function(e,t){if(c(e)){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=t(o,i);if(c(r))return r}}};Xt.topLevel=function(e,t,n){let i=e[t];return c(i)&&!Array.isArray(i)?Xt.objectLegacy(i,n):Xt.object(i,n)};Xt.accessor=function(e,t){return Xt.topLevel(e,"accessors",t)};Xt.accessorWithSemantic=function(e,t,n){let i={};return Xt.mesh(e,function(o){return Xt.meshPrimitive(o,function(r){let s=Xt.meshPrimitiveAttribute(r,function(a,l){if(l.indexOf(t)===0&&!c(i[a])){i[a]=!0;let u=n(a);if(c(u))return u}});return c(s)?s:Xt.meshPrimitiveTarget(r,function(a){return Xt.meshPrimitiveTargetAttribute(a,function(l,u){if(u.indexOf(t)===0&&!c(i[l])){i[l]=!0;let f=n(l);if(c(f))return f}})})})})};Xt.accessorContainingVertexAttributeData=function(e,t){let n={};return Xt.mesh(e,function(i){return Xt.meshPrimitive(i,function(o){let r=Xt.meshPrimitiveAttribute(o,function(s){if(!c(n[s])){n[s]=!0;let a=t(s);if(c(a))return a}});return c(r)?r:Xt.meshPrimitiveTarget(o,function(s){return Xt.meshPrimitiveTargetAttribute(s,function(a){if(!c(n[a])){n[a]=!0;let l=t(a);if(c(l))return l}})})})})};Xt.accessorContainingIndexData=function(e,t){let n={};return Xt.mesh(e,function(i){return Xt.meshPrimitive(i,function(o){let r=o.indices;if(c(r)&&!c(n[r])){n[r]=!0;let s=t(r);if(c(s))return s}})})};Xt.animation=function(e,t){return Xt.topLevel(e,"animations",t)};Xt.animationChannel=function(e,t){let n=e.channels;return Xt.object(n,t)};Xt.animationSampler=function(e,t){let n=e.samplers;return Xt.object(n,t)};Xt.buffer=function(e,t){return Xt.topLevel(e,"buffers",t)};Xt.bufferView=function(e,t){return Xt.topLevel(e,"bufferViews",t)};Xt.camera=function(e,t){return Xt.topLevel(e,"cameras",t)};Xt.image=function(e,t){return Xt.topLevel(e,"images",t)};Xt.material=function(e,t){return Xt.topLevel(e,"materials",t)};Xt.materialValue=function(e,t){let n=e.values;c(e.extensions)&&c(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(c(o))return o}};Xt.mesh=function(e,t){return Xt.topLevel(e,"meshes",t)};Xt.meshPrimitive=function(e,t){let n=e.primitives;if(c(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r,o);if(c(s))return s}}};Xt.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(c(o))return o}};Xt.meshPrimitiveTarget=function(e,t){let n=e.targets;if(c(n)){let i=n.length;for(let o=0;o<i;++o){let r=t(n[o],o);if(c(r))return r}}};Xt.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(c(o))return o}};Xt.node=function(e,t){return Xt.topLevel(e,"nodes",t)};Xt.nodeInTree=function(e,t,n){let i=e.nodes;if(c(i)){let o=t.length;for(let r=0;r<o;r++){let s=t[r],a=i[s];if(c(a)){let l=n(a,s);if(c(l))return l;let u=a.children;if(c(u)&&(l=Xt.nodeInTree(e,u,n),c(l)))return l}}}};Xt.nodeInScene=function(e,t,n){let i=t.nodes;if(c(i))return Xt.nodeInTree(e,i,n)};Xt.program=function(e,t){return br(e,"KHR_techniques_webgl")?Xt.object(e.extensions.KHR_techniques_webgl.programs,t):Xt.topLevel(e,"programs",t)};Xt.sampler=function(e,t){return Xt.topLevel(e,"samplers",t)};Xt.scene=function(e,t){return Xt.topLevel(e,"scenes",t)};Xt.shader=function(e,t){return br(e,"KHR_techniques_webgl")?Xt.object(e.extensions.KHR_techniques_webgl.shaders,t):Xt.topLevel(e,"shaders",t)};Xt.skin=function(e,t){return Xt.topLevel(e,"skins",t)};Xt.skinJoint=function(e,t){let n=e.joints;if(c(n)){let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=t(r);if(c(s))return s}}};Xt.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(c(o))return o}};Xt.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(c(o))return o}};Xt.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let o=t(n[i],i);if(c(o))return o}};Xt.technique=function(e,t){return br(e,"KHR_techniques_webgl")?Xt.object(e.extensions.KHR_techniques_webgl.techniques,t):Xt.topLevel(e,"techniques",t)};Xt.texture=function(e,t){return Xt.topLevel(e,"textures",t)};var Oe=Xt;function x3e(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var mf=x3e;function T3e(e,t){let n=t.bufferView;if(c(n)){let i=e.bufferViews[n];if(c(i.byteStride)&&i.byteStride>0)return i.byteStride}return $.getSizeInBytes(t.componentType)*mf(t.type)}var ou=T3e;function A3e(e){Oe.accessor(e,function(n){c(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),Oe.bufferView(e,function(n){c(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){if(i.mode=i.mode??ne.TRIANGLES,!c(i.material)){c(e.materials)||(e.materials=[]);let o={name:"default"};i.material=Bs(e.materials,o)}})}),Oe.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=i.normalized??!1,c(o)){let r=e.bufferViews[o];r.byteStride=ou(e,i),r.target=ne.ARRAY_BUFFER}}),Oe.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(c(o)){let r=e.bufferViews[o];r.target=ne.ELEMENT_ARRAY_BUFFER}}),Oe.material(e,function(n){let i=n.extensions??W.EMPTY_OBJECT,o=i.KHR_materials_common;if(c(o)){let l=o.technique,u=c(o.values)?o.values:{};o.values=u,u.ambient=c(u.ambient)?u.ambient:[0,0,0,1],u.emission=c(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,l!=="CONSTANT"&&(u.diffuse=c(u.diffuse)?u.diffuse:[0,0,0,1],l!=="LAMBERT"&&(u.specular=c(u.specular)?u.specular:[0,0,0,1],u.shininess=u.shininess??0)),o.transparent=o.transparent??!1,o.doubleSided=o.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let r=i.KHR_techniques_webgl;c(r)&&Oe.materialValue(n,function(l){c(l.index)&&lb(l)}),lb(n.emissiveTexture),lb(n.normalTexture),lb(n.occlusionTexture);let s=n.pbrMetallicRoughness;c(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,lb(s.baseColorTexture),lb(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;c(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,lb(a.specularGlossinessTexture))}),Oe.animation(e,function(n){Oe.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=C3e(e);return Oe.node(e,function(n,i){c(t[i])||c(n.translation)||c(n.rotation)||c(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=n.matrix??[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}),Oe.sampler(e,function(n){n.wrapS=n.wrapS??ne.REPEAT,n.wrapT=n.wrapT??ne.REPEAT}),c(e.scenes)&&!c(e.scene)&&(e.scene=0),e}function C3e(e){let t={};return Oe.animation(e,function(n){Oe.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function lb(e){c(e)&&(e.texCoord=e.texCoord??0)}var DN=A3e;function E3e(e){return Oe.shader(e,function(t){PN(t)}),Oe.buffer(e,function(t){PN(t)}),Oe.image(e,function(t){PN(t)}),PN(e),e}function PN(e){e.extras=c(e.extras)?e.extras:{},e.extras._pipeline=c(e.extras._pipeline)?e.extras._pipeline:{}}var ub=E3e;function S3e(e,t){let n=e.extensionsRequired;if(c(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var IN=S3e;function w3e(e,t){let n=e.extensionsUsed;if(c(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),IN(e,t),n.length===0&&delete e.extensionsUsed}}var gA=w3e;var v3e=4;function D3e(e){if(Wh(e)!=="glTF")throw new ae("File is not valid binary glTF");let n=kie(e,0,5),i=n[1];if(i!==1&&i!==2)throw new ae("Binary glTF version is not 1 or 2");return i===1?P3e(e,n):I3e(e,n)}function kie(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r<n;++r)o[r]=i.getUint32(e.byteOffset+t+r*v3e,!0);return o}function P3e(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new ae("Binary glTF scene format is not JSON");let r=20,s=r+i,a=tu(e,r,i),l=JSON.parse(a);ub(l);let u=e.subarray(s,n),f=l.buffers;if(c(f)&&Object.keys(f).length>0){let h=f.binary_glTF??f.KHR_binary_glTF;c(h)&&(h.extras._pipeline.source=u,delete h.uri)}return gA(l,"KHR_binary_glTF"),l}function I3e(e,t){let n=t[2],i=12,o,r;for(;i<n;){let s=kie(e,i,2),a=s[0],l=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,l===1313821514){let f=tu(u);o=JSON.parse(f),ub(o)}else l===5130562&&(r=u)}if(c(o)&&c(r)){let s=o.buffers;if(c(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=r}}return o}var ON=D3e;function O3e(e){return Oe.shader(e,function(t){RN(t)}),Oe.buffer(e,function(t){RN(t)}),Oe.image(e,function(t){RN(t)}),RN(e),e}function RN(e){c(e.extras)&&(c(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var MN=O3e;function R3e(e,t){let n=e.extensionsUsed;c(n)||(n=[],e.extensionsUsed=n),Bs(n,t,!0)}var Ad=R3e;function M3e(e){switch(e){case $.BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt8(n+s*o)};case $.UNSIGNED_BYTE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint8(n+s*o)};case $.SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt16(n+s*o,!0)};case $.UNSIGNED_SHORT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint16(n+s*o,!0)};case $.INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getInt32(n+s*o,!0)};case $.UNSIGNED_INT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getUint32(n+s*o,!0)};case $.FLOAT:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat32(n+s*o,!0)};case $.DOUBLE:return function(t,n,i,o,r){for(let s=0;s<i;++s)r[s]=t.getFloat64(n+s*o,!0)}}}var Tg=M3e;function L3e(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=mf(t.type);if(!c(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),l=n[o],u=l.buffer,h=i[u].extras._pipeline.source,p=t.count,g=ou(e,t),m=t.byteOffset+l.byteOffset+h.byteOffset,y=t.componentType,b=$.getSizeInBytes(y),x=new DataView(h.buffer),A=new Array(r),E=Tg(y);for(let S=0;S<p;S++){E(x,m,r,b,A);for(let v=0;v<r;v++){let P=A[v];s[v]=Math.min(s[v],P),a[v]=Math.max(a[v],P)}m+=g}return{min:s,max:a}}var yA=L3e;var N3e=[ne.FUNC_ADD,ne.FUNC_ADD],F3e=[ne.ONE,ne.ZERO,ne.ONE,ne.ZERO];function Uie(e,t){let n=e.enable;return c(n)?n.indexOf(t)>-1:!1}var B3e=[ne.ZERO,ne.ONE,ne.SRC_COLOR,ne.ONE_MINUS_SRC_COLOR,ne.SRC_ALPHA,ne.ONE_MINUS_SRC_ALPHA,ne.DST_ALPHA,ne.ONE_MINUS_DST_ALPHA,ne.DST_COLOR,ne.ONE_MINUS_DST_COLOR];function k3e(e,t){if(!c(e))return t;for(let n=0;n<4;n++)if(B3e.indexOf(e[n])===-1)return t;return e}function U3e(e){let t={},n={},i=e.techniques;return c(i)&&(Oe.technique(e,function(o,r){let s=o.states;if(c(s)){let a=n[r]={};if(Uie(s,ne.BLEND)){a.alphaMode="BLEND";let l=s.functions;c(l)&&(c(l.blendEquationSeparate)||c(l.blendFuncSeparate))&&(t[r]={blendEquation:l.blendEquationSeparate??N3e,blendFactors:k3e(l.blendFuncSeparate,F3e)})}Uie(s,ne.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(c(e.extensions)||(e.extensions={}),Ad(e,"KHR_blend")),Oe.material(e,function(o){if(c(o.technique)){let r=n[o.technique];Oe.objectLegacy(r,function(a,l){o[l]=a});let s=t[o.technique];c(s)&&(c(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var LN=U3e;function V3e(e,t){let n=e.extensionsRequired;c(n)||(n=[],e.extensionsRequired=n),Bs(n,t,!0),Ad(e,t)}var NN=V3e;function z3e(e){let t=e.techniques,n={},i={},o={};if(c(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Oe.technique(e,function(a,l){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Oe.techniqueAttribute(a,function(h,p){f=a.parameters[h],u.attributes[p]={semantic:f.semantic}}),Oe.techniqueUniform(a,function(h,p){f=a.parameters[h],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},c(n[l])||(n[l]={}),n[l][h]=p}),c(o[a.program]))u.program=o[a.program];else{let h=e.programs[a.program],p={name:h.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[h.fragmentShader];p.fragmentShader=Bs(r.shaders,g,!0);let m=e.shaders[h.vertexShader];p.vertexShader=Bs(r.shaders,m,!0),u.program=Bs(r.programs,p),o[a.program]=u.program}i[l]=Bs(r.techniques,u)}),r.techniques.length>0&&(c(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Ad(e,"KHR_techniques_webgl"),NN(e,"KHR_techniques_webgl"))}return Oe.material(e,function(r){if(c(r.technique)){let s={technique:i[r.technique]};Oe.objectLegacy(r.values,function(a,l){c(s.values)||(s.values={});let u=n[r.technique][l];c(u)&&(s.values[u]=a)}),c(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var FN=z3e;function H3e(e,t){T.typeOf.object("material",e),T.defined("handler",t);let n=e.pbrMetallicRoughness;if(c(n)){if(c(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(c(s))return s}if(c(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(c(s))return s}}let{extensions:i}=e;if(c(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(c(r)){if(c(r.diffuseTexture)){let l=r.diffuseTexture,u=t(l.index,l);if(c(u))return u}if(c(r.specularGlossinessTexture)){let l=r.specularGlossinessTexture,u=t(l.index,l);if(c(u))return u}}let s=i.KHR_materials_specular;if(c(s)){let{specularTexture:l,specularColorTexture:u}=s;if(c(l)){let f=t(l.index,l);if(c(f))return f}if(c(u)){let f=t(u.index,u);if(c(f))return f}}let a=i.KHR_materials_common;if(c(a)&&c(a.values)){let{diffuse:l,ambient:u,emission:f,specular:h}=a.values;if(c(l)&&c(l.index)){let p=t(l.index,l);if(c(p))return p}if(c(u)&&c(u.index)){let p=t(u.index,u);if(c(p))return p}if(c(f)&&c(f.index)){let p=t(f.index,f);if(c(p))return p}if(c(h)&&c(h.index)){let p=t(h.index,h);if(c(p))return p}}}let o=Oe.materialValue(e,function(r){if(c(r.index)){let s=t(r.index,r);if(c(s))return s}});if(c(o))return o;if(c(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(c(s))return s}if(c(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(c(s))return s}if(c(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(c(s))return s}}var fv=H3e;var Vie=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function G3e(e,t){return t=t??Vie,Vie.forEach(function(n){t.indexOf(n)>-1&&W3e(e,n)}),e}var j3e={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function W3e(e,t){let n=j3e[t],i=e[n];if(c(i)){let o=0,r=Xh[t](e),s=i.length;for(let a=0;a<s;++a)r[a]||(Yh[t](e,a-o),o++)}}function Yh(){}Yh.accessor=function(e,t){e.accessors.splice(t,1),Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){Oe.meshPrimitiveAttribute(o,function(a,l){a>t&&o.attributes[l]--}),Oe.meshPrimitiveTarget(o,function(a){Oe.meshPrimitiveTargetAttribute(a,function(l,u){l>t&&a[u]--})});let r=o.indices;c(r)&&r>t&&o.indices--;let s=o.extensions;c(s)&&c(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Oe.skin(e,function(i){c(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Oe.animation(e,function(i){Oe.animationSampler(i,function(o){c(o.input)&&o.input>t&&o.input--,c(o.output)&&o.output>t&&o.output--})})};Yh.buffer=function(e,t){e.buffers.splice(t,1),Oe.bufferView(e,function(i){c(i.buffer)&&i.buffer>t&&i.buffer--,c(i.extensions)&&c(i.extensions.EXT_meshopt_compression)&&i.extensions.EXT_meshopt_compression.buffer--})};Yh.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Oe.accessor(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Oe.shader(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Oe.image(e,function(i){c(i.bufferView)&&i.bufferView>t&&i.bufferView--}),br(e,"KHR_draco_mesh_compression")&&Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){c(o.extensions)&&c(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),br(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(c(a)){for(let l in a)if(a.hasOwnProperty(l)){let u=a[l];c(u.bufferView)&&u.bufferView>t&&u.bufferView--,c(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,c(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(br(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(c(o)){let r=o.length;for(let s=0;s<r;++s){let l=o[s].properties;for(let u in l)if(l.hasOwnProperty(u)){let f=l[u];c(f.values)&&f.values>t&&f.values--,c(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,c(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};Yh.image=function(e,t){e.images.splice(t,1),Oe.texture(e,function(i){c(i.source)&&i.source>t&&--i.source;let o=i.extensions;c(o)&&c(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:c(o)&&c(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Yh.mesh=function(e,t){e.meshes.splice(t,1),Oe.node(e,function(i){c(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Yh.node=function(e,t){e.nodes.splice(t,1),Oe.skin(e,function(i){c(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),Oe.animation(e,function(i){Oe.animationChannel(i,function(o){c(o.target)&&c(o.target.node)&&o.target.node>t&&o.target.node--})}),Oe.technique(e,function(i){Oe.techniqueUniform(i,function(o){c(o.node)&&o.node>t&&o.node--})}),Oe.node(e,function(i){c(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),Oe.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Yh.material=function(e,t){e.materials.splice(t,1),Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){c(o.material)&&o.material>t&&o.material--})})};Yh.sampler=function(e,t){e.samplers.splice(t,1),Oe.texture(e,function(i){c(i.sampler)&&i.sampler>t&&--i.sampler})};Yh.texture=function(e,t){if(e.textures.splice(t,1),Oe.material(e,function(i){fv(i,function(o,r){r.index>t&&--r.index})}),br(e,"EXT_feature_metadata")){Oe.mesh(e,function(r){Oe.meshPrimitive(r,function(s){let a=s.extensions;if(c(a)&&c(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(c(u)){let f=u.length;for(let h=0;h<f;++h){let g=u[h].featureIds.texture;g.index>t&&--g.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(c(a)){for(let l in a)if(a.hasOwnProperty(l)){let f=a[l].texture;f.index>t&&--f.index}}}}if(br(e,"EXT_mesh_features")&&Oe.mesh(e,function(i){Oe.meshPrimitive(i,function(o){let r=o.extensions;if(c(r)&&c(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(c(a)){let l=a.length;for(let u=0;u<l;++u){let f=a[u];c(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),br(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(c(o)){let r=o.length;for(let s=0;s<r;++s){let l=o[s].properties;for(let u in l)if(l.hasOwnProperty(u)){let f=l[u];f.index>t&&--f.index}}}}};function Xh(){}Xh.accessor=function(e){let t={};return Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){Oe.meshPrimitiveAttribute(i,function(r){t[r]=!0}),Oe.meshPrimitiveTarget(i,function(r){Oe.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;c(o)&&(t[o]=!0)})}),Oe.skin(e,function(n){c(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Oe.animation(e,function(n){Oe.animationSampler(n,function(i){c(i.input)&&(t[i.input]=!0),c(i.output)&&(t[i.output]=!0)})}),br(e,"EXT_mesh_gpu_instancing")&&Oe.node(e,function(n){c(n.extensions)&&c(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),br(e,"CESIUM_primitive_outline")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){let o=i.extensions;if(c(o)&&c(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;c(s)&&(t[s]=!0)}})}),t};Xh.buffer=function(e){let t={};return Oe.bufferView(e,function(n){c(n.buffer)&&(t[n.buffer]=!0),c(n.extensions)&&c(n.extensions.EXT_meshopt_compression)&&(t[n.extensions.EXT_meshopt_compression.buffer]=!0)}),t};Xh.bufferView=function(e){let t={};if(Oe.accessor(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),Oe.shader(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),Oe.image(e,function(n){c(n.bufferView)&&(t[n.bufferView]=!0)}),br(e,"KHR_draco_mesh_compression")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){c(i.extensions)&&c(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),br(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(c(s)){for(let a in s)if(s.hasOwnProperty(a)){let l=s[a];c(l.bufferView)&&(t[l.bufferView]=!0),c(l.arrayOffsetBufferView)&&(t[l.arrayOffsetBufferView]=!0),c(l.stringOffsetBufferView)&&(t[l.stringOffsetBufferView]=!0)}}}}if(br(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(c(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let l in a)if(a.hasOwnProperty(l)){let u=a[l];c(u.values)&&(t[u.values]=!0),c(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),c(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};Xh.image=function(e){let t={};return Oe.texture(e,function(n){c(n.source)&&(t[n.source]=!0),c(n.extensions)&&c(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:c(n.extensions)&&c(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};Xh.mesh=function(e){let t={};return Oe.node(e,function(n){if(c(n.mesh&&c(e.meshes))){let i=e.meshes[n.mesh];c(i)&&c(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function zie(e,t,n){let i=e.nodes[t];return c(i.mesh)||c(i.camera)||c(i.skin)||c(i.weights)||c(i.extras)||c(i.extensions)&&Object.keys(i.extensions).length!==0||c(n[t])?!1:!c(i.children)||i.children.filter(function(o){return!zie(e,o,n)}).length===0}Xh.node=function(e){let t={};return Oe.skin(e,function(n){c(n.skeleton)&&(t[n.skeleton]=!0),Oe.skinJoint(n,function(i){t[i]=!0})}),Oe.animation(e,function(n){Oe.animationChannel(n,function(i){c(i.target)&&c(i.target.node)&&(t[i.target.node]=!0)})}),Oe.technique(e,function(n){Oe.techniqueUniform(n,function(i){c(i.node)&&(t[i.node]=!0)})}),Oe.node(e,function(n,i){zie(e,i,t)||(t[i]=!0)}),t};Xh.material=function(e){let t={};return Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){c(i.material)&&(t[i.material]=!0)})}),t};Xh.texture=function(e){let t={};if(Oe.material(e,function(n){fv(n,function(i){t[i]=!0})}),br(e,"EXT_feature_metadata")){Oe.mesh(e,function(o){Oe.meshPrimitive(o,function(r){let s=r.extensions;if(c(s)&&c(s.EXT_feature_metadata)){let l=s.EXT_feature_metadata.featureIdTextures;if(c(l)){let u=l.length;for(let f=0;f<u;++f){let p=l[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(c(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(br(e,"EXT_mesh_features")&&Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){let o=i.extensions;if(c(o)&&c(o.EXT_mesh_features)){let s=o.EXT_mesh_features.featureIds;if(c(s)){let a=s.length;for(let l=0;l<a;++l){let u=s[l];c(u.texture)&&(t[u.texture.index]=!0)}}}})}),br(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(c(i)){let o=i.length;for(let r=0;r<o;++r){let a=i[r].properties;for(let l in a)if(a.hasOwnProperty(l)){let u=a[l];t[u.index]=!0}}}}return t};Xh.sampler=function(e){let t={};return Oe.texture(e,function(n){c(n.sampler)&&(t[n.sampler]=!0)}),t};var BN=G3e;function q3e(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},o={buffer:Bs(e.buffers,n),byteOffset:0,byteLength:t.length};return Bs(e.bufferViews,o)}var kN=q3e;function Y3e(e,t){let n=ou(e,t),i=$.getSizeInBytes(t.componentType),o=mf(t.type),r=t.count,s=new Array(o*r);if(!c(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],l=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+l.byteOffset,f=new DataView(l.buffer),h=new Array(o),p=Tg(t.componentType);for(let g=0;g<r;++g){p(f,u,o,i,h);for(let m=0;m<o;++m)s[g*o+m]=h[m];u+=n}return s}var UN=Y3e;function X3e(e){let t;return Oe.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ne.BYTE?VN(e,i,$.UNSIGNED_BYTE):t!==ne.UNSIGNED_BYTE&&t!==ne.UNSIGNED_SHORT&&VN(e,i,$.UNSIGNED_SHORT)}),Oe.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===ne.BYTE?VN(e,i,$.UNSIGNED_BYTE):t===ne.SHORT&&VN(e,i,$.UNSIGNED_SHORT)}),e}function VN(e,t,n){let i=$.createTypedArray(n,UN(e,t)),o=new Uint8Array(i.buffer);t.bufferView=kN(e,o),t.componentType=n,t.byteOffset=0}var zN=X3e;function K3e(e,t){return gA(e,t),t==="CESIUM_RTC"&&$3e(e),Nj(e,t)}function $3e(e){Oe.technique(e,function(t){Oe.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function Nj(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)Nj(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;c(n)&&(i=n[t],c(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&Nj(e[o],t);return i}}var bA=K3e;var HN={.8:nke,"1.0":Cke,"2.0":void 0};function Z3e(e,t){t=t??W.EMPTY_OBJECT;let n=t.targetVersion,i=e.version;e.asset=e.asset??{version:"1.0"},e.asset.version=e.asset.version??"1.0",i=(i??e.asset.version).toString(),Object.prototype.hasOwnProperty.call(HN,i)||(c(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(HN,i)||(i="1.0"));let o=HN[i];for(;c(o)&&i!==n;)o(e,t),i=e.asset.version,o=HN[i];return t.keepLegacyExtensions||(wke(e,t),vke(e)),e}function jie(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.instanceTechnique;c(o)&&(i.technique=o.technique,i.values=o.values,delete i.instanceTechnique)}}function Q3e(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let o=t[n].primitives;if(c(o)){let r=o.length;for(let s=0;s<r;++s){let a=o[s],l=a.primitive??ne.TRIANGLES;a.mode=a.mode??l,delete a.primitive}}}}function J3e(e){let t=e.nodes,n=new d,i=new Le;for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o];if(c(r.rotation)){let a=r.rotation;d.fromArray(a,0,n),Le.fromAxisAngle(n,a[3],i),r.rotation=[i.x,i.y,i.z,i.w]}let s=r.instanceSkin;c(s)&&(r.skeletons=s.skeletons,r.skin=s.skin,r.meshes=s.meshes,delete r.instanceSkin)}}function eke(e){let t=e.animations,n=e.accessors,i=e.bufferViews,o=e.buffers,r={},s=new d,a=new Le;for(let l in t)if(Object.prototype.hasOwnProperty.call(t,l)){let u=t[l],f=u.channels,h=u.parameters,p=u.samplers;if(c(f)){let g=f.length;for(let m=0;m<g;++m){let y=f[m];if(y.target.path==="rotation"){let b=h[p[y.sampler].output];if(c(r[b]))continue;r[b]=!0;let x=n[b],A=i[x.bufferView],S=o[A.buffer].extras._pipeline.source,v=S.byteOffset+A.byteOffset+x.byteOffset,P=x.componentType,M=x.count,R=mf(x.type),L=x.count*R,B=$.createArrayBufferView(P,S.buffer,v,L);for(let _=0;_<M;_++){let w=_*R;d.unpack(B,w,s);let D=B[w+3];Le.fromAxisAngle(s,D,a),Le.pack(a,B,w)}}}}}}function tke(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.passes;if(c(o)){let r=i.pass??"defaultPass";if(Object.prototype.hasOwnProperty.call(o,r)){let s=o[r],a=s.instanceProgram;i.attributes=i.attributes??a.attributes,i.program=i.program??a.program,i.uniforms=i.uniforms??a.uniforms,i.states=i.states??s.states}delete i.passes,delete i.pass}}}function nke(e){c(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(c(e.version)&&delete e.version,jie(e),Q3e(e),J3e(e),eke(e),tke(e),c(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),c(e.lights)){let n=e.extensions??{};e.extensions=n;let i=n.KHR_materials_common??{};n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Ad(e,"KHR_materials_common")}}function ike(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],o=i.parameters;if(c(o)){let r=i.samplers;for(let s in r)if(Object.prototype.hasOwnProperty.call(r,s)){let a=r[s];a.input=o[a.input],a.output=o[a.output]}delete i.parameters}}}function Hie(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let o=e[i];t[i]=n.length,n.push(o),c(o.name)||(o.name=i)}return n}function oke(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,o={},r=e.nodes;for(let s in r)Object.prototype.hasOwnProperty.call(r,s)&&(i=r[s].jointName,c(i)&&(o[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&c(n[s])){let a={},l=e[s];e[s]=Hie(l,a),n[s]=a}for(i in o)Object.prototype.hasOwnProperty.call(o,i)&&(o[i]=n.nodes[o[i]]);c(e.scene)&&(e.scene=n.scenes[e.scene]),Oe.bufferView(e,function(s){c(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Oe.accessor(e,function(s){c(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Oe.shader(e,function(s){let a=s.extensions;if(c(a)){let l=a.KHR_binary_glTF;c(l)&&(s.bufferView=n.bufferViews[l.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Oe.program(e,function(s){c(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),c(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Oe.technique(e,function(s){c(s.program)&&(s.program=n.programs[s.program]),Oe.techniqueParameter(s,function(a){c(a.node)&&(a.node=n.nodes[a.node]);let l=a.value;typeof l=="string"&&(a.value={index:n.textures[l]})})}),Oe.mesh(e,function(s){Oe.meshPrimitive(s,function(a){c(a.indices)&&(a.indices=n.accessors[a.indices]),Oe.meshPrimitiveAttribute(a,function(l,u){a.attributes[u]=n.accessors[l]}),c(a.material)&&(a.material=n.materials[a.material])})}),Oe.node(e,function(s){let a=s.children;if(c(a)){let l=a.length;for(t=0;t<l;++t)a[t]=n.nodes[a[t]]}if(c(s.meshes)){let l=s.meshes,u=l.length;if(u>0)for(s.mesh=n.meshes[l[0]],t=1;t<u;++t){let f={mesh:n.meshes[l[t]]},h=Bs(e.nodes,f);c(a)||(a=[],s.children=a),a.push(h)}delete s.meshes}if(c(s.camera)&&(s.camera=n.cameras[s.camera]),c(s.skin)&&(s.skin=n.skins[s.skin]),c(s.skeletons)){let l=s.skeletons;if(l.length>0&&c(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[l[0]]}delete s.skeletons}c(s.jointName)&&delete s.jointName}),Oe.skin(e,function(s){c(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(c(a)){let l=[],u=a.length;for(t=0;t<u;++t)l[t]=o[a[t]];s.joints=l,delete s.jointNames}}),Oe.scene(e,function(s){let a=s.nodes;if(c(a)){let l=a.length;for(t=0;t<l;++t)a[t]=n.nodes[a[t]]}}),Oe.animation(e,function(s){let a={};s.samplers=Hie(s.samplers,a),Oe.animationSampler(s,function(l){l.input=n.accessors[l.input],l.output=n.accessors[l.output]}),Oe.animationChannel(s,function(l){l.sampler=a[l.sampler];let u=l.target;c(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Oe.material(e,function(s){c(s.technique)&&(s.technique=n.techniques[s.technique]),Oe.materialValue(s,function(l,u){typeof l=="string"&&(s.values[u]={index:n.textures[l]})});let a=s.extensions;if(c(a)){let l=a.KHR_materials_common;c(l)&&c(l.values)&&Oe.materialValue(l,function(u,f){typeof u=="string"&&(l.values[f]={index:n.textures[u]})})}}),Oe.image(e,function(s){let a=s.extensions;if(c(a)){let l=a.KHR_binary_glTF;c(l)&&(s.bufferView=n.bufferViews[l.bufferView],s.mimeType=l.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Oe.texture(e,function(s){c(s.sampler)&&(s.sampler=n.samplers[s.sampler]),c(s.source)&&(s.source=n.images[s.source])})}function rke(e){Oe.animation(e,function(t){Oe.animationSampler(t,function(n){delete n.name})})}function ske(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}Oe.node(e,function(t){c(t.children)&&t.children.length===0&&delete t.children})}function ake(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var cke={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function lke(e){let t=e.extensionsUsed;if(e.extensionsRequired=e.extensionsRequired??[],c(t)){let n=t.length;for(let i=0;i<n;++i){let o=t[i];c(cke[o])&&e.extensionsRequired.push(o)}}}function uke(e){Oe.buffer(e,function(t){delete t.type})}function fke(e){Oe.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function dke(e){Oe.mesh(e,function(t){Oe.meshPrimitive(t,function(n){Oe.meshPrimitiveAttribute(n,function(i,o){o==="TEXCOORD"?n.attributes.TEXCOORD_0=i:o==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Oe.technique(e,function(t){Oe.techniqueParameter(t,function(n){let i=n.semantic;c(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var hke={POSITION:!0,NORMAL:!0,TANGENT:!0},mke={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function pke(e){let t={};Oe.mesh(e,function(n){Oe.meshPrimitive(n,function(i){Oe.meshPrimitiveAttribute(i,function(o,r){if(r.charAt(0)!=="_"){let s=r.search(/_[0-9]+/g),a=r,l="_0";s>=0&&(a=r.substring(0,s),l=r.substring(s));let u,f=mke[a];c(f)?(u=f+l,t[r]=u):c(hke[a])||(u=`_${r}`,t[r]=u)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];c(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),Oe.technique(e,function(n){Oe.techniqueParameter(n,function(i){let o=t[i.semantic];c(o)&&(i.semantic=o)})})}function _ke(e){Oe.camera(e,function(t){let n=t.perspective;if(c(n)){let i=n.aspectRatio;c(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;c(o)&&o===0&&(n.yfov=1)}})}function Bj(e,t){return c(t.byteStride)&&t.byteStride!==0?t.byteStride:ou(e,t)}function gke(e){Oe.buffer(e,function(t){c(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Oe.accessor(e,function(t){let n=t.bufferView;if(c(n)){let i=e.bufferViews[n],o=Bj(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function yke(e){let t,n,i,o=e.bufferViews,r={};Oe.accessorContainingVertexAttributeData(e,function(a){let l=e.accessors[a];c(l.bufferView)&&(r[l.bufferView]=!0)});let s={};Oe.accessor(e,function(a){c(a.bufferView)&&(s[a.bufferView]=s[a.bufferView]??[],s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let l=s[a];l.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,h=l.length;for(t=0;t<h;++t){let p=l[t],g=Bj(e,p),m=p.byteOffset,y=p.count*g;delete p.byteStride;let b=t<h-1,x=b?Bj(e,l[t+1]):void 0;if(g!==x){let A=We(i,!0);r[a]&&(A.byteStride=g),A.byteOffset+=u,A.byteLength=m+y-u;let E=Bs(o,A);for(n=f;n<=t;++n)p=l[n],p.bufferView=E,p.byteOffset=p.byteOffset-u;u=b?l[t+1].byteOffset:void 0,f=t+1}}}BN(e,["accessor","bufferView","buffer"])}function bke(e){Oe.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!c(n.min)||!c(n.max)){let i=yA(e,n);n.min=i.min,n.max=i.max}})}function Wie(e){return(!c(e.children)||e.children.length===0)&&(!c(e.meshes)||e.meshes.length===0)&&!c(e.camera)&&!c(e.skin)&&!c(e.skeletons)&&!c(e.jointName)&&(!c(e.translation)||d.fromArray(e.translation).equals(d.ZERO))&&(!c(e.scale)||d.fromArray(e.scale).equals(new d(1,1,1)))&&(!c(e.rotation)||se.fromArray(e.rotation).equals(new se(0,0,0,1)))&&(!c(e.matrix)||F.fromColumnMajorArray(e.matrix).equals(F.IDENTITY))&&!c(e.extensions)&&!c(e.extras)}function qie(e,t){Oe.scene(e,function(n){let i=n.nodes;if(c(i)){let o=i.length;for(let r=o;r>=0;--r)if(i[r]===t){i.splice(r,1);return}}}),Oe.node(e,function(n,i){if(c(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),Wie(n)&&qie(e,i))}}),delete e.nodes[t]}function xke(e){return Oe.node(e,function(t,n){Wie(t)&&qie(e,n)}),e}function Tke(e){Oe.animation(e,function(t){Oe.animationSampler(t,function(n){let i=e.accessors[n.input];if(!c(i.min)||!c(i.max)){let o=yA(e,i);i.min=o.min,i.max=o.max}})})}function Ake(e){Oe.accessor(e,function(t){if(c(t.min)||c(t.max)){let n=yA(e,t);c(t.min)&&(t.min=n.min),c(t.max)&&(t.max=n.max)}})}function Cke(e){e.asset=e.asset??{},e.asset.version="2.0",jie(e),ike(e),xke(e),oke(e),rke(e),ake(e),lke(e),gke(e),yke(e),bke(e),Tke(e),Ake(e),uke(e),fke(e),dke(e),pke(e),zN(e),_ke(e),LN(e),FN(e),ske(e)}var Eke=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],Ske=["u_diffuse","u_diffuse_mat"];function kj(e){e.pbrMetallicRoughness=c(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function Uj(e){return c(e.index)}function Vj(e){return Array.isArray(e)&&e.length===4}function Yie(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function wke(e,t){t=t??W.EMPTY_OBJECT;let n=t.baseColorTextureNames??Eke,i=t.baseColorFactorNames??Ske;Oe.material(e,function(o){Oe.materialValue(o,function(r,s){n.indexOf(s)!==-1&&Uj(r)?(kj(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&Vj(r)&&(kj(o),o.pbrMetallicRoughness.baseColorFactor=Yie(r))})}),bA(e,"KHR_techniques_webgl"),bA(e,"KHR_blend")}function Fj(e,t){c(t)&&(Vj(t)?e.pbrMetallicRoughness.baseColorFactor=Yie(t):Uj(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Gie(e,t){c(t)&&(Vj(t)?e.emissiveFactor=t.slice(0,3):Uj(t)&&(e.emissiveTexture=t))}function vke(e){Oe.material(e,function(t){let n=(t.extensions??W.EMPTY_OBJECT).KHR_materials_common;if(!c(n))return;let i=n.values??{},o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,l=n.doubleSided,u=n.transparent;kj(t),n.technique==="CONSTANT"?(Ad(e,"KHR_materials_unlit"),t.extensions=c(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},Fj(t,s),Fj(t,o)):(Fj(t,r),Gie(t,o),Gie(t,s)),c(l)&&(t.doubleSided=l),c(a)&&(c(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),c(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),bA(e,"KHR_materials_common")}var GN=Z3e;function nc(){}nc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;c(n)&&c(n.message)&&(i+=`
${n.message}`);let o=new ae(i);return c(n)&&(o.stack=`Original stack:
${n.stack}
Handler stack:
${o.stack}`),o};nc.getNodeTransform=function(e){return c(e.matrix)?e.matrix:F.fromTranslationQuaternionRotationScale(c(e.translation)?e.translation:d.ZERO,c(e.rotation)?e.rotation:Le.IDENTITY,c(e.scale)?e.scale:d.ONE)};nc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=c(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};nc.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.name===t)return r}};nc.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};nc.hasQuantizedAttributes=function(e){if(!c(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(c(n.quantization))return!0}return!1};nc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,o=!1;c(t)?(i=ht.getVariableName(t,n),o=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let r=/^color_\d+$/.test(i),s=e.type,a=nn.getGlslType(s);r&&(a="vec4");let l=c(e.quantization),u;return l&&(u=r?"vec4":nn.getGlslType(e.quantization.type)),{attribute:e,isQuantized:l,variableName:i,hasSemantic:o,glslType:a,quantizedGlslType:u}};var Dke=new d,Pke=new d;nc.getPositionMinMax=function(e,t,n){let i=nc.getAttributeBySemantic(e,"POSITION"),o=i.max,r=i.min;return c(n)&&c(t)&&(r=d.add(r,t,Pke),o=d.add(o,n,Dke)),{min:r,max:o}};nc.getAxisCorrectionMatrix=function(e,t,n){return n=F.clone(F.IDENTITY,n),e===Fo.Y?n=F.clone(Fo.Y_UP_TO_Z_UP,n):e===Fo.X&&(n=F.clone(Fo.X_UP_TO_Z_UP,n)),t===Fo.Z&&(n=F.multiplyTransformation(n,Fo.Z_UP_TO_X_UP,n)),n};var Ike=new J;nc.getCullFace=function(e,t){if(!Me.isTriangles(t))return Ti.BACK;let n=F.getMatrix3(e,Ike);return J.determinant(n)<0?Ti.FRONT:Ti.BACK};nc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};nc.supportedExtensions={AGI_articulations:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_implicit_cylinder_region:!0,EXT_implicit_ellipsoid_region:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_meshopt_compression:!0,EXT_primitive_voxels:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_implicit_shapes:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_techniques_webgl:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,WEB3D_quantized_attributes:!0};nc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!nc.supportedExtensions[i])throw new ae(`Unsupported glTF Extension: ${i}`)}};var $t=nc;function Ag(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltfResource,i=e.baseResource,o=e.typedArray,r=e.gltfJson,s=e.cacheKey;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltfResource",n),T.typeOf.object("options.baseResource",i),this._resourceCache=t,this._gltfResource=n,this._baseResource=i,this._typedArray=o,this._gltfJson=r,this._cacheKey=s,this._gltf=void 0,this._bufferLoaders=[],this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(Ag.prototype=Object.create($i.prototype),Ag.prototype.constructor=Ag);Object.defineProperties(Ag.prototype,{cacheKey:{get:function(){return this._cacheKey}},gltf:{get:function(){return this._gltf}}});Ag.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,c(this._gltfJson)?(this._promise=Xie(this,this._gltfJson),this._promise):c(this._typedArray)?(this._promise=Kie(this,this._typedArray),this._promise):(this._promise=Oke(this),this._promise))};async function Oke(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;zj(e,n)}return Kie(e,t)}function zj(e,t){e.unload(),e._state=gt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function Rke(e,t){if(c(t.asset)&&t.asset.version==="2.0"&&!br(t,"KHR_techniques_webgl")&&!br(t,"KHR_materials_common"))return Promise.resolve();let n=[];Oe.buffer(t,function(i){if(!c(i.extras._pipeline.source)&&c(i.uri)){let o=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:o});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),GN(t)}function Mke(e){let t=[];return Oe.buffer(e,function(n){let i=n.uri;!c(n.extras._pipeline.source)&&c(i)&&k_(i)&&(delete n.uri,t.push(we.fetchArrayBuffer(i).then(function(o){n.extras._pipeline.source=new Uint8Array(o)})))}),Promise.all(t)}function Lke(e,t){let n=[];return Oe.buffer(t,function(i,o){let r=i.extras._pipeline.source;if(c(r)&&!c(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:o,typedArray:r});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function Xie(e,t){try{ub(t),await Mke(t),await Rke(e,t),DN(t),await Lke(e,t),MN(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new ae(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return c(i)&&$t.checkSupportedExtensions(i),e._gltf=t,e._state=gt.READY,e}catch(n){if(e.isDestroyed())return;zj(e,n)}}async function Kie(e,t){let n;try{Wh(t)==="glTF"?n=ON(t):n=sr(t)}catch(i){if(e.isDestroyed())return;zj(e,i)}return Xie(e,n)}Ag.prototype.unload=function(){let e=this._bufferLoaders,t=e.length;for(let n=0;n<t;++n)e[n]=!e[n].isDestroyed()&&this._resourceCache.unload(e[n]);this._bufferLoaders.length=0,this._gltf=void 0};Ag.prototype._fetchGltf=function(){return this._gltfResource.fetchArrayBuffer()};var dv=Ag;var Nke={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"},Ip=Object.freeze(Nke);var To={};function Fke(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}function Bke(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}function kke(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}function Uke(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}function Vke(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}function zke(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}function Hke(){this.attributes=[]}function Gke(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0}function jke(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}function Wke(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}function qke(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0}function Yke(){this.nodes=[]}var Xke={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"};function Kke(){this.input=[],this.interpolation=void 0,this.output=[]}function $ke(){this.node=void 0,this.path=void 0}function Zke(){this.sampler=void 0,this.target=void 0}function Qke(){this.name=void 0,this.samplers=[],this.channels=[]}function Jke(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}function eUe(){this.name=void 0,this.stages=[]}function $ie(){this.credits=[]}function tUe(){this.asset=new $ie,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=F.clone(F.IDENTITY),this.extensions={}}function nUe(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=J.clone(J.IDENTITY),this.scale=1,this.channels=void 0}function Cg(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(Cg.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=Cg.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=Cg.DEFAULT_ROUGHNESS_FACTOR}Cg.DEFAULT_BASE_COLOR_FACTOR=se.ONE;Cg.DEFAULT_METALLIC_FACTOR=1;Cg.DEFAULT_ROUGHNESS_FACTOR=1;function fb(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(fb.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=d.clone(fb.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=fb.DEFAULT_GLOSSINESS_FACTOR}fb.DEFAULT_DIFFUSE_FACTOR=se.ONE;fb.DEFAULT_SPECULAR_FACTOR=d.ONE;fb.DEFAULT_GLOSSINESS_FACTOR=1;function hv(){this.specularFactor=hv.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=d.clone(hv.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}hv.DEFAULT_SPECULAR_FACTOR=1;hv.DEFAULT_SPECULAR_COLOR_FACTOR=d.ONE;function mv(){this.anisotropyStrength=mv.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=mv.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}mv.DEFAULT_ANISOTROPY_STRENGTH=0;mv.DEFAULT_ANISOTROPY_ROTATION=0;function pv(){this.clearcoatFactor=pv.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=pv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}pv.DEFAULT_CLEARCOAT_FACTOR=0;pv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR=0;function Hj(){this.metallicRoughness=new Cg,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=d.clone(Hj.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Ip.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1}Hj.DEFAULT_EMISSIVE_FACTOR=d.ZERO;To.Quantization=Fke;To.Attribute=Bke;To.Indices=kke;To.FeatureIdAttribute=Uke;To.FeatureIdTexture=zke;To.FeatureIdImplicitRange=Vke;To.MorphTarget=Hke;To.Primitive=Gke;To.Instances=jke;To.Skin=Wke;To.Node=qke;To.Scene=Yke;To.AnimatedPropertyType=Object.freeze(Xke);To.AnimationSampler=Kke;To.AnimationTarget=$ke;To.AnimationChannel=Zke;To.Animation=Qke;To.ArticulationStage=Jke;To.Articulation=eUe;To.Asset=$ie;To.Components=tUe;To.TextureReader=nUe;To.MetallicRoughness=Cg;To.SpecularGlossiness=fb;To.Specular=hv;To.Anisotropy=mv;To.Clearcoat=pv;To.Material=Hj;var An=To;var jN={};jN.getImageIdFromTexture=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,textureId:n,supportedImageFormats:i}=e;T.typeOf.object("options.gltf",t),T.typeOf.number("options.textureId",n),T.typeOf.object("options.supportedImageFormats",i);let o=t.textures[n],r=o.extensions;if(c(r)){if(i.webp&&c(r.EXT_texture_webp))return r.EXT_texture_webp.source;if(i.basis&&c(r.KHR_texture_basisu))return r.KHR_texture_basisu.source}return o.source};jN.createSampler=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e;T.typeOf.object("options.gltf",t),T.typeOf.object("options.textureInfo",n);let o=gn.REPEAT,r=gn.REPEAT,s=Yt.LINEAR,a=ui.LINEAR,l=n.index,f=t.textures[l].sampler;if(c(f)){let h=t.samplers[f];o=h.wrapS??o,r=h.wrapT??r,s=h.minFilter??s,a=h.magFilter??a}return i&&s!==Yt.LINEAR&&s!==Yt.NEAREST&&(s===Yt.NEAREST_MIPMAP_NEAREST||s===Yt.NEAREST_MIPMAP_LINEAR?s=Yt.NEAREST:s=Yt.LINEAR),new Qt({wrapS:o,wrapT:r,minificationFilter:s,magnificationFilter:a})};var iUe=new z(1,1);jN.createModelTextureReader=function(e){e=e??W.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e;T.typeOf.object("options.textureInfo",t);let o=t.texCoord??0,r,s=t.extensions?.KHR_texture_transform;if(c(s)){o=s.texCoord??o;let l=c(s.offset)?z.unpack(s.offset):z.ZERO,u=s.rotation??0,f=c(s.scale)?z.unpack(s.scale):iUe;u=-u,r=new J(Math.cos(u)*f.x,-Math.sin(u)*f.y,l.x,Math.sin(u)*f.x,Math.cos(u)*f.y,l.y,0,0,1)}let a=new An.TextureReader;return a.index=t.index,a.texture=i,a.texCoord=o,a.scale=t.scale,a.transform=r,a.channels=n,a};var ru=jN;function oUe(e){let t=document.createElement("canvas");return t.width=O.nextPowerOfTwo(e.width),t.height=O.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var db=oUe;function Eg(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.textureInfo,o=e.gltfResource,r=e.baseResource,s=e.supportedImageFormats,a=e.cacheKey,l=e.asynchronous??!0;T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.object("options.textureInfo",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r),T.typeOf.object("options.supportedImageFormats",s);let u=i.index,f=ru.getImageIdFromTexture({gltf:n,textureId:u,supportedImageFormats:s});this._resourceCache=t,this._gltf=n,this._textureInfo=i,this._imageId=f,this._gltfResource=o,this._baseResource=r,this._cacheKey=a,this._asynchronous=l,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(Eg.prototype=Object.create($i.prototype),Eg.prototype.constructor=Eg);Object.defineProperties(Eg.prototype,{cacheKey:{get:function(){return this._cacheKey}},texture:{get:function(){return this._texture}}});var rUe=new Gj;async function sUe(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=gt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load texture",n)}}Eg.prototype.load=async function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=sUe(this),this._promise)};function Gj(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}Gj.prototype.set=function(e,t,n,i,o,r){this.gltf=e,this.textureInfo=t,this.textureId=n,this.image=i,this.mipLevels=o,this.context=r};Gj.prototype.execute=function(){this.texture=Zie(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)};function Zie(e,t,n,i,o,r){let s=i.internalFormat,a=!1;ke.isCompressedFormat(s)&&!c(o)&&(a=!0);let l=ru.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=l.minificationFilter,f=l.wrapS,h=l.wrapT,p=u===Yt.NEAREST_MIPMAP_NEAREST||u===Yt.NEAREST_MIPMAP_LINEAR||u===Yt.LINEAR_MIPMAP_NEAREST||u===Yt.LINEAR_MIPMAP_LINEAR,g=!c(s)&&p,m=g||f===gn.REPEAT||f===gn.MIRRORED_REPEAT||h===gn.REPEAT||h===gn.MIRRORED_REPEAT,y=!O.isPowerOfTwo(i.width)||!O.isPowerOfTwo(i.height),b=m&&y,x;return c(s)?(!r.webgl2&&ke.isCompressedFormat(s)&&y&&m&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),x=Rt.create({id:n,context:r,source:{arrayBufferView:i.bufferView,mipLevels:o},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:l})):(b&&(i=db(i)),x=Rt.create({id:n,context:r,source:i,sampler:l,flipY:!1,skipColorSpaceConversion:!0})),g&&x.generateMipmap(),x}Eg.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING||c(this._texture)||!c(this._image))return!1;this._state=gt.PROCESSING;let t;if(this._asynchronous){let n=rUe;if(n.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context),!e.jobScheduler.execute(n,wa.TEXTURE))return;t=n.texture}else t=Zie(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,e.context);return this.unload(),this._texture=t,this._state=gt.READY,this._resourceCache.statistics.addTextureLoader(this),!0};Eg.prototype.unload=function(){c(this._texture)&&this._texture.destroy(),c(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0};var _v=Eg;function Sg(e){e=e??W.EMPTY_OBJECT;let t=e.resourceCache,n=e.gltf,i=e.gltfResource,o=e.baseResource,r=e.bufferViewId,s=e.primitive,a=e.draco,l=e.attributeSemantic,u=e.accessorId,f=e.cacheKey,h=e.asynchronous??!0,p=e.loadBuffer??!1,g=e.loadTypedArray??!1;if(T.typeOf.func("options.resourceCache",t),T.typeOf.object("options.gltf",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),!p&&!g)throw new C("At least one of loadBuffer and loadTypedArray must be true.");let m=c(r),y=c(s),b=Qie(a,l),x=c(l),A=c(u);if(m===b)throw new C("One of options.bufferViewId and options.draco must be defined.");if(b&&!x)throw new C("When options.draco is defined options.attributeSemantic must also be defined.");if(b&&!A)throw new C("When options.draco is defined options.accessorId must also be defined.");if(b&&!y)throw new C("When options.draco is defined options.primitive must also be defined.");b&&(T.typeOf.object("options.primitive",s),T.typeOf.object("options.draco",a),T.typeOf.string("options.attributeSemantic",l),T.typeOf.number("options.accessorId",u)),this._resourceCache=t,this._gltfResource=i,this._baseResource=o,this._gltf=n,this._bufferViewId=r,this._primitive=s,this._draco=a,this._attributeSemantic=l,this._accessorId=u,this._cacheKey=f,this._asynchronous=h,this._loadBuffer=p,this._loadTypedArray=g,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(Sg.prototype=Object.create($i.prototype),Sg.prototype.constructor=Sg);Object.defineProperties(Sg.prototype,{cacheKey:{get:function(){return this._cacheKey}},buffer:{get:function(){return this._buffer}},typedArray:{get:function(){return this._typedArray}},quantization:{get:function(){return this._quantization}}});function Qie(e,t){return c(e)&&c(e.attributes)&&c(e.attributes[t])}Sg.prototype.load=async function(){return c(this._promise)?this._promise:Qie(this._draco,this._attributeSemantic)?(this._promise=cUe(this),this._promise):(this._promise=uUe(this),this._promise)};function aUe(e,t,n,i){let r=(1<<e.quantizationBits)-1,s=1/r,a=new An.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=nn.VEC2,a.normalizationRange=r;else{let l=nn.getMathType(i);if(l===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=r,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=l.unpack(e.minValues),a.normalizationRange=l.unpack(new Array(n).fill(r));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=l.unpack(u);let f=u.map(function(h){return h*s});a.quantizedVolumeStepSize=l.unpack(f)}}return a}async function cUe(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=gt.LOADED,e)}catch{if(e.isDestroyed())return;jj(e)}}function lUe(e){e._state=gt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,o=n[i],r=e._accessorId,a=e._gltf.accessors[r].type,l=o.array,u=o.data.quantization;c(u)&&(e._quantization=aUe(u,o.data.componentDatatype,o.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(l.buffer,l.byteOffset,l.byteLength)}async function uUe(e){e._state=gt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=gt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;jj(e,n)}}function jj(e,t){throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load vertex buffer",t)}function Wj(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}Wj.prototype.set=function(e,t){this.typedArray=e,this.context=t};Wj.prototype.execute=function(){this.buffer=Jie(this.typedArray,this.context)};function Jie(e,t){let n=bt.createVertexBuffer({typedArray:e,context:t,usage:Be.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var fUe=new Wj;Sg.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED&&this._state!==gt.PROCESSING)return!1;if(c(this._dracoLoader)){try{if(!this._dracoLoader.process(e))return!1}catch(i){jj(this,i)}lUe(this)}let t,n=this._typedArray;if(this._loadBuffer&&this._asynchronous){let i=fUe;if(i.set(n,e.context),!e.jobScheduler.execute(i,wa.BUFFER))return!1;t=i.buffer}else this._loadBuffer&&(t=Jie(n,e.context));return this.unload(),this._buffer=t,this._typedArray=this._loadTypedArray?n:void 0,this._state=gt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0};Sg.prototype.unload=function(){c(this._buffer)&&this._buffer.destroy();let e=this._resourceCache;c(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&e.unload(this._bufferViewLoader),c(this._dracoLoader)&&e.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0};var gv=Sg;function yv(e){e=e??W.EMPTY_OBJECT;let t=e.id;T.typeOf.string("options.id",t);let n=e.properties??{},i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];c(r.semantic)&&(i[r.semantic]=r)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=We(e.extras,!0),this._extensions=We(e.extensions,!0)}yv.fromJson=function(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.class;T.typeOf.string("options.id",t),T.typeOf.object("options.class",n);let i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=vp.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new yv({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(yv.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});yv.BATCH_TABLE_CLASS_NAME="_batchTable";var Kh=yv;function WN(e){e=e??W.EMPTY_OBJECT;let t=e.value,n=e.name;T.typeOf.number("options.value",t),T.typeOf.string("options.name",n),this._value=t,this._name=n,this._description=e.description,this._extras=We(e.extras,!0),this._extensions=We(e.extensions,!0)}WN.fromJson=function(e){return T.typeOf.object("value",e),new WN({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(WN.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var qN=WN;function YN(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.values;T.typeOf.string("options.id",t),T.defined("options.values",n);let i={},o={},r=n.length;for(let a=0;a<r;++a){let l=n[a];i[l.value]=l.name,o[l.name]=l.value}let s=e.valueType??Nt.UINT16;this._values=n,this._namesByValue=i,this._valuesByName=o,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=We(e.extras,!0),this._extensions=We(e.extensions,!0)}YN.fromJson=function(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.enum;T.typeOf.string("options.id",t),T.typeOf.object("options.enum",n);let i=n.values.map(function(o){return qN.fromJson(o)});return new YN({id:t,values:i,valueType:Nt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(YN.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var XN=YN;function KN(e){e=e??W.EMPTY_OBJECT;let t=e.classes??{},n=e.enums??{};this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=We(e.extras,!0),this._extensions=We(e.extensions,!0)}KN.fromJson=function(e){T.typeOf.object("schema",e);let t={};if(c(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=XN.fromJson({id:i,enum:e.enums[i]}));let n={};if(c(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Kh.fromJson({id:i,class:e.classes[i],enums:t}));return new KN({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(KN.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var pf=KN;function hb(e){e=e??W.EMPTY_OBJECT;let t=e.schema,n=e.resource,i=e.cacheKey;if(c(t)===c(n))throw new C("One of options.schema and options.resource must be defined.");this._schema=c(t)?pf.fromJson(t):void 0,this._resource=n,this._cacheKey=i,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(hb.prototype=Object.create($i.prototype),hb.prototype.constructor=hb);Object.defineProperties(hb.prototype,{cacheKey:{get:function(){return this._cacheKey}},schema:{get:function(){return this._schema}}});hb.prototype.load=async function(){return c(this._promise)?this._promise:c(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=dUe(this),this._promise)};async function dUe(e){let t=e._resource;e._state=gt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=pf.fromJson(n),e._state=gt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=gt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}hb.prototype.unload=function(){this._schema=void 0};var bv=hb;var Cd={};function xA(e){return rp(e.url)}function $N(e){let{byteOffset:t,byteLength:n}=e;if(ri(e,"EXT_meshopt_compression")){let i=e.extensions.EXT_meshopt_compression;t=i.byteOffset??0,n=i.byteLength}return`${t}-${t+n}`}function hUe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:o,count:r}=e;return`${n}-${i}-${o}-${r}`}function eoe(e,t){return`${xA(e)}-buffer-id-${t}`}function xv(e,t,n,i){if(c(e.uri)){let o=i.getDerivedResource({url:e.uri});return xA(o)}return eoe(n,t)}function qj(e,t,n,i){let o=t.bufferView,r=e.bufferViews[o],s=r.buffer,a=e.buffers[s],l=xv(a,s,n,i),u=$N(r);return`${l}-range-${u}`}function toe(e,t,n,i){let o=e.images[t],r=o.bufferView,s=o.uri;if(c(s)){let p=i.getDerivedResource({url:s});return xA(p)}let a=e.bufferViews[r],l=a.buffer,u=e.buffers[l],f=xv(u,l,n,i),h=$N(a);return`${f}-range-${h}`}function mUe(e,t){let n=ru.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Cd.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;if(c(t)===c(n))throw new C("One of options.schema and options.resource must be defined.");return c(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${xA(n)}`};Cd.getExternalBufferCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{resource:t}=e;return T.typeOf.object("options.resource",t),`external-buffer:${xA(t)}`};Cd.getEmbeddedBufferCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return T.typeOf.object("options.parentResource",t),T.typeOf.number("options.bufferId",n),`embedded-buffer:${eoe(t,n)}`};Cd.getGltfCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltfResource:t}=e;return T.typeOf.object("options.gltfResource",t),`gltf:${xA(t)}`};Cd.getBufferViewCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e;T.typeOf.object("options.gltf",t),T.typeOf.number("options.bufferViewId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o);let r=t.bufferViews[n],s=r.buffer,a=t.buffers[s];ri(r,"EXT_meshopt_compression")&&(s=r.extensions.EXT_meshopt_compression.buffer);let l=xv(a,s,i,o),u=$N(r);return`buffer-view:${l}-range-${u}`};Cd.getDracoCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:o}=e;return T.typeOf.object("options.gltf",t),T.typeOf.object("options.draco",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),`draco:${qj(t,n,i,o)}`};Cd.getVertexBufferCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:s,attributeSemantic:a,dequantize:l=!1,loadBuffer:u=!1,loadTypedArray:f=!1}=e;T.typeOf.object("options.gltf",t),T.typeOf.object("options.gltfResource",n),T.typeOf.object("options.baseResource",i),T.typeOf.object("options.frameState",o);let h=c(r),p=pUe(s,a),g=c(a);if(h===p)throw new C("One of options.bufferViewId and options.draco must be defined.");if(p&&!g)throw new C("When options.draco is defined options.attributeSemantic must also be defined.");if(p&&(T.typeOf.object("options.draco",s),T.typeOf.string("options.attributeSemantic",a)),!u&&!f)throw new C("At least one of loadBuffer and loadTypedArray must be true.");let m="";if(l&&(m+="-dequantize"),u&&(m+="-buffer",m+=`-context-${o.context.id}`),f&&(m+="-typed-array"),c(s))return`vertex-buffer:${qj(t,s,n,i)}-draco-${a}${m}`;let y=t.bufferViews[r],b=y.buffer,x=t.buffers[b],A=xv(x,b,n,i),E=$N(y);return`vertex-buffer:${A}-range-${E}${m}`};function pUe(e,t){return c(e)&&c(e.attributes)&&c(e.attributes[t])}Cd.getIndexBufferCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:s,loadBuffer:a=!1,loadTypedArray:l=!1}=e;if(T.typeOf.object("options.gltf",t),T.typeOf.number("options.accessorId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),T.typeOf.object("options.frameState",r),!a&&!l)throw new C("At least one of loadBuffer and loadTypedArray must be true.");let u="";if(a&&(u+="-buffer",u+=`-context-${r.context.id}`),l&&(u+="-typed-array"),c(s))return`index-buffer:${qj(t,s,i,o)}-draco${u}`;let f=t.accessors[n],h=f.bufferView,p=t.bufferViews[h],g=p.buffer,m=t.buffers[g],y=xv(m,g,i,o),b=hUe(f,p);return`index-buffer:${y}-accessor-${b}${u}`};Cd.getImageCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;return T.typeOf.object("options.gltf",t),T.typeOf.number("options.imageId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),`image:${toe(t,n,i,o)}`};Cd.getTextureCacheKey=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}=e;T.typeOf.object("options.gltf",t),T.typeOf.object("options.textureInfo",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),T.typeOf.object("options.supportedImageFormats",r),T.typeOf.object("options.frameState",s);let a=n.index,l=ru.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:r}),u=toe(t,l,i,o),f=mUe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var su=Cd;function Tv(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}Tv.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};Tv.prototype.addGeometryLoader=function(e){T.typeOf.object("loader",e);let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,o=0;c(n)&&(o+=n.sizeInBytes),c(i)&&(o+=i.byteLength),this.geometryByteLength+=o,this._geometrySizes[t]=o};Tv.prototype.addTextureLoader=function(e){T.typeOf.object("loader",e);let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};Tv.prototype.removeLoader=function(e){T.typeOf.object("loader",e);let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],c(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],c(i)&&(this.texturesByteLength-=i)};var ZN=Tv;function Mn(){}Mn.cacheEntries={};Mn.statistics=new ZN;function _Ue(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Mn.get=function(e){T.typeOf.string("cacheKey",e);let t=Mn.cacheEntries[e];if(c(t))return++t.referenceCount,t.resourceLoader};Mn.add=function(e){T.typeOf.object("resourceLoader",e);let t=e.cacheKey;if(T.typeOf.string("options.resourceLoader.cacheKey",t),c(Mn.cacheEntries[t]))throw new C(`Resource with this cacheKey is already in the cache: ${t}`);return Mn.cacheEntries[t]=new _Ue(e),e};Mn.unload=function(e){T.typeOf.object("resourceLoader",e);let t=e.cacheKey,n=Mn.cacheEntries[t];if(!c(n))throw new C(`Resource is not in the cache: ${t}`);--n.referenceCount,n.referenceCount===0&&(Mn.statistics.removeLoader(e),e.destroy(),delete Mn.cacheEntries[t])};Mn.getSchemaLoader=function(e){e=e??W.EMPTY_OBJECT;let{schema:t,resource:n}=e;if(c(t)===c(n))throw new C("One of options.schema and options.resource must be defined.");let i=su.getSchemaCacheKey({schema:t,resource:n}),o=Mn.get(i);return c(o)?o:(o=new bv({schema:t,resource:n,cacheKey:i}),Mn.add(o))};Mn.getEmbeddedBufferLoader=function(e){e=e??W.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e;T.typeOf.object("options.parentResource",t),T.typeOf.number("options.bufferId",n);let o=su.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),r=Mn.get(o);return c(r)?r:(T.typeOf.object("options.typedArray",i),r=new pA({typedArray:i,cacheKey:o}),Mn.add(r))};Mn.getExternalBufferLoader=function(e){e=e??W.EMPTY_OBJECT;let{resource:t}=e;T.typeOf.object("options.resource",t);let n=su.getExternalBufferCacheKey({resource:t}),i=Mn.get(n);return c(i)?i:(i=new pA({resource:t,cacheKey:n}),Mn.add(i))};Mn.getGltfJsonLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:o}=e;T.typeOf.object("options.gltfResource",t),T.typeOf.object("options.baseResource",n);let r=su.getGltfCacheKey({gltfResource:t}),s=Mn.get(r);return c(s)?s:(s=new dv({resourceCache:Mn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:o,cacheKey:r}),Mn.add(s))};Mn.getBufferViewLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}=e;T.typeOf.object("options.gltf",t),T.typeOf.number("options.bufferViewId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o);let r=su.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:o}),s=Mn.get(r);return c(s)?s:(s=new av({resourceCache:Mn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:o,cacheKey:r}),Mn.add(s))};Mn.getDracoLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r}=e;T.typeOf.object("options.gltf",t),T.typeOf.object("options.primitive",n),T.typeOf.object("options.draco",i),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r);let s=su.getDracoCacheKey({gltf:t,draco:i,gltfResource:o,baseResource:r}),a=Mn.get(s);return c(a)?a:(a=new cv({resourceCache:Mn,gltf:t,primitive:n,draco:i,gltfResource:o,baseResource:r,cacheKey:s}),Mn.add(a))};Mn.getVertexBufferLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,primitive:s,draco:a,attributeSemantic:l,accessorId:u,asynchronous:f=!0,dequantize:h=!1,loadBuffer:p=!1,loadTypedArray:g=!1}=e;if(T.typeOf.object("options.gltf",t),T.typeOf.object("options.gltfResource",n),T.typeOf.object("options.baseResource",i),T.typeOf.object("options.frameState",o),!p&&!g)throw new C("At least one of loadBuffer and loadTypedArray must be true.");let m=c(r),y=c(s),b=gUe(a,l),x=c(l),A=c(u);if(m===b)throw new C("One of options.bufferViewId and options.draco must be defined.");if(b&&!x)throw new C("When options.draco is defined options.attributeSemantic must also be defined.");if(b&&!A)throw new C("When options.draco is defined options.haAccessorId must also be defined.");if(b&&!y)throw new C("When options.draco is defined options.primitive must also be defined.");b&&(T.typeOf.object("options.draco",a),T.typeOf.string("options.attributeSemantic",l),T.typeOf.number("options.accessorId",u));let E=su.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:o,bufferViewId:r,draco:a,attributeSemantic:l,dequantize:h,loadBuffer:p,loadTypedArray:g}),S=Mn.get(E);return c(S)?S:(S=new gv({resourceCache:Mn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:r,primitive:s,draco:a,attributeSemantic:l,accessorId:u,cacheKey:E,asynchronous:f,dequantize:h,loadBuffer:p,loadTypedArray:g}),Mn.add(S))};function gUe(e,t){return c(e)&&c(e.attributes)&&c(e.attributes[t])}Mn.getIndexBufferLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,primitive:s,draco:a,asynchronous:l=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e;if(T.typeOf.object("options.gltf",t),T.typeOf.number("options.accessorId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),T.typeOf.object("options.frameState",r),!u&&!f)throw new C("At least one of loadBuffer and loadTypedArray must be true.");let h=su.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:o,frameState:r,draco:a,loadBuffer:u,loadTypedArray:f}),p=Mn.get(h);return c(p)?p:(p=new uv({resourceCache:Mn,gltf:t,accessorId:n,gltfResource:i,baseResource:o,primitive:s,draco:a,cacheKey:h,asynchronous:l,loadBuffer:u,loadTypedArray:f}),Mn.add(p))};Mn.getImageLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:o}=e;T.typeOf.object("options.gltf",t),T.typeOf.number("options.imageId",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o);let r=su.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:o}),s=Mn.get(r);return c(s)?s:(s=new lv({resourceCache:Mn,gltf:t,imageId:n,gltfResource:i,baseResource:o,cacheKey:r}),Mn.add(s))};Mn.getTextureLoader=function(e){e=e??W.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a=!0}=e;T.typeOf.object("options.gltf",t),T.typeOf.object("options.textureInfo",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),T.typeOf.object("options.supportedImageFormats",r),T.typeOf.object("options.frameState",s);let l=su.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s}),u=Mn.get(l);return c(u)?u:(u=new _v({resourceCache:Mn,gltf:t,textureInfo:n,gltfResource:i,baseResource:o,supportedImageFormats:r,cacheKey:l,asynchronous:a}),Mn.add(u))};Mn.clearForSpecs=function(){let e=[gv,uv,cv,_v,lv,av,pA,bv,dv],t,n=Mn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(r,s){let a=e.indexOf(r.resourceLoader.constructor),l=e.indexOf(s.resourceLoader.constructor);return a-l});let o=i.length;for(let r=0;r<o;++r){let s=i[r];t=s.resourceLoader.cacheKey,c(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Mn.statistics.clear()};var Di=Mn;function ia(e,t,n){T.typeOf.object("resource",e),T.typeOf.object("implicitTileset",t),T.typeOf.object("implicitCoordinates",n),this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(ia.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});ia.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};ia.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};ia.prototype.contentIsAvailableAtIndex=function(e,t){if(t=t??0,t<0||t>=this._contentAvailabilityBitstreams.length)throw new C("contentIndex out of bounds.");return this._contentAvailabilityBitstreams[t].getBit(e)};ia.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};ia.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};ia.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};ia.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};ia.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===cr.OCTREE&&(t=3),e>>t};ia.fromSubtreeJson=async function(e,t,n,i,o){if(T.typeOf.object("resource",e),c(t)===c(n))throw new C("One of json and subtreeView must be defined.");T.typeOf.object("implicitTileset",i),T.typeOf.object("implicitCoordinates",o);let r=new ia(e,i,o),s;c(t)?s={json:t,binary:void 0}:s=yUe(n);let a=s.json;r._subtreeJson=a;let l;if(ri(a,"3DTILES_metadata"))l=a.extensions["3DTILES_metadata"];else if(c(a.tileMetadata)){let A=a.tileMetadata;l=a.propertyTables[A]}let u=[];if(c(a.contentMetadata)){let A=a.contentMetadata.length;for(let E=0;E<A;E++){let S=a.contentMetadata[E];u.push(a.propertyTables[S])}}let f,h=i.metadataSchema,p=a.subtreeMetadata;if(c(p)){let A=p.class,E=h.classes[A];f=new SN({subtreeMetadata:p,class:E})}r._metadata=f,r._tilePropertyTableJson=l,r._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],ri(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(a.contentAvailability??g);let m=bUe(a.buffers),y=xUe(a.bufferViews,m);TUe(a,y),c(l)&&noe(l,y);for(let A=0;A<u.length;A++){let E=u[A];noe(E,y)}let b=await AUe(r,m,s.binary),x=EUe(y,b);return SUe(r,a,i,x),c(l)&&(wUe(r,i,x),DUe(r)),vUe(r,i,x),PUe(r),r._ready=!0,r};function yUe(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=sr(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function bUe(e){e=c(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=c(n.uri),n.isActive=!1}return e}function xUe(e,t){e=c(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],o=t[i.buffer];i.bufferHeader=o,i.isActive=!1}return e}function TUe(e,t){let n,i=e.tileAvailability;c(i.bitstream)?n=t[i.bitstream]:c(i.bufferView)&&(n=t[i.bufferView]),c(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,c(o[s].bitstream)?n=t[o[s].bitstream]:c(o[s].bufferView)&&(n=t[o[s].bufferView]),c(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;c(r.bitstream)?n=t[r.bitstream]:c(r.bufferView)&&(n=t[r.bufferView]),c(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function noe(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=r.values??r.bufferView;i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=r.stringOffsets??r.stringOffsetBufferView;c(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let l=r.arrayOffsets??r.arrayOffsetBufferView;c(l)&&(i=t[l],i.isActive=!0,i.bufferHeader.isActive=!0)}}function AUe(e,t,n){let i=[];for(let o=0;o<t.length;o++){let r=t[o];if(!r.isActive)i.push(Promise.resolve(void 0));else if(r.isExternal){let s=CUe(e,r);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let s=0;s<o.length;s++){let a=o[s];c(a)&&(r[s]=a)}return r})}async function CUe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Di.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function EUe(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,s=r+o.byteLength,l=t[o.buffer].subarray(r,s);n[i]=l}return n}function SUe(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),l=ri(t,"3DTILES_metadata"),u=c(e._tilePropertyTableJson),f=l||u;e._tileAvailability=Yj(t.tileAvailability,i,s,f);let h=e._contentPropertyTableJsons.length>0;f=f||h;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=Yj(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=Yj(t.childSubtreeAvailability,i,a)}function Yj(e,t,n,i){if(c(e.constant))return new ov({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return c(e.bitstream)?o=t[e.bitstream]:c(e.bufferView)&&(o=t[e.bufferView]),new ov({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function wUe(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new Td({class:a,count:o,properties:i.properties,bufferViews:n})}function vUe(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let l=i[a],f=o[a].availableCount,h=l.class,p=r.classes[h],g=new Td({class:p,count:f,properties:l.properties,bufferViews:n});s.push(g)}}function ioe(e){let t=0,n=e.lengthBits,i=e.availableCount,o;i<256?o=new Uint8Array(n):i<65536?o=new Uint16Array(n):o=new Uint32Array(n);for(let r=0;r<e.lengthBits;r++)e.getBit(r)&&(o[r]=t,t++);return o}function DUe(e){let t=ioe(e._tileAvailability);e._tileJumpBuffer=t}function PUe(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=ioe(o);t.push(r)}}ia.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new ae("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};ia.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new ae("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function IUe(e,t){if(!c(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function OUe(e,t,n){let i=e._contentMetadataTables;if(!c(i))return;let o=i[n];if(!c(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}ia.prototype.getTileMetadataView=function(e){let t=IUe(this,e);if(!c(t))return;let n=this._tileMetadataTable;return new rv({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};ia.prototype.getContentMetadataView=function(e,t){let n=OUe(this,e,t);if(!c(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new rv({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};ia.prototype.isDestroyed=function(){return!1};ia.prototype.destroy=function(){return c(this._bufferLoader)&&Di.unload(this._bufferLoader),de(this)};var TA=ia;var RUe={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"},AA=Object.freeze(RUe);var Ed={};Ed.parseAllBoundingVolumeSemantics=function(e){return T.typeOf.object("tileMetadata",e),{tile:{boundingVolume:Ed.parseBoundingVolumeSemantic("TILE",e),minimumHeight:Ed._parseMinimumHeight("TILE",e),maximumHeight:Ed._parseMaximumHeight("TILE",e)},content:{boundingVolume:Ed.parseBoundingVolumeSemantic("CONTENT",e),minimumHeight:Ed._parseMinimumHeight("CONTENT",e),maximumHeight:Ed._parseMaximumHeight("CONTENT",e)}}};Ed.parseBoundingVolumeSemantic=function(e,t){if(T.typeOf.string("prefix",e),e!=="TILE"&&e!=="CONTENT")throw new C("prefix must be either 'TILE' or 'CONTENT'");T.typeOf.object("tileMetadata",t);let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(c(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(c(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(c(a))return{sphere:a}};Ed._parseMinimumHeight=function(e,t){if(T.typeOf.string("prefix",e),e!=="TILE"&&e!=="CONTENT")throw new C("prefix must be either 'TILE' or 'CONTENT'");T.typeOf.object("tileMetadata",t);let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Ed._parseMaximumHeight=function(e,t){if(T.typeOf.string("prefix",e),e!=="TILE"&&e!=="CONTENT")throw new C("prefix must be either 'TILE' or 'CONTENT'");T.typeOf.object("tileMetadata",t);let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var CA=Ed;function Fc(e,t,n){T.defined("tile.implicitTileset",t.implicitTileset),T.defined("tile.implicitCoordinates",t.implicitCoordinates);let i=t.implicitTileset,o=t.implicitCoordinates;this._implicitTileset=i,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=e,this._tile=t,this._resource=n,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let r=o.getTemplateValues(),s=i.subtreeUriTemplate.getDerivedResource({templateValues:r});this._url=s.getUrlComponent(!0),this._ready=!1}Object.defineProperties(Fc.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._url}},metadata:{get:function(){},set:function(){throw new C("Implicit3DTileContent cannot have metadata")}},batchTable:{get:function(){}},group:{get:function(){return this._group},set:function(e){this._group=e}}});Fc.fromSubtreeJson=async function(e,t,n,i,o,r){if(T.defined("tile.implicitTileset",t.implicitTileset),T.defined("tile.implicitCoordinates",t.implicitCoordinates),c(i)===c(o))throw new C("One of json and arrayBuffer must be defined.");r=r??0;let s;c(o)&&(s=new Uint8Array(o,r));let a=t.implicitTileset,l=t.implicitCoordinates,u=await TA.fromSubtreeJson(n,i,s,a,l),f=new Fc(e,t,n);return f._implicitSubtree=u,MUe(f,u),f._ready=!0,f};function MUe(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=NUe(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=LUe(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let l=s[a],u=l.tile,f=jUe(e,u,l.childIndex);u.children.push(f),r.numberOfTilesTotal++}}function LUe(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(c(s))for(let a=0;a<o;a++){let l=r*o+a;t.childSubtreeIsAvailableAtIndex(l)&&i.push({tile:s,childIndex:a})}}return i}function NUe(e,t,n,i){let s=ooe(e,t,n,i,0,!0),a=e._tileset.statistics,l=[s],u=[],f=e._implicitTileset;for(let h=1;h<f.subtreeLevels;h++){let p=t.getLevelOffset(h),g=f.branchingFactor*l.length;for(let m=0;m<g;m++){let y=p+m;if(!t.tileIsAvailableAtIndex(y)){u.push(void 0);continue}let b=t.getParentMortonIndex(m),x=l[b],A=m%f.branchingFactor,E=ooe(e,t,x,A,y);x.children.push(E),a.numberOfTilesTotal++,u.push(E)}l=u,u=[]}return{rootTile:s,bottomRow:l}}function roe(e,t,n){let i=AA.TILE_GEOMETRIC_ERROR;return c(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function ooe(e,t,n,i,o,r){let s=e._implicitTileset,a;r??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let l,u,f;if(c(t.tilePropertyTableJson)){l=t.getTileMetadataView(a);let P=CA.parseAllBoundingVolumeSemantics(l);u=P.tile,f=P.content}let p=t.contentPropertyTableJsons.length,g=!1;for(let P=0;P<p;P++)if(t.contentIsAvailableAtCoordinates(a,P)){g=!0;break}let m=kUe(s,a,i,r,n,u),y=[];for(let P=0;P<s.contentCount;P++){if(!t.contentIsAvailableAtIndex(o,P))continue;let L={uri:s.contentUriTemplates[P].getDerivedResource({templateValues:a.getTemplateValues()}).url},B=UUe(m,f);c(B)&&(L.boundingVolume=B),y.push(xt(L,s.contentHeaders[P]))}let b=roe(l,s,a),x={boundingVolume:m,geometricError:b,refine:s.refine,contents:y},A=!0,E=We(s.tileHeader,A);delete E.boundingVolume,delete E.transform,delete E.metadata;let S=xt(x,E,A),v=uoe(e,s.baseResource,S,n);return v.implicitCoordinates=a,v.implicitSubtree=t,v.metadata=l,v.hasImplicitContentMetadata=g,v}function QN(e,t){return c(e)&&c(t)&&(c(t.minimumHeight)||c(t.maximumHeight))&&(ri(e,"3DTILES_bounding_volume_S2")||c(e.region))}function Kj(e,t){c(t)&&(ri(e,"3DTILES_bounding_volume_S2")?BUe(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):c(e.region)&&FUe(e.region,t.minimumHeight,t.maximumHeight))}function FUe(e,t,n){c(t)&&(e[4]=t),c(n)&&(e[5]=n)}function BUe(e,t,n){c(t)&&(e.minimumHeight=t),c(n)&&(e.maximumHeight=n)}function kUe(e,t,n,i,o,r){let s;return!c(r)||!c(r.boundingVolume)||!QN(r.boundingVolume,r)&&QN(e.boundingVolume,r)?s=soe(e,t,n,i??!1,o):s=r.boundingVolume,Kj(s,r),s}function UUe(e,t){let n;return c(t)&&(n=t.boundingVolume),QN(n,t)?Kj(n,t):QN(e,t)&&(n=We(e,!0),Kj(n,t)),n}function soe(e,t,n,i,o){let r=e.boundingVolume;return ri(r,"3DTILES_bounding_volume_S2")?aoe(i,o,n,t.level,t.x,t.y,t.z):c(r.region)?{region:loe(r.region,t.level,t.x,t.y,t.z)}:{box:coe(r.box,t.level,t.x,t.y,t.z)}}function aoe(e,t,n,i,o,r,s){T.typeOf.bool("parentIsPlaceholderTile",e),T.typeOf.object("parentTile",t),T.typeOf.number("childIndex",n),T.typeOf.number("level",i),T.typeOf.number("x",o),T.typeOf.number("y",r),c(s)&&T.typeOf.number("z",s);let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:_g.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let l=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=l%2===0?iv.encode2D(i,o,r):iv.encode2D(i,r,o),f=_g.fromFacePositionLevel(l,BigInt(u),i),h,p;if(c(s)){let g=(a.maximumHeight+a.minimumHeight)/2;h=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else h=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:_g.getTokenFromId(f._cellId),minimumHeight:h,maximumHeight:p}}}}var VUe=new d,zUe=new d,Xj=new d,HUe=new J;function coe(e,t,n,i,o){if(T.typeOf.object("rootBox",e),T.typeOf.number("level",t),T.typeOf.number("x",n),T.typeOf.number("y",i),c(o)&&T.typeOf.number("z",o),t===0)return e;let r=d.unpack(e,0,zUe),s=J.unpack(e,3,HUe),a=Math.pow(2,-t),l=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,h=d.fromElements(a,a,1,VUe);c(o)&&(f=-1+(2*o+1)*a,h.z=a);let p=d.fromElements(l,u,f,Xj);p=J.multiplyByVector(s,p,Xj),p=d.add(p,r,Xj);let g=J.clone(s);g=J.multiplyByScale(g,h,g);let m=new Array(12);return d.pack(p,m),J.pack(g,m,3),m}var GUe=new ce;function loe(e,t,n,i,o){if(T.typeOf.object("rootRegion",e),T.typeOf.number("level",t),T.typeOf.number("x",n),T.typeOf.number("y",i),c(o)&&T.typeOf.number("z",o),t===0)return e.slice();let r=ce.unpack(e,0,GUe),s=e[4],a=e[5],l=Math.pow(2,-t),u=l*r.width,f=O.negativePiToPi(r.west+n*u),h=O.negativePiToPi(f+u),p=l*r.height,g=O.negativePiToPi(r.south+i*p),m=O.negativePiToPi(g+p),y=s,b=a;if(c(o)){let x=l*(a-s);y+=o*x,b=y+x}return[f,g,h,m,y,b]}function jUe(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=soe(i,o,n,!1,t),s=roe(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,l={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=uoe(e,i.baseResource,l,t);return u.implicitTileset=i,u.implicitCoordinates=o,u}function uoe(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}Fc.prototype.hasProperty=function(e,t){return!1};Fc.prototype.getFeature=function(e){};Fc.prototype.applyDebugSettings=function(e,t){};Fc.prototype.applyStyle=function(e){};Fc.prototype.update=function(e,t){};Fc.prototype.pick=function(e,t,n){};Fc.prototype.isDestroyed=function(){return!1};Fc.prototype.destroy=function(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),de(this)};Fc._deriveBoundingBox=coe;Fc._deriveBoundingRegion=loe;Fc._deriveBoundingVolumeS2=aoe;var Av=Fc;var WUe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2},au=Object.freeze(WUe);function EA(e,t){T.typeOf.object("normal",e),T.typeOf.number("distance",t),this._distance=t,this._normal=new foe(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(EA.prototype,{distance:{get:function(){return this._distance},set:function(e){T.typeOf.number("value",e),c(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){T.typeOf.object("value",e),c(this.onChangeCallback)&&!d.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),d.clone(e,this._normal._cartesian3)}}});EA.fromPlane=function(e,t){return T.typeOf.object("plane",e),c(t)?(t.normal=e.normal,t.distance=e.distance):t=new EA(e.normal,e.distance),t};EA.clone=function(e,t){return c(t)?(t.normal=e.normal,t.distance=e.distance,t):new EA(e.normal,e.distance)};function foe(e,t){this._clippingPlane=t,this._cartesian3=d.clone(e)}Object.defineProperties(foe.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){T.typeOf.number("value",e),c(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){T.typeOf.number("value",e),c(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){T.typeOf.number("value",e),c(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var SA=EA;function ic(e){e=e??W.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.edgeColor=G.clone(e.edgeColor??G.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new pe,this.planeRemoved=new pe,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?_oe:goe,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(c(n)){let i=n.length;for(let o=0;o<i;++o)this.add(n[o])}}function _oe(e){return e===Wt.OUTSIDE}function goe(e){return e===Wt.INSIDE}Object.defineProperties(ic.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?_oe:goe)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function doe(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}ic.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){doe(n,i)},e.index=t,doe(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};ic.prototype.get=function(e){return T.typeOf.number("index",e),this._planes[e]};function yoe(e,t){let n=e.length;for(let i=0;i<n;++i)if(sn.equals(e[i],t))return i;return-1}ic.prototype.contains=function(e){return yoe(this._planes,e)!==-1};ic.prototype.remove=function(e){let t=this._planes,n=yoe(t,e);if(n===-1)return!1;e instanceof SA&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let o=n;o<i;++o){let r=t[o+1];t[o]=r,r instanceof SA&&(r.index=o)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};ic.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof SA&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var qUe=new se,YUe=new se;function hoe(e,t,n){let i=e._uint8View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],l=Ln.octEncodeToCartesian4(a.normal,YUe);i[r]=l.x,i[r+1]=l.y,i[r+2]=l.z,i[r+3]=l.w;let u=se.packFloat(a.distance,qUe);i[r+4]=u.x,i[r+5]=u.y,i[r+6]=u.z,i[r+7]=u.w,r+=8}}function moe(e,t,n){let i=e._float32View,o=e._planes,r=0;for(let s=t;s<n;++s){let a=o[s],l=a.normal;i[r]=l.x,i[r+1]=l.y,i[r+2]=l.z,i[r+3]=a.distance,r+=4}}function boe(e,t){let n=ut.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var XUe=new z;ic.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=ic.useFloatTexture(n),o=i?this.length:this.length*2;if(c(t)){let s=t.width*t.height;(s<o||o<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!c(t)){let s=boe(o,XUe);s.y*=2,i?(t=new Rt({context:n,width:s.x,height:s.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT,sampler:Qt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Rt({context:n,width:s.x,height:s.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Qt.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let r=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&r===-1)){if(this._multipleDirtyPlanes)i?(moe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(hoe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s=0,a=0;i?(a=Math.floor(r/t.width),s=Math.floor(r-a*t.width),moe(this,r,r+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(r*2/t.width),s=Math.floor(r*2-a*t.width),hoe(this,r,r+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var KUe=new F,poe=new sn(d.UNIT_X,0);ic.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,o=this.modelMatrix;c(t)&&(o=F.multiply(t,o,KUe));let r=Wt.INSIDE;!this.unionClippingRegions&&i>0&&(r=Wt.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];sn.transform(a,o,poe);let l=e.intersectPlane(poe);if(l===Wt.INTERSECTING)r=l;else if(this._testIntersection(l))return l}return r};ic.setOwner=function(e,t,n){if(e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),c(e))){if(c(e._owner))throw new C("ClippingPlaneCollection should only be assigned to one object");e._owner=t,t[n]=e}};ic.useFloatTexture=function(e){return e.floatingPointTexture};ic.getTextureResolution=function(e,t,n){let i=e.texture;if(c(i))return n.x=i.width,n.y=i.height,n;let o=ic.useFloatTexture(t)?e.length:e.length*2,r=boe(o,n);return r.y*=2,r};ic.prototype.isDestroyed=function(){return!1};ic.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),de(this)};var xs=ic;function Qj(e,t,n=2){let i=t&&t.length,o=i?t[0]*n:e.length,r=Toe(e,0,o,n,!0),s=[];if(!r||r.next===r.prev)return s;let a,l,u;if(i&&(r=eVe(e,t,r,n)),e.length>80*n){a=1/0,l=1/0;let f=-1/0,h=-1/0;for(let p=n;p<o;p+=n){let g=e[p],m=e[p+1];g<a&&(a=g),m<l&&(l=m),g>f&&(f=g),m>h&&(h=m)}u=Math.max(f-a,h-l),u=u!==0?32767/u:0}return Ev(r,s,n,a,l,u,0),s}function Toe(e,t,n,i,o){let r;if(o===fVe(e,t,n,i)>0)for(let s=t;s<n;s+=i)r=xoe(s/i|0,e[s],e[s+1],r);else for(let s=n-i;s>=t;s-=i)r=xoe(s/i|0,e[s],e[s+1],r);return r&&wA(r,r.next)&&(wv(r),r=r.next),r}function mb(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(wA(n,n.next)||Nr(n.prev,n,n.next)===0)){if(wv(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function Ev(e,t,n,i,o,r,s){if(!e)return;!s&&r&&rVe(e,i,o,r);let a=e;for(;e.prev!==e.next;){let l=e.prev,u=e.next;if(r?ZUe(e,i,o,r):$Ue(e)){t.push(l.i,e.i,u.i),wv(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=QUe(mb(e),t),Ev(e,t,n,i,o,r,2)):s===2&&JUe(e,t,n,i,o,r):Ev(mb(e),t,n,i,o,r,1);break}}}function $Ue(e){let t=e.prev,n=e,i=e.next;if(Nr(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,l=n.y,u=i.y,f=Math.min(o,r,s),h=Math.min(a,l,u),p=Math.max(o,r,s),g=Math.max(a,l,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=h&&m.y<=g&&Cv(o,a,r,l,s,u,m.x,m.y)&&Nr(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function ZUe(e,t,n,i){let o=e.prev,r=e,s=e.next;if(Nr(o,r,s)>=0)return!1;let a=o.x,l=r.x,u=s.x,f=o.y,h=r.y,p=s.y,g=Math.min(a,l,u),m=Math.min(f,h,p),y=Math.max(a,l,u),b=Math.max(f,h,p),x=$j(g,m,t,n,i),A=$j(y,b,t,n,i),E=e.prevZ,S=e.nextZ;for(;E&&E.z>=x&&S&&S.z<=A;){if(E.x>=g&&E.x<=y&&E.y>=m&&E.y<=b&&E!==o&&E!==s&&Cv(a,f,l,h,u,p,E.x,E.y)&&Nr(E.prev,E,E.next)>=0||(E=E.prevZ,S.x>=g&&S.x<=y&&S.y>=m&&S.y<=b&&S!==o&&S!==s&&Cv(a,f,l,h,u,p,S.x,S.y)&&Nr(S.prev,S,S.next)>=0))return!1;S=S.nextZ}for(;E&&E.z>=x;){if(E.x>=g&&E.x<=y&&E.y>=m&&E.y<=b&&E!==o&&E!==s&&Cv(a,f,l,h,u,p,E.x,E.y)&&Nr(E.prev,E,E.next)>=0)return!1;E=E.prevZ}for(;S&&S.z<=A;){if(S.x>=g&&S.x<=y&&S.y>=m&&S.y<=b&&S!==o&&S!==s&&Cv(a,f,l,h,u,p,S.x,S.y)&&Nr(S.prev,S,S.next)>=0)return!1;S=S.nextZ}return!0}function QUe(e,t){let n=e;do{let i=n.prev,o=n.next.next;!wA(i,o)&&Coe(i,n,n.next,o)&&Sv(i,o)&&Sv(o,i)&&(t.push(i.i,n.i,o.i),wv(n),wv(n.next),n=e=o),n=n.next}while(n!==e);return mb(n)}function JUe(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&cVe(s,a)){let l=Eoe(s,a);s=mb(s,s.next),l=mb(l,l.next),Ev(s,t,n,i,o,r,0),Ev(l,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function eVe(e,t,n,i){let o=[];for(let r=0,s=t.length;r<s;r++){let a=t[r]*i,l=r<s-1?t[r+1]*i:e.length,u=Toe(e,a,l,i,!1);u===u.next&&(u.steiner=!0),o.push(aVe(u))}o.sort(tVe);for(let r=0;r<o.length;r++)n=nVe(o[r],n);return n}function tVe(e,t){let n=e.x-t.x;if(n===0&&(n=e.y-t.y,n===0)){let i=(e.next.y-e.y)/(e.next.x-e.x),o=(t.next.y-t.y)/(t.next.x-t.x);n=i-o}return n}function nVe(e,t){let n=iVe(e,t);if(!n)return t;let i=Eoe(n,e);return mb(i,i.next),mb(n,n.next)}function iVe(e,t){let n=t,i=e.x,o=e.y,r=-1/0,s;if(wA(e,n))return n;do{if(wA(e,n.next))return n.next;if(o<=n.y&&o>=n.next.y&&n.next.y!==n.y){let h=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(h<=i&&h>r&&(r=h,s=n.x<n.next.x?n:n.next,h===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,l=s.x,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=l&&i!==n.x&&Aoe(o<u?i:r,o,l,u,o<u?r:i,o,n.x,n.y)){let h=Math.abs(o-n.y)/(i-n.x);Sv(n,e)&&(h<f||h===f&&(n.x>s.x||n.x===s.x&&oVe(s,n)))&&(s=n,f=h)}n=n.next}while(n!==a);return s}function oVe(e,t){return Nr(e.prev,e,t.prev)<0&&Nr(t.next,e,e.next)<0}function rVe(e,t,n,i){let o=e;do o.z===0&&(o.z=$j(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,sVe(o)}function sVe(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let u=0;u<n&&(a++,s=s.nextZ,!!s);u++);let l=n;for(;a>0||l>0&&s;)a!==0&&(l===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,l--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function $j(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function aVe(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function Aoe(e,t,n,i,o,r,s,a){return(o-s)*(t-a)>=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function Cv(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&Aoe(e,t,n,i,o,r,s,a)}function cVe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!lVe(e,t)&&(Sv(e,t)&&Sv(t,e)&&uVe(e,t)&&(Nr(e.prev,e,t.prev)||Nr(e,t.prev,t))||wA(e,t)&&Nr(e.prev,e,e.next)>0&&Nr(t.prev,t,t.next)>0)}function Nr(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function wA(e,t){return e.x===t.x&&e.y===t.y}function Coe(e,t,n,i){let o=eF(Nr(e,t,n)),r=eF(Nr(e,t,i)),s=eF(Nr(n,i,e)),a=eF(Nr(n,i,t));return!!(o!==r&&s!==a||o===0&&JN(e,n,t)||r===0&&JN(e,i,t)||s===0&&JN(n,e,i)||a===0&&JN(n,t,i))}function JN(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function eF(e){return e>0?1:e<0?-1:0}function lVe(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Coe(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function Sv(e,t){return Nr(e.prev,e,e.next)<0?Nr(e,t,e.next)>=0&&Nr(e,e.prev,t)>=0:Nr(e,t,e.prev)<0||Nr(e,e.next,t)<0}function uVe(e,t){let n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Eoe(e,t){let n=Zj(e.i,e.x,e.y),i=Zj(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function xoe(e,t,n,i){let o=Zj(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function wv(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function Zj(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function fVe(e,t,n,i){let o=0;for(let r=t,s=n-i;r<n;r+=i)o+=(e[s]-e[r])*(e[r+1]+e[s+1]),s=r;return o}var dVe=new d,hVe=new d,wg={};wg.computeArea2D=function(e){T.defined("positions",e),T.typeOf.number.greaterThanOrEquals("positions.length",e.length,3);let t=e.length,n=0;for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];n+=r.x*s.y-s.x*r.y}return n*.5};wg.computeWindingOrder2D=function(e){return wg.computeArea2D(e)>0?ts.COUNTER_CLOCKWISE:ts.CLOCKWISE};wg.triangulate=function(e,t){T.defined("positions",e);let n=z.packArray(e);return Qj(n,t,2)};var Doe=new d,Poe=new d,Ioe=new d,Soe=new d,woe=new d,voe=new d,Op=new d,Ooe=new z,Roe=new z,Moe=new z,vA=new z;wg.computeSubdivision=function(e,t,n,i,o){o=o??O.RADIANS_PER_DEGREE;let r=c(i);T.typeOf.object("ellipsoid",e),T.defined("positions",t),T.defined("indices",n),T.typeOf.number.greaterThanOrEquals("indices.length",n.length,3),T.typeOf.number.equals("indices.length % 3","0",n.length%3,0),T.typeOf.number.greaterThan("granularity",o,0);let s=n.slice(0),a,l=t.length,u=new Array(l*3),f=new Array(l*2),h=0,p=0;for(a=0;a<l;a++){let E=t[a];if(u[h++]=E.x,u[h++]=E.y,u[h++]=E.z,r){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let g=[],m={},y=e.maximumRadius,b=O.chordLength(o,y),x=b*b;for(;s.length>0;){let E=s.pop(),S=s.pop(),v=s.pop(),P=d.fromArray(u,v*3,Doe),M=d.fromArray(u,S*3,Poe),R=d.fromArray(u,E*3,Ioe),L,B,_;r&&(L=z.fromArray(f,v*2,Ooe),B=z.fromArray(f,S*2,Roe),_=z.fromArray(f,E*2,Moe));let w=d.multiplyByScalar(d.normalize(P,Soe),y,Soe),D=d.multiplyByScalar(d.normalize(M,woe),y,woe),I=d.multiplyByScalar(d.normalize(R,voe),y,voe),N=d.magnitudeSquared(d.subtract(w,D,Op)),k=d.magnitudeSquared(d.subtract(D,I,Op)),H=d.magnitudeSquared(d.subtract(I,w,Op)),V=Math.max(N,k,H),j,U,q;V>x?N===V?(j=`${Math.min(v,S)} ${Math.max(v,S)}`,a=m[j],c(a)||(U=d.add(P,M,Op),d.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,m[j]=a,r&&(q=z.add(L,B,vA),z.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(v,a,E),s.push(a,S,E)):k===V?(j=`${Math.min(S,E)} ${Math.max(S,E)}`,a=m[j],c(a)||(U=d.add(M,R,Op),d.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,m[j]=a,r&&(q=z.add(B,_,vA),z.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(S,a,v),s.push(a,E,v)):H===V&&(j=`${Math.min(E,v)} ${Math.max(E,v)}`,a=m[j],c(a)||(U=d.add(R,P,Op),d.multiplyByScalar(U,.5,U),u.push(U.x,U.y,U.z),a=u.length/3-1,m[j]=a,r&&(q=z.add(_,L,vA),z.multiplyByScalar(q,.5,q),f.push(q.x,q.y))),s.push(E,a,S),s.push(a,v,S)):(g.push(v),g.push(S),g.push(E))}let A={attributes:{position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Me.TRIANGLES};return r&&(A.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:f})),new ct(A)};var mVe=new he,pVe=new he,_Ve=new he,Jj=new he;wg.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??O.RADIANS_PER_DEGREE;let r=c(i);T.typeOf.object("ellipsoid",e),T.defined("positions",t),T.defined("indices",n),T.typeOf.number.greaterThanOrEquals("indices.length",n.length,3),T.typeOf.number.equals("indices.length % 3","0",n.length%3,0),T.typeOf.number.greaterThan("granularity",o,0);let s=n.slice(0),a,l=t.length,u=new Array(l*3),f=new Array(l*2),h=0,p=0;for(a=0;a<l;a++){let v=t[a];if(u[h++]=v.x,u[h++]=v.y,u[h++]=v.z,r){let P=i[a];f[p++]=P.x,f[p++]=P.y}}let g=[],m={},y=e.maximumRadius,b=O.chordLength(o,y),x=new Ja(void 0,void 0,e),A=new Ja(void 0,void 0,e),E=new Ja(void 0,void 0,e);for(;s.length>0;){let v=s.pop(),P=s.pop(),M=s.pop(),R=d.fromArray(u,M*3,Doe),L=d.fromArray(u,P*3,Poe),B=d.fromArray(u,v*3,Ioe),_,w,D;r&&(_=z.fromArray(f,M*2,Ooe),w=z.fromArray(f,P*2,Roe),D=z.fromArray(f,v*2,Moe));let I=e.cartesianToCartographic(R,mVe),N=e.cartesianToCartographic(L,pVe),k=e.cartesianToCartographic(B,_Ve);x.setEndPoints(I,N);let H=x.surfaceDistance;A.setEndPoints(N,k);let V=A.surfaceDistance;E.setEndPoints(k,I);let j=E.surfaceDistance,U=Math.max(H,V,j),q,X,te,K,Z;U>b?H===U?(q=`${Math.min(M,P)} ${Math.max(M,P)}`,a=m[q],c(a)||(X=x.interpolateUsingFraction(.5,Jj),te=(I.height+N.height)*.5,K=d.fromRadians(X.longitude,X.latitude,te,e,Op),u.push(K.x,K.y,K.z),a=u.length/3-1,m[q]=a,r&&(Z=z.add(_,w,vA),z.multiplyByScalar(Z,.5,Z),f.push(Z.x,Z.y))),s.push(M,a,v),s.push(a,P,v)):V===U?(q=`${Math.min(P,v)} ${Math.max(P,v)}`,a=m[q],c(a)||(X=A.interpolateUsingFraction(.5,Jj),te=(N.height+k.height)*.5,K=d.fromRadians(X.longitude,X.latitude,te,e,Op),u.push(K.x,K.y,K.z),a=u.length/3-1,m[q]=a,r&&(Z=z.add(w,D,vA),z.multiplyByScalar(Z,.5,Z),f.push(Z.x,Z.y))),s.push(P,a,M),s.push(a,v,M)):j===U&&(q=`${Math.min(v,M)} ${Math.max(v,M)}`,a=m[q],c(a)||(X=E.interpolateUsingFraction(.5,Jj),te=(k.height+I.height)*.5,K=d.fromRadians(X.longitude,X.latitude,te,e,Op),u.push(K.x,K.y,K.z),a=u.length/3-1,m[q]=a,r&&(Z=z.add(D,_,vA),z.multiplyByScalar(Z,.5,Z),f.push(Z.x,Z.y))),s.push(v,a,P),s.push(a,M,P)):(g.push(M),g.push(P),g.push(v))}let S={attributes:{position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Me.TRIANGLES};return r&&(S.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:f})),new ct(S)};wg.scaleToGeodeticHeight=function(e,t,n,i){n=n??ie.default;let o=dVe,r=hVe;if(t=t??0,i=i??!0,c(e)){let s=e.length;for(let a=0;a<s;a+=3)d.fromArray(e,a,r),i&&(r=n.scaleToGeodeticSurface(r,r)),t!==0&&(o=n.geodeticSurfaceNormal(r,o),d.multiplyByScalar(o,t,o),d.add(r,o,r)),e[a]=r.x,e[a+1]=r.y,e[a+2]=r.z}return e};var si=wg;function vg(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(vg.prototype,{length:{get:function(){return this._length}}});vg.prototype.enqueue=function(e){this._array.push(e),this._length++};vg.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};vg.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};vg.prototype.contains=function(e){return this._array.indexOf(e)!==-1};vg.prototype.clear=function(){this._array.length=this._offset=this._length=0};vg.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var pb=vg;var qo={};qo.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!c(o))continue;n+=2;let r=o.positions,s=o.holes;if(c(r)&&r.length>0&&(n+=r.length*t.packedLength),c(s)){let a=s.length;for(let l=0;l<a;++l)i.push(s[l])}}return n};qo.packPolygonHierarchy=function(e,t,n,i){let o=[e];for(;o.length>0;){let r=o.pop();if(!c(r))continue;let s=r.positions,a=r.holes;if(t[n++]=c(s)?s.length:0,t[n++]=c(a)?a.length:0,c(s)){let l=s.length;for(let u=0;u<l;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(c(a)){let l=a.length;for(let u=0;u<l;++u)o.push(a[u])}}return n};qo.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],o=e[t++],r=new Array(i),s=o>0?new Array(o):void 0;for(let a=0;a<i;++a,t+=n.packedLength)r[a]=n.unpack(e,t);for(let a=0;a<o;++a)s[a]=qo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:r,holes:s,startingIndex:t}};var _b=new z;function Foe(e,t,n,i){return z.subtract(t,e,_b),z.multiplyByScalar(_b,n/i,_b),z.add(e,_b,_b),[_b.x,_b.y]}var Dg=new d;function gVe(e,t,n,i){return d.subtract(t,e,Dg),d.multiplyByScalar(Dg,n/i,Dg),d.add(e,Dg,Dg),[Dg.x,Dg.y,Dg.z]}qo.subdivideLineCount=function(e,t,n){let o=d.distance(e,t)/n,r=Math.max(0,Math.ceil(O.log2(o)));return Math.pow(2,r)};var nF=new he,iF=new he,yVe=new he,bVe=new d,tF=new Ja;qo.subdivideRhumbLineCount=function(e,t,n,i){let o=e.cartesianToCartographic(t,nF),r=e.cartesianToCartographic(n,iF),a=new Ja(o,r,e).surfaceDistance/i,l=Math.max(0,Math.ceil(O.log2(a)));return Math.pow(2,l)};qo.subdivideTexcoordLine=function(e,t,n,i,o,r){let s=qo.subdivideLineCount(n,i,o),a=z.distance(e,t),l=a/s,u=r;u.length=s*2;let f=0;for(let h=0;h<s;h++){let p=Foe(e,t,h*l,a);u[f++]=p[0],u[f++]=p[1]}return u};qo.subdivideLine=function(e,t,n,i){let o=qo.subdivideLineCount(e,t,n),r=d.distance(e,t),s=r/o;c(i)||(i=[]);let a=i;a.length=o*3;let l=0;for(let u=0;u<o;u++){let f=gVe(e,t,u*s,r);a[l++]=f[0],a[l++]=f[1],a[l++]=f[2]}return a};qo.subdivideTexcoordRhumbLine=function(e,t,n,i,o,r,s){let a=n.cartesianToCartographic(i,nF),l=n.cartesianToCartographic(o,iF);tF.setEndPoints(a,l);let u=tF.surfaceDistance/r,f=Math.max(0,Math.ceil(O.log2(u))),h=Math.pow(2,f),p=z.distance(e,t),g=p/h,m=s;m.length=h*2;let y=0;for(let b=0;b<h;b++){let x=Foe(e,t,b*g,p);m[y++]=x[0],m[y++]=x[1]}return m};qo.subdivideRhumbLine=function(e,t,n,i,o){let r=e.cartesianToCartographic(t,nF),s=e.cartesianToCartographic(n,iF),a=new Ja(r,s,e);if(c(o)||(o=[]),a.surfaceDistance<=i)return o.length=3,o[0]=t.x,o[1]=t.y,o[2]=t.z,o;let l=a.surfaceDistance/i,u=Math.max(0,Math.ceil(O.log2(l))),f=Math.pow(2,u),h=a.surfaceDistance/f,p=o;p.length=f*3;let g=0;for(let m=0;m<f;m++){let y=a.interpolateUsingSurfaceDistance(m*h,yVe),b=e.cartographicToCartesian(y,bVe);p[g++]=b.x,p[g++]=b.y,p[g++]=b.z}return p};var xVe=new d,TVe=new d,AVe=new d,CVe=new d;qo.scaleToGeodeticHeightExtruded=function(e,t,n,i,o){i=i??ie.default;let r=xVe,s=TVe,a=AVe,l=CVe;if(c(e)&&c(e.attributes)&&c(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let h=0;h<f;h+=3)d.fromArray(u,h,a),i.geodeticSurfaceNormal(a,r),l=i.scaleToGeodeticSurface(a,l),s=d.multiplyByScalar(r,n,s),s=d.add(l,s,s),u[h+f]=s.x,u[h+1+f]=s.y,u[h+2+f]=s.z,o&&(l=d.clone(a,l)),s=d.multiplyByScalar(r,t,s),s=d.add(l,s,s),u[h]=s.x,u[h+1]=s.y,u[h+2]=s.z}return e};qo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],o=new pb;o.enqueue(e);let r,s,a;for(;o.length!==0;){let l=o.dequeue(),u=l.positions;if(t)for(a=u.length,r=0;r<a;r++)n.scaleToGeodeticSurface(u[r],u[r]);if(u=xo(u,d.equalsEpsilon,!0),u.length<3)continue;let f=l.holes?l.holes.length:0;for(r=0;r<f;r++){let h=l.holes[r],p=h.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=xo(p,d.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(c(h.holes)&&(g=h.holes.length),s=0;s<g;s++)o.enqueue(h.holes[s])}i.push(u)}return i};var EVe=new he;function SVe(e,t,n){let i=n.cartesianToCartographic(e,nF),o=n.cartesianToCartographic(t,iF);if(Math.sign(i.latitude)===Math.sign(o.latitude))return;tF.setEndPoints(i,o);let r=tF.findIntersectionWithLatitude(0,EVe);if(!c(r))return;let s=Math.min(i.longitude,o.longitude),a=Math.max(i.longitude,o.longitude);if(Math.abs(a-s)>O.PI){let l=s;s=a,a=l}if(!(r.longitude<s||r.longitude>a))return n.cartographicToCartesian(r)}function wVe(e,t,n,i){if(i===qt.RHUMB)return SVe(e,t,n);let o=Qn.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(c(o))return n.scaleToGeodeticSurface(o,o)}var vVe=new he;function DVe(e,t,n){let i=[],o,r,s,a,l,u=0;for(;u<e.length;){o=e[u],r=e[(u+1)%e.length],s=O.sign(o.z),a=O.sign(r.z);let f=h=>t.cartesianToCartographic(h,vVe).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(o)});else if(a!==0){if(l=wVe(o,r,t,n),++u,!c(l))continue;e.splice(u,0,l),i.push({position:u,type:s,visited:!1,next:a,theta:f(l)})}++u}return i}function Boe(e,t,n,i,o,r,s){let a=[],l=r,u=h=>p=>p.position===h,f=[];do{let h=n[l];a.push(h);let p=i.findIndex(u(l)),g=i[p];if(!c(g)){++l;continue}let{visited:m,type:y,next:b}=g;if(g.visited=!0,y===0){if(b===0){let S=i[p-(s?1:-1)];if(S?.position===l+1)S.visited=!0;else{++l;continue}}if(!m&&s&&b>0||r===l&&!s&&b<0){++l;continue}}if(!(s?y>=0:y<=0)){++l;continue}m||f.push(l);let A=p+(s?1:-1),E=i[A];if(!c(E)){++l;continue}l=E.position}while(l<n.length&&l>=0&&l!==r&&a.length<n.length);e.splice(t,o,a);for(let h of f)t=Boe(e,++t,n,i,0,h,!s);return t}qo.splitPolygonsOnEquator=function(e,t,n,i){c(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let o=0;for(;o<i.length;){let r=i[o],s=r.slice();if(r.length<3){i[o]=s,++o;continue}let a=DVe(s,t,n);if(s.length===r.length||a.length<=1){i[o]=s,++o;continue}a.sort((u,f)=>u.theta-f.theta);let l=s[0].z>=0;o=Boe(i,o,s,a,1,0,l)}return i};qo.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],l=new pb;l.enqueue(e);let u=c(r);for(;l.length!==0;){let f=l.dequeue(),h=f.positions,p=f.holes,g,m;if(i)for(m=h.length,g=0;g<m;g++)o.scaleToGeodeticSurface(h[g],h[g]);if(t||(h=xo(h,d.equalsEpsilon,!0)),h.length<3)continue;let y=n(h);if(!c(y))continue;let b=[],x=si.computeWindingOrder2D(y);if(x===ts.CLOCKWISE&&(y.reverse(),h=h.slice().reverse()),u){u=!1;let P=[h];if(P=r(P,P),P.length>1){for(let M of P)l.enqueue(new ec(M,p));continue}}let A=h.slice(),E=c(p)?p.length:0,S=[],v;for(g=0;g<E;g++){let P=p[g],M=P.positions;if(i)for(m=M.length,v=0;v<m;++v)o.scaleToGeodeticSurface(M[v],M[v]);if(t||(M=xo(M,d.equalsEpsilon,!0)),M.length<3)continue;let R=n(M);if(!c(R))continue;x=si.computeWindingOrder2D(R),x===ts.CLOCKWISE&&(R.reverse(),M=M.slice().reverse()),S.push(M),b.push(A.length),A=A.concat(M),y=y.concat(R);let L=0;for(c(P.holes)&&(L=P.holes.length),v=0;v<L;v++)l.enqueue(P.holes[v])}s.push({outerRing:h,holes:S}),a.push({positions:A,positions2D:y,holes:b})}return{hierarchy:s,polygons:a}};var PVe=new z,IVe=new d,OVe=new Le,RVe=new J;qo.computeBoundingRectangle=function(e,t,n,i,o){let r=Le.fromAxisAngle(e,i,OVe),s=J.fromQuaternion(r,RVe),a=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,h=n.length;for(let p=0;p<h;++p){let g=d.clone(n[p],IVe);J.multiplyByVector(s,g,g);let m=t(g,PVe);c(m)&&(a=Math.min(a,m.x),l=Math.max(l,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return o.x=a,o.y=u,o.width=l-a,o.height=f-u,o};qo.createGeometryFromPositions=function(e,t,n,i,o,r,s){let a=si.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let l=t.positions,u=c(n),f=u?n.positions:void 0;if(o){let h=l.length,p=new Array(h*3),g=0;for(let b=0;b<h;b++){let x=l[b];p[g++]=x.x,p[g++]=x.y,p[g++]=x.z}let m={attributes:{position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Me.TRIANGLES};u&&(m.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:z.packArray(f)}));let y=new ct(m);return r.normal?Nn.computeNormal(y):y}if(s===qt.GEODESIC)return si.computeSubdivision(e,l,a,f,i);if(s===qt.RHUMB)return si.computeRhumbLineSubdivision(e,l,a,f,i)};var Loe=[],Noe=[],MVe=new d,LVe=new d;qo.computeWallGeometry=function(e,t,n,i,o,r){let s,a,l,u,f,h,p,g,m,y=e.length,b=0,x=0,A=c(t),E=A?t.positions:void 0;if(o)for(a=y*3*2,s=new Array(a*2),A&&(m=y*2*2,g=new Array(m*2)),l=0;l<y;l++)u=e[l],f=e[(l+1)%y],s[b]=s[b+a]=u.x,++b,s[b]=s[b+a]=u.y,++b,s[b]=s[b+a]=u.z,++b,s[b]=s[b+a]=f.x,++b,s[b]=s[b+a]=f.y,++b,s[b]=s[b+a]=f.z,++b,A&&(h=E[l],p=E[(l+1)%y],g[x]=g[x+m]=h.x,++x,g[x]=g[x+m]=h.y,++x,g[x]=g[x+m]=p.x,++x,g[x]=g[x+m]=p.y,++x);else{let R=O.chordLength(i,n.maximumRadius),L=0;if(r===qt.GEODESIC)for(l=0;l<y;l++)L+=qo.subdivideLineCount(e[l],e[(l+1)%y],R);else if(r===qt.RHUMB)for(l=0;l<y;l++)L+=qo.subdivideRhumbLineCount(n,e[l],e[(l+1)%y],R);for(a=(L+y)*3,s=new Array(a*2),A&&(m=(L+y)*2,g=new Array(m*2)),l=0;l<y;l++){u=e[l],f=e[(l+1)%y];let B,_;A&&(h=E[l],p=E[(l+1)%y]),r===qt.GEODESIC?(B=qo.subdivideLine(u,f,R,Noe),A&&(_=qo.subdivideTexcoordLine(h,p,u,f,R,Loe))):r===qt.RHUMB&&(B=qo.subdivideRhumbLine(n,u,f,R,Noe),A&&(_=qo.subdivideTexcoordRhumbLine(h,p,n,u,f,R,Loe)));let w=B.length;for(let D=0;D<w;++D,++b)s[b]=B[D],s[b+a]=B[D];if(s[b]=f.x,s[b+a]=f.x,++b,s[b]=f.y,s[b+a]=f.y,++b,s[b]=f.z,s[b+a]=f.z,++b,A){let D=_.length;for(let I=0;I<D;++I,++x)g[x]=_[I],g[x+m]=_[I];g[x]=p.x,g[x+m]=p.x,++x,g[x]=p.y,g[x+m]=p.y,++x}}}y=s.length;let S=Fe.createTypedArray(y/3,y-e.length*6),v=0;for(y/=6,l=0;l<y;l++){let R=l,L=R+1,B=R+y,_=B+1;u=d.fromArray(s,R*3,MVe),f=d.fromArray(s,L*3,LVe),!d.equalsEpsilon(u,f,O.EPSILON10,O.EPSILON10)&&(S[v++]=R,S[v++]=B,S[v++]=L,S[v++]=L,S[v++]=B,S[v++]=_)}let P={attributes:new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:s})}),indices:S,primitiveType:Me.TRIANGLES};return A&&(P.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:g})),new ct(P)};var zn=qo;function Fr(e,t){this.position=e,c(this.position)||(this.position=new z),this.tangentPlane=t,c(this.tangentPlane)||(this.tangentPlane=Fr.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Fr.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=z.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(O.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=O.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=O.TWO_PI),e}}});var DA=new he,NVe=new d;Fr.prototype.getLatitude=function(e){c(e)||(e=ie.default),DA.latitude=this.conformalLatitude,DA.longitude=this.longitude,DA.height=0;let t=this.ellipsoid.cartographicToCartesian(DA,NVe);return e.cartesianToCartographic(t,DA),DA.latitude};var FVe=new _n,BVe=new d,kVe=new d;Fr.fromCartesian=function(e,t){T.defined("cartesian",e);let n=O.signNotZero(e.z),i=Fr.NORTH_POLE_TANGENT_PLANE,o=Fr.SOUTH_POLE;n<0&&(i=Fr.SOUTH_POLE_TANGENT_PLANE,o=Fr.NORTH_POLE);let r=FVe;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=d.subtract(r.origin,o,BVe),d.normalize(r.direction,r.direction);let s=Qn.rayPlane(r,i.plane,kVe),a=d.subtract(s,o,s),l=d.dot(i.xAxis,a),u=n*d.dot(i.yAxis,a);return c(t)?(t.position=new z(l,u),t.tangentPlane=i,t):new Fr(new z(l,u),i)};Fr.fromCartesianArray=function(e,t){T.defined("cartesians",e);let n=e.length;c(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=Fr.fromCartesian(e[i],t[i]);return t};Fr.clone=function(e,t){if(c(e))return c(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Fr(e.position,e.tangentPlane)};Fr.HALF_UNIT_SPHERE=Object.freeze(new ie(.5,.5,.5));Fr.NORTH_POLE=Object.freeze(new d(0,0,.5));Fr.SOUTH_POLE=Object.freeze(new d(0,0,-.5));Fr.NORTH_POLE_TANGENT_PLANE=Object.freeze(new is(Fr.NORTH_POLE,Fr.HALF_UNIT_SPHERE));Fr.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new is(Fr.SOUTH_POLE,Fr.HALF_UNIT_SPHERE));var Bc=Fr;var UVe=new he,koe=new he;function VVe(e,t,n,i){let r=i.cartesianToCartographic(e,UVe).height,s=i.cartesianToCartographic(t,koe);s.height=r,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,koe);a.height=r-100,i.cartographicToCartesian(a,n)}var Uoe=new Ke,zVe=new d,HVe=new d,GVe=new d,jVe=new d,WVe=new d,qVe=new d,oF=new d,$h=new d,PA=new d,YVe=new z,XVe=new z,KVe=new d,Voe=new Le,$Ve=new J,ZVe=new J;function e9(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,o=n.attributes.position.values,r=c(n.attributes.st)?n.attributes.st.values:void 0,s=o.length,a=e.wall,l=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,h=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,m=e.stRotation,y=e.perPositionHeight,b=YVe;b.x=f.x,b.y=f.y;let x=t.st?new Float32Array(2*(s/3)):void 0,A;t.normal&&(y&&l&&!a?A=n.attributes.normal.values:A=new Float32Array(s));let E=t.tangent?new Float32Array(s):void 0,S=t.bitangent?new Float32Array(s):void 0,v=i?new Float32Array(s):void 0,P=0,M=0,R=HVe,L=GVe,B=jVe,_=!0,w=$Ve,D=ZVe;if(m!==0){let k=Le.fromAxisAngle(h,m,Voe);w=J.fromQuaternion(k,w),k=Le.fromAxisAngle(h,-m,Voe),D=J.fromQuaternion(k,D)}else w=J.clone(J.IDENTITY,w),D=J.clone(J.IDENTITY,D);let I=0,N=0;l&&u&&(I=s/2,N=s/3,s/=2);for(let k=0;k<s;k+=3){let H=d.fromArray(o,k,KVe);if(t.st&&!c(r)){let V=J.multiplyByVector(w,H,zVe);V=g.scaleToGeodeticSurface(V,V);let j=p([V],XVe)[0];z.subtract(j,b,j);let U=O.clamp(j.x/f.width,0,1),q=O.clamp(j.y/f.height,0,1);u&&(x[P+N]=U,x[P+1+N]=q),l&&(x[P]=U,x[P+1]=q),P+=2}if(t.normal||t.tangent||t.bitangent||i){let V=M+1,j=M+2;if(a){if(k+3<s){let U=d.fromArray(o,k+3,WVe);if(_){let q=d.fromArray(o,k+s,qVe);y&&VVe(H,U,q,g),d.subtract(U,H,U),d.subtract(q,H,q),R=d.normalize(d.cross(q,U,R),R),_=!1}d.equalsEpsilon(U,H,O.EPSILON10)&&(_=!0)}(t.tangent||t.bitangent)&&(B=g.geodeticSurfaceNormal(H,B),t.tangent&&(L=d.normalize(d.cross(B,R,L),L)))}else R=g.geodeticSurfaceNormal(H,R),(t.tangent||t.bitangent)&&(y&&(oF=d.fromArray(A,M,oF),$h=d.cross(d.UNIT_Z,oF,$h),$h=d.normalize(J.multiplyByVector(D,$h,$h),$h),t.bitangent&&(PA=d.normalize(d.cross(oF,$h,PA),PA))),L=d.cross(d.UNIT_Z,R,L),L=d.normalize(J.multiplyByVector(D,L,L),L),t.bitangent&&(B=d.normalize(d.cross(R,L,B),B)));t.normal&&(e.wall?(A[M+I]=R.x,A[V+I]=R.y,A[j+I]=R.z):u&&(A[M+I]=-R.x,A[V+I]=-R.y,A[j+I]=-R.z),(l&&!y||a)&&(A[M]=R.x,A[V]=R.y,A[j]=R.z)),i&&(a&&(R=g.geodeticSurfaceNormal(H,R)),v[M+I]=-R.x,v[V+I]=-R.y,v[j+I]=-R.z),t.tangent&&(e.wall?(E[M+I]=L.x,E[V+I]=L.y,E[j+I]=L.z):u&&(E[M+I]=-L.x,E[V+I]=-L.y,E[j+I]=-L.z),l&&(y?(E[M]=$h.x,E[V]=$h.y,E[j]=$h.z):(E[M]=L.x,E[V]=L.y,E[j]=L.z))),t.bitangent&&(u&&(S[M+I]=B.x,S[V+I]=B.y,S[j+I]=B.z),l&&(y?(S[M]=PA.x,S[V]=PA.y,S[j]=PA.z):(S[M]=B.x,S[V]=B.y,S[j]=B.z))),M+=3}}t.st&&!c(r)&&(n.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:x})),t.normal&&(n.attributes.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:A})),t.tangent&&(n.attributes.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:E})),t.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:S})),i&&(n.attributes.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:v}))}if(e.extrude&&c(e.offsetAttribute)){let f=o.length/3,h=new Uint8Array(f);if(e.offsetAttribute===Zt.TOP)l&&u||a?h=h.fill(1,0,f/2):l&&(h=h.fill(1));else{let p=e.offsetAttribute===Zt.NONE?0:1;h=h.fill(p)}n.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}return n}var zoe=[];function QVe(e,t,n,i,o,r,s,a,l,u){let f={walls:[]},h;if(s||a){let A=zn.createGeometryFromPositions(e,t,n,i,r,l,u),E=A.attributes.position.values,S=A.indices,v,P;if(s&&a){let M=E.concat(E);v=M.length/3,P=Fe.createTypedArray(v,S.length*2),P.set(S);let R=S.length,L=v/2;for(h=0;h<R;h+=3){let B=P[h]+L,_=P[h+1]+L,w=P[h+2]+L;P[h+R]=w,P[h+1+R]=_,P[h+2+R]=B}if(A.attributes.position.values=M,r&&l.normal){let B=A.attributes.normal.values;A.attributes.normal.values=new Float32Array(M.length),A.attributes.normal.values.set(B)}if(l.st&&c(n)){let B=A.attributes.st.values;A.attributes.st.values=new Float32Array(v*2),A.attributes.st.values=B.concat(B)}A.indices=P}else if(a){for(v=E.length/3,P=Fe.createTypedArray(v,S.length),h=0;h<S.length;h+=3)P[h]=S[h+2],P[h+1]=S[h+1],P[h+2]=S[h];A.indices=P}f.topAndBottom=new St({geometry:A})}let p=o.outerRing,g=is.fromPoints(p,e),m=g.projectPointsOntoPlane(p,zoe),y=si.computeWindingOrder2D(m);y===ts.CLOCKWISE&&(p=p.slice().reverse());let b=zn.computeWallGeometry(p,n,e,i,r,u);f.walls.push(new St({geometry:b}));let x=o.holes;for(h=0;h<x.length;h++){let A=x[h];m=g.projectPointsOntoPlane(A,zoe),y=si.computeWindingOrder2D(m),y===ts.COUNTER_CLOCKWISE&&(A=A.slice().reverse()),b=zn.computeWallGeometry(A,n,e,i,r,u),f.walls.push(new St({geometry:b}))}return f}function gf(e){if(T.typeOf.object("options",e),T.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),c(e.perPositionHeight)&&e.perPositionHeight&&c(e.height))throw new C("Cannot use both options.perPositionHeight and options.height");if(c(e.arcType)&&e.arcType!==qt.GEODESIC&&e.arcType!==qt.RHUMB)throw new C("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,n=e.vertexFormat??Ie.DEFAULT,i=e.ellipsoid??ie.default,o=e.granularity??O.RADIANS_PER_DEGREE,r=e.stRotation??0,s=e.textureCoordinates,a=e.perPositionHeight??!1,l=a&&c(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!l){let h=Math.max(u,f);f=Math.min(u,f),u=h}this._vertexFormat=Ie.clone(n),this._ellipsoid=ie.clone(i),this._granularity=o,this._stRotation=r,this._height=u,this._extrudedHeight=f,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=l,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??qt.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=zn.computeHierarchyPackedLength(t,d)+ie.packedLength+Ie.packedLength+(s?zn.computeHierarchyPackedLength(s,z):1)+12}gf.fromPositions=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new gf(t)};gf.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=e._offsetAttribute??-1,t[n++]=e._arcType,c(e._textureCoordinates)?n=zn.packPolygonHierarchy(e._textureCoordinates,t,n,z):t[n++]=-1,t[n++]=e.packedLength,t};var JVe=ie.clone(ie.UNIT_SPHERE),eze=new Ie,tze={polygonHierarchy:{}};gf.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=ie.unpack(e,t,JVe);t+=ie.packedLength;let r=Ie.unpack(e,t,eze);t+=Ie.packedLength;let s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++]===1,h=e[t++]===1,p=e[t++]===1,g=e[t++]===1,m=e[t++]===1,y=e[t++],b=e[t++],x=e[t]===-1?void 0:zn.unpackPolygonHierarchy(e,t,z);c(x)?(t=x.startingIndex,delete x.startingIndex):t++;let A=e[t++];return c(n)||(n=new gf(tze)),n._polygonHierarchy=i,n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=l,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=h,n._closeTop=p,n._closeBottom=g,n._shadowVolume=m,n._offsetAttribute=y===-1?void 0:y,n._arcType=b,n._textureCoordinates=x,n.packedLength=A,n};var nze=new z,ize=new z,oze=new Bc;function Hoe(e,t,n,i,o,r){let s=e.longitude,a=s>=0?s:s+O.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let l=e.getLatitude(n),u=l;if(r.south=Math.min(r.south,l),r.north=Math.max(r.north,l),i!==qt.RHUMB){let p=z.subtract(t.position,e.position,nze),g=z.dot(t.position,p)/z.dot(p,p);if(g>0&&g<1){let m=z.add(t.position,z.multiplyByScalar(p,-g,p),ize),y=Bc.clone(t,oze);y.position=m;let b=y.getLatitude(n);r.south=Math.min(r.south,b),r.north=Math.max(r.north,b),Math.abs(l)>Math.abs(b)&&(u=b)}}let f=t.x*e.y-e.x*t.y,h=Math.sign(f);h!==0&&(h*=z.angleBetween(t.position,e.position)),u>=0&&(o.northAngle+=h),u<=0&&(o.southAngle+=h)}var Goe=new Bc,rze=new Bc,_f={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};gf.computeRectangleFromPositions=function(e,t,n,i){if(T.defined("positions",e),c(i)||(i=new ce),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,_f.northAngle=0,_f.southAngle=0,_f.westOverIdl=Number.POSITIVE_INFINITY,_f.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=Bc.fromCartesian(e[0],rze);for(let s=1;s<o;s++){let a=Bc.fromCartesian(e[s],Goe);Hoe(a,r,t,n,_f,i),r=Bc.clone(a,r)}return Hoe(Bc.fromCartesian(e[0],Goe),r,t,n,_f,i),i.east-i.west>_f.eastOverIdl-_f.westOverIdl&&(i.west=_f.westOverIdl,i.east=_f.eastOverIdl,i.east>O.PI&&(i.east=i.east-O.TWO_PI),i.west>O.PI&&(i.west=i.west-O.TWO_PI)),O.equalsEpsilon(Math.abs(_f.northAngle),O.TWO_PI,O.EPSILON10)&&(i.north=O.PI_OVER_TWO,i.east=O.PI,i.west=-O.PI),O.equalsEpsilon(Math.abs(_f.southAngle),O.TWO_PI,O.EPSILON10)&&(i.south=-O.PI_OVER_TWO,i.east=O.PI,i.west=-O.PI),i};var sze=new Bc;function aze(e,t,n){return e.height>=O.PI||e.width>=O.PI?Bc.fromCartesian(t[0],sze).tangentPlane:is.fromPoints(t,n)}var joe=new he;function cze(e,t,n){return(i,o)=>{if(e.height>=O.PI||e.width>=O.PI){if(e.south<0&&e.north>0){c(o)||(o=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],joe);o[s]=new z(a.longitude/O.PI,a.latitude/O.PI_OVER_TWO)}return o.length=i.length,o}return Bc.fromCartesianArray(i,o)}return is.fromPoints(t,n).projectPointsOntoPlane(i,o)}}function lze(e,t,n){if(e.height>=O.PI||e.width>=O.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,joe);return c(r)||(r=new z),r.x=s.longitude/O.PI,r.y=s.latitude/O.PI_OVER_TWO,r}return Bc.fromCartesian(o,r)};let i=is.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function uze(e,t,n,i){return(o,r)=>!i&&(e.height>=O.PI_OVER_TWO||e.width>=2*O.PI_OVER_THREE)?zn.splitPolygonsOnEquator(o,t,n,r):o}function fze(e,t,n,i){if(t.height>=O.PI||t.width>=O.PI)return Ke.fromRectangle(t,void 0,Uoe);let o=e,r=is.fromPoints(o,n);return zn.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,Uoe)}gf.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,l=e._closeBottom,u=e._arcType,f=e._textureCoordinates,h=c(f),p=r.positions;if(p.length<3)return;let g=e.rectangle,m=zn.polygonsFromHierarchy(r,h,cze(g,p,n),!s,n,uze(g,n,u,s)),y=m.hierarchy,b=m.polygons,x=function(I){return I},A=h?zn.polygonsFromHierarchy(f,!0,x,!1,n).polygons:void 0;if(y.length===0)return;let E=y[0].outerRing,S=fze(E,g,n,o),v=[],P=e._height,M=e._extrudedHeight,R=e._perPositionHeightExtrude||!O.equalsEpsilon(P,M,0,O.EPSILON2),L={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:aze(g,E,n).plane.normal,projectTo2d:lze(g,E,n),boundingRectangle:S,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},B;if(R)for(L.extrude=!0,L.top=a,L.bottom=l,L.shadowVolume=e._shadowVolume,L.offsetAttribute=e._offsetAttribute,B=0;B<b.length;B++){let I=QVe(n,b[B],h?A[B]:void 0,i,y[B],s,a,l,t,u),N;a&&l?(N=I.topAndBottom,L.geometry=zn.scaleToGeodeticHeightExtruded(N.geometry,P,M,n,s)):a?(N=I.topAndBottom,N.geometry.attributes.position.values=si.scaleToGeodeticHeight(N.geometry.attributes.position.values,P,n,!s),L.geometry=N.geometry):l&&(N=I.topAndBottom,N.geometry.attributes.position.values=si.scaleToGeodeticHeight(N.geometry.attributes.position.values,M,n,!0),L.geometry=N.geometry),(a||l)&&(L.wall=!1,N.geometry=e9(L),v.push(N));let k=I.walls;L.wall=!0;for(let H=0;H<k.length;H++){let V=k[H];L.geometry=zn.scaleToGeodeticHeightExtruded(V.geometry,P,M,n,s),V.geometry=e9(L),v.push(V)}}else for(B=0;B<b.length;B++){let I=new St({geometry:zn.createGeometryFromPositions(n,b[B],h?A[B]:void 0,i,s,t,u)});if(I.geometry.attributes.position.values=si.scaleToGeodeticHeight(I.geometry.attributes.position.values,P,n,!s),L.geometry=I.geometry,I.geometry=e9(L),c(e._offsetAttribute)){let N=I.geometry.attributes.position.values.length,k=e._offsetAttribute===Zt.NONE?0:1,H=new Uint8Array(N/3).fill(k);I.geometry.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:H})}v.push(I)}let _=Nn.combineInstances(v)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=Fe.createTypedArray(_.attributes.position.values.length/3,_.indices);let w=_.attributes,D=le.fromVertices(w.position.values);return t.position||delete w.position,new ct({attributes:w,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:D,offsetAttribute:e._offsetAttribute})};gf.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new gf({polygonHierarchy:e._polygonHierarchy,ellipsoid:o,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function dze(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,o=e.rectangle;return ct._textureCoordinateRotationPoints(i,t,n,o)}Object.defineProperties(gf.prototype,{rectangle:{get:function(){if(!c(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=gf.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return c(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=dze(this)),this._textureCoordinateRotationPoints}}});var Pg=gf;function gb(e){T.typeOf.object("options",e),T.typeOf.object("options.positions",e.positions),T.typeOf.number.greaterThanOrEquals("options.positions.length",e.positions.length,3),this._ellipsoid=e.ellipsoid??ie.default,this._positions=[...e.positions]}Object.defineProperties(gb.prototype,{length:{get:function(){return this._positions.length}},positions:{get:function(){return this._positions}},ellipsoid:{get:function(){return this._ellipsoid}}});gb.clone=function(e,t){return T.typeOf.object("polygon",e),c(t)?(t._ellipsoid=e.ellipsoid,t._positions.length=0,t._positions.push(...e.positions),t):new gb({positions:e.positions,ellipsoid:e.ellipsoid})};gb.equals=function(e,t){return T.typeOf.object("left",e),T.typeOf.object("right",t),e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions};gb.prototype.computeRectangle=function(e){return Pg.computeRectangleFromPositions(this.positions,this.ellipsoid,void 0,e)};var hze=new ce,Woe=new d;gb.prototype.computeSphericalExtents=function(e){c(e)||(e=new ce);let t=this.computeRectangle(hze),n=he.toCartesian(ce.southwest(t),this.ellipsoid,Woe),i=Math.sqrt(n.x*n.x+n.y*n.y),o=O.fastApproximateAtan2(i,n.z),r=O.fastApproximateAtan2(n.x,n.y);return e.south=o,e.west=r,n=he.toCartesian(ce.northeast(t),this.ellipsoid,Woe),i=Math.sqrt(n.x*n.x+n.y*n.y),o=O.fastApproximateAtan2(i,n.z),r=O.fastApproximateAtan2(n.x,n.y),e.north=o,e.east=r,e};var vv=gb;var rF=`in vec2 v_textureCoordinates;
uniform int u_polygonsLength;
uniform int u_extentsLength;
uniform highp sampler2D u_polygonTexture;
uniform highp sampler2D u_extentsTexture;
int getPolygonIndex(float dimension, vec2 coord) {
vec2 uv = coord.xy * dimension;
return int(floor(uv.y) * dimension + floor(uv.x));
}
vec2 getLookupUv(ivec2 dimensions, int i) {
int pixY = i / dimensions.x;
int pixX = i - (pixY * dimensions.x);
float pixelWidth = 1.0 / float(dimensions.x);
float pixelHeight = 1.0 / float(dimensions.y);
float u = (float(pixX) + 0.5) * pixelWidth;
float v = (float(pixY) + 0.5) * pixelHeight;
return vec2(u, v);
}
vec4 getExtents(int i) {
return texture(u_extentsTexture, getLookupUv(textureSize(u_extentsTexture, 0), i));
}
ivec2 getPositionsLengthAndExtentsIndex(int i) {
vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
vec4 value = texture(u_polygonTexture, uv);
return ivec2(int(value.x), int(value.y));
}
vec2 getPolygonPosition(int i) {
vec2 uv = getLookupUv(textureSize(u_polygonTexture, 0), i);
return texture(u_polygonTexture, uv).xy;
}
vec2 getCoordinates(vec2 textureCoordinates, vec4 extents) {
float latitude = mix(extents.x, extents.x + 1.0 / extents.z, textureCoordinates.y);
float longitude = mix(extents.y, extents.y + 1.0 / extents.w, textureCoordinates.x);
return vec2(latitude, longitude);
}
void main() {
int lastPolygonIndex = 0;
out_FragColor = vec4(1.0);
float dimension = float(u_extentsLength);
if (u_extentsLength > 2) {
dimension = ceil(log2(float(u_extentsLength)));
}
int regionIndex = getPolygonIndex(dimension, v_textureCoordinates);
for (int polygonIndex = 0; polygonIndex < u_polygonsLength; polygonIndex++) {
ivec2 positionsLengthAndExtents = getPositionsLengthAndExtentsIndex(lastPolygonIndex);
int positionsLength = positionsLengthAndExtents.x;
int polygonExtentsIndex = positionsLengthAndExtents.y;
lastPolygonIndex += 1;
if (polygonExtentsIndex == regionIndex) {
float clipAmount = czm_infinity;
vec4 extents = getExtents(polygonExtentsIndex);
vec2 textureOffset = vec2(mod(float(polygonExtentsIndex), dimension), floor(float(polygonExtentsIndex) / dimension)) / dimension;
vec2 p = getCoordinates((v_textureCoordinates - textureOffset) * dimension, extents);
float s = 1.0;
for (int i = 0, j = positionsLength - 1; i < positionsLength; j = i, i++) {
vec2 a = getPolygonPosition(lastPolygonIndex + i);
vec2 b = getPolygonPosition(lastPolygonIndex + j);
vec2 ab = b - a;
vec2 pa = p - a;
float t = dot(pa, ab) / dot(ab, ab);
t = clamp(t, 0.0, 1.0);
vec2 pq = pa - t * ab;
float d = length(pq);
bvec3 cond = bvec3(p.y >= a.y,
p.y < b.y,
ab.x * pa.y > ab.y * pa.x);
if (all(cond) || all(not(cond))) s = -s;
if (abs(d) < abs(clipAmount)) {
clipAmount = d;
}
}
vec4 result = (s * vec4(clipAmount * length(extents.zw))) / 2.0 + 0.5;
out_FragColor = min(out_FragColor, result);
}
lastPolygonIndex += positionsLength;
}
}
`;function Yr(e){e=e??W.EMPTY_OBJECT,this._polygons=[],this._totalPositions=0,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,this.polygonAdded=new pe,this.polygonRemoved=new pe,this._owner=void 0,this._float32View=void 0,this._extentsFloat32View=void 0,this._extentsCount=0,this._polygonsTexture=void 0,this._extentsTexture=void 0,this._signedDistanceTexture=void 0,this._signedDistanceComputeCommand=void 0;let t=e.polygons;if(c(t)){let n=t.length;for(let i=0;i<n;++i)this._polygons.push(t[i])}}Object.defineProperties(Yr.prototype,{length:{get:function(){return this._polygons.length}},totalPositions:{get:function(){return this._totalPositions}},extentsTexture:{get:function(){return this._extentsTexture}},extentsCount:{get:function(){return this._extentsCount}},pixelsNeededForExtents:{get:function(){return this.length}},pixelsNeededForPolygonPositions:{get:function(){return this.totalPositions+this.length}},clippingTexture:{get:function(){return this._signedDistanceTexture}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return this.inverse?-this.extentsCount:this.extentsCount}}});Yr.prototype.add=function(e){T.typeOf.object("polygon",e);let t=this._polygons.length;return this._polygons.push(e),this.polygonAdded.raiseEvent(e,t),e};Yr.prototype.get=function(e){return T.typeOf.number("index",e),this._polygons[e]};Yr.prototype.contains=function(e){return T.typeOf.object("polygon",e),this._polygons.some(t=>vv.equals(t,e))};Yr.prototype.remove=function(e){T.typeOf.object("polygon",e);let t=this._polygons,n=t.findIndex(i=>vv.equals(i,e));return n===-1?!1:(t.splice(n,1),this.polygonRemoved.raiseEvent(e,n),!0)};var mze=new ce;function pze(e){let t=[],n=[],i=e.length;for(let r=0;r<i;++r){let a=e[r].computeSphericalExtents(),l=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=ce.clone(a);f.south-=l,f.west-=u,f.north+=l,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI);let h=[r];for(let p=0;p<t.length;++p){let g=t[p];if(c(g)&&c(ce.simpleIntersection(g,f))&&!ce.equals(g,f)){let m=n[p];h.push(...m),m.reduce((y,b)=>ce.union(e[b].computeSphericalExtents(mze),y,y),a),t[p]=void 0,n[p]=void 0,l=Math.max(a.height*2.5,.001),u=Math.max(a.width*2.5,.001),f=ce.clone(a,f),f.south-=l,f.west-=u,f.north+=l,f.east+=u,f.south=Math.max(f.south,-Math.PI),f.west=Math.max(f.west,-Math.PI),f.north=Math.min(f.north,Math.PI),f.east=Math.min(f.east,Math.PI),p=-1}}t.push(f),n.push(h)}let o=new Map;return n.filter(c).forEach((r,s)=>r.forEach(a=>o.set(a,s))),{extentsList:t.filter(c),extentsIndexByPolygon:o}}Yr.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];this.polygonRemoved.raiseEvent(i,n)}this._polygons=[]};function _ze(e){let t=e._float32View,n=e._extentsFloat32View,i=e._polygons,{extentsList:o,extentsIndexByPolygon:r}=pze(i),s=0;for(let[l,u]of i.entries()){let f=u.length;t[s++]=f,t[s++]=r.get(l);for(let h=0;h<f;++h){let p=u.positions[h],g=Math.hypot(p.x,p.y),m=O.fastApproximateAtan2(g,p.z),y=O.fastApproximateAtan2(p.x,p.y);t[s++]=m,t[s++]=y}}let a=0;for(let l of o){let u=1/(l.east-l.west),f=1/(l.north-l.south);n[a++]=l.south,n[a++]=l.west,n[a++]=f,n[a++]=u}e._extentsCount=o.length}var t9=new z;Yr.prototype.update=function(e){let t=e.context;if(!Yr.isSupported(e))throw new ae("ClippingPolygonCollections are only supported for WebGL 2.");let n=this._polygons.reduce((s,a)=>s+a.length,0);if(n===this.totalPositions||(this._totalPositions=n,this.length===0))return;c(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0,this._signedDistanceComputeCommand=void 0);let i=this._polygonsTexture,o=this._extentsTexture,r=this._signedDistanceTexture;if(c(i)){let s=i.width*i.height;(s<this.pixelsNeededForPolygonPositions||this.pixelsNeededForPolygonPositions<.25*s)&&(i.destroy(),i=void 0,this._polygonsTexture=void 0)}if(!c(i)){let s=Yr.getTextureResolution(i,this.pixelsNeededForPolygonPositions,t9);i=new Rt({context:t,width:s.x,height:s.y,pixelFormat:ke.RG,pixelDatatype:Ue.FLOAT,sampler:Qt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*2),this._polygonsTexture=i}if(c(o)){let s=o.width*o.height;(s<this.pixelsNeededForExtents||this.pixelsNeededForExtents<.25*s)&&(o.destroy(),o=void 0,this._extentsTexture=void 0)}if(!c(o)){let s=Yr.getTextureResolution(o,this.pixelsNeededForExtents,t9);o=new Rt({context:t,width:s.x,height:s.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT,sampler:Qt.NEAREST,flipY:!1}),this._extentsFloat32View=new Float32Array(s.x*s.y*4),this._extentsTexture=o}if(_ze(this),o.copyFrom({source:{width:o.width,height:o.height,arrayBufferView:this._extentsFloat32View}}),i.copyFrom({source:{width:i.width,height:i.height,arrayBufferView:this._float32View}}),!c(r)){let s=Yr.getClippingDistanceTextureResolution(this,t9);r=new Rt({context:t,width:s.x,height:s.y,pixelFormat:t.webgl2?ke.RED:ke.LUMINANCE,pixelDatatype:Ue.FLOAT,sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:ui.LINEAR}),flipY:!1}),this._signedDistanceTexture=r}this._signedDistanceComputeCommand=gze(this)};Yr.prototype.queueCommands=function(e){c(this._signedDistanceComputeCommand)&&e.commandList.push(this._signedDistanceComputeCommand)};function gze(e){let t=e._polygonsTexture,n=e._extentsTexture;return new cl({fragmentShaderSource:rF,outputTexture:e._signedDistanceTexture,uniformMap:{u_polygonsLength:function(){return e.length},u_extentsLength:function(){return e.extentsCount},u_extentsTexture:function(){return n},u_polygonTexture:function(){return t}},persists:!1,owner:e,postExecute:()=>{e._signedDistanceComputeCommand=void 0}})}var qoe=new ce,yze=new ce;Yr.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,o=Wt.OUTSIDE;this.inverse&&(o=Wt.INSIDE);for(let r=0;r<i;++r){let a=n[r].computeRectangle(),l=e.rectangle;if(!c(l)&&c(e.boundingVolume?.computeCorners)){let f=e.boundingVolume.computeCorners();l=ce.fromCartesianArray(f,t,qoe)}c(l)||(l=ce.fromBoundingSphere(e.boundingSphere,t,qoe));let u=ce.simpleIntersection(l,a,yze);c(u)&&(o=Wt.INTERSECTING)}return o};Yr.setOwner=function(e,t,n){if(e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),c(e))){if(c(e._owner))throw new C("ClippingPolygonCollection should only be assigned to one object");e._owner=t,t[n]=e}};Yr.isSupported=function(e){return e?.context.webgl2};Yr.getTextureResolution=function(e,t,n){if(c(e))return n.x=e.width,n.y=e.height,n;let i=ut.maximumTextureSize;return n.x=Math.min(t,i),n.y=Math.ceil(t/n.x),n.y*=2,n};Yr.getClippingDistanceTextureResolution=function(e,t){let n=e.signedDistanceTexture;return c(n)?(t.x=n.width,t.y=n.height,t):(t.x=Math.min(ut.maximumTextureSize,4096),t.y=Math.min(ut.maximumTextureSize,4096),t)};Yr.getClippingExtentsTextureResolution=function(e,t){let n=e.extentsTexture;return c(n)?(t.x=n.width,t.y=n.height,t):Yr.getTextureResolution(n,e.pixelsNeededForExtents,t)};Yr.prototype.isDestroyed=function(){return!1};Yr.prototype.destroy=function(){return c(this._signedDistanceComputeCommand)&&(this._signedDistanceComputeCommand.canceled=!0),this._polygonsTexture=this._polygonsTexture&&this._polygonsTexture.destroy(),this._extentsTexture=this._extentsTexture&&this._extentsTexture.destroy(),this._signedDistanceTexture=this._signedDistanceTexture&&this._signedDistanceTexture.destroy(),de(this)};var Zh=Yr;var Dv={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};Dv.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?Dv.SUNLIGHT:Dv.SCENE_LIGHT:Dv.NONE};var Ig=Object.freeze(Dv);function Yoe(){this.lightIntensity=10,this.rayleighCoefficient=new d(55e-7,13e-6,284e-7),this.mieCoefficient=new d(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=Ig.NONE}Yoe.requiresColorCorrect=function(e){return!(O.equalsEpsilon(e.hueShift,0,O.EPSILON7)&&O.equalsEpsilon(e.saturationShift,0,O.EPSILON7)&&O.equalsEpsilon(e.brightnessShift,0,O.EPSILON7))};var IA=Yoe;var Qh=`uniform vec3 u_radiiAndDynamicAtmosphereColor;
uniform float u_atmosphereLightIntensity;
uniform float u_atmosphereRayleighScaleHeight;
uniform float u_atmosphereMieScaleHeight;
uniform float u_atmosphereMieAnisotropy;
uniform vec3 u_atmosphereRayleighCoefficient;
uniform vec3 u_atmosphereMieCoefficient;
const float ATMOSPHERE_THICKNESS = 111e3;
const int PRIMARY_STEPS_MAX = 16;
const int LIGHT_STEPS_MAX = 4;
void computeScattering(
czm_ray primaryRay,
float primaryRayLength,
vec3 lightDirection,
float atmosphereInnerRadius,
out vec3 rayleighColor,
out vec3 mieColor,
out float opacity
) {
rayleighColor = vec3(0.0);
mieColor = vec3(0.0);
opacity = 0.0;
float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
vec3 origin = vec3(0.0);
czm_raySegment primaryRayAtmosphereIntersect = czm_raySphereIntersectionInterval(primaryRay, origin, atmosphereOuterRadius);
if (primaryRayAtmosphereIntersect == czm_emptyRaySegment) {
return;
}
float x = 1e-7 * primaryRayAtmosphereIntersect.stop / length(primaryRayLength);
float w_stop_gt_lprl = 0.5 * (1.0 + czm_approximateTanh(x));
float start_0 = primaryRayAtmosphereIntersect.start;
primaryRayAtmosphereIntersect.start = max(primaryRayAtmosphereIntersect.start, 0.0);
primaryRayAtmosphereIntersect.stop = min(primaryRayAtmosphereIntersect.stop, length(primaryRayLength));
float x_o_a = start_0 - ATMOSPHERE_THICKNESS;
float w_inside_atmosphere = 1.0 - 0.5 * (1.0 + czm_approximateTanh(x_o_a));
int PRIMARY_STEPS = PRIMARY_STEPS_MAX - int(w_inside_atmosphere * 12.0);
int LIGHT_STEPS = LIGHT_STEPS_MAX - int(w_inside_atmosphere * 2.0);
float rayPositionLength = primaryRayAtmosphereIntersect.start;
float totalRayLength = primaryRayAtmosphereIntersect.stop - rayPositionLength;
float rayStepLengthIncrease = w_inside_atmosphere * ((1.0 - w_stop_gt_lprl) * totalRayLength / (float(PRIMARY_STEPS * (PRIMARY_STEPS + 1)) / 2.0));
float rayStepLength = max(1.0 - w_inside_atmosphere, w_stop_gt_lprl) * totalRayLength / max(7.0 * w_inside_atmosphere, float(PRIMARY_STEPS));
vec3 rayleighAccumulation = vec3(0.0);
vec3 mieAccumulation = vec3(0.0);
vec2 opticalDepth = vec2(0.0);
vec2 heightScale = vec2(u_atmosphereRayleighScaleHeight, u_atmosphereMieScaleHeight);
for (int i = 0; i < PRIMARY_STEPS_MAX; ++i) {
if (i >= PRIMARY_STEPS) {
break;
}
vec3 samplePosition = primaryRay.origin + primaryRay.direction * (rayPositionLength + rayStepLength);
float sampleHeight = length(samplePosition) - atmosphereInnerRadius;
vec2 sampleDensity = exp(-sampleHeight / heightScale) * rayStepLength;
opticalDepth += sampleDensity;
czm_ray lightRay = czm_ray(samplePosition, lightDirection);
czm_raySegment lightRayAtmosphereIntersect = czm_raySphereIntersectionInterval(lightRay, origin, atmosphereOuterRadius);
float lightStepLength = lightRayAtmosphereIntersect.stop / float(LIGHT_STEPS);
float lightPositionLength = 0.0;
vec2 lightOpticalDepth = vec2(0.0);
for (int j = 0; j < LIGHT_STEPS_MAX; ++j) {
if (j >= LIGHT_STEPS) {
break;
}
vec3 lightPosition = samplePosition + lightDirection * (lightPositionLength + lightStepLength * 0.5);
float lightHeight = length(lightPosition) - atmosphereInnerRadius;
lightOpticalDepth += exp(-lightHeight / heightScale) * lightStepLength;
lightPositionLength += lightStepLength;
}
vec3 attenuation = exp(-((u_atmosphereMieCoefficient * (opticalDepth.y + lightOpticalDepth.y)) + (u_atmosphereRayleighCoefficient * (opticalDepth.x + lightOpticalDepth.x))));
rayleighAccumulation += sampleDensity.x * attenuation;
mieAccumulation += sampleDensity.y * attenuation;
rayPositionLength += (rayStepLength += rayStepLengthIncrease);
}
rayleighColor = u_atmosphereRayleighCoefficient * rayleighAccumulation;
mieColor = u_atmosphereMieCoefficient * mieAccumulation;
opacity = length(exp(-((u_atmosphereMieCoefficient * opticalDepth.y) + (u_atmosphereRayleighCoefficient * opticalDepth.x))));
}
vec4 computeAtmosphereColor(
vec3 positionWC,
vec3 lightDirection,
vec3 rayleighColor,
vec3 mieColor,
float opacity
) {
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
float cosAngle = dot(cameraToPositionWCDirection, lightDirection);
float cosAngleSq = cosAngle * cosAngle;
float G = u_atmosphereMieAnisotropy;
float GSq = G * G;
float rayleighPhase = 3.0 / (50.2654824574) * (1.0 + cosAngleSq);
float miePhase = 3.0 / (25.1327412287) * ((1.0 - GSq) * (cosAngleSq + 1.0)) / (pow(1.0 + GSq - 2.0 * cosAngle * G, 1.5) * (2.0 + GSq));
vec3 rayleigh = rayleighPhase * rayleighColor;
vec3 mie = miePhase * mieColor;
vec3 color = (rayleigh + mie) * u_atmosphereLightIntensity;
return vec4(color, opacity);
}
`;var sF=`uniform samplerCube u_radianceMap;
in vec2 v_textureCoordinates;
const float twoSqrtPi = 2.0 * sqrt(czm_pi);
float computeShBasis(int index, vec3 s) {
if (index == 0) {
return 1.0 / twoSqrtPi;
}
if (index == 1) {
return -sqrt(3.0) * s.y / twoSqrtPi;
}
if (index == 2) {
return sqrt(3.0) * s.z / twoSqrtPi;
}
if (index == 3) {
return -sqrt(3.0) * s.x / twoSqrtPi;
}
if (index == 4) {
return sqrt(15.0) * s.y * s.x / twoSqrtPi;
}
if (index == 5) {
return -sqrt(15.0) * s.y * s.z / twoSqrtPi;
}
if (index == 6) {
return sqrt(5.0) * (3.0 * s.z * s.z - 1.0) / 2.0 / twoSqrtPi;
}
if (index == 7) {
return -sqrt(15.0) * s.x * s.z / twoSqrtPi;
}
if (index == 8) {
return sqrt(15.0) * (s.x * s.x - s.y * s.y) / 2.0 / twoSqrtPi;
}
return 0.0;
}
float vdcRadicalInverse(int i)
{
float r;
float base = 2.0;
float value = 0.0;
float invBase = 1.0 / base;
float invBi = invBase;
for (int x = 0; x < 100; x++)
{
if (i <= 0)
{
break;
}
r = mod(float(i), base);
value += r * invBi;
invBi *= invBase;
i = int(float(i) * invBase);
}
return value;
}
vec2 hammersley2D(int i, int N)
{
return vec2(float(i) / float(N), vdcRadicalInverse(i));
}
const int samples = 256;
const float solidAngle = 1.0 / float(samples);
void main() {
vec2 uv = v_textureCoordinates.xy * 3.0;
int coefficientIndex = int(floor(uv.y) * 3.0 + floor(uv.x));
for (int i = 0; i < samples; ++i) {
vec2 xi = hammersley2D(i, samples);
float phi = czm_twoPi * xi.x;
float cosTheta = 1.0 - 2.0 * sqrt(1.0 - xi.y * xi.y);
float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
vec3 direction = normalize(vec3(sinTheta * cos(phi), cosTheta, sinTheta * sin(phi)));
float Ylm = computeShBasis(coefficientIndex, direction);
vec3 lookupDirection = -direction.xyz;
lookupDirection.z = -lookupDirection.z;
vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0);
out_FragColor += Ylm * color * solidAngle * sinTheta;
}
}
`;var aF=`precision highp float;
in vec2 v_textureCoordinates;
uniform vec3 u_faceDirection;
uniform vec3 u_positionWC;
uniform mat4 u_enuToFixedFrame;
uniform vec4 u_brightnessSaturationGammaIntensity;
uniform vec4 u_groundColor;
vec4 getCubeMapDirection(vec2 uv, vec3 faceDir) {
vec2 scaledUV = uv * 2.0 - 1.0;
if (faceDir.x != 0.0) {
return vec4(faceDir.x, scaledUV.x * faceDir.x, -scaledUV.y, 0.0);
} else if (faceDir.y != 0.0) {
return vec4(scaledUV.x, -scaledUV.y * faceDir.y, faceDir.y, 0.0);
} else {
return vec4(scaledUV.x * faceDir.z, -faceDir.z, -scaledUV.y, 0.0);
}
}
void main() {
float height = length(u_positionWC);
float atmosphereInnerRadius = u_radiiAndDynamicAtmosphereColor.y;
float ellipsoidHeight = max(height - atmosphereInnerRadius, 0.0);
vec3 positionWC = u_positionWC / height * (ellipsoidHeight + atmosphereInnerRadius);
float atmosphereOuterRadius = u_radiiAndDynamicAtmosphereColor.x;
float atmosphereHeight = atmosphereOuterRadius - atmosphereInnerRadius;
vec3 direction = (u_enuToFixedFrame * getCubeMapDirection(v_textureCoordinates, u_faceDirection)).xyz;
vec3 normalizedDirection = normalize(direction);
czm_ray ray = czm_ray(positionWC, normalizedDirection);
czm_raySegment intersection = czm_raySphereIntersectionInterval(ray, vec3(0.0), atmosphereInnerRadius);
if (!czm_isEmpty(intersection)) {
intersection = czm_rayEllipsoidIntersectionInterval(ray, vec3(0.0), czm_ellipsoidInverseRadii);
}
bool onEllipsoid = intersection.start >= 0.0;
float rayLength = czm_branchFreeTernary(onEllipsoid, intersection.start, atmosphereOuterRadius);
vec3 skyPositionWC = positionWC + normalizedDirection * rayLength;
float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
vec3 lightDirectionWC = normalize(czm_getDynamicAtmosphereLightDirection(skyPositionWC, lightEnum));
vec3 mieColor;
vec3 rayleighColor;
float opacity;
czm_computeScattering(
ray,
rayLength,
lightDirectionWC,
atmosphereInnerRadius,
rayleighColor,
mieColor,
opacity
);
vec4 atmopshereColor = czm_computeAtmosphereColor(ray, lightDirectionWC, rayleighColor, mieColor, opacity);
#ifdef ATMOSPHERE_COLOR_CORRECT
const bool ignoreBlackPixels = true;
atmopshereColor.rgb = czm_applyHSBShift(atmopshereColor.rgb, czm_atmosphereHsbShift, ignoreBlackPixels);
#endif
vec3 lookupDirection = -normalizedDirection;
lookupDirection.x = -lookupDirection.x;
lookupDirection = -normalize(czm_temeToPseudoFixed * lookupDirection);
lookupDirection.x = -lookupDirection.x;
float skyAlpha = clamp((1.0 - ellipsoidHeight / atmosphereHeight) * atmopshereColor.a, 0.0, 1.0);
skyAlpha = czm_branchFreeTernary(length(atmopshereColor.rgb) <= czm_epsilon7, 0.0, skyAlpha);
float intensity = u_brightnessSaturationGammaIntensity.w;
vec4 sceneSkyBoxColor = czm_textureCube(czm_environmentMap, lookupDirection);
vec3 skyBackgroundColor = mix(czm_backgroundColor.rgb, sceneSkyBoxColor.rgb, sceneSkyBoxColor.a);
vec4 combinedSkyColor = vec4(mix(skyBackgroundColor, atmopshereColor.rgb * intensity, skyAlpha), 1.0);
vec3 up = normalize(positionWC);
float occlusion = max(dot(lightDirectionWC, up), 0.05);
vec4 groundColor = vec4(u_groundColor.rgb * u_groundColor.a * (vec3(intensity * occlusion) + atmopshereColor.rgb), 1.0);
vec4 blendedGroundColor = mix(groundColor, atmopshereColor, clamp(ellipsoidHeight / atmosphereHeight, 0.0, 1.0));
vec4 color = czm_branchFreeTernary(onEllipsoid, blendedGroundColor, combinedSkyColor);
float brightness = u_brightnessSaturationGammaIntensity.x;
float saturation = u_brightnessSaturationGammaIntensity.y;
float gamma = u_brightnessSaturationGammaIntensity.z;
#ifdef ENVIRONMENT_COLOR_CORRECT
color.rgb = mix(vec3(0.0), color.rgb, brightness);
color.rgb = czm_saturation(color.rgb, saturation);
#endif
color.rgb = pow(color.rgb, vec3(gamma));
color.rgb = czm_gammaCorrect(color.rgb);
out_FragColor = color;
}
`;var cF=`precision highp float;
in vec3 v_textureCoordinates;
uniform float u_roughness;
uniform samplerCube u_radianceTexture;
uniform vec3 u_faceDirection;
float vdcRadicalInverse(int i)
{
float r;
float base = 2.0;
float value = 0.0;
float invBase = 1.0 / base;
float invBi = invBase;
for (int x = 0; x < 100; x++)
{
if (i <= 0)
{
break;
}
r = mod(float(i), base);
value += r * invBi;
invBi *= invBase;
i = int(float(i) * invBase);
}
return value;
}
vec2 hammersley2D(int i, int N)
{
return vec2(float(i) / float(N), vdcRadicalInverse(i));
}
vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N)
{
float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
float phi = czm_twoPi * xi.x;
float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y));
float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
vec3 tangentX = normalize(cross(upVector, N));
vec3 tangentY = cross(N, tangentX);
return tangentX * H.x + tangentY * H.y + N * H.z;
}
const int samples = 128;
void main() {
vec3 normal = u_faceDirection;
vec3 V = normalize(v_textureCoordinates);
float roughness = u_roughness;
vec4 color = vec4(0.0);
float weight = 0.0;
for (int i = 0; i < samples; ++i) {
vec2 xi = hammersley2D(i, samples);
vec3 H = importanceSampleGGX(xi, roughness, V);
vec3 L = 2.0 * dot(V, H) * H - V;
float NdotL = max(dot(V, L), 0.0);
if (NdotL > 0.0) {
color += vec4(czm_textureCube(u_radianceTexture, L).rgb, 1.0) * NdotL;
weight += NdotL;
}
}
out_FragColor = color / weight;
}
`;var lF=`in vec3 position;
out vec3 v_textureCoordinates;
uniform vec3 u_faceDirection;
vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) {
vec2 scaledUV = uv;
if (faceDir.x != 0.0) {
return vec3(faceDir.x, scaledUV.y, scaledUV.x * faceDir.x);
} else if (faceDir.y != 0.0) {
return vec3(scaledUV.x, -faceDir.y, -scaledUV.y * faceDir.y);
} else {
return vec3(scaledUV.x * faceDir.z, scaledUV.y, -faceDir.z);
}
}
void main()
{
v_textureCoordinates = getCubeMapDirection(position.xy, u_faceDirection);
v_textureCoordinates.y = -v_textureCoordinates.y;
v_textureCoordinates.z = -v_textureCoordinates.z;
gl_Position = vec4(position, 1.0);
}
`;function Kn(e){this._position=void 0,this._radianceMapDirty=!1,this._radianceCommandsDirty=!1,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1,this._irradianceTextureDirty=!1,this._sphericalHarmonicCoefficientsDirty=!1,this._shouldRegenerateShaders=!1,this._shouldReset=!1,e=e??W.EMPTY_OBJECT;let t=Math.min(e.mipmapLevels??7,Math.log2(ut.maximumCubeMapSize));this._mipmapLevels=t,this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array((t-1)*6),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array((t-1)*6),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=Kn.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new Q;let n=Math.pow(2,t-1);this._textureDimensions=new z(n,n),this._radiiAndDynamicAtmosphereColor=new d,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??60*60,this.maximumPositionEpsilon=e.maximumPositionEpsilon??1e3,this.atmosphereScatteringIntensity=e.atmosphereScatteringIntensity??2,this.gamma=e.gamma??1,this.brightness=e.brightness??1,this.saturation=e.saturation??1,this.groundColor=e.groundColor??Kn.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(Kn.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){d.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=d.clone(e,this._position),this._shouldReset=!0)}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});Kn._maximumComputeCommandCount=8;Kn._activeComputeCommandCount=0;Kn._nextFrameCommandQueue=[];Kn._queueCommand=(e,t)=>{if(Kn._activeComputeCommandCount>=Kn._maximumComputeCommandCount){Kn._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Kn._activeComputeCommandCount++};Kn._updateCommandQueue=e=>{if(Kn._maximumComputeCommandCount=Math.log2(ut.maximumCubeMapSize),Kn._nextFrameCommandQueue.length>0&&Kn._activeComputeCommandCount<Kn._maximumComputeCommandCount){let t=Kn._nextFrameCommandQueue.shift();for(;c(t)&&Kn._activeComputeCommandCount<Kn._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=Kn._nextFrameCommandQueue.shift();continue}e.commandList.push(t),Kn._activeComputeCommandCount++,t=Kn._nextFrameCommandQueue.shift()}c(t)&&Kn._nextFrameCommandQueue.push(t)}};Kn.setOwner=function(e,t,n){if(e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),c(e))){if(c(e._owner))throw new C("DynamicEnvironmentMapManager should only be assigned to one object");e._owner=t,t[n]=e}};Kn.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)c(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)c(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;c(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var bze=new d,xze=new d;function Tze(e,t){let n=e._position,i=t.atmosphere,o=t.mapProjection.ellipsoid,r=o.scaleToGeodeticSurface(n,xze),s=1.025,a=bze,l=c(r)?d.magnitude(r):o.maximumRadius;return a.x=l*s,a.y=l,a.z=i.dynamicLighting,!d.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(d.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var Xoe=new d,Aze=new F,Cze=new se,Eze=new G;function Sze(e,t){let n=t.context,i=e._textureDimensions;if(c(e._radianceCubeMap)||(e._radianceCubeMap=new Go({context:n,width:i.x,height:i.y,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA})),e._radianceCommandsDirty){let o=e._radianceMapFS;c(o)||(o=new He({sources:[Qh,aF]}),e._radianceMapFS=o),IA.requiresColorCorrect(t.atmosphere)&&o.defines.push("ATMOSPHERE_COLOR_CORRECT");let r=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,l=Ot.eastNorthUpToFixedFrame(r,a,Aze),u=Cze;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&o.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let h of Go.faceNames()){let p=e._radianceMapTextures[f];c(p)&&!p.isDestroyed()&&p.destroy(),p=new Rt({context:n,width:i.x,height:i.y,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA}),e._radianceMapTextures[f]=p;let g=f,m=new cl({fragmentShaderSource:o,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>l,u_faceDirection:()=>Go.getDirection(h,Xoe),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,Eze)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Kn._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[g]=void 0;let b=new Wr({context:n,colorTextures:[e._radianceMapTextures[g]]});b._bind(),e._radianceCubeMap[h].copyFromFramebuffer(),b._unBind(),b.destroy(),Kn._activeComputeCommandCount--,y.some(c)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,Kn._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function wze(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,l=0,u=(h,p,g,m,y)=>()=>{if(e.isDestroyed()||h.canceled){Kn._activeComputeCommandCount--;return}let b=e._convolutionComputeCommands;b[p]=void 0,n.copyFace(t,g,m,y),l++,Kn._activeComputeCommandCount--,g.destroy(),e._specularMapTextures[p]=void 0;let x=e._specularMapTextures.length;l>=x&&(e._irradianceCommandDirty=!0,n.sampler=new Qt({minificationFilter:Yt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0)},f=0;for(let h=1;h<i;++h){for(let p of Go.faceNames()){c(e._specularMapTextures[f])&&e._specularMapTextures[f].destroy();let g=e._specularMapTextures[f]=new Rt({context:a,width:r,height:s,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA}),m=e._va;c(m)||(m=Go.createVertexArray(a,p),e._va=m);let y=e._convolveSP;c(y)||(y=en.fromCache({context:a,vertexShaderSource:lF,fragmentShaderSource:cF,attributeLocations:{positions:0}}),e._convolveSP=y);let b=new cl({shaderProgram:y,vertexArray:m,outputTexture:g,persists:!0,owner:e,uniformMap:{u_roughness:()=>h/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>Go.getDirection(p,Xoe)}});b.postExecute=u(b,f,g,p,h),e._convolutionComputeCommands[f]=b,Kn._queueCommand(b,t),++f}r/=2,s/=2}}var Koe=new z(3,3);function vze(e,t){let n=t.context,i=Koe,o=e._irradianceMapTexture;c(o)&&!o.isDestroyed()&&o.destroy(),o=new Rt({context:n,width:i.x,height:i.y,pixelDatatype:Ue.FLOAT,pixelFormat:ke.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;c(r)||(r=new He({sources:[sF]}),e._irradianceMapFS=r);let s=new cl({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Kn._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Kn._activeComputeCommandCount--},e._irradianceComputeCommand=s,Kn._queueCommand(s,t),e._irradianceTextureDirty=!0}function Dze(e,t){let n=t.context;if(!c(e._irradianceMapTexture))return;let i=new Wr({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=Koe,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=d.unpack(r,s*4),d.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Kn.prototype.update=function(e){let t=e.mode;if(!Kn.isDynamicUpdateSupported(e)||!this.enabled||!this.shouldUpdate||!c(this._position)||t===oe.MORPHING){this._shouldRegenerateShaders=!1;return}Kn._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=Tze(this,e)||i===Ig.SUNLIGHT&&!Q.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=Q.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(Sze(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(wze(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(vze(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){Dze(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Kn.prototype.isDestroyed=function(){return!1};Kn.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;this._irradianceMapComputeCommand=void 0,e=this._radianceMapTextures.length;for(let t=0;t<e;++t)this._radianceMapTextures[t]=this._radianceMapTextures[t]&&!this._radianceMapTextures[t].isDestroyed()&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&!this._specularMapTextures[t].isDestroyed()&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&!this._irradianceMapTexture.isDestroyed()&&this._irradianceMapTexture.destroy(),c(this._va)&&this._va.destroy(),c(this._convolveSP)&&this._convolveSP.destroy(),de(this)};Kn.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};Kn.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(G.fromCssColorString("#717145"));Kn.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new d(.35449,.35449,.35449)),d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO,d.ZERO]);var Og=Kn;var Pv={HIGHLIGHT:0,REPLACE:1,MIX:2};Pv.getColorBlend=function(e,t){if(e===Pv.HIGHLIGHT)return 0;if(e===Pv.REPLACE)return 1;if(e===Pv.MIX)return O.clamp(t,O.EPSILON4,1)};var kc=Object.freeze(Pv);var Pze={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"},Uc=Object.freeze(Pze);var Ize={STEP:0,LINEAR:1,CUBICSPLINE:2},Jh=Object.freeze(Ize);var $oe={};function Iv(e){T.typeOf.number.greaterThan("options.count",e.count,0),T.typeOf.object("options.properties",e.properties),this._count=e.count,this._properties=We(e.properties,!0)}Iv.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,$oe)};Iv.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,$oe,e)};Iv.prototype.getProperty=function(e,t){if(T.typeOf.number("index",e),T.typeOf.string("propertyId",t),e<0||e>=this._count)throw new C(`index must be in the range [0, ${this._count})`);let n=this._properties[t];if(c(n))return We(n[e],!0)};Iv.prototype.setProperty=function(e,t,n){if(T.typeOf.number("index",e),T.typeOf.string("propertyId",t),e<0||e>=this._count)throw new C(`index must be in the range [0, ${this._count})`);let i=this._properties[t];c(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=We(n,!0)};var Rg=Iv;function oc(e){e=e??W.EMPTY_OBJECT,T.typeOf.number("options.count",e.count),this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy}Object.defineProperties(oc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(c(this._metadataTable))return this._metadataTable.class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return c(this._metadataTable)&&(e+=this._metadataTable.byteLength),c(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}}});oc.prototype.hasProperty=function(e,t){return T.typeOf.number("index",e),T.typeOf.string("propertyId",t),!!(c(this._metadataTable)&&this._metadataTable.hasProperty(t)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||c(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};oc.prototype.hasPropertyBySemantic=function(e,t){return T.typeOf.number("index",e),T.typeOf.string("semantic",t),c(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};oc.prototype.propertyExists=function(e){return T.typeOf.string("propertyId",e),!!(c(this._metadataTable)&&this._metadataTable.hasProperty(e)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||c(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};oc.prototype.propertyExistsBySemantic=function(e){return T.typeOf.string("semantic",e),c(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var n9=[];oc.prototype.getPropertyIds=function(e,t){return t=c(t)?t:[],t.length=0,c(this._metadataTable)&&t.push.apply(t,this._metadataTable.getPropertyIds(n9)),c(this._batchTableHierarchy)&&t.push.apply(t,this._batchTableHierarchy.getPropertyIds(e,n9)),c(this._jsonMetadataTable)&&t.push.apply(t,this._jsonMetadataTable.getPropertyIds(n9)),t};oc.prototype.getProperty=function(e,t){let n;if(c(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),c(n))||c(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),c(n))||c(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),c(n)))return n};oc.prototype.setProperty=function(e,t,n){c(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||c(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(c(this._jsonMetadataTable)||(this._jsonMetadataTable=new Rg({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};oc.prototype.getPropertyBySemantic=function(e,t){if(c(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};oc.prototype.setPropertyBySemantic=function(e,t,n){return c(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};oc.prototype.getPropertyTypedArray=function(e){if(T.typeOf.string("propertyId",e),c(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};oc.prototype.getPropertyTypedArrayBySemantic=function(e){if(T.typeOf.string("semantic",e),c(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};function i9(e,t){if(!c(e)||e<0||e>=t)throw new C(`featureId is required and must be between zero and featuresLength - 1 (${t}`-+").")}oc.prototype.isClass=function(e,t){i9(e,this.count),T.typeOf.string("className",t);let n=this._batchTableHierarchy;return c(n)?n.isClass(e,t):!1};oc.prototype.isExactClass=function(e,t){return i9(e,this.count),T.typeOf.string("className",t),this.getExactClassName(e)===t};oc.prototype.getExactClassName=function(e){i9(e,this.count);let t=this._batchTableHierarchy;if(c(t))return t.getClassName(e)};var Cl=oc;function Ov(e){e=e??W.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures;T.typeOf.object("options.property",t),T.typeOf.object("options.classProperty",n),T.typeOf.object("options.textures",i);let o=c(t.channels)?t.channels:[0],r=t,s=ru.createModelTextureReader({textureInfo:r,channels:Mze(o),texture:i[r.index]});this._min=t.min,this._max=t.max;let a=t.offset,l=t.scale,u=n.hasValueTransform||c(a)||c(l);a=a??n.offset,l=l??n.scale,a=n.unpackVectorAndMatrixTypes(a),l=n.unpackVectorAndMatrixTypes(l),this._offset=a,this._scale=l,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Ov.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ov.prototype.isGpuCompatible=function(){let e=this._classProperty,t=e.type,n=e.componentType;return e.isArray?e.isVariableLengthArray?(dt(`Property texture property ${e.id} is a variable-length array, which is not supported`),!1):e.arrayLength>4?(dt(`Property texture property ${e.id} is an array of length ${e.arrayLength}, but may have at most a length of 4`),!1):t!==at.SCALAR?(dt(`Property texture property ${e.id} is an array of type ${t}, but only SCALAR is supported`),!1):n!==Nt.UINT8?(dt(`Property texture property ${e.id} is an array with component type ${n}, but only UINT8 is supported`),!1):!0:at.isVectorType(t)||t===at.SCALAR?n!==Nt.UINT8?(dt(`Property texture property ${e.id} has component type ${n}, but only UINT8 is supported`),!1):!0:(dt(`Property texture property ${e.id} has an unsupported type`),!1)};var Oze=[void 0,"float","vec2","vec3","vec4"],Rze=[void 0,"int","ivec2","ivec3","ivec4"];Ov.prototype.getGlslType=function(){let e=this._classProperty,t=at.getComponentCount(e.type);return e.isArray&&(t=e.arrayLength),e.normalized?Oze[t]:Rze[t]};Ov.prototype.unpackInShader=function(e){return this._classProperty.normalized?e:`${this.getGlslType()}(255.0 * ${e})`};function Mze(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var uF=Ov;function o9(e){e=e??W.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures;T.typeOf.object("options.propertyTexture",t),T.typeOf.object("options.class",n),T.typeOf.object("options.textures",i);let o=t.extensions,r=t.extras,s={};if(c(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new uF({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=r,this._extensions=o}Object.defineProperties(o9.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});o9.prototype.getProperty=function(e){return T.typeOf.string("propertyId",e),this._properties[e]};var Mg=o9;function Zoe(e){e=e??W.EMPTY_OBJECT;let t=e.property,n=e.classProperty;T.typeOf.object("options.property",t),T.typeOf.object("options.classProperty",n),this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,o=t.scale,r=n.hasValueTransform||c(i)||c(o);i=i??n.offset,o=o??n.scale,i=n.unpackVectorAndMatrixTypes(i),o=n.unpackVectorAndMatrixTypes(o),this._offset=i,this._scale=o,this._hasValueTransform=r,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Zoe.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var fF=Zoe;function r9(e){e=e??W.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class;T.typeOf.object("options.propertyAttribute",t),T.typeOf.object("options.class",n);let i={};if(c(t.properties))for(let o in t.properties)t.properties.hasOwnProperty(o)&&(i[o]=new fF({property:t.properties[o],classProperty:n.properties[o]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(r9.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});r9.prototype.getProperty=function(e){return T.typeOf.string("propertyId",e),this._properties[e]};var OA=r9;function Rv(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.schema",e.schema),this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=c(t)?t.length:0,this._propertyTables=t,this._propertyTextures=e.propertyTextures,this._propertyAttributes=e.propertyAttributes,this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(Rv.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!c(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});Rv.prototype.getPropertyTable=function(e){return T.typeOf.number("propertyTableId",e),this._propertyTables[e]};Rv.prototype.getPropertyTexture=function(e){return T.typeOf.number("propertyTextureId",e),this._propertyTextures[e]};Rv.prototype.getPropertyAttribute=function(e){return T.typeOf.number("propertyAttributeId",e),this._propertyAttributes[e]};var oa=Rv;function Lze(e){e=e??W.EMPTY_OBJECT;let t=e.extension,n=e.schema;T.typeOf.object("options.extension",t),T.typeOf.object("options.schema",n);let i=[];if(c(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],l=n.classes[a.class],u=new Td({count:a.count,properties:a.properties,class:l,bufferViews:e.bufferViews});i.push(new Cl({id:s,name:a.name,count:a.count,metadataTable:u,extras:a.extras,extensions:a.extensions}))}let o=[];if(c(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];o.push(new Mg({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let r=[];if(c(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];r.push(new OA({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new oa({schema:n,propertyTables:i,propertyTextures:o,propertyAttributes:r,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var dF=Lze;function Nze(e){e=e??W.EMPTY_OBJECT;let t=e.extension,n=e.schema;T.typeOf.object("options.extension",t),T.typeOf.object("options.schema",n);let i,o=[],r;if(c(t.featureTables))for(r=Object.keys(t.featureTables).sort(),i=0;i<r.length;i++){let a=r[i],l=t.featureTables[a],u=n.classes[l.class],f=new Td({count:l.count,properties:l.properties,class:u,bufferViews:e.bufferViews});o.push(new Cl({id:a,count:l.count,metadataTable:f,extras:l.extras,extensions:l.extensions}))}let s=[];if(c(t.featureTextures))for(r=Object.keys(t.featureTextures).sort(),i=0;i<r.length;i++){let a=r[i],l=t.featureTextures[a];s.push(new Mg({id:a,propertyTexture:Fze(l),class:n.classes[l.class],textures:e.textures}))}return new oa({schema:n,propertyTables:o,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function Fze(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i],r={channels:Bze(o.channels),extras:o.extras,extensions:o.extensions};t.properties[i]=xt(o.texture,r,!0)}return t}function Bze(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var hF=Nze;function Lg(e){e=e??W.EMPTY_OBJECT;let{gltf:t,extension:n,extensionLegacy:i,gltfResource:o,baseResource:r,supportedImageFormats:s,frameState:a,cacheKey:l,asynchronous:u=!0}=e;if(T.typeOf.object("options.gltf",t),T.typeOf.object("options.gltfResource",o),T.typeOf.object("options.baseResource",r),T.typeOf.object("options.supportedImageFormats",s),T.typeOf.object("options.frameState",a),!c(e.extension)&&!c(e.extensionLegacy))throw new C("One of options.extension or options.extensionLegacy must be specified");this._gltfResource=o,this._baseResource=r,this._gltf=t,this._extension=n,this._extensionLegacy=i,this._supportedImageFormats=s,this._frameState=a,this._cacheKey=l,this._asynchronous=u,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(Lg.prototype=Object.create($i.prototype),Lg.prototype.constructor=Lg);Object.defineProperties(Lg.prototype,{cacheKey:{get:function(){return this._cacheKey}},structuralMetadata:{get:function(){return this._structuralMetadata}}});async function kze(e){try{let t=Gze(e),n=Xze(e),i=Kze(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=gt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=gt.FAILED,e.getError("Failed to load structural metadata",t)}}Lg.prototype.load=function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=kze(this),this._promise)};function Uze(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.values,r=i.arrayOffsets,s=i.stringOffsets;c(o)&&(t[o]=!0),c(r)&&(t[r]=!0),c(s)&&(t[s]=!0)}}function Vze(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=i.bufferView,r=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;c(o)&&(t[o]=!0),c(r)&&(t[r]=!0),c(s)&&(t[s]=!0)}}function zze(e){let t=e.propertyTables,n={};if(c(t))for(let i=0;i<t.length;i++){let o=t[i];Uze(o.properties,n)}return n}function Hze(e){let t=e.featureTables,n={};if(c(t)){for(let i in t)if(t.hasOwnProperty(i)){let r=t[i].properties;c(r)&&Vze(r,n)}}return n}async function Gze(e){let t;c(e._extension)?t=zze(e._extension):t=Hze(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let o=Di.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(o),e._bufferViewIds.push(i),n.push(o.load())}return Promise.all(n)}function jze(e){let t={},n=e.propertyTextures;if(c(n))for(let i=0;i<n.length;i++){let r=n[i].properties;c(r)&&Wze(r,t)}return t}function Wze(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function qze(e){let t={},n=e.featureTextures;if(c(n)){for(let i in n)if(n.hasOwnProperty(i)){let r=n[i].properties;c(r)&&Yze(r,t)}}return t}function Yze(e,t){for(let n in e)if(e.hasOwnProperty(n)){let o=e[n].texture;t[o.index]=o}}function Xze(e){let t;c(e._extension)?t=jze(e._extension):t=qze(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,o=e._baseResource,r=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,l=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Di.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:o,supportedImageFormats:r,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),l.push(f.load())}return Promise.all(l)}async function Kze(e){let t=e._extension??e._extensionLegacy,n;if(c(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Di.getSchemaLoader({resource:i})}else n=Di.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}Lg.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let a=0;a<n;++a){let u=t[a].process(e);i=i&&u}if(!i)return!1;let o=this._schemaLoader.schema,r={};for(let a=0;a<this._bufferViewIds.length;++a){let l=this._bufferViewIds[a],u=this._bufferViewLoaders[a];if(!u.isDestroyed()){let f=new Uint8Array(u.typedArray);r[l]=f}}let s={};for(let a=0;a<this._textureIds.length;++a){let l=this._textureIds[a],u=t[a];u.isDestroyed()||(s[l]=u.texture)}return c(this._extension)?this._structuralMetadata=dF({extension:this._extension,schema:o,bufferViews:r,textures:s}):this._structuralMetadata=hF({extension:this._extensionLegacy,schema:o,bufferViews:r,textures:s}),Qoe(this),this._state=gt.READY,!0};function Qoe(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Di.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function $ze(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Di.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}Lg.prototype.unload=function(){Qoe(this),$ze(this),c(this._schemaLoader)&&Di.unload(this._schemaLoader),this._schemaLoader=void 0,this._structuralMetadata=void 0};var mF=Lg;var RA={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};RA.fromGltfSemantic=function(e){T.typeOf.string("gltfSemantic",e);let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return RA.TRANSLATION;case"ROTATION":return RA.ROTATION;case"SCALE":return RA.SCALE;case"_FEATURE_ID":return RA.FEATURE_ID}};var rs=Object.freeze(RA);var Zze=65534,Qze=255;function pF(e){e=e??W.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;T.typeOf.object("options.triangleIndices",t),T.typeOf.object("options.outlineIndices",n),T.typeOf.number("options.originalVertexCount",i),this._triangleIndices=t,this._originalVertexCount=i,this._edges=new tre(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],Jze(this)}Object.defineProperties(pF.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function Jze(e){let t=e._triangleIndices,n=e._edges,i=[],o=e._extraVertices,r=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let l=t[a],u=t[a+1],f=t[a+2],h=!1,p=h||n.hasEdge(l,u),g=h||n.hasEdge(u,f),m=h||n.hasEdge(f,l),y=Joe(i,l,u,f,p,g,m);for(;c(y);){let b=s[y];if(!c(b)){b=r+o.length;let x=y;for(;x>=r;)x=o[x-r];o.push(x),s[y]=b}b>Zze&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):b>Qze&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===l?(l=b,t[a]=b):y===u?(u=b,t[a+1]=b):(f=b,t[a+2]=b),y=Joe(i,l,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function Joe(e,t,n,i,o,r,s){let a=s?1:0,l=o?1:0,u=0,f=s9(e,t,a,l,u);if(f===0)return t;let h=0,p=o?1:0,g=r?1:0,m=s9(e,n,h,p,g);if(m===0)return n;let y=s?1:0,b=0,x=r?1:0,A=s9(e,i,y,b,x);if(A===0)return i;let E=f&m&A,S,v,P;if(E&1)S=0,v=1,P=2;else if(E&2)S=0,P=1,v=2;else if(E&4)v=0,S=1,P=2;else if(E&8)v=0,P=1,S=2;else if(E&16)P=0,S=1,v=2;else if(E&32)P=0,v=1,S=2;else{let B=a9(f),_=a9(m),w=a9(A);return B<_&&B<w?t:_<w?n:i}let M=t*3;e[M+S]=a,e[M+v]=l,e[M+P]=u;let R=n*3;e[R+S]=h,e[R+v]=p,e[R+P]=g;let L=i*3;e[L+S]=y,e[L+v]=b,e[L+P]=x}function s9(e,t,n,i,o){let r=t*3,s=e[r],a=e[r+1],l=e[r+2];return c(s)?(s===n&&a===i&&l===o)<<0|(s===n&&a===o&&l===i)<<1|(s===i&&a===n&&l===o)<<2|(s===i&&a===o&&l===n)<<3|(s===o&&a===n&&l===i)<<4|(s===o&&a===i&&l===n)<<5:63}function a9(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}pF.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a<o;a++){let l=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[l+f]}return s};pF.createTexture=function(e){let t=e.cache.modelOutliningCache;if(c(t)||(t=e.cache.modelOutliningCache={}),c(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,ut.maximumTextureSize),i=n,o=ere(i),r=[];for(;i>1;)i>>=1,r.push(ere(i));let s=new Rt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:ke.LUMINANCE,sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR_MIPMAP_LINEAR,magnificationFilter:ui.LINEAR})});return t.outlineTexture=s,s};function ere(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function tre(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],o=e[n+1],r=Math.min(i,o),s=Math.max(i,o),a=r*this._originalVertexCount+s;this._edges.add(a)}}tre.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),o=n*this._originalVertexCount+i;return this._edges.has(o)};var MA=pF;function nre(e){T.typeOf.object("attribute",e),this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function e4e(e){T.typeOf.object("indices",e),this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function _F(e){T.typeOf.object("primitive",e),this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0}_F.prototype.postProcess=function(e){this.needsOutlines&&(t4e(this),i4e(this,e))};function t4e(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,o=new MA({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=o.updatedTriangleIndices,n.indexDatatype=Fe.fromTypedArray(n.typedArray);let r=n4e(o.outlineCoordinates),s=new nre(r);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,l=e.attributePlans.length;for(let u=0;u<l;u++){let f=a[u].attribute;f.typedArray=o.updateAttribute(f.typedArray)}}function n4e(e){let t=new An.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=$.FLOAT,t.type=nn.VEC3,t.normalized=!1,t.count=e.length/3,t}function i4e(e,t){o4e(e.attributePlans,t),c(e.indicesPlan)&&r4e(e.indicesPlan,t)}function o4e(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i],r=o.attribute,s=r.typedArray;if(o.loadBuffer){let a=bt.createVertexBuffer({typedArray:s,context:t,usage:Be.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.buffer=a}o.loadTypedArray||(r.typedArray=void 0)}}function r4e(e,t){let n=e.indices;if(e.loadBuffer){let i=bt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Be.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}_F.AttributeLoadPlan=nre;_F.IndicesLoadPlan=e4e;var LA=_F;function s4e(e){e=e??W.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var gF=s4e;function ire(e){T.typeOf.object("options.position",e.position),T.typeOf.object("options.adjustmentParams",e.adjustmentParams),this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(ire.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var yF=ire;function ore(e){T.typeOf.object("options.position",e.position),T.typeOf.object("options.adjustmentParams",e.adjustmentParams),T.typeOf.object("options.covarianceMatrix",e.covarianceMatrix),this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(ore.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var bF=ore;function rre(e){T.typeOf.object("options.groupFlags",e.groupFlags),T.typeOf.object("options.rotationThetas",e.rotationThetas),T.typeOf.object("options.params",e.params),this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(rre.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var xF=rre;var a4e={Direct:"Direct",Indirect:"Indirect"},Rp=Object.freeze(a4e);function sre(e){if(T.typeOf.string("options.storageType",e.storageType),this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect,this.storageType===Rp.Indirect){if(!c(this.anchorPointsIndirect))throw new ae("The anchorPointsIndirect are required for 'Indirect' storage");if(!c(this.intraTileCorrelationGroups))throw new ae("The intraTileCorrelationGroups are required for 'Indirect' storage");if(c(this.anchorPointsDirect))throw new ae("The anchorPointsDirect must be omitted for 'Indirect' storage");if(c(this.covarianceDirect))throw new ae("The covarianceDirect must be omitted for 'Indirect' storage")}else{if(!c(this.anchorPointsDirect))throw new ae("The anchorPointsDirect are required for 'Direct' storage");if(!c(this.covarianceDirect))throw new ae("The covarianceDirect is required for 'Direct' storage");if(c(this.anchorPointsIndirect))throw new ae("The anchorPointsIndirect must be omitted for 'Direct' storage");if(c(this.intraTileCorrelationGroups))throw new ae("The intraTileCorrelationGroups must be omitted for 'Direct' storage")}}Object.defineProperties(sre.prototype,{storageType:{get:function(){return this._storageType}},anchorPointsIndirect:{get:function(){return this._anchorPointsIndirect}},anchorPointsDirect:{get:function(){return this._anchorPointsDirect}},intraTileCorrelationGroups:{get:function(){return this._intraTileCorrelationGroups}},covarianceDirect:{get:function(){return this._covarianceDirect}}});var Mv=sre;function are(e){T.typeOf.number.greaterThan("options.A",e.A,0),T.typeOf.number.lessThanOrEquals("options.A",e.A,1),T.typeOf.number.greaterThanOrEquals("options.alpha",e.alpha,0),T.typeOf.number.lessThan("options.alpha",e.alpha,1),T.typeOf.number.greaterThanOrEquals("options.beta",e.beta,0),T.typeOf.number.lessThanOrEquals("options.beta",e.beta,10),T.typeOf.number.greaterThan("options.T",e.T,0),this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(are.prototype,{A:{get:function(){return this._A}},alpha:{get:function(){return this._alpha}},beta:{get:function(){return this._beta}},T:{get:function(){return this._T}}});var TF=are;function NA(){}function cre(e){return new J(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function c4e(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d);return new yF({position:t,adjustmentParams:n})}function l4e(e){let t=d.fromArray(e.position,0,new d),n=d.fromArray(e.adjustmentParams,0,new d),i=cre(e.covarianceMatrix);return new bF({position:t,adjustmentParams:n,covarianceMatrix:i})}function u4e(e){let t=e.groupFlags,n=d.fromArray(e.rotationThetas,0,new d),i=[];for(let r of e.params){let s=new TF({A:r.A,alpha:r.alpha,beta:r.beta,T:r.T});i.push(s)}return new xF({groupFlags:t,rotationThetas:n,params:i})}NA.load=function(e){T.typeOf.object("gltfGpmLocalJson",e);let t=e.storageType;if(t===Rp.Direct)return NA.loadDirect(e);if(t===Rp.Indirect)return NA.loadIndirect(e);throw new ae(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};NA.loadDirect=function(e){T.typeOf.object("gltfGpmLocalJson",e),T.typeOf.object("gltfGpmLocalJson.anchorPointsDirect",e.anchorPointsDirect),T.typeOf.object("gltfGpmLocalJson.covarianceDirectUpperTriangle",e.covarianceDirectUpperTriangle);let t=[],n=e.anchorPointsDirect;for(let r of n){let s=c4e(r);t.push(s)}let i=cre(e.covarianceDirectUpperTriangle);return new Mv({storageType:Rp.Direct,anchorPointsDirect:t,covarianceDirect:i})};NA.loadIndirect=function(e){T.typeOf.object("gltfGpmLocalJson",e),T.typeOf.object("gltfGpmLocalJson.anchorPointsIndirect",e.anchorPointsIndirect),T.typeOf.object("gltfGpmLocalJson.intraTileCorrelationGroups",e.intraTileCorrelationGroups);let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=l4e(s);t.push(a)}let i=e.intraTileCorrelationGroups,o=[];for(let s of i){let a=u4e(s);o.push(a)}return new Mv({storageType:Rp.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:o})};var AF=NA;function lre(e){T.typeOf.object("options.traits",e.traits),T.typeOf.number.greaterThanOrEquals("options.index",e.index,0),this._traits=e.traits,this._noData=e.noData,this._offset=e.offset,this._scale=e.scale,this._index=e.index,this._texCoord=e.texCoord}Object.defineProperties(lre.prototype,{traits:{get:function(){return this._traits}},noData:{get:function(){return this._noData}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},index:{get:function(){return this._index}},texCoord:{get:function(){return this._texCoord}}});var CF=lre;function ure(e){T.typeOf.string("options.source",e.source),this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(ure.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var EF=ure;function fre(e){this._ppeTextures=e}Object.defineProperties(fre.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var SF=fre;function xr(e){e=e??W.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,o=e.baseResource,r=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,l=e.asynchronous??!0;T.typeOf.object("options.gltf",t),T.typeOf.object("options.extension",n),T.typeOf.object("options.gltfResource",i),T.typeOf.object("options.baseResource",o),T.typeOf.object("options.supportedImageFormats",r),T.typeOf.object("options.frameState",s),this._gltfResource=i,this._baseResource=o,this._gltf=t,this._extension=n,this._supportedImageFormats=r,this._frameState=s,this._cacheKey=a,this._asynchronous=l,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=gt.UNLOADED,this._promise=void 0}c(Object.create)&&(xr.prototype=Object.create($i.prototype),xr.prototype.constructor=xr);Object.defineProperties(xr.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});xr.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=gt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=gt.FAILED,this.getError("Failed to load GPM data",e)}};xr.prototype.load=function(){return c(this._promise)?this._promise:(this._state=gt.LOADING,this._promise=this._loadResources(this),this._promise)};function f4e(e){let t={},n=e.ppeTextures;if(c(n))for(let i=0;i<n.length;i++){let o=n[i];t[o.index]=o}return t}xr.prototype._loadTextures=function(){let e;c(this._extension)&&(e=f4e(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,o=this._supportedImageFormats,r=this._frameState,s=this._asynchronous,a=[];for(let l in e)if(e.hasOwnProperty(l)){let u=Di.getTextureLoader({gltf:t,textureInfo:e[l],gltfResource:n,baseResource:i,supportedImageFormats:o,frameState:r,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(l),a.push(u.load())}return Promise.all(a)};xr.ppeTexturesMetadataSchemaCache=new Map;xr._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,o=e.offset??0,r=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:o,scale:r,min:n.min,max:n.max}}}};xr._obtainPpeTexturesMetadataSchema=function(e){let n=xr._collectPpeTexturePropertyIdentifiers(e).toString(),i=xr.ppeTexturesMetadataSchemaCache.get(n);if(c(i))return i;let r={id:`PPE_TEXTURE_SCHEMA_${xr.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let l=s[a],u=`ppeTexture_${a}`,f=xr._createPpeTextureClassJson(l,a);r.classes[u]=f}return i=pf.fromJson(r),xr.ppeTexturesMetadataSchemaCache.set(n,i),i};xr._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let o=n[i],r=xr._createPpeTextureClassJson(o,i),s=JSON.stringify(r);t.push(s)}return t};xr._convertToStructuralMetadata=function(e,t){let n=[],i=xr._obtainPpeTexturesMetadataSchema(e),o=e.ppeTextures;for(let s=0;s<o.length;s++){let a=o[s],l=`ppeTexture_${s}`,f=a.traits.source,h=i.classes[l],p={class:l,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new Mg({id:s,name:a.name,propertyTexture:p,class:h,textures:t}))}return new oa({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};xr.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===gt.READY)return!0;if(this._state!==gt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let h=t[u].process(e);i=i&&h}if(!i)return!1;let o={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],h=t[u];h.isDestroyed()||(o[f]=h.texture)}let r=[],s=this._extension;if(c(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let h=f.traits,p=new EF({min:h.min,max:h.max,source:h.source}),g=new CF({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});r.push(g)}}let a=new SF(r);this._meshPrimitiveGpmLocal=a;let l=xr._convertToStructuralMetadata(a,o);return this._structuralMetadata=l,this._state=gt.READY,!0};xr.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Di.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};xr.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var wF=xr;var{Attribute:d4e,Indices:h4e,FeatureIdAttribute:dre,FeatureIdTexture:hre,FeatureIdImplicitRange:mre,MorphTarget:m4e,Primitive:p4e,Instances:_4e,Skin:g4e,Node:y4e,AnimatedPropertyType:b4e,AnimationSampler:x4e,AnimationTarget:T4e,AnimationChannel:A4e,Animation:C4e,ArticulationStage:E4e,Articulation:S4e,Asset:w4e,Scene:v4e,Components:D4e,MetallicRoughness:P4e,SpecularGlossiness:I4e,Specular:O4e,Anisotropy:c9,Clearcoat:l9,Material:R4e}=An,Do={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8};function Sd(e){e=e??W.EMPTY_OBJECT;let{gltfResource:t,typedArray:n,releaseGltfJson:i=!1,asynchronous:o=!0,incrementallyLoadTextures:r=!0,upAxis:s=Fo.Y,forwardAxis:a=Fo.Z,loadAttributesAsTypedArray:l=!1,loadAttributesFor2D:u=!1,enablePick:f=!1,loadIndicesForWireframe:h=!1,loadPrimitiveOutline:p=!0,loadForClassification:g=!1,renameBatchIdSemantic:m=!1}=e;T.typeOf.object("options.gltfResource",t);let{baseResource:y=t.clone()}=e;this._gltfJson=e.gltfJson,this._gltfResource=t,this._baseResource=y,this._typedArray=n,this._releaseGltfJson=i,this._asynchronous=o,this._incrementallyLoadTextures=r,this._upAxis=s,this._forwardAxis=a,this._loadAttributesAsTypedArray=l,this._loadAttributesFor2D=u,this._enablePick=f,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._loadForClassification=g,this._renameBatchIdSemantic=m,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=Do.NOT_LOADED,this._textureState=Do.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._meshPrimitiveGpmLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}c(Object.create)&&(Sd.prototype=Object.create($i.prototype),Sd.prototype.constructor=Sd);Object.defineProperties(Sd.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},gltfJson:{get:function(){return c(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}},incrementallyLoadTextures:{get:function(){return this._incrementallyLoadTextures}},texturesLoaded:{get:function(){return this._texturesLoaded}}});async function M4e(e){e._state=Do.LOADING,e._textureState=Do.LOADING;try{let t=Di.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=Do.LOADED,e._textureState=Do.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=Do.FAILED,e._textureState=Do.FAILED,vF(e,t)}}async function L4e(e,t){zt.supportsWebP.initialized||await zt.supportsWebP.initialize(),e._supportedImageFormats=new gF({webp:zt.supportsWebP(),basis:t.context.supportsBasis});let n=B8e(e,t);return e._state=Do.PROCESSING,e._textureState=Do.PROCESSING,c(e._gltfJsonLoader)&&e._releaseGltfJson&&(Di.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}Sd.prototype.load=async function(){return c(this._promise)?this._promise:(this._promise=M4e(this),this._promise)};function vF(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function N4e(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&c(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let o=e._structuralMetadataLoader;if(c(o)){let s=o.process(t);s&&(e._components.structuralMetadata=o.structuralMetadata),n=n&&s}let r=e._meshPrimitiveGpmLoader;if(c(r)){let s=r.process(t);s&&(c(e._components.structuralMetadata)&&dt("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=r.structuralMetadata),n=n&&s}n&&(e._state=Do.POST_PROCESSING)}function F4e(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let o=n[i];o.postProcess(t),o.needsOutlines&&B4e(e,o)}}function B4e(e,t){let n=e._postProcessBuffers,i=t.primitive,o=i.outlineCoordinates;c(o)&&n.push(o.buffer);let r=i.attributes;for(let a=0;a<r.length;a++){let l=r[a];c(l.buffer)&&n.push(l.buffer)}let s=i.indices;c(s)&&c(s.buffer)&&n.push(s.buffer)}Sd.prototype._process=function(e){return this._state===Do.READY?!0:(this._state===Do.PROCESSING&&N4e(this,e),this._resourcesLoaded&&this._state===Do.POST_PROCESSING&&(F4e(this,e.context),this._state=Do.PROCESSED),this._resourcesLoaded&&this._state===Do.PROCESSED?(Cre(this),this._typedArray=void 0,this._state=Do.READY,!0):!1)};Sd.prototype._processTextures=function(e){if(this._textureState===Do.READY)return!0;if(this._textureState!==Do.PROCESSING)return!1;let t=!0,n=this._textureLoaders;for(let i=0;i<n.length;++i){let o=n[i].process(e);o&&c(this._textureCallbacks[i])&&(this._textureCallbacks[i](),this._textureCallbacks[i]=void 0),t=t&&o}return t?(this._textureState=Do.READY,this._texturesLoaded=!0,!0):!1};Sd.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===Do.LOADED&&!c(this._loadResourcesPromise)&&(this._loadResourcesPromise=L4e(this,e).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),c(this._processError)){this._state=Do.FAILED;let o=this._processError;this._processError=void 0,vF(this,o)}let t=this._textureErrors.pop();if(c(t)){let o=this.getError("Failed to load glTF texture",t);throw o.name="TextureError",o}if(this._state===Do.FAILED)return!1;let n=!1;try{n=this._process(e)}catch(o){this._state=Do.FAILED,vF(this,o)}let i=!1;try{i=this._processTextures(e)}catch(o){this._textureState=Do.FAILED,vF(this,o)}return this._incrementallyLoadTextures?n:n&&i};function k4e(e,t,n,i,o,r,s,a){let l=e.gltfJson,f=l.accessors[t].bufferView;return Di.getVertexBufferLoader({gltf:l,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:a,bufferViewId:f,primitive:i,draco:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:s})}function U4e(e,t,n,i,o,r,s){return Di.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:o,loadTypedArray:r})}function V4e(e,t){let n=Di.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function pre(e,t,n){let i=t.byteOffset,o=ou(e,t),r=t.count,s=mf(t.type),a=t.componentType,l=$.getSizeInBytes(a),u=l*s,f=r*s;if(o===u)return n=new Uint8Array(n),$.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let h=$.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),m=Tg(t.componentType);i=n.byteOffset+i;for(let y=0;y<r;++y){m(p,i,s,l,g);for(let b=0;b<s;++b)h[y*s+b]=g[b];i+=o}return h}function z4e(e,t){let n=e.type;if(n===nn.SCALAR)return t.fill(0);let i=nn.getMathType(n);return t.fill(i.clone(i.ZERO))}function H4e(e,t,n,i){let o=e.type,r=e.count;if(o===nn.SCALAR)for(let s=0;s<r;s++)n[s]=t[s];else if(o===nn.VEC4&&i)for(let s=0;s<r;s++)n[s]=Le.unpack(t,s*4);else{let s=nn.getMathType(o),a=nn.getNumberOfComponents(o);for(let l=0;l<r;l++)n[l]=s.unpack(t,l*a)}return n}async function G4e(e,t,n,i,o){let{gltfJson:r}=e;if(await t.load(),e.isDestroyed())return;let s=pre(r,n,t.typedArray);i=i??!1,H4e(n,s,o,i)}function DF(e,t,n){let i=new Array(t.count),o=t.bufferView;if(c(o)){let r=V4e(e,o),s=G4e(e,r,t,n,i);return e._loaderPromises.push(s),i}return z4e(t,i)}function cu(e,t){if(c(t))return e===Number?t[0]:e.unpack(t)}function j4e(e){return e===Number?0:new e}function W4e(e){switch(e){case $.BYTE:return 127;case $.UNSIGNED_BYTE:return 255;case $.SHORT:return 32767;case $.UNSIGNED_SHORT:return 65535;default:return 1}}var q4e={VEC2:new z(-1,-1),VEC3:new d(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function Y4e(e,t){let n=W4e(e.componentDatatype),i=q4e[e.type],o=e.min;c(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;c(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function X4e(e,t,n){let i=e.decodeMatrix,o=cu(n,e.decodedMin),r=cu(n,e.decodedMax);c(o)&&c(r)&&(t.min=o,t.max=r);let s=new An.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new z(i[6],i[7]),s.quantizedVolumeStepSize=new z(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new d(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new d(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new se(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new se(i[0],i[6],i[12],i[18])),t.quantization=s}function K4e(e,t,n,i,o){let r=e.accessors[t],s=nn.getMathType(r.type),a=r.normalized??!1,l=new d4e;l.name=n,l.semantic=i,l.setIndex=o,l.constant=j4e(s),l.componentDatatype=r.componentType,l.normalized=a,l.count=r.count,l.type=r.type,l.min=cu(s,r.min),l.max=cu(s,r.max),l.byteOffset=r.byteOffset,l.byteStride=ou(e,r),ri(r,"WEB3D_quantized_attributes")&&X4e(r.extensions.WEB3D_quantized_attributes,l,s);let u=l.semantic===ht.POSITION||l.semantic===ht.NORMAL||l.semantic===ht.TANGENT||l.semantic===ht.TEXCOORD;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&Y4e(l,s),l}function _re(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var $4e={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function u9(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=$4e;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function Z4e(e){let t=e===ht.POSITION,n=e===ht.FEATURE_ID,i=e===ht.TEXCOORD;return t||n||i}function Q4e(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=c(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=$.createArrayBufferView(o,t.typedArray.buffer)}}function J4e(e,t,n,i,o,r){if(o&&(n.buffer=i.buffer),r){let s=i.typedArray;n.typedArray=pre(e,t,s),o||(n.byteOffset=0,n.byteStride=void 0)}}function gre(e,t,n,i,o,r,s,a){let l=e.gltfJson,u=l.accessors[t],f=u.bufferView,h=n.gltfSemantic,p=n.renamedSemantic,g=n.modelSemantic,m=c(g)?_re(p):void 0,b=K4e(l,t,h,g,m);if(!c(o)&&!c(f))return b;let x=k4e(e,t,h,i,o,r,s,a),A=e._geometryLoaders.length;e._geometryLoaders.push(x);let E=x.load();return e._loaderPromises.push(E),e._geometryCallbacks[A]=()=>{c(o)&&c(o.attributes)&&c(o.attributes[h])?Q4e(b,x,r,s):J4e(l,u,b,x,r,s)},b}function yre(e,t,n,i,o,r,s,a){let l=n.modelSemantic,u=l===ht.POSITION,f=l===ht.FEATURE_ID,h=u&&!r&&e._loadAttributesFor2D&&!a.scene3DOnly,p=u&&e._enablePick&&!a.context.webgl2,g=e._loadForClassification&&f,m=e._loadAttributesAsTypedArray,y=!m,b=m||h||p||g,E=gre(e,t,n,i,o,s?!1:y,s?!0:b,a),S=new LA.AttributeLoadPlan(E);return S.loadBuffer=y,S.loadTypedArray=b,S}function e8e(e,t,n,i,o){let r=e.gltfJson.accessors,s=c(n.ROTATION),a=c(n.TRANSLATION)&&c(r[n.TRANSLATION].min)&&c(r[n.TRANSLATION].max),l=u9(e,rs,i),u=l.modelSemantic,f=u===rs.TRANSLATION||u===rs.ROTATION||u===rs.SCALE,h=u===rs.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!o.context.instancedArrays,g=e._enablePick&&!o.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!o.scene3DOnly;return gre(e,t,l,void 0,void 0,m,p||h&&(!a||y||g),o)}function t8e(e,t,n,i,o,r,s){let a=e.gltfJson.accessors[t],l=a.bufferView;if(!c(i)&&!c(l))return;let u=new h4e;u.count=a.count;let f=e._loadAttributesAsTypedArray,h=(e._loadIndicesForWireframe||e._enablePick)&&!s.context.webgl2,p=e._loadForClassification&&o,m=!f,y=f||h||p,A=U4e(e,t,n,i,r?!1:m,r?!0:y,s),E=e._geometryLoaders.length;e._geometryLoaders.push(A);let S=A.load();e._loaderPromises.push(S),e._geometryCallbacks[E]=()=>{u.indexDatatype=A.indexDatatype,u.buffer=A.buffer,u.typedArray=A.typedArray};let v=new LA.IndicesLoadPlan(u);return v.loadBuffer=m,v.loadTypedArray=y,v}function Vc(e,t,n,i){let o=e.gltfJson,r=ru.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!c(r))return;let s=Di.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),a=ru.createModelTextureReader({textureInfo:t}),l=e._textureLoaders.length;e._textureLoaders.push(s);let u=s.load().catch(f=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw f;e._textureState=Do.FAILED,e._textureErrors.push(f)}});return e._texturesPromises.push(u),e._textureCallbacks[l]=()=>{a.texture=s.texture,c(i)&&(a.texture.sampler=i)},a}function n8e(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,l=new I4e;return c(i)&&(l.diffuseTexture=Vc(e,i,n)),c(o)&&(l.specularGlossinessTexture=Vc(e,o,n)),l.diffuseFactor=cu(se,r),l.specularFactor=cu(d,s),l.glossinessFactor=a,l}function i8e(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,l=new P4e;return c(i)&&(l.baseColorTexture=Vc(e,i,n)),c(o)&&(l.metallicRoughnessTexture=Vc(e,o,n)),l.baseColorFactor=cu(se,r),l.metallicFactor=s,l.roughnessFactor=a,l}function o8e(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new O4e;return c(o)&&(a.specularTexture=Vc(e,o,n)),c(s)&&(a.specularColorTexture=Vc(e,s,n)),a.specularFactor=i,a.specularColorFactor=cu(d,r),a}function r8e(e,t,n){let{anisotropyStrength:i=c9.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=c9.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new c9;return c(r)&&(s.anisotropyTexture=Vc(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function s8e(e,t,n){let{clearcoatFactor:i=l9.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=l9.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,l=new l9;return c(o)&&(l.clearcoatTexture=Vc(e,o,n)),c(s)&&(l.clearcoatRoughnessTexture=Vc(e,s,n)),c(a)&&(l.clearcoatNormalTexture=Vc(e,a,n)),l.clearcoatFactor=i,l.clearcoatRoughnessFactor=r,l}function a8e(e,t,n){let i=new R4e,o=t.extensions??W.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,l=o.KHR_materials_clearcoat,u=t.pbrMetallicRoughness;return i.unlit=c(o.KHR_materials_unlit),c(r)?i.specularGlossiness=n8e(e,r,n):(c(u)&&(i.metallicRoughness=i8e(e,u,n)),c(s)&&!i.unlit&&(i.specular=o8e(e,s,n)),c(a)&&!i.unlit&&(i.anisotropy=r8e(e,a,n)),c(l)&&!i.unlit&&(i.clearcoat=s8e(e,l,n))),c(t.emissiveTexture)&&(i.emissiveTexture=Vc(e,t.emissiveTexture,n)),c(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Vc(e,t.normalTexture,n)),c(t.occlusionTexture)&&(i.occlusionTexture=Vc(e,t.occlusionTexture,n)),i.emissiveFactor=cu(d,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,i}function bre(e,t){let n=new dre;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function xre(e,t,n,i){let o=new dre,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=_re(r.attribute),o.positionalLabel=i,o}function Tre(e,t){let n=new mre;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function Are(e,t,n,i){let o=new mre,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=r.constant??0;let s=r.divisor??0;return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function c8e(e,t,n,i){let o=new hre;o.featureCount=t.featureCount,o.nullFeatureId=t.nullFeatureId,o.propertyTableId=t.propertyTable,o.label=t.label,o.positionalLabel=i;let r=t.texture;o.textureReader=Vc(e,r,n,Qt.NEAREST);let a=(c(r.channels)?r.channels:[0]).map(function(l){return"rgba".charAt(l)}).join("");return o.textureReader.channels=a,o}function l8e(e,t,n,i,o,r){let s=new hre,a=t.featureIds,l=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=Vc(e,l,i,Qt.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function u8e(e,t,n,i,o){let r=new m4e,s=void 0,a=void 0,l=!1;for(let u in t){if(!t.hasOwnProperty(u))continue;let f=t[u],h=u9(e,ht,u),p=yre(e,f,h,s,a,l,n,o);r.attributes.push(p.attribute),i.attributePlans.push(p)}return r}function f8e(e,t,n,i){let o=new p4e,r=new LA(o);e._primitiveLoadPlans.push(r);let s=t.material;c(s)&&(o.material=a8e(e,e.gltfJson.materials[s],i));let a=t.extensions??W.EMPTY_OBJECT,l=!1,u=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&c(u)&&(l=!0,r.needsOutlines=!0,r.outlineIndices=d8e(e,u,r));let f=e._loadForClassification,h=a.KHR_draco_mesh_compression,p=!1,g=t.attributes;if(c(g))for(let v in g){if(!g.hasOwnProperty(v))continue;let P=g[v],M=u9(e,ht,v),R=M.modelSemantic;if(f&&!Z4e(R))continue;R===ht.FEATURE_ID&&(p=!0);let L=yre(e,P,M,t,h,n,l,i);r.attributePlans.push(L),o.attributes.push(L.attribute)}let m=t.targets;if(c(m)&&!f)for(let v=0;v<m.length;++v)o.morphTargets.push(u8e(e,m[v],l,r,i));let y=t.indices;if(c(y)){let v=t8e(e,y,t,h,p,l,i);c(v)&&(r.indicesPlan=v,o.indices=v.indices)}let b=a.EXT_structural_metadata,x=a.EXT_mesh_features,A=a.EXT_feature_metadata,E=c(A);c(x)?h8e(e,o,x,i):E&&m8e(e,o,A,i),c(b)?p8e(o,b):E&&_8e(e,o,A);let S=t.mode;if(f&&S!==Me.TRIANGLES)throw new ae("Only triangle meshes can be used for classification.");return o.primitiveType=S,o}function d8e(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return DF(e,i,!1)}function h8e(e,t,n,i){let o;c(n)&&c(n.featureIds)?o=n.featureIds:o=[];for(let r=0;r<o.length;r++){let s=o[r],a=`featureId_${r}`,l;c(s.texture)?l=c8e(e,s,i,a):c(s.attribute)?l=bre(s,a):l=Tre(s,a),t.featureIds.push(l)}}function m8e(e,t,n,i){let{featureTables:o}=e.gltfJson.extensions.EXT_feature_metadata,r=0,s=n.featureIdAttributes;if(c(s))for(let l=0;l<s.length;++l){let u=s[l],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,g=`featureId_${r}`;r++;let m;c(u.featureIds.attribute)?m=xre(u,h,p,g):m=Are(u,h,p,g),t.featureIds.push(m)}let a=n.featureIdTextures;if(c(a))for(let l=0;l<a.length;++l){let u=a[l],f=u.featureTable,h=e._sortedPropertyTableIds.indexOf(f),p=o[f].count,g=`featureId_${r}`;r++;let m=l8e(e,u,h,i,p,g);t.featureIds.push(m)}}function p8e(e,t){if(!c(t))return;let{propertyTextures:n,propertyAttributes:i}=t;c(n)&&(e.propertyTextureIds=n),c(i)&&(e.propertyAttributeIds=i)}function _8e(e,t,n){c(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function g8e(e,t,n){let i=t.EXT_mesh_gpu_instancing,o=new _4e,r=i.attributes;if(c(r))for(let u in r){if(!r.hasOwnProperty(u))continue;let f=r[u];o.attributes.push(e8e(e,f,r,u,n))}let s=i.extensions??W.EMPTY_OBJECT,a=t.EXT_instance_features,l=s.EXT_feature_metadata;return c(a)?y8e(o,a):c(l)&&b8e(e.gltfJson,o,l,e._sortedPropertyTableIds),o}function y8e(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let o=n[i],r=`instanceFeatureId_${i}`,s;c(o.attribute)?s=bre(o,r):s=Tre(o,r),e.featureIds.push(s)}}function b8e(e,t,n,i){let o=e.extensions.EXT_feature_metadata.featureTables,r=n.featureIdAttributes;if(c(r))for(let s=0;s<r.length;++s){let a=r[s],l=a.featureTable,u=i.indexOf(l),f=o[l].count,h=`instanceFeatureId_${s}`,p;c(a.featureIds.attribute)?p=xre(a,u,f,h):p=Are(a,u,f,h),t.featureIds.push(p)}}function x8e(e,t,n){let i=new y4e;i.name=t.name,i.matrix=cu(F,t.matrix),i.translation=cu(d,t.translation),i.rotation=cu(Le,t.rotation),i.scale=cu(d,t.scale);let o=t.extensions??W.EMPTY_OBJECT,r=o.EXT_mesh_gpu_instancing,s=o.AGI_articulations;if(c(r)){if(e._loadForClassification)throw new ae("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=g8e(e,o,n)}c(s)&&(i.articulationName=s.articulationName);let a=t.mesh;if(c(a)){let l=e.gltfJson.meshes[a],u=l.primitives;for(let p=0;p<u.length;++p)i.primitives.push(f8e(e,u[p],c(i.instances),n));let f=t.weights??l.weights,h=i.primitives[0].morphTargets;i.morphWeights=c(f)?f.slice():new Array(h.length).fill(0)}return i}function T8e(e,t){let n=e.gltfJson.nodes;if(!c(n))return[];let i=n.map(function(o,r){let s=x8e(e,o,t);return s.index=r,s});for(let o=0;o<i.length;++o){let r=n[o].children;if(c(r))for(let s=0;s<r.length;++s)i[o].children.push(i[r[s]])}return i}function A8e(e,t,n){let i=new g4e,o=t.joints;i.joints=o.map(s=>n[s]);let r=t.inverseBindMatrices;if(c(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=DF(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(F.IDENTITY);return i}function C8e(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!c(n))return[];let i=n.map(function(r,s){let a=A8e(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r<t.length;++r){let s=o[r].skin;c(s)&&(t[r].skin=i[s])}return i}async function E8e(e,t,n,i){let o=new mF({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=o,o.load()}async function S8e(e,t,n,i){let o=new wF({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=o,o.load()}function w8e(e,t){let n=new x4e,i=e.gltfJson.accessors,o=i[t.input];n.input=DF(e,o);let r=t.interpolation;n.interpolation=Jh[r]??Jh.LINEAR;let s=i[t.output];return n.output=DF(e,s,!0),n}function v8e(e,t){let n=new T4e,i=e.node;if(!c(i))return;n.node=t[i];let o=e.path.toUpperCase();return n.path=b4e[o],n}function D8e(e,t,n){let i=new A4e,o=e.sampler;return i.sampler=t[o],i.target=v8e(e.target,n),i}function P8e(e,t,n){let i=new C4e;i.name=t.name;let o=t.samplers.map(function(s,a){let l=w8e(e,s);return l.index=a,l}),r=t.channels.map(function(s){return D8e(s,o,n)});return i.samplers=o,i.channels=r,i}function I8e(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!c(n)?[]:n.map(function(o,r){let s=P8e(e,o,t);return s.index=r,s})}function O8e(e){let t=new E4e;t.name=e.name;let n=e.type.toUpperCase();return t.type=Uc[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function R8e(e){let t=new S4e;return t.name=e.name,t.stages=e.stages.map(O8e),t}function M8e(e){let n=(e.extensions??W.EMPTY_OBJECT).AGI_articulations?.articulations;return c(n)?n.map(R8e):[]}function L8e(e){let t;return c(e.scenes)&&c(e.scene)&&(t=e.scenes[e.scene].nodes),t=t??e.nodes,t=c(t)?t:[],t}function N8e(e,t){let n=new v4e,i=L8e(e);return n.nodes=i.map(function(o){return t[o]}),n}var F8e=new d;function B8e(e,t){let n=e.gltfJson,i=n.extensions??W.EMPTY_OBJECT,o=i.EXT_structural_metadata,r=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(c(r)){let A=r.featureTables,E=r.featureTextures,S=c(A)?A:[],v=c(E)?E:[];e._sortedPropertyTableIds=Object.keys(S).sort(),e._sortedFeatureTextureIds=Object.keys(v).sort()}let a=T8e(e,t),l=C8e(e,a),u=I8e(e,a),f=M8e(n),h=N8e(n,a),p=new D4e,g=new w4e,m=n.asset.copyright;if(c(m)){let A=m.split(";").map(function(E){return new At(E.trim())});g.credits=A}if(p.asset=g,p.scene=h,p.nodes=a,p.skins=l,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,c(s)){let A=d.fromArray(s.center,0,F8e);p.transform=F.fromTranslation(A,p.transform)}if(e._components=p,c(o)||c(r)){let A=E8e(e,o,r,t);e._loaderPromises.push(A)}let y=i.NGA_gpm_local;if(c(y)){let A=AF.load(y);e._components.extensions.NGA_gpm_local=A}let b=n.meshes;if(c(b))for(let A of b){let E=A.primitives;if(c(E))for(let S of E){let v=S.extensions;if(c(v)){let P=v.NGA_gpm_local;if(c(P)){let M=S8e(e,n,P,t);e._loaderPromises.push(M)}}}}let x=[];return x.push.apply(x,e._loaderPromises),e._incrementallyLoadTextures||x.push.apply(x,e._texturesPromises),Promise.all(x)}function k8e(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Di.unload(t[n]);e._textureLoaders.length=0}function Cre(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Di.unload(t[n]);e._bufferViewLoaders.length=0}function U8e(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Di.unload(t[n]);e._geometryLoaders.length=0}function V8e(e){let t=e._postProcessBuffers;for(let n=0;n<t.length;n++){let i=t[n];i.isDestroyed()||i.destroy()}t.length=0}function z8e(e){c(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function H8e(e){c(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}Sd.prototype.isUnloaded=function(){return this._state===Do.UNLOADED};Sd.prototype.unload=function(){c(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Di.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,k8e(this),Cre(this),U8e(this),V8e(this),z8e(this),H8e(this),this._components=void 0,this._typedArray=void 0,this._state=Do.UNLOADED};var em=Sd;var PF=`uniform sampler2D u_pointCloud_colorGBuffer;
uniform sampler2D u_pointCloud_depthGBuffer;
uniform vec2 u_distanceAndEdlStrength;
in vec2 v_textureCoordinates;
vec2 neighborContribution(float log2Depth, vec2 offset)
{
float dist = u_distanceAndEdlStrength.x;
vec2 texCoordOrig = v_textureCoordinates + offset * dist;
vec2 texCoord0 = v_textureCoordinates + offset * floor(dist);
vec2 texCoord1 = v_textureCoordinates + offset * ceil(dist);
float depthOrLogDepth0 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord0));
float depthOrLogDepth1 = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, texCoord1));
if (depthOrLogDepth0 == 0.0 || depthOrLogDepth1 == 0.0) {
return vec2(0.0);
}
float depthMix = mix(depthOrLogDepth0, depthOrLogDepth1, fract(dist));
vec4 eyeCoordinate = czm_windowToEyeCoordinates(texCoordOrig, depthMix);
return vec2(max(0.0, log2Depth - log2(-eyeCoordinate.z / eyeCoordinate.w)), 1.0);
}
void main()
{
float depthOrLogDepth = czm_unpackDepth(texture(u_pointCloud_depthGBuffer, v_textureCoordinates));
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, depthOrLogDepth);
eyeCoordinate /= eyeCoordinate.w;
float log2Depth = log2(-eyeCoordinate.z);
if (depthOrLogDepth == 0.0)
{
discard;
}
vec4 color = texture(u_pointCloud_colorGBuffer, v_textureCoordinates);
vec2 texelSize = 1.0 / czm_viewport.zw;
vec2 responseAndCount = vec2(0.0);
responseAndCount += neighborContribution(log2Depth, vec2(-texelSize.x, 0.0));
responseAndCount += neighborContribution(log2Depth, vec2(+texelSize.x, 0.0));
responseAndCount += neighborContribution(log2Depth, vec2(0.0, -texelSize.y));
responseAndCount += neighborContribution(log2Depth, vec2(0.0, +texelSize.y));
float response = responseAndCount.x / responseAndCount.y;
float strength = u_distanceAndEdlStrength.y;
float shade = exp(-response * 300.0 * strength);
color.rgb *= shade;
out_FragColor = vec4(color);
gl_FragDepth = depthOrLogDepth;
}
`;function FA(){this._framebuffer=new pi({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(FA.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function G8e(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var f9=new z;function j8e(e,t){let n=new He({defines:["LOG_DEPTH_WRITE"],sources:[PF]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return f9.x=e._radius,f9.y=e._strength,f9}},o=ze.fromCache({blending:un.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:kt.setCesium3DTileBit(),stencilMask:kt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:De.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ti({framebuffer:e.framebuffer,color:new G(0,0,0,0),depth:1,renderState:ze.fromCache(),pass:De.CESIUM_3D_TILE,owner:e})}function W8e(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),j8e(e,t)}function Ere(e){return e.drawBuffers&&e.fragmentDepth}FA.isSupported=Ere;function q8e(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!c(n)){let i=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0;
layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(function(r){return r=He.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main()
{
czm_point_cloud_post_process_main();
#ifdef LOG_DEPTH
czm_writeLogDepth();
out_FragData_1 = czm_packDepth(gl_FragDepth);
#else
out_FragData_1 = czm_packDepth(gl_FragCoord.z);
#endif
}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}FA.prototype.update=function(e,t,n,i){if(!Ere(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,W8e(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o<s;++o){let u=r[o];if(u.primitiveType!==Me.POINTS||u.pass===De.TRANSLUCENT)continue;let f,h,p=u.derivedCommands.pointCloudProcessor;c(p)&&(f=p.command,h=p.originalShaderProgram),(!c(f)||u.dirty||h!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=Je.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=q8e(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,c(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),r[o]=f}let a=this._clearCommand,l=this._drawCommand;l.boundingVolume=i,r.push(l),r.push(a)};FA.prototype.isDestroyed=function(){return!1};FA.prototype.destroy=function(){return G8e(this),de(this)};var Ng=FA;function Sre(e){let t=e??{};this.attenuation=t.attenuation??!1,this.geometricErrorScale=t.geometricErrorScale??1,this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=t.eyeDomeLighting??!0,this.eyeDomeLightingStrength=t.eyeDomeLightingStrength??1,this.eyeDomeLightingRadius=t.eyeDomeLightingRadius??1,this.backFaceCulling=t.backFaceCulling??!1,this.normalShading=t.normalShading??!0}Sre.isSupported=function(e){return Ng.isSupported(e.context)};var Mp=Sre;var va={},Y8e=new se(0,0,0,1),rc=new se,X8e=new Ke,d9=new z,h9=new z;va.worldToWindowCoordinates=function(e,t,n){return va.worldWithEyeOffsetToWindowCoordinates(e,t,d.ZERO,n)};var wre=new se,vre=new d;function Lv(e,t,n,i){let o=n.viewMatrix,r=F.multiplyByVector(o,se.fromElements(e.x,e.y,e.z,1,wre),wre),s=d.multiplyComponents(t,d.normalize(r,vre),vre);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,F.multiplyByVector(n.frustum.projectionMatrix,r,i)}var K8e=new he(Math.PI,O.PI_OVER_TWO),$8e=new d,Z8e=new d;va.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){if(!c(e))throw new C("scene is required.");if(!c(t))throw new C("position is required.");let o=e.frameState,r=va.computeActualEllipsoidPosition(o,t,Y8e);if(!c(r))return;let s=e.canvas,a=X8e;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let l=e.camera,u=!1;if(o.mode===oe.SCENE2D){let f=e.mapProjection,h=K8e,p=f.project(h,$8e),g=d.clone(l.position,Z8e),m=l.frustum.clone(),y=F.computeViewportTransformation(a,0,1,new F),b=l.frustum.projectionMatrix,x=l.positionWC.y,A=d.fromElements(O.sign(x)*p.x-x,0,-l.positionWC.x),E=Ot.pointToGLWindowCoordinates(b,y,A);if(x===0||E.x<=0||E.x>=s.clientWidth)u=!0;else{if(E.x>s.clientWidth*.5){a.width=E.x,l.frustum.right=p.x-x,rc=Lv(r,n,l,rc),va.clipToGLWindowCoordinates(a,rc,d9),a.x+=E.x,l.position.x=-l.position.x;let S=l.frustum.right;l.frustum.right=-l.frustum.left,l.frustum.left=-S,rc=Lv(r,n,l,rc),va.clipToGLWindowCoordinates(a,rc,h9)}else{a.x+=E.x,a.width-=E.x,l.frustum.left=-p.x-x,rc=Lv(r,n,l,rc),va.clipToGLWindowCoordinates(a,rc,d9),a.x=a.x-a.width,l.position.x=-l.position.x;let S=l.frustum.left;l.frustum.left=-l.frustum.right,l.frustum.right=-S,rc=Lv(r,n,l,rc),va.clipToGLWindowCoordinates(a,rc,h9)}d.clone(g,l.position),l.frustum=m.clone(),i=z.clone(d9,i),(i.x<0||i.x>s.clientWidth)&&(i.x=h9.x)}}if(o.mode!==oe.SCENE2D||u){if(rc=Lv(r,n,l,rc),rc.z<0&&!(l.frustum instanceof on)&&!(l.frustum instanceof jo))return;i=va.clipToGLWindowCoordinates(a,rc,i)}return i.y=s.clientHeight-i.y,i};va.worldToDrawingBufferCoordinates=function(e,t,n){if(n=va.worldToWindowCoordinates(e,t,n),!!c(n))return va.transformWindowToDrawingBuffer(e,n,n)};var Lp=new d,Q8e=new he;va.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===oe.SCENE3D)return d.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,Q8e);if(!c(r))return;if(o.project(r,Lp),i===oe.COLUMBUS_VIEW)return d.fromElements(Lp.z,Lp.x,Lp.y,n);if(i===oe.SCENE2D)return d.fromElements(0,Lp.x,Lp.y,n);let s=e.morphTime;return d.fromElements(O.lerp(Lp.z,t.x,s),O.lerp(Lp.x,t.y,s),O.lerp(Lp.y,t.z,s),n)};var Dre=new d,Pre=new d,Ire=new F;va.clipToGLWindowCoordinates=function(e,t,n){return d.divideByScalar(t,t.w,Dre),F.computeViewportTransformation(e,0,1,Ire),F.multiplyByPoint(Ire,Dre,Pre),z.fromCartesian3(Pre,n)};va.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return z.fromElements(t.x*o,t.y*r,n)};var J8e=new se,Ore=new se;va.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,l=s.y;if(e.frameState.useLogDepth){let g=n*r.log2FarDepthFromNearPlusOne,m=Math.pow(2,g)-1;n=l*(1-a/(m+a))/(l-a)}let u=e.view.passState.viewport,f=se.clone(se.UNIT_W,J8e);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let h,p=e.camera.frustum;if(c(p.fovy)){h=F.multiplyByVector(r.inverseViewProjection,f,Ore);let g=1/h.w;d.multiplyByScalar(h,g,h)}else{let g=p.offCenterFrustum;c(g)&&(p=g),h=Ore,h.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,h.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,h.z=(f.z*(a-l)-a-l)*.5,h.w=1,h=F.multiplyByVector(r.inverseView,h,h)}return d.fromCartesian4(h,i)};var Hi=va;var BA={};BA._deprecationWarning=Ns;var Np=Uint32Array.BYTES_PER_ELEMENT;BA.parse=function(e,t){let n=t??0;T.defined("arrayBuffer",e),t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Np;let r=o.getUint32(t,!0);if(r!==1)throw new ae(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=Np;let s=o.getUint32(t,!0);t+=Np;let a=o.getUint32(t,!0);t+=Np;let l=o.getUint32(t,!0);t+=Np;let u=o.getUint32(t,!0);t+=Np;let f=o.getUint32(t,!0);t+=Np;let h;u>=570425344?(t-=Np*2,h=a,u=l,f=0,a=0,l=0,BA._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=Np,h=u,u=a,f=l,a=0,l=0,BA._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:h??0}:(p=sr(i,t,a),t+=a);let g=new Uint8Array(e,t,l);t+=l;let m,y;u>0&&(m=sr(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let b=n+s-t;if(b===0)throw new ae("glTF byte length must be greater than 0.");let x;return t%4===0?x=new Uint8Array(e,t,b):(BA._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),x=new Uint8Array(i.subarray(t,t+b))),{batchLength:h,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:x}};var IF=BA;function Nv(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Rre(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return c(a)||(a=$.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function eHe(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return c(r)||(r=$.createTypedArray(n,i),o[t]=r),r}Nv.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(c(i))return c(i.byteOffset)?(t=t??$.UNSIGNED_INT,n=n??1,Rre(this,e,t,n,1,i.byteOffset)):i};Nv.prototype.hasProperty=function(e){return c(this.json[e])};Nv.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(c(i))return c(i.byteOffset)?(c(i.componentType)&&(t=$.fromName(i.componentType)),Rre(this,e,t,n,this.featuresLength,i.byteOffset)):eHe(this,e,t,i)};Nv.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!c(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)o[a]=s[n*i+a];return o};var tm=Nv;function Fv(e){T.typeOf.number("options.count",e.count),T.typeOf.object("options.batchTable",e.batchTable);let t=e.count,n=e.batchTable,i=e.binaryBody,o=e.parseAsPropertyAttributes??!1,r=e.customAttributeOutput;if(o&&!c(r))throw new C("customAttributeOutput is required when parsing batch table as property attributes");let s=tHe(n),a;c(s.jsonProperties)&&(a=new Rg({count:t,properties:s.jsonProperties}));let l;c(s.hierarchy)&&(l=new fA({extension:s.hierarchy,binaryBody:i}));let u=Kh.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,h,p,g;if(o){let b=iHe(t,u,f,i,r);g=b.transcodedSchema,p=[new OA({propertyAttribute:b.propertyAttributeJson,class:b.transcodedClass})]}else{let b=nHe(t,u,f,i);g=b.transcodedSchema;let x=b.featureTableJson;h=new Td({count:x.count,properties:x.properties,class:b.transcodedClass,bufferViews:b.bufferViewsTypedArrays}),p=[]}let m=[];if(c(h)||c(a)||c(l)){let b=new Cl({id:0,name:"Batch Table",count:t,metadataTable:h,jsonMetadataTable:a,batchTableHierarchy:l});m.push(b)}let y={schema:g,propertyTables:m,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new oa(y)}function tHe(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,o;c(t)?(Fv._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),o=t):c(i)&&(o=i["3DTILES_batch_table_hierarchy"]);let r,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let l=e[a];Array.isArray(l)?(r=c(r)?r:{},r[a]=l):s[a]=l}return{binaryProperties:s,jsonProperties:r,hierarchy:o,extras:n,extensions:i}}function nHe(e,t,n,i){let o={},r={},s={},a=0;for(let h in n){if(!n.hasOwnProperty(h))continue;if(!c(i))throw new ae(`Property ${h} requires a batch table binary.`);let p=n[h],g=df(p);r[h]={bufferView:a},o[h]=Mre(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let l={classes:{}};l.classes[t]={properties:o};let u=pf.fromJson(l);return{featureTableJson:{class:t,count:e,properties:r},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function iHe(e,t,n,i,o){let r={},s={},a=0;for(let h in n){if(!n.hasOwnProperty(h))continue;let p=n[h];if(!c(i)&&!c(p.typedArray))throw new ae(`Property ${h} requires a batch table binary.`);let g=$t.sanitizeGlslIdentifier(h);(g===""||r.hasOwnProperty(g))&&(g=`property_${a}`,a++);let m=Mre(p);m.name=h,r[g]=m;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let b=p.typedArray;c(b)||(b=df(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let x=new An.Attribute;x.name=y,x.count=e,x.type=p.type;let A=$.fromTypedArray(b);(A===$.INT||A===$.UNSIGNED_INT||A===$.DOUBLE)&&(Fv._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${y}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),b=new Float32Array(b)),x.componentDatatype=$.fromTypedArray(b),x.typedArray=b,o.push(x),s[g]={attribute:y}}let l={classes:{}};l.classes[t]={properties:r};let u=pf.fromJson(l);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function Mre(e){let t=oHe(e.componentType);return{type:e.type,componentType:t}}function oHe(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}Fv._deprecationWarning=Ns;Fv._oneTimeWarning=dt;var Fg=Fv;var yb={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},rHe=An.FeatureIdAttribute;function Bg(e){e=e??W.EMPTY_OBJECT;let t=e.b3dmResource,n=e.baseResource,i=e.arrayBuffer,o=e.byteOffset??0,r=e.releaseGltfJson??!1,s=e.asynchronous??!0,a=e.incrementallyLoadTextures??!0,l=e.upAxis??Fo.Y,u=e.forwardAxis??Fo.X,f=e.loadAttributesAsTypedArray??!1,h=e.loadAttributesFor2D??!1,p=e.enablePick??!1,g=e.loadIndicesForWireframe??!1,m=e.loadPrimitiveOutline??!0,y=e.loadForClassification??!1;T.typeOf.object("options.b3dmResource",t),T.typeOf.object("options.arrayBuffer",i),n=c(n)?n:t.clone(),this._b3dmResource=t,this._baseResource=n,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=l,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadAttributesFor2D=h,this._enablePick=p,this._loadIndicesForWireframe=g,this._loadPrimitiveOutline=m,this._loadForClassification=y,this._state=yb.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=F.IDENTITY}c(Object.create)&&(Bg.prototype=Object.create($i.prototype),Bg.prototype.constructor=Bg);Object.defineProperties(Bg.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Bg.prototype.load=function(){if(c(this._promise))return this._promise;let e=IF.parse(this._arrayBuffer,this._byteOffset),t=e.batchLength,n=e.featureTableJson,i=e.featureTableBinary,o=e.batchTableJson,r=e.batchTableBinary,s=new tm(n,i);t=s.getGlobalProperty("BATCH_LENGTH"),this._batchLength=t;let a=s.getGlobalProperty("RTC_CENTER",$.FLOAT,3);c(a)&&(this._transform=F.fromTranslation(d.fromArray(a))),this._batchTable={json:o,binary:r};let l=new em({typedArray:e.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=l,this._state=yb.LOADING;let u=this;return this._promise=l.load().then(function(){if(!u.isDestroyed())return u._state=yb.PROCESSING,u}).catch(function(f){if(!u.isDestroyed())return sHe(u,f)}),this._promise};function sHe(e,t){return e.unload(),e._state=yb.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}Bg.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===yb.READY)return!0;if(this._state!==yb.PROCESSING||!this._gltfLoader.process(e))return!1;let n=this._gltfLoader.components;return n.transform=F.multiplyTransformation(this._transform,n.transform,n.transform),aHe(this,n),this._components=n,this._arrayBuffer=void 0,this._state=yb.READY,!0};function aHe(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let o;if(c(n.json))o=Fg({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Cl({name:Kh.BATCH_TABLE_CLASS_NAME,count:i});o=new oa({schema:{},propertyTables:[a]})}let r=t.scene.nodes,s=r.length;for(let a=0;a<s;a++)Lre(r[a]);t.structuralMetadata=o}function Lre(e){let t=e.children.length;for(let i=0;i<t;i++)Lre(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let o=e.primitives[i],r=$t.getAttributeBySemantic(o,ht.FEATURE_ID);if(c(r)){r.setIndex=0;let s=new rHe;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",o.featureIds.push(s)}}}Bg.prototype.unload=function(){c(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0};var OF=Bg;function kg(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.geoJson",e.geoJson),this._geoJson=e.geoJson,this._components=void 0}c(Object.create)&&(kg.prototype=Object.create($i.prototype),kg.prototype.constructor=kg);Object.defineProperties(kg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}}});kg.prototype.load=function(){return Promise.resolve(this)};kg.prototype.process=function(e){return T.typeOf.object("frameState",e),c(this._components)||(this._components=xHe(this._geoJson,e),this._geoJson=void 0),!0};function cHe(){this.lines=void 0,this.points=void 0,this.properties=void 0}function lHe(){this.features=[]}function m9(e){let t=e[0],n=e[1],i=e[2]??0;return new d(t,n,i)}function p9(e){let t=e.length,n=new Array(t);for(let o=0;o<t;o++)n[o]=m9(e[o]);return[n]}function uHe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=p9(e[i])[0];return n}function Nre(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=p9(e[i])[0];return n}function fHe(e){let t=e.length,n=[];for(let i=0;i<t;i++)Array.prototype.push.apply(n,Nre(e[i]));return n}function dHe(e){return[m9(e)]}function hHe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=m9(e[i]);return n}var mHe={LineString:p9,MultiLineString:uHe,MultiPolygon:fHe,Polygon:Nre,MultiPoint:hHe,Point:dHe},pHe={LineString:Me.LINES,MultiLineString:Me.LINES,MultiPolygon:Me.LINES,Polygon:Me.LINES,MultiPoint:Me.POINTS,Point:Me.POINTS};function Fre(e,t){if(!c(e.geometry))return;let n=e.geometry.type,i=mHe[n],o=pHe[n],r=e.geometry.coordinates;if(!c(i)||!c(r))return;let s=new cHe;o===Me.LINES?s.lines=i(r):o===Me.POINTS&&(s.points=i(r)),s.properties=e.properties,t.features.push(s)}function _He(e,t){let n=e.features,i=n.length;for(let o=0;o<i;o++)Fre(n[o],t)}var gHe={FeatureCollection:_He,Feature:Fre},RF=new d;function yHe(e,t,n){let i=0,o=0,r=e.length;for(let L=0;L<r;L++){let B=e[L];if(c(B.lines)){let _=B.lines.length;for(let w=0;w<_;w++){let D=B.lines[w];i+=D.length,o+=(D.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),l=Fe.createTypedArray(i,o),u=Fe.fromTypedArray(l),f=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),h=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let L=0;L<r;L++){let B=e[L];if(!c(B.lines))continue;let _=B.lines.length;for(let w=0;w<_;w++){let D=B.lines[w],I=D.length;for(let N=0;N<I;N++){let k=D[N],H=d.fromDegrees(k.x,k.y,k.z,ie.WGS84,RF),V=F.multiplyByPoint(t,H,RF);d.minimumByComponent(f,V,f),d.maximumByComponent(h,V,h),d.pack(V,s,p*3),a[p]=L,N<I-1&&(l[g*2]=p,l[g*2+1]=p+1,g++),p++}}}let m=bt.createVertexBuffer({typedArray:s,context:n.context,usage:Be.STATIC_DRAW});m.vertexArrayDestroyable=!1;let y=bt.createVertexBuffer({typedArray:a,context:n.context,usage:Be.STATIC_DRAW});y.vertexArrayDestroyable=!1;let b=bt.createIndexBuffer({typedArray:l,context:n.context,usage:Be.STATIC_DRAW,indexDatatype:u});b.vertexArrayDestroyable=!1;let x=new An.Attribute;x.semantic=ht.POSITION,x.componentDatatype=$.FLOAT,x.type=nn.VEC3,x.count=i,x.min=f,x.max=h,x.buffer=m;let A=new An.Attribute;A.semantic=ht.FEATURE_ID,A.setIndex=0,A.componentDatatype=$.FLOAT,A.type=nn.SCALAR,A.count=i,A.buffer=y;let E=[x,A],S=new An.Material;S.unlit=!0;let v=new An.Indices;v.indexDatatype=u,v.count=l.length,v.buffer=b;let P=new An.FeatureIdAttribute;P.featureCount=r,P.propertyTableId=0,P.setIndex=0,P.positionalLabel="featureId_0";let M=[P],R=new An.Primitive;return R.attributes=E,R.indices=v,R.featureIds=M,R.primitiveType=Me.LINES,R.material=S,R}function bHe(e,t,n){let i=0,o=e.length;for(let E=0;E<o;E++){let S=e[E];c(S.points)&&(i+=S.points.length)}let r=new Float32Array(i*3),s=new Float32Array(i),a=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),l=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let E=0;E<o;E++){let S=e[E];if(!c(S.points))continue;let v=S.points.length;for(let P=0;P<v;P++){let M=S.points[P],R=d.fromDegrees(M.x,M.y,M.z,ie.WGS84,RF),L=F.multiplyByPoint(t,R,RF);d.minimumByComponent(a,L,a),d.maximumByComponent(l,L,l),d.pack(L,r,u*3),s[u]=E,u++}}let f=bt.createVertexBuffer({typedArray:r,context:n.context,usage:Be.STATIC_DRAW});f.vertexArrayDestroyable=!1;let h=bt.createVertexBuffer({typedArray:s,context:n.context,usage:Be.STATIC_DRAW});h.vertexArrayDestroyable=!1;let p=new An.Attribute;p.semantic=ht.POSITION,p.componentDatatype=$.FLOAT,p.type=nn.VEC3,p.count=i,p.min=a,p.max=l,p.buffer=f;let g=new An.Attribute;g.semantic=ht.FEATURE_ID,g.setIndex=0,g.componentDatatype=$.FLOAT,g.type=nn.SCALAR,g.count=i,g.buffer=h;let m=[p,g],y=new An.Material;y.unlit=!0;let b=new An.FeatureIdAttribute;b.featureCount=o,b.propertyTableId=0,b.setIndex=0,b.positionalLabel="featureId_0";let x=[b],A=new An.Primitive;return A.attributes=m,A.featureIds=x,A.primitiveType=Me.POINTS,A.material=y,A}function xHe(e,t){let n=new lHe,i=gHe[e.type];c(i)&&i(e,n);let o=n.features,r=o.length;if(r===0)throw new ae("GeoJSON must have at least one feature");let s={};for(let L=0;L<r;L++){let _=o[L].properties??W.EMPTY_OBJECT;for(let w in _)_.hasOwnProperty(w)&&(c(s[w])||(s[w]=new Array(r)))}for(let L=0;L<r;L++){let B=o[L];for(let _ in s)if(s.hasOwnProperty(_)){let w=B.properties[_]??"";s[_][L]=w}}let a=new Rg({count:r,properties:s}),u=[new Cl({id:0,count:r,jsonMetadataTable:a})],f=pf.fromJson({}),h=new oa({schema:f,propertyTables:u}),p=new d(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new d(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,y=!1;for(let L=0;L<r;L++){let B=o[L];if(c(B.lines)){m=!0;let _=B.lines.length;for(let w=0;w<_;w++){let D=B.lines[w],I=D.length;for(let N=0;N<I;N++)d.minimumByComponent(p,D[N],p),d.maximumByComponent(g,D[N],g)}}if(c(B.points)){y=!0;let _=B.points.length;for(let w=0;w<_;w++){let D=B.points[w];d.minimumByComponent(p,D,p),d.maximumByComponent(g,D,g)}}}let b=d.midpoint(p,g,new d),x=d.fromDegrees(b.x,b.y,b.z,ie.WGS84,new d),A=Ot.eastNorthUpToFixedFrame(x,ie.WGS84,new F),E=F.inverseTransformation(A,new F),S=[];m&&S.push(yHe(o,E,t)),y&&S.push(bHe(o,E,t));let v=new An.Node;v.index=0,v.primitives=S;let P=[v],M=new An.Scene;M.nodes=P;let R=new An.Components;return R.scene=M,R.nodes=P,R.transform=A,R.structuralMetadata=h,R}kg.prototype.unload=function(){this._components=void 0};var MF=kg;var LF={};LF._deprecationWarning=Ns;var Ug=Uint32Array.BYTES_PER_ELEMENT;LF.parse=function(e,t){T.defined("arrayBuffer",e);let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Ug;let r=o.getUint32(t,!0);if(r!==1)throw new ae(`Only Instanced 3D Model version 1 is supported. Version ${r} is not.`);t+=Ug;let s=o.getUint32(t,!0);t+=Ug;let a=o.getUint32(t,!0);if(a===0)throw new ae("featureTableJsonByteLength is zero, the feature table must be defined.");t+=Ug;let l=o.getUint32(t,!0);t+=Ug;let u=o.getUint32(t,!0);t+=Ug;let f=o.getUint32(t,!0);t+=Ug;let h=o.getUint32(t,!0);if(h!==1&&h!==0)throw new ae(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${h} is not.`);t+=Ug;let p=sr(i,t,a);t+=a;let g=new Uint8Array(e,t,l);t+=l;let m,y;u>0&&(m=sr(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let b=n+s-t;if(b===0)throw new ae("glTF byte length must be greater than 0.");let x;return t%4===0?x=new Uint8Array(e,t,b):(LF._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),x=new Uint8Array(i.subarray(t,t+b))),{gltfFormat:h,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:x}};var NF=LF;var Fp={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},FF=An.Attribute,THe=An.FeatureIdAttribute,kre=An.Instances;function Bp(e){e=e??W.EMPTY_OBJECT;let t=e.i3dmResource,n=e.arrayBuffer,i=e.baseResource,o=e.byteOffset??0,r=e.releaseGltfJson??!1,s=e.asynchronous??!0,a=e.incrementallyLoadTextures??!0,l=e.upAxis??Fo.Y,u=e.forwardAxis??Fo.X,f=e.loadAttributesAsTypedArray??!1,h=e.loadIndicesForWireframe??!1,p=e.loadPrimitiveOutline??!0,g=e.enablePick??!1;T.typeOf.object("options.i3dmResource",t),T.typeOf.object("options.arrayBuffer",n),i=c(i)?i:t.clone(),this._i3dmResource=t,this._baseResource=i,this._arrayBuffer=n,this._byteOffset=o,this._releaseGltfJson=r,this._asynchronous=s,this._incrementallyLoadTextures=a,this._upAxis=l,this._forwardAxis=u,this._loadAttributesAsTypedArray=f,this._loadIndicesForWireframe=h,this._loadPrimitiveOutline=p,this._enablePick=g,this._state=Fp.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}c(Object.create)&&(Bp.prototype=Object.create($i.prototype),Bp.prototype.constructor=Bp);Object.defineProperties(Bp.prototype,{texturesLoaded:{get:function(){return this._gltfLoader?.texturesLoaded}},cacheKey:{get:function(){}},components:{get:function(){return this._components}}});Bp.prototype.load=function(){if(c(this._promise))return this._promise;let e=NF.parse(this._arrayBuffer,this._byteOffset),t=e.featureTableJson,n=e.featureTableBinary,i=e.batchTableJson,o=e.batchTableBinary,r=e.gltfFormat,s=new tm(t,n);this._featureTable=s;let a=s.getGlobalProperty("INSTANCES_LENGTH");if(s.featuresLength=a,!c(a))throw new ae("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=a;let l=s.getGlobalProperty("RTC_CENTER",$.FLOAT,3);c(l)&&(this._transform=F.fromTranslation(d.fromArray(l))),this._batchTable={json:i,binary:o};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(r===0){let h=tu(e.gltf);h=h.replace(/[\s\0]+$/,"");let p=this._baseResource.getDerivedResource({url:h});u.gltfResource=p,u.baseResource=p}else u.gltfResource=this._i3dmResource,u.typedArray=e.gltf;let f=new em(u);return this._gltfLoader=f,this._state=Fp.LOADING,this._promise=f.load().then(()=>{if(!this.isDestroyed())return this._state=Fp.PROCESSING,this}).catch(h=>{if(!this.isDestroyed())throw AHe(this,h)}),this._promise};function AHe(e,t){return e.unload(),e._state=Fp.FAILED,e.getError("Failed to load i3dm",t)}Bp.prototype.process=function(e){if(T.typeOf.object("frameState",e),this._state===Fp.READY)return!0;let t=this._gltfLoader,n=!1;if(this._state===Fp.PROCESSING&&(n=t.process(e)),!n)return!1;let i=t.components;return i.transform=F.multiplyTransformation(this._transform,i.transform,i.transform),SHe(this,i,e),CHe(this,i),this._components=i,this._arrayBuffer=void 0,this._state=Fp.READY,!0};function CHe(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(c(n.json))o=Fg({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new Cl({name:Kh.BATCH_TABLE_CLASS_NAME,count:i});o=new oa({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var BF=new d,_9=new Array(4),EHe=new F;function SHe(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",$.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),l=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,u=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),f=vHe(o,r),h;l&&(h=new Float32Array(4*r));let p;u&&(p=new Float32Array(3*r));let g=new Float32Array(r),m=d.unpackArray(f),y=new d,b=new d,x=new d,A=new d,E=new J,S=new Le,v=new Array(4),P=new d,M=new Array(3),R=new F;if(!c(s)||d.equals(d.unpack(s),d.ZERO)){let V=le.fromPoints(m);for(i=0;i<m.length;i++)d.subtract(m[i],V.center,BF),f[3*i+0]=BF.x,f[3*i+1]=BF.y,f[3*i+2]=BF.z;let j=F.fromTranslation(V.center,EHe);t.transform=F.multiplyTransformation(j,t.transform,t.transform)}for(i=0;i<r;i++){y=d.clone(m[i]),c(s)&&d.add(y,d.unpack(s),y),l&&(DHe(o,a,i,S,y,x,b,A,E,R),Le.pack(S,v,0),h[4*i+0]=v[0],h[4*i+1]=v[1],h[4*i+2]=v[2],h[4*i+3]=v[3]),u&&(PHe(o,i,P),d.pack(P,M,0),p[3*i+0]=M[0],p[3*i+1]=M[1],p[3*i+2]=M[2]);let V=o.getProperty("BATCH_ID",$.UNSIGNED_SHORT,1,i);c(V)||(V=i),g[i]=V}let L=new kre;L.transformInWorldSpace=!0;let B=e._buffers,_=new FF;if(_.name="Instance Translation",_.semantic=rs.TRANSLATION,_.componentDatatype=$.FLOAT,_.type=nn.VEC3,_.count=r,_.typedArray=f,!l){let V=bt.createVertexBuffer({context:n.context,typedArray:f,usage:Be.STATIC_DRAW});V.vertexArrayDestroyable=!1,B.push(V),_.buffer=V}if(L.attributes.push(_),l){let V=new FF;V.name="Instance Rotation",V.semantic=rs.ROTATION,V.componentDatatype=$.FLOAT,V.type=nn.VEC4,V.count=r,V.typedArray=h,L.attributes.push(V)}if(u){let V=new FF;if(V.name="Instance Scale",V.semantic=rs.SCALE,V.componentDatatype=$.FLOAT,V.type=nn.VEC3,V.count=r,l)V.typedArray=p;else{let j=bt.createVertexBuffer({context:n.context,typedArray:p,usage:Be.STATIC_DRAW});j.vertexArrayDestroyable=!1,B.push(j),V.buffer=j}L.attributes.push(V)}let w=new FF;w.name="Instance Feature ID",w.setIndex=0,w.semantic=rs.FEATURE_ID,w.componentDatatype=$.FLOAT,w.type=nn.SCALAR,w.count=r;let D=bt.createVertexBuffer({context:n.context,typedArray:g,usage:Be.STATIC_DRAW});D.vertexArrayDestroyable=!1,B.push(D),w.buffer=D,L.attributes.push(w);let I=new THe;I.propertyTableId=0,I.setIndex=0,I.positionalLabel="instanceFeatureId_0",L.featureIds.push(I);let N=t.nodes,k=N.length,H=!1;for(i=0;i<k;i++){let V=N[i];V.primitives.length>0&&(V.instances=H?wHe(L):L,H=!0)}}function wHe(e){let t=new kre;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=We(n[o],!1);t.attributes.push(r)}return t.featureIds=e.featureIds,t}function vHe(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",$.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",$.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",$.FLOAT,3);if(!c(i))throw new ae("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let o=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",$.FLOAT,3);if(!c(o))throw new ae("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let l=3*s+a;r[l]=n[l]/65535*o[a]+i[a]}return r}else throw new ae("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var Bre=new Array(4);function DHe(e,t,n,i,o,r,s,a,l,u){let f=e.getProperty("NORMAL_UP",$.FLOAT,3,n,_9),h=e.getProperty("NORMAL_RIGHT",$.FLOAT,3,n,Bre),p=!1;if(c(f)){if(!c(h))throw new ae("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");d.unpack(f,0,r),d.unpack(h,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",$.UNSIGNED_SHORT,2,n,_9),m=e.getProperty("NORMAL_RIGHT_OCT32P",$.UNSIGNED_SHORT,2,n,Bre);if(c(g)){if(!c(m))throw new ae("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");Ln.octDecodeInRange(g[0],g[1],65535,r),Ln.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(Ot.eastNorthUpToFixedFrame(o,ie.WGS84,u),F.getMatrix3(u,l)):J.clone(J.IDENTITY,l)}p&&(d.cross(s,r,a),d.normalize(a,a),J.setColumn(l,0,s,l),J.setColumn(l,1,r,l),J.setColumn(l,2,a,l)),Le.fromRotationMatrix(l,i)}function PHe(e,t,n){n=d.fromElements(1,1,1,n);let i=e.getProperty("SCALE",$.FLOAT,1,t);c(i)&&d.multiplyByScalar(n,i,n);let o=e.getProperty("SCALE_NON_UNIFORM",$.FLOAT,3,t,_9);c(o)&&(n.x*=o[0],n.y*=o[1],n.z*=o[2])}function IHe(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let o=t[i];o.isDestroyed()||o.destroy()}t.length=0}Bp.prototype.isUnloaded=function(){return this._state===Fp.UNLOADED};Bp.prototype.unload=function(){c(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),IHe(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Fp.UNLOADED};var kF=Bp;var OHe={STOPPED:0,ANIMATING:1},nm=Object.freeze(OHe);function kA(){this.times=void 0,this.points=void 0,C.throwInstantiationError()}kA.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof d)return d;if(e instanceof Le)return Le;throw new C("point must be a Cartesian3, Quaternion, or number.")};kA.prototype.evaluate=C.throwInstantiationError;kA.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(T.typeOf.number("time",e),e<n[0]||e>n[i-1])throw new C("time is out of range.");if(t=t??0,e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o<i-1&&!(e>=n[o]&&e<n[o+1]);++o);else for(o=t-1;o>=0&&!(e>=n[o]&&e<n[o+1]);--o);return o===i-1&&(o=i-2),o};kA.prototype.wrapTime=function(e){T.typeOf.number("time",e);let t=this.times,n=t[t.length-1],i=t[0],o=n-i,r;return e<i&&(r=Math.floor((i-e)/o)+1,e+=r*o),e>n&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};kA.prototype.clampTime=function(e){T.typeOf.number("time",e);let t=this.times;return O.clamp(e,t[0],t[t.length-1])};var Ni=kA;function UA(e){this._value=e,this._valueType=Ni.getPointType(e)}Object.defineProperties(UA.prototype,{value:{get:function(){return this._value}}});UA.prototype.findTimeInterval=function(e){throw new C("findTimeInterval cannot be called on a ConstantSpline.")};UA.prototype.wrapTime=function(e){return T.typeOf.number("time",e),0};UA.prototype.clampTime=function(e){return T.typeOf.number("time",e),0};UA.prototype.evaluate=function(e,t){T.typeOf.number("time",e);let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var UF=UA;function VA(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times;if(!c(t)||!c(n))throw new C("points and times are required.");if(t.length<2)throw new C("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new C("times.length must be equal to points.length.");this._times=n,this._points=t,this._pointType=Ni.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(VA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});VA.prototype.findTimeInterval=Ni.prototype.findTimeInterval;VA.prototype.wrapTime=Ni.prototype.wrapTime;VA.prototype.clampTime=Ni.prototype.clampTime;VA.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(c(t)||(t=new d),d.lerp(n[o],n[o+1],r,t))};var bb=VA;var Ure={};Ure.solve=function(e,t,n,i){if(!c(e)||!(e instanceof Array))throw new C("The array lower is required.");if(!c(t)||!(t instanceof Array))throw new C("The array diagonal is required.");if(!c(n)||!(n instanceof Array))throw new C("The array upper is required.");if(!c(i)||!(i instanceof Array))throw new C("The array right is required.");if(t.length!==i.length)throw new C("diagonal and right must have the same lengths.");if(e.length!==n.length)throw new C("lower and upper must have the same lengths.");if(e.length!==t.length-1)throw new C("lower and upper must be one less than the length of diagonal.");let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a<r.length;a++)r[a]=new d,s[a]=new d;o[0]=n[0]/t[0],r[0]=d.multiplyByScalar(i[0],1/t[0],r[0]);let l;for(a=1;a<o.length;++a)l=1/(t[a]-o[a-1]*e[a-1]),o[a]=n[a]*l,r[a]=d.subtract(i[a],d.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=d.multiplyByScalar(r[a],l,r[a]);for(l=1/(t[a]-o[a-1]*e[a-1]),r[a]=d.subtract(i[a],d.multiplyByScalar(r[a-1],e[a-1],r[a]),r[a]),r[a]=d.multiplyByScalar(r[a],l,r[a]),s[s.length-1]=r[r.length-1],a=s.length-2;a>=0;--a)s[a]=d.subtract(r[a],d.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var Bv=Ure;var Vre=[],zre=[],Hre=[],Gre=[];function RHe(e,t,n){let i=Vre,o=Hre,r=zre,s=Gre;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let l=s[0];for(c(l)||(l=s[0]=new d),d.clone(t,l),a=1;a<i.length-1;++a)i[a]=o[a]=1,r[a]=4,l=s[a],c(l)||(l=s[a]=new d),d.subtract(e[a+1],e[a-1],l),d.multiplyByScalar(l,3,l);return i[a]=0,o[a]=1,r[a]=4,l=s[a],c(l)||(l=s[a]=new d),d.subtract(e[a+1],e[a-1],l),d.multiplyByScalar(l,3,l),r[a+1]=1,l=s[a+1],c(l)||(l=s[a+1]=new d),d.clone(n,l),Bv.solve(i,r,o,s)}function MHe(e){let t=Vre,n=Hre,i=zre,o=Gre;t.length=n.length=e.length-1,i.length=o.length=e.length;let r;t[0]=n[0]=1,i[0]=2;let s=o[0];for(c(s)||(s=o[0]=new d),d.subtract(e[1],e[0],s),d.multiplyByScalar(s,3,s),r=1;r<t.length;++r)t[r]=n[r]=1,i[r]=4,s=o[r],c(s)||(s=o[r]=new d),d.subtract(e[r+1],e[r-1],s),d.multiplyByScalar(s,3,s);return i[r]=2,s=o[r],c(s)||(s=o[r]=new d),d.subtract(e[r],e[r-1],s),d.multiplyByScalar(s,3,s),Bv.solve(t,i,n,o)}function El(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,o=e.outTangents;if(!c(t)||!c(n)||!c(i)||!c(o))throw new C("times, points, inTangents, and outTangents are required.");if(t.length<2)throw new C("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new C("times.length must be equal to points.length.");if(i.length!==o.length||i.length!==t.length-1)throw new C("inTangents and outTangents must have a length equal to points.length - 1.");if(this._times=n,this._points=t,this._pointType=Ni.getPointType(t[0]),this._pointType!==Ni.getPointType(i[0])||this._pointType!==Ni.getPointType(o[0]))throw new C("inTangents and outTangents must be of the same type as points.");this._inTangents=i,this._outTangents=o,this._lastTimeIndex=0}Object.defineProperties(El.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});El.createC1=function(e){e=e??W.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.tangents;if(!c(n)||!c(t)||!c(i))throw new C("points, times and tangents are required.");if(n.length<2)throw new C("points.length must be greater than or equal to 2.");if(t.length!==n.length||t.length!==i.length)throw new C("times, points and tangents must have the same length.");let o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new El({times:t,points:n,inTangents:r,outTangents:o})};El.createNaturalCubic=function(e){e=e??W.EMPTY_OBJECT;let t=e.times,n=e.points;if(!c(n)||!c(t))throw new C("points and times are required.");if(n.length<2)throw new C("points.length must be greater than or equal to 2.");if(t.length!==n.length)throw new C("times.length must be equal to points.length.");if(n.length<3)return new bb({points:n,times:t});let i=MHe(n),o=i.slice(0,i.length-1),r=i.slice(1,i.length);return new El({times:t,points:n,inTangents:r,outTangents:o})};El.createClampedCubic=function(e){e=e??W.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,o=e.lastTangent;if(!c(n)||!c(t)||!c(i)||!c(o))throw new C("points, times, firstTangent and lastTangent are required.");if(n.length<2)throw new C("points.length must be greater than or equal to 2.");if(t.length!==n.length)throw new C("times.length must be equal to points.length.");let r=Ni.getPointType(n[0]);if(r!==Ni.getPointType(i)||r!==Ni.getPointType(o))throw new C("firstTangent and lastTangent must be of the same type as points.");if(n.length<3)return new bb({points:n,times:t});let s=RHe(n,i,o),a=s.slice(0,s.length-1),l=s.slice(1,s.length);return new El({times:t,points:n,inTangents:l,outTangents:a})};El.hermiteCoefficientMatrix=new F(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);El.prototype.findTimeInterval=Ni.prototype.findTimeInterval;var LHe=new se,zA=new d;El.prototype.wrapTime=Ni.prototype.wrapTime;El.prototype.clampTime=Ni.prototype.clampTime;El.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this.inTangents,r=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],l=(e-i[s])/a,u=LHe;u.z=l,u.y=l*l,u.x=u.y*l,u.w=1;let f=F.multiplyByVector(El.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let h=this._pointType;return h===Number?n[s]*f.x+n[s+1]*f.y+r[s]*f.z+o[s]*f.w:(c(t)||(t=new h),t=h.multiplyByScalar(n[s],f.x,t),h.multiplyByScalar(n[s+1],f.y,zA),h.add(t,zA,t),h.multiplyByScalar(r[s],f.z,zA),h.add(t,zA,t),h.multiplyByScalar(o[s],f.w,zA),h.add(t,zA,t))};var xb=El;function HA(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times;if(!c(t)||!c(n))throw new C("points and times are required.");if(t.length<2)throw new C("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new C("times.length must be equal to points.length.");this._times=n,this._points=t,this._pointType=Ni.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(HA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});HA.prototype.findTimeInterval=Ni.prototype.findTimeInterval;HA.prototype.wrapTime=Ni.prototype.wrapTime;HA.prototype.clampTime=Ni.prototype.clampTime;HA.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,o=this._pointType;return o===Number?n[i]:(c(t)||(t=new o),o.clone(n[i],t))};var VF=HA;function NHe(e){let t=e.points,n=e.times;return function(i,o){c(o)||(o=new Le);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=t[r],l=t[r+1];return Le.fastSlerp(a,l,s,o)}}function GA(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times;if(!c(t)||!c(n))throw new C("points and times are required.");if(t.length<2)throw new C("points.length must be greater than or equal to 2.");if(n.length!==t.length)throw new C("times.length must be equal to points.length.");this._times=n,this._points=t,this._evaluateFunction=NHe(this),this._lastTimeIndex=0}Object.defineProperties(GA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});GA.prototype.findTimeInterval=Ni.prototype.findTimeInterval;GA.prototype.wrapTime=Ni.prototype.wrapTime;GA.prototype.clampTime=Ni.prototype.clampTime;GA.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var zF=GA;var jA=An.AnimatedPropertyType;function g9(e){e=e??W.EMPTY_OBJECT;let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;T.typeOf.object("options.channel",t),T.typeOf.object("options.runtimeAnimation",n),T.typeOf.object("options.runtimeNode",i),this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,VHe(this)}Object.defineProperties(g9.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function FHe(e,t){let n=[],i=[],o=[],r=t.length;for(let s=0;s<r;s+=3)i.push(t[s]),n.push(t[s+1]),o.push(t[s+2]);return i.splice(0,1),o.length=o.length-1,new xb({times:e,points:n,inTangents:i,outTangents:o})}function jre(e,t,n,i){if(e.length===1&&t.length===1)return new UF(t[0]);switch(n){case Jh.STEP:return new VF({times:e,points:t});case Jh.CUBICSPLINE:return FHe(e,t);case Jh.LINEAR:return i===jA.ROTATION?new zF({times:e,points:t}):new bb({times:e,points:t})}}function BHe(e,t,n,i,o){let r=[];if(i===jA.WEIGHTS){let a=t.length/o,l,u;for(l=0;l<o;l++){let f=new Array(a),h=l;if(n===Jh.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[h],f[u+1]=t[h+o],f[u+2]=t[h+2*o],h+=o*3;else for(u=0;u<a;u++)f[u]=t[h],h+=o;r.push(jre(e,f,n,i))}}else r.push(jre(e,t,n,i));return r}var kHe=new d,UHe=new Le;function VHe(e){let t=e._channel,n=t.sampler,i=n.input,o=n.output,r=n.interpolation,a=t.target.path,l=e._runtimeNode,u=c(l.morphWeights)?l.morphWeights.length:1,f=BHe(i,o,r,a,u);e._splines=f,e._path=a}g9.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,o=this._runtimeNode;if(n===jA.WEIGHTS){let r=o.morphWeights,s=r.length;for(let a=0;a<s;a++){let l=t[a],u=i.clampAnimations?l.clampTime(e):l.wrapTime(e);r[a]=l.evaluate(u)}}else{if(o.userAnimated)return;{let r=t[0],s=i.clampAnimations?r.clampTime(e):r.wrapTime(e);n===jA.TRANSLATION||n===jA.SCALE?o[n]=r.evaluate(s,kHe):n===jA.ROTATION&&(o[n]=r.evaluate(s,UHe))}}};var HF=g9;function y9(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=Q.clone(n.startTime),this._delay=n.delay??0,this._stopTime=Q.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??au.NONE,this._startOffset=n.startOffset??0,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new pe,this.update=new pe,this.stop=new pe,this._state=nm.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,zHe(this)}Object.defineProperties(y9.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},startOffset:{get:function(){return this._startOffset}},animationTime:{get:function(){return this._animationTime}}});function zHe(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,r=e._animation.channels,s=r.length,a=[];for(let l=0;l<s;l++){let u=r[l],f=u.target;if(!c(f))continue;let h=f.node.index,p=i._runtimeNodes[h],g=new HF({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}y9.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var GF=y9;function kp(e){this.animationAdded=new pe,this.animationRemoved=new pe,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(kp.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function b9(e,t,n){let i=e._model,o=new GF(i,t,n);return e._runtimeAnimations.push(o),e.animationAdded.raiseEvent(i,o),o}kp.prototype.add=function(e){e=e??W.EMPTY_OBJECT;let t=this._model;if(!t.ready)throw new C("Animations are not loaded. Wait for Model.ready to be true.");let n=t.sceneGraph.components.animations;if(!c(e.name)&&!c(e.index))throw new C("Either options.name or options.index must be defined.");if(c(e.multiplier)&&e.multiplier<=0)throw new C("options.multiplier must be greater than zero.");if(c(e.index)&&(e.index>=n.length||e.index<0))throw new C("options.index must be a valid animation index.");let i=e.index;if(c(i))return b9(this,n[i],e);let o=n.length;for(let r=0;r<o;++r)if(n[r].name===e.name){i=r;break}if(!c(i))throw new C("options.name must be a valid animation name.");return b9(this,n[i],e)};kp.prototype.addAll=function(e){e=e??W.EMPTY_OBJECT;let t=this._model;if(!t.ready)throw new C("Animations are not loaded. Wait for Model.ready to be true.");if(c(e.multiplier)&&e.multiplier<=0)throw new C("options.multiplier must be greater than zero.");let n=t.sceneGraph.components.animations,i=[],o=n.length;for(let r=0;r<o;++r){let s=b9(this,n[r],e);i.push(s)}return i};kp.prototype.remove=function(e){if(!c(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};kp.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};kp.prototype.contains=function(e){return c(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};kp.prototype.get=function(e){if(!c(e))throw new C("index is required.");if(e>=this._runtimeAnimations.length||e<0)throw new C("index must be valid within the range of the collection");return this._runtimeAnimations[e]};var jF=[];function HHe(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}kp.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&Q.equals(e.time,this._previousTime))return!1;this._previousTime=Q.clone(e.time,this._previousTime);let i=!1,o=e.time,r=this._model;for(let s=0;s<n;++s){let a=t[s];c(a._computedStartTime)||(a._computedStartTime=Q.addSeconds(a.startTime??o,a.delay,new Q)),c(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let l=a._computedStartTime,u=a._duration,f=a.stopTime,h=Q.lessThanOrEquals(l,o),p=c(f)&&Q.greaterThan(o,f),g=0;if(u!==0){let b=Q.secondsDifference(p?f:o,l);g=c(a._animationTime)?a._animationTime(u,b):b/u}let m=a.loop===au.REPEAT||a.loop===au.MIRRORED_REPEAT,y=(h||m&&!c(a.startTime))&&(g<=1||m)&&!p;if(g===a._prevAnimationDelta){let b=a._state===nm.STOPPED;if(y!==b)continue}if(a._prevAnimationDelta=g,y||a._state===nm.ANIMATING){if(y&&a._state===nm.STOPPED&&(a._state=nm.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===au.REPEAT)g=g-Math.floor(g);else if(a.loop===au.MIRRORED_REPEAT){let A=Math.floor(g),E=g-A;g=A%2===1?1-E:E}let b=a.startOffset;a.reverse&&(g=1-g,b=-b);let x=g*u*a.multiplier+b;x=O.clamp(x,a.localStartTime,a.localStopTime),a.animate(x),a.update.numberOfListeners>0&&(a._updateEventTime=x,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=nm.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&jF.push(a))}}n=jF.length;for(let s=0;s<n;++s){let a=jF[s];t.splice(t.indexOf(a),1),e.afterRender.push(HHe(this,r,a))}return jF.length=0,i};var WF=kp;function Tb(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(Tb.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return c(this._color)||(this._color=new G),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});Tb.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};Tb.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};Tb.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};Tb.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};Tb.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var qF=Tb;var kv={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};kv.getStyleCommandsNeeded=function(e,t){return t===0?kv.ALL_OPAQUE:t===e?kv.ALL_TRANSLUCENT:kv.OPAQUE_AND_TRANSLUCENT};var im=Object.freeze(kv);var Vg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};Vg.is3DTiles=function(e){switch(T.typeOf.string("modelType",e),e){case Vg.TILE_GLTF:case Vg.TILE_B3DM:case Vg.TILE_I3DM:case Vg.TILE_PNTS:case Vg.TILE_GEOJSON:return!0;case Vg.GLTF:return!1;default:throw new C("modelType is not a valid value.")}};var Tr=Object.freeze(Vg);function Br(e){let t=e.model,n=e.propertyTable;T.typeOf.object("propertyTable",n),T.typeOf.object("model",t),this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=im.ALL_OPAQUE,GHe(this)}Object.defineProperties(Br.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return c(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function GHe(e){let t=e._model,n=Tr.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let o,r=new Array(i);if(n){let s=t.content;for(o=0;o<i;o++)r[o]=new ta(s,o)}else for(o=0;o<i;o++)r[o]=new qF({model:t,featureId:o,featureTable:e});e._features=r,e._featuresLength=i,e._batchTexture=new Tl({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Br.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=im.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Br.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Br.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Br.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Br.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Br.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Br.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Br.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Br.prototype.getFeature=function(e){return this._features[e]};Br.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Br.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Br.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Br.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Br.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Br.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Br.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Br.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Br.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var jHe=new G;Br.prototype.applyStyle=function(e){if(!c(e)){this.setAllColor(Tl.DEFAULT_COLOR_VALUE),this.setAllShow(Tl.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=c(e.color)?e.color.evaluateColor(n,jHe)??Tl.DEFAULT_COLOR_VALUE:Tl.DEFAULT_COLOR_VALUE,o=c(e.show)?e.show.evaluate(n)??Tl.DEFAULT_SHOW_VALUE:Tl.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,o)}};Br.prototype.isDestroyed=function(){return!1};Br.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),de(this)};var YF=Br;var Wre={name:"TilesetPipelineStage"};Wre.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,ge.FRAGMENT);let r={u_polygonOffset:function(){return z.ZERO}};e.uniformMap=xt(r,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=kt.setCesium3DTileBit(),i.stencilMask=kt.CESIUM_3D_TILE_MASK};var XF=Wre;var KF=`vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) {
vec2 p = abs(pos);
vec2 inverseRadii = 1.0 / radii;
vec2 evoluteScale = (radii.x * radii.x - radii.y * radii.y) * vec2(1.0, -1.0) * inverseRadii;
vec2 tTrigs = vec2(0.70710678118);
vec2 v = radii * tTrigs;
vec2 evolute = evoluteScale * tTrigs * tTrigs * tTrigs;
vec2 q = normalize(p - evolute) * length(v - evolute);
tTrigs = (q + evolute) * inverseRadii;
tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));
v = radii * tTrigs;
return v * sign(pos);
}
vec3 computeEllipsoidPositionWC(vec3 positionMC) {
vec3 positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
vec2 positionEllipse = vec2(length(positionWC.xy), positionWC.z);
vec2 nearestPoint = nearestPointOnEllipseFast(positionEllipse, czm_ellipsoidRadii.xz);
return vec3(nearestPoint.x * normalize(positionWC.xy), nearestPoint.y);
}
void applyFog(inout vec4 color, vec4 groundAtmosphereColor, vec3 lightDirection, float distanceToCamera) {
vec3 fogColor = groundAtmosphereColor.rgb;
const float NONE = 0.0;
if (czm_atmosphereDynamicLighting != NONE) {
float darken = clamp(dot(normalize(czm_viewerPositionWC), lightDirection), czm_fogMinimumBrightness, 1.0);
fogColor *= darken;
}
#ifndef HDR
fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb);
fogColor.rgb = czm_inverseGamma(fogColor.rgb);
#endif
vec3 withFog = czm_fog(distanceToCamera, color.rgb, fogColor, czm_fogVisualDensityScalar);
color = vec4(withFog, color.a);
}
void atmosphereStage(inout vec4 color, in ProcessedAttributes attributes) {
vec3 rayleighColor;
vec3 mieColor;
float opacity;
vec3 positionWC;
vec3 lightDirection;
if (false) {
positionWC = computeEllipsoidPositionWC(attributes.positionMC);
lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);
czm_computeGroundAtmosphereScattering(
positionWC,
lightDirection,
rayleighColor,
mieColor,
opacity
);
} else {
positionWC = attributes.positionWC;
lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC, czm_atmosphereDynamicLighting);
rayleighColor = v_atmosphereRayleighColor;
mieColor = v_atmosphereMieColor;
opacity = v_atmosphereOpacity;
}
const bool ignoreBlackPixels = true;
rayleighColor = czm_applyHSBShift(rayleighColor, czm_atmosphereHsbShift, ignoreBlackPixels);
mieColor = czm_applyHSBShift(mieColor, czm_atmosphereHsbShift, ignoreBlackPixels);
vec4 groundAtmosphereColor = czm_computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);
if (u_isInFog) {
float distanceToCamera = length(attributes.positionEC);
applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera);
} else {
}
}
`;var $F=`void atmosphereStage(ProcessedAttributes attributes) {
vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting);
czm_computeGroundAtmosphereScattering(
v_positionWC,
lightDirection,
v_atmosphereRayleighColor,
v_atmosphereMieColor,
v_atmosphereOpacity
);
}
`;var qre={name:"AtmospherePipelineStage"};qre.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,ge.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ge.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([$F]),i.addFragmentLines([KF]),i.addUniform("bool","u_isInFog",ge.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=d.distance(n.camera.positionWC,t.boundingSphere.center);return O.fog(o,n.fog.density)>O.EPSILON3}};var ZF=qre;var QF=`#ifdef DIFFUSE_IBL
vec3 sampleDiffuseEnvironment(vec3 cubeDir)
{
#ifdef CUSTOM_SPHERICAL_HARMONICS
return czm_sphericalHarmonics(cubeDir, model_sphericalHarmonicCoefficients);
#else
return czm_sphericalHarmonics(cubeDir, czm_sphericalHarmonicCoefficients);
#endif
}
#endif
#ifdef SPECULAR_IBL
vec3 sampleSpecularEnvironment(vec3 cubeDir, float roughness)
{
#ifdef CUSTOM_SPECULAR_IBL
float lod = roughness * model_specularEnvironmentMapsMaximumLOD;
return czm_textureCube(model_specularEnvironmentMaps, cubeDir, lod).rgb;
#else
float lod = roughness * czm_specularEnvironmentMapsMaximumLOD;
return czm_textureCube(czm_specularEnvironmentMaps, cubeDir, lod).rgb;
#endif
}
vec3 computeSpecularIBL(vec3 cubeDir, float NdotV, vec3 f0, float roughness)
{
vec3 f90 = max(vec3(1.0 - roughness), f0);
vec3 F = fresnelSchlick2(f0, f90, NdotV);
vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
vec3 specularSample = sampleSpecularEnvironment(cubeDir, roughness);
return specularSample * (F * brdfLut.x + brdfLut.y);
}
#endif
#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
vec3 textureIBL(vec3 viewDirectionEC, vec3 normalEC, czm_modelMaterial material) {
vec3 f0 = material.specular;
float roughness = material.roughness;
float specularWeight = 1.0;
#ifdef USE_SPECULAR
specularWeight = material.specularWeight;
#endif
float NdotV = clamp(dot(normalEC, viewDirectionEC), 0.0, 1.0);
vec3 f90 = max(vec3(1.0 - roughness), f0);
vec3 singleScatterFresnel = fresnelSchlick2(f0, f90, NdotV);
vec2 brdfLut = texture(czm_brdfLut, vec2(NdotV, roughness)).rg;
vec3 FssEss = specularWeight * (singleScatterFresnel * brdfLut.x + brdfLut.y);
#ifdef DIFFUSE_IBL
vec3 normalMC = normalize(model_iblReferenceFrameMatrix * normalEC);
vec3 irradiance = sampleDiffuseEnvironment(normalMC);
vec3 averageFresnel = f0 + (1.0 - f0) / 21.0;
float Ems = specularWeight * (1.0 - brdfLut.x - brdfLut.y);
vec3 FmsEms = FssEss * averageFresnel * Ems / (1.0 - averageFresnel * Ems);
vec3 dielectricScattering = (1.0 - FssEss - FmsEms) * material.diffuse;
vec3 diffuseContribution = irradiance * (FmsEms + dielectricScattering) * model_iblFactor.x;
#else
vec3 diffuseContribution = vec3(0.0);
#endif
#ifdef USE_ANISOTROPY
vec3 anisotropyDirection = material.anisotropicB;
vec3 anisotropicTangent = cross(anisotropyDirection, viewDirectionEC);
vec3 anisotropicNormal = cross(anisotropicTangent, anisotropyDirection);
float bendFactor = 1.0 - material.anisotropyStrength * (1.0 - roughness);
float bendFactorPow4 = bendFactor * bendFactor * bendFactor * bendFactor;
vec3 bentNormal = normalize(mix(anisotropicNormal, normalEC, bendFactorPow4));
vec3 reflectEC = reflect(-viewDirectionEC, bentNormal);
#else
vec3 reflectEC = reflect(-viewDirectionEC, normalEC);
#endif
#ifdef SPECULAR_IBL
vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflectEC);
vec3 radiance = sampleSpecularEnvironment(reflectMC, roughness);
vec3 specularContribution = radiance * FssEss * model_iblFactor.y;
#else
vec3 specularContribution = vec3(0.0);
#endif
return diffuseContribution + specularContribution;
}
#endif
`;var Yre={name:"ImageBasedLightingPipelineStage"},WHe=new z;Yre.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;c(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,ge.FRAGMENT),r.addUniform("vec2","model_iblFactor",ge.FRAGMENT),Hh.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",ge.FRAGMENT),c(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,ge.BOTH),c(a)&&c(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,ge.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",ge.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,ge.FRAGMENT),c(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||c(s)?(r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,ge.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",ge.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",ge.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,ge.FRAGMENT)),r.addFragmentLines(QF);let l={model_iblFactor:function(){return z.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,WHe)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};c(s)&&(l.model_specularEnvironmentMaps=function(){return s},l.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=xt(l,e.uniformMap)};var JF=Yre;var qHe=O.EPSILON16;function T9(e){e=e??W.EMPTY_OBJECT;let t=e.stage,n=e.runtimeArticulation;T.typeOf.object("options.stage",t),T.typeOf.object("options.runtimeArticulation",n),this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(T9.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){T.typeOf.number("value",e),e=O.clamp(e,this.minimumValue,this.maximumValue),O.equalsEpsilon(this._currentValue,e,qHe)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var YHe=new d,x9=new J;T9.prototype.applyStageToMatrix=function(e){T.typeOf.object("result",e);let t=this.type,n=this.currentValue,i=YHe,o;switch(t){case Uc.XROTATE:o=J.fromRotationX(O.toRadians(n),x9),e=F.multiplyByMatrix3(e,o,e);break;case Uc.YROTATE:o=J.fromRotationY(O.toRadians(n),x9),e=F.multiplyByMatrix3(e,o,e);break;case Uc.ZROTATE:o=J.fromRotationZ(O.toRadians(n),x9),e=F.multiplyByMatrix3(e,o,e);break;case Uc.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case Uc.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=F.multiplyByTranslation(e,i,e);break;case Uc.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=F.multiplyByTranslation(e,i,e);break;case Uc.XSCALE:i.x=n,i.y=1,i.z=1,e=F.multiplyByScale(e,i,e);break;case Uc.YSCALE:i.x=1,i.y=n,i.z=1,e=F.multiplyByScale(e,i,e);break;case Uc.ZSCALE:i.x=1,i.y=1,i.z=n,e=F.multiplyByScale(e,i,e);break;case Uc.UNIFORMSCALE:e=F.multiplyByUniformScale(e,n,e);break;default:break}return e};var e2=T9;function t2(e){e=e??W.EMPTY_OBJECT;let t=e.articulation,n=e.sceneGraph;T.typeOf.object("options.articulation",t),T.typeOf.object("options.sceneGraph",n),this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,XHe(this)}Object.defineProperties(t2.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function XHe(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],l=new e2({stage:a,runtimeArticulation:e});o.push(l);let u=a.name;r[u]=l}}t2.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];c(n)&&(n.currentValue=t)};var KHe=new F,$He=new F;t2.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=F.clone(F.IDENTITY,KHe),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let o=this._runtimeNodes,r=o.length;for(t=0;t<r;t++){let s=o[t],a=F.multiplyTransformation(s.originalTransform,e,$He);s.transform=a}};var n2=t2;var i2=`void modelColorStage(inout czm_modelMaterial material)
{
material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend);
float highlight = ceil(model_colorBlend);
material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight);
material.alpha *= model_color.a;
}
`;var WA={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};WA.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,ge.FRAGMENT),i.addFragmentLines(i2);let o={},r=t.color;r.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),r.alpha<1&&(e.alphaOptions.pass=De.TRANSLUCENT),i.addUniform("vec4",WA.COLOR_UNIFORM_NAME,ge.FRAGMENT),o[WA.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",WA.COLOR_BLEND_UNIFORM_NAME,ge.FRAGMENT),o[WA.COLOR_BLEND_UNIFORM_NAME]=function(){return kc.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=xt(o,e.uniformMap)};var Ab=WA;var o2=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE
vec4 getClippingPlane(
highp sampler2D packedClippingPlanes,
int clippingPlaneNumber,
mat4 transform
) {
int pixY = clippingPlaneNumber / CLIPPING_PLANES_TEXTURE_WIDTH;
int pixX = clippingPlaneNumber - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
float u = (float(pixX) + 0.5) * pixelWidth;
float v = (float(pixY) + 0.5) * pixelHeight;
vec4 plane = texture(packedClippingPlanes, vec2(u, v));
return czm_transformPlane(plane, transform);
}
#else
vec4 getClippingPlane(
highp sampler2D packedClippingPlanes,
int clippingPlaneNumber,
mat4 transform
) {
int clippingPlaneStartIndex = clippingPlaneNumber * 2;
int pixY = clippingPlaneStartIndex / CLIPPING_PLANES_TEXTURE_WIDTH;
int pixX = clippingPlaneStartIndex - (pixY * CLIPPING_PLANES_TEXTURE_WIDTH);
float pixelWidth = 1.0 / float(CLIPPING_PLANES_TEXTURE_WIDTH);
float pixelHeight = 1.0 / float(CLIPPING_PLANES_TEXTURE_HEIGHT);
float u = (float(pixX) + 0.5) * pixelWidth;
float v = (float(pixY) + 0.5) * pixelHeight;
vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
vec4 plane;
plane.xyz = czm_octDecode(oct, 65535.0);
plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + pixelWidth, v)));
return czm_transformPlane(plane, transform);
}
#endif
float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) {
vec4 position = czm_windowToEyeCoordinates(fragCoord);
vec3 clipNormal = vec3(0.0);
vec3 clipPosition = vec3(0.0);
float pixelWidth = czm_metersPerPixel(position);
#ifdef UNION_CLIPPING_REGIONS
float clipAmount;
#else
float clipAmount = 0.0;
bool clipped = true;
#endif
for (int i = 0; i < CLIPPING_PLANES_LENGTH; ++i) {
vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
clipNormal = clippingPlane.xyz;
clipPosition = -clippingPlane.w * clipNormal;
float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
#ifdef UNION_CLIPPING_REGIONS
clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
if (amount <= 0.0) {
discard;
}
#else
clipAmount = max(amount, clipAmount);
clipped = clipped && (amount <= 0.0);
#endif
}
#ifndef UNION_CLIPPING_REGIONS
if (clipped) {
discard;
}
#endif
return clipAmount;
}
void modelClippingPlanesStage(inout vec4 color)
{
float clipDistance = clip(gl_FragCoord, model_clippingPlanes, model_clippingPlanesMatrix);
vec4 clippingPlanesEdgeColor = vec4(1.0);
clippingPlanesEdgeColor.rgb = model_clippingPlanesEdgeStyle.rgb;
float clippingPlanesEdgeWidth = model_clippingPlanesEdgeStyle.a;
if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) {
color = clippingPlanesEdgeColor;
}
}
`;var Xre={name:"ModelClippingPlanesPipelineStage"},ZHe=new z;Xre.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,ge.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,ge.FRAGMENT),xs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,ge.FRAGMENT);let s=xs.getTextureResolution(i,o,ZHe);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,ge.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,ge.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",ge.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",ge.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",ge.FRAGMENT),r.addFragmentLines(o2);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let l=G.clone(i.edgeColor);return l.alpha=i.edgeWidth,l},model_clippingPlanesMatrix:function(){return t._clippingPlanesMatrix}};e.uniformMap=xt(a,e.uniformMap)};var r2=Xre;var s2=`void modelClippingPolygonsStage(ProcessedAttributes attributes)
{
vec2 sphericalLatLong = czm_approximateSphericalCoordinates(v_positionWC);
sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
vec2 minDistance = vec2(czm_infinity);
v_regionIndex = -1;
v_clippingPosition = vec2(czm_infinity);
for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {
vec4 extents = czm_unpackClippingExtents(model_clippingExtents, regionIndex);
vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;
vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));
vec2 distance = abs(rectUv - clamped) * extents.wz;
if (minDistance.x > distance.x || minDistance.y > distance.y) {
minDistance = distance;
v_clippingPosition = rectUv;
}
float threshold = 0.01;
if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {
v_regionIndex = regionIndex;
}
}
}
`;var a2=`void modelClippingPolygonsStage()
{
vec2 clippingPosition = v_clippingPosition;
int regionIndex = v_regionIndex;
czm_clipPolygons(model_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
}
`;var Kre={name:"ModelClippingPolygonsPipelineStage"};Kre.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,ge.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,ge.FRAGMENT),o.addDefine("CLIPPING_POLYGON_REGIONS_LENGTH",i.extentsCount,ge.BOTH),o.addUniform("sampler2D","model_clippingDistance",ge.FRAGMENT),o.addUniform("sampler2D","model_clippingExtents",ge.VERTEX),o.addVarying("vec2","v_clippingPosition"),o.addVarying("int","v_regionIndex","flat"),o.addVertexLines(s2),o.addFragmentLines(a2);let r={model_clippingDistance:function(){return i.clippingTexture},model_clippingExtents:function(){return i.extentsTexture}};e.uniformMap=xt(r,e.uniformMap)};var c2=Kre;function $re(e,t){T.typeOf.object("model",e),T.typeOf.object("runtimeNode",t),this._model=e,this._runtimeNode=t}Object.defineProperties($re.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){c(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var l2=$re;var u2=`mat4 getInstancingTransform()
{
mat4 instancingTransform;
#ifdef HAS_INSTANCE_MATRICES
instancingTransform = mat4(
a_instancingTransformRow0.x, a_instancingTransformRow1.x, a_instancingTransformRow2.x, 0.0,
a_instancingTransformRow0.y, a_instancingTransformRow1.y, a_instancingTransformRow2.y, 0.0,
a_instancingTransformRow0.z, a_instancingTransformRow1.z, a_instancingTransformRow2.z, 0.0,
a_instancingTransformRow0.w, a_instancingTransformRow1.w, a_instancingTransformRow2.w, 1.0
);
#else
vec3 translation = vec3(0.0, 0.0, 0.0);
vec3 scale = vec3(1.0, 1.0, 1.0);
#ifdef HAS_INSTANCE_TRANSLATION
translation = a_instanceTranslation;
#endif
#ifdef HAS_INSTANCE_SCALE
scale = a_instanceScale;
#endif
instancingTransform = mat4(
scale.x, 0.0, 0.0, 0.0,
0.0, scale.y, 0.0, 0.0,
0.0, 0.0, scale.z, 0.0,
translation.x, translation.y, translation.z, 1.0
);
#endif
return instancingTransform;
}
#ifdef USE_2D_INSTANCING
mat4 getInstancingTransform2D()
{
mat4 instancingTransform2D;
#ifdef HAS_INSTANCE_MATRICES
instancingTransform2D = mat4(
a_instancingTransform2DRow0.x, a_instancingTransform2DRow1.x, a_instancingTransform2DRow2.x, 0.0,
a_instancingTransform2DRow0.y, a_instancingTransform2DRow1.y, a_instancingTransform2DRow2.y, 0.0,
a_instancingTransform2DRow0.z, a_instancingTransform2DRow1.z, a_instancingTransform2DRow2.z, 0.0,
a_instancingTransform2DRow0.w, a_instancingTransform2DRow1.w, a_instancingTransform2DRow2.w, 1.0
);
#else
vec3 translation2D = vec3(0.0, 0.0, 0.0);
vec3 scale = vec3(1.0, 1.0, 1.0);
#ifdef HAS_INSTANCE_TRANSLATION
translation2D = a_instanceTranslation2D;
#endif
#ifdef HAS_INSTANCE_SCALE
scale = a_instanceScale;
#endif
instancingTransform2D = mat4(
scale.x, 0.0, 0.0, 0.0,
0.0, scale.y, 0.0, 0.0,
0.0, 0.0, scale.z, 0.0,
translation2D.x, translation2D.y, translation2D.z, 1.0
);
#endif
return instancingTransform2D;
}
#endif
`;var f2=`void instancingStage(inout ProcessedAttributes attributes)
{
vec3 positionMC = attributes.positionMC;
mat4 instancingTransform = getInstancingTransform();
attributes.positionMC = (instancingTransform * vec4(positionMC, 1.0)).xyz;
#ifdef HAS_NORMALS
vec3 normalMC = attributes.normalMC;
attributes.normalMC = (instancingTransform * vec4(normalMC, 0.0)).xyz;
#endif
#ifdef USE_2D_INSTANCING
mat4 instancingTransform2D = getInstancingTransform2D();
attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
#endif
}
`;var d2=`void legacyInstancingStage(
inout ProcessedAttributes attributes,
out mat4 instanceModelView,
out mat3 instanceModelViewInverseTranspose)
{
vec3 positionMC = attributes.positionMC;
mat4 instancingTransform = getInstancingTransform();
mat4 instanceModel = instancingTransform * u_instance_nodeTransform;
instanceModelView = u_instance_modifiedModelView;
instanceModelViewInverseTranspose = mat3(u_instance_modifiedModelView * instanceModel);
attributes.positionMC = (instanceModel * vec4(positionMC, 1.0)).xyz;
#ifdef USE_2D_INSTANCING
mat4 instancingTransform2D = getInstancingTransform2D();
attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz;
#endif
}
`;var h2=new F,QHe=new F,JHe=new F,Qre={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:ise,_transformsToTypedArray:C9};Qre.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(u2);let s=e.model,a=s.sceneGraph,l=e.runtimeNode,u=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,h=[];mGe(e,n,i,h,u,f),gGe(e,n,i,h);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",ge.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",ge.VERTEX),p.u_instance_modifiedModelView=function(){let g=F.multiplyTransformation(s.modelMatrix,a.components.transform,h2);return u?F.multiplyTransformation(n.context.uniformState.view3D,g,h2):(n.mode!==oe.SCENE3D&&(g=Ot.basisTo2D(n.mapProjection,g,h2)),F.multiplyTransformation(n.context.uniformState.view,g,h2))},p.u_instance_nodeTransform=function(){return F.multiplyTransformation(a.axisCorrectionMatrix,l.computedTransform,QHe)},r.addVertexLines(d2)):r.addVertexLines(f2),u){r.addDefine("USE_2D_INSTANCING",void 0,ge.VERTEX),r.addUniform("mat4","u_modelView2D",ge.VERTEX);let g=n.context,m=F.fromTranslation(l.instancingReferencePoint2D,new F);p.u_modelView2D=function(){return F.multiplyTransformation(g.uniformState.view,m,JHe)}}e.uniformMap=xt(p,e.uniformMap),e.instanceCount=o,e.attributes.push.apply(e.attributes,h)};var Uv=new F,eGe=new d;function tGe(e,t,n,i,o){let r=F.multiplyTransformation(t,e,Uv);return r=F.multiplyTransformation(r,n,Uv),o=Ot.basisTo2D(i.mapProjection,r,o),o}function nGe(e,t,n,i,o){let r=F.fromTranslation(e,Uv),s=F.multiplyTransformation(t,r,Uv);s=F.multiplyTransformation(s,n,Uv);let a=F.getTranslation(s,eGe);return o=Hi.computeActualEllipsoidPosition(i,a,o),o}function Jre(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(t=F.multiplyTransformation(i.modelMatrix,o.components.transform,t),n=F.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=F.clone(o.computedModelMatrix,t),t=F.multiplyTransformation(t,e.runtimeNode.computedTransform,t),n=F.clone(F.IDENTITY,n))}var ese=new F,tse=new F,iGe=new F,oGe=new d;function rGe(e,t,n,i){let o=ese,r=tse;Jre(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,l=e.length;for(let u=0;u<l;u++){let f=e[u],h=tGe(f,o,r,n,iGe),p=F.getTranslation(h,oGe),g=d.subtract(p,a,p);i[u]=F.setTranslation(h,g,i[u])}return i}function sGe(e,t,n,i){let o=ese,r=tse;Jre(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,l=e.length;for(let u=0;u<l;u++){let f=e[u],h=nGe(f,o,r,n,f);i[u]=d.subtract(h,a,i[u])}return i}var aGe=new d,cGe=new d;function nse(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,o=F.multiplyByPoint(i,n.instancingTranslationMin,aGe),r=Hi.computeActualEllipsoidPosition(t,o,o),s=F.multiplyByPoint(i,n.instancingTranslationMax,cGe),a=Hi.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=d.lerp(r,a,.5,new d)}function C9(e){let n=e.length,i=new Float32Array(n*12);for(let o=0;o<n;o++){let r=e[o],s=12*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8],i[s+3]=r[12],i[s+4]=r[1],i[s+5]=r[5],i[s+6]=r[9],i[s+7]=r[13],i[s+8]=r[2],i[s+9]=r[6],i[s+10]=r[10],i[s+11]=r[14]}return i}function lGe(e){let n=e.length,i=new Float32Array(n*3);for(let o=0;o<n;o++){let r=e[o],s=3*o;i[s+0]=r[0],i[s+1]=r[4],i[s+2]=r[8]}return i}var uGe=new d,fGe=new Le,dGe=new d;function ise(e,t,n){let i=new Array(t),o=$t.getAttributeBySemantic(e,rs.TRANSLATION),r=$t.getAttributeBySemantic(e,rs.ROTATION),s=$t.getAttributeBySemantic(e,rs.SCALE),a=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),l=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=c(o),f=c(r),h=c(s),p=u?o.typedArray:new Float32Array(t*3),g=f?r.typedArray:new Float32Array(t*4);f&&r.normalized&&(g=Ln.dequantize(g,r.componentDatatype,r.type,t));let m;h?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let b=0;b<t;b++){let x=new d(p[b*3],p[b*3+1],p[b*3+2],uGe);d.maximumByComponent(a,x,a),d.minimumByComponent(l,x,l);let A=new Le(g[b*4],g[b*4+1],g[b*4+2],f?g[b*4+3]:1,fGe),E=new d(m[b*3],m[b*3+1],m[b*3+2],dGe),S=F.fromTranslationQuaternionRotationScale(x,A,E,new F);i[b]=S}let y=n.runtimeNode;return y.instancingTranslationMin=l,y.instancingTranslationMax=a,u&&(o.typedArray=void 0),f&&(r.typedArray=void 0),h&&(s.typedArray=void 0),i}function hGe(e,t,n){let i=new Array(t),o=e.typedArray,r=new d(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new d(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let l=0;l<t;l++){let u=new d(o[l*3],o[l*3+1],o[l*3+2]);i[l]=u,d.minimumByComponent(r,u,r),d.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=r,a.instancingTranslationMax=s,e.typedArray=void 0,i}function E9(e,t){let n=bt.createVertexBuffer({context:t.context,typedArray:e,usage:Be.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function mGe(e,t,n,i,o,r){let s=$t.getAttributeBySemantic(n,rs.ROTATION);c(s)?pGe(e,n,i,t,o,r):_Ge(e,n,i,t,o)}function pGe(e,t,n,i,o,r){let s=e.shaderBuilder,a=t.attributes[0].count,l=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",h,p=u.instancingTransformsBuffer;if(!c(p)){h=ise(t,a,e);let b=C9(h);p=E9(b,i),l._modelResources.push(p),r&&(u.transformsTypedArray=b),u.instancingTransformsBuffer=p}if(Zre(e,p,n,f),!o)return;let g=We(i);g.mode=oe.COLUMBUS_VIEW,nse(e,g);let m=u.instancingTransformsBuffer2D;if(!c(m)){let b=rGe(h,e,g,h),x=C9(b);m=E9(x,i),l._modelResources.push(m),u.instancingTransformsBuffer2D=m}Zre(e,m,n,"Transform2D")}function _Ge(e,t,n,i,o,r){let s=e.shaderBuilder,a=e.runtimeNode,l=$t.getAttributeBySemantic(t,rs.TRANSLATION),u=$t.getAttributeBySemantic(t,rs.SCALE);if(c(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),A9(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!c(l))return;let f,h=l.typedArray;if(c(h)?f=hGe(l,l.count,e):c(a.instancingTranslationMin)||(a.instancingTranslationMin=l.min,a.instancingTranslationMax=l.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),A9(e,l.buffer,l.byteOffset,l.byteStride,n,"Translation"),!o&&!r)return;let g=We(i);g.mode=oe.COLUMBUS_VIEW,nse(e,g);let m=a.instancingTranslationBuffer2D;if(!c(m)){let A=sGe(f,e,g,f),E=lGe(A);r&&(a.transformsTypedArray=E),m=E9(E,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!o)return;A9(e,m,0,void 0,n,"Translation2D")}function Zre(e,t,n,i){let r=$.getSizeInBytes($.FLOAT),s=r*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:$.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:$.FLOAT,normalize:!1,offsetInBytes:r*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:$.FLOAT,normalize:!1,offsetInBytes:r*8,strideInBytes:s,instanceDivisor:1}],l=e.shaderBuilder;l.addAttribute("vec4",`a_instancing${i}Row0`),l.addAttribute("vec4",`a_instancing${i}Row1`),l.addAttribute("vec4",`a_instancing${i}Row2`),n.push.apply(n,a)}function A9(e,t,n,i,o,r){o.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:$.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${r}`)}function gGe(e,t,n,i){let o=n.attributes,r=e.shaderBuilder;for(let s=0;s<o.length;s++){let a=o[s];a.semantic===rs.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:nn.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var m2=Qre;var S9={};S9.name="ModelMatrixUpdateStage";S9.update=function(e,t,n){let i=n.mode!==oe.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){let o=i?t._computedModelMatrix2D:t._computedModelMatrix;ose(e,t,o,e.transformToRoot),e._transformDirty=!1}};function yGe(e,t,n){e.modelMatrix=F.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=$t.getCullFace(e.modelMatrix,e.primitiveType)}function ose(e,t,n,i){let o;i=F.multiplyTransformation(i,e.transform,new F),e.updateComputedTransform();let r=e.runtimePrimitives.length;for(o=0;o<r;o++){let a=e.runtimePrimitives[o];yGe(a.drawCommand,n,i)}let s=e.children.length;for(o=0;o<s;o++){let a=t._runtimeNodes[e.children[o]];a._transformToRoot=F.clone(i,a._transformToRoot),ose(a,t,n,i),a._transformDirty=!1}}var p2=S9;var rse={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:sse,_countGeneratedBuffers:ase};rse.process=function(e,t,n){let i=e.model.statistics,o=t.instances,r=e.runtimeNode;sse(i,o),ase(i,r)};function sse(e,t){if(!c(t))return;let n=t.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];c(r.buffer)&&e.addBuffer(r.buffer,!1)}}function ase(e,t){c(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),c(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),c(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var _2=rse;function qA(e){e=e??W.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,o=e.sceneGraph,r=e.children;T.typeOf.object("options.node",t),T.typeOf.object("options.transform",n),T.typeOf.object("options.transformToRoot",i),T.typeOf.object("options.sceneGraph",o),T.typeOf.object("options.children",r),this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=o,this._children=r,this._originalTransform=F.clone(n,this._originalTransform),this._transform=F.clone(n,this._transform),this._transformToRoot=F.clone(i,this._transformToRoot),this._computedTransform=new F,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,bGe(this)}Object.defineProperties(qA.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=F.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return c(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters;if(!c(t))throw new C("The translation of a node cannot be set if it was defined using a matrix in the model.");let n=t.translation;d.equals(n,e)||(t.translation=d.clone(e,t.translation),w9(this,t))}},rotation:{get:function(){return c(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters;if(!c(t))throw new C("The rotation of a node cannot be set if it was defined using a matrix in the model.");let n=t.rotation;Le.equals(n,e)||(t.rotation=Le.clone(e,t.rotation),w9(this,t))}},scale:{get:function(){return c(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters;if(!c(t))throw new C("The scale of a node cannot be set if it was defined using a matrix in the model.");let n=t.scale;d.equals(n,e)||(t.scale=d.clone(e,t.scale),w9(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;if(this._morphWeights.length!==t)throw new C("value must have the same length as the original weights array.");for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function bGe(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=F.multiply(n,t,i);let o=e.node;c(o.matrix)||(e._transformParameters=new eb(o.translation,o.rotation,o.scale)),c(o.morphWeights)&&(e._morphWeights=o.morphWeights.slice());let r=o.articulationName;if(c(r)){let l=e.sceneGraph._runtimeArticulations[r];c(l)&&l.runtimeNodes.push(e)}}function w9(e,t){e._transformDirty=!0,e._transform=F.fromTranslationRotationScale(t,e._transform)}qA.prototype.getChild=function(e){if(T.typeOf.number("index",e),e<0||e>=this.children.length)throw new C("index must be greater than or equal to 0 and less than the number of children.");return this.sceneGraph._runtimeNodes[this.children[e]]};qA.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,c(e.instances)&&t.push(m2),t.push(_2),n.push(p2)};qA.prototype.updateComputedTransform=function(){this._computedTransform=F.multiply(this._transformToRoot,this._transform,this._computedTransform)};qA.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!c(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let o=0;o<i;o++){c(t[o])||(t[o]=new F);let r=F.multiplyTransformation(this.transformToRoot,this.transform,t[o]),s=F.inverseTransformation(r,t[o]);t[o]=F.multiplyTransformation(s,n[o],t[o])}};var g2=qA;var cse={name:"AlphaPipelineStage"};cse.process=function(e,t,n){let i=e.alphaOptions,o=e.model;i.pass=i.pass??o.opaquePass;let r=e.renderStateOptions;i.pass===De.TRANSLUCENT&&(r.cull.enabled=!1,r.depthMask=!1,r.blending=un.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;c(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,ge.FRAGMENT),s.addUniform("float","u_alphaCutoff",ge.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var y2=cse;var lse={name:"BatchTexturePipelineStage"};lse.process=function(e,t,n){let i=e.shaderBuilder,o={},r=e.model,s=r.featureTables[r.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),o.model_featuresLength=function(){return a};let l=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),o.model_batchTexture=function(){return l.batchTexture??l.defaultTexture},i.addUniform("vec4","model_textureStep"),o.model_textureStep=function(){return l.textureStep},l.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return l.textureDimensions}),e.uniformMap=xt(o,e.uniformMap)};var b2=lse;var use={name:"ClassificationPipelineStage"};use.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,ge.BOTH);let o=e.runtimePrimitive;c(o.batchLengths)||xGe(t,o)};function xGe(e,t){let n=$t.getAttributeBySemantic(e,ht.POSITION);if(!c(n))throw new ae("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=c(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=$t.getAttributeBySemantic(e,ht.FEATURE_ID,0);if(!c(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let l=a.typedArray;a.typedArray=void 0;let u=[],f=[0],h=r?i[0]:0,p=l[h],g=0;for(let y=1;y<s;y++){let b=r?i[y]:y,x=l[b];if(x!==p){let A=y-g,E=y;u.push(A),f.push(E),g=E,p=x}}let m=s-g;u.push(m),t.batchLengths=u,t.batchOffsets=f}var x2=use;var T2=`void filterByPassType(inout vec3 positionMC, vec4 featureColor)
{
bool styleTranslucent = (featureColor.a != 1.0);
if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
{
#ifdef HAS_SILHOUETTE
positionMC *= float(model_silhouettePass);
#else
positionMC *= 0.0;
#endif
}
else if (czm_pass != czm_passTranslucent && styleTranslucent)
{
positionMC *= 0.0;
}
}
void cpuStylingStage(inout vec3 positionMC, inout SelectedFeature feature)
{
float show = ceil(feature.color.a);
positionMC *= show;
#if defined(HAS_SELECTED_FEATURE_ID_ATTRIBUTE) && !defined(HAS_CLASSIFICATION)
filterByPassType(positionMC, feature.color);
#endif
}
`;var A2=`void filterByPassType(vec4 featureColor)
{
bool styleTranslucent = (featureColor.a != 1.0);
if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
{
#ifdef HAS_SILHOUETTE
if(!model_silhouettePass) {
discard;
}
#else
discard;
#endif
}
else if (czm_pass != czm_passTranslucent && styleTranslucent)
{
discard;
}
}
void cpuStylingStage(inout czm_modelMaterial material, SelectedFeature feature)
{
vec4 featureColor = feature.color;
if (featureColor.a == 0.0)
{
discard;
}
#if defined(HAS_SELECTED_FEATURE_ID_TEXTURE) && !defined(HAS_CLASSIFICATION)
filterByPassType(featureColor);
#endif
featureColor = czm_gammaCorrect(featureColor);
#ifdef HAS_CLASSIFICATION
material.diffuse = featureColor.rgb * featureColor.a;
#else
float highlight = ceil(model_colorBlend);
material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight);
#endif
material.alpha *= featureColor.a;
}
`;var fse={name:"CPUStylingPipelineStage"};fse.process=function(e,t,n){let i=e.model,o=e.shaderBuilder;o.addVertexLines(T2),o.addFragmentLines(A2),o.addDefine("USE_CPU_STYLING",void 0,ge.BOTH),c(i.color)||(o.addUniform("float",Ab.COLOR_BLEND_UNIFORM_NAME,ge.FRAGMENT),e.uniformMap[Ab.COLOR_BLEND_UNIFORM_NAME]=function(){return kc.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),o.addUniform("bool","model_commandTranslucent",ge.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===De.TRANSLUCENT}};var C2=fse;var dse={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};dse.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};var zg=Object.freeze(dse);var E2=`void customShaderStage(
inout czm_modelVertexOutput vsOutput,
inout ProcessedAttributes attributes,
FeatureIds featureIds,
Metadata metadata,
MetadataClass metadataClass,
MetadataStatistics metadataStatistics
) {
VertexInput vsInput;
initializeInputStruct(vsInput, attributes);
vsInput.featureIds = featureIds;
vsInput.metadata = metadata;
vsInput.metadataClass = metadataClass;
vsInput.metadataStatistics = metadataStatistics;
vertexMain(vsInput, vsOutput);
attributes.positionMC = vsOutput.positionMC;
}
`;var S2=`void customShaderStage(
inout czm_modelMaterial material,
ProcessedAttributes attributes,
FeatureIds featureIds,
Metadata metadata,
MetadataClass metadataClass,
MetadataStatistics metadataStatistics
) {
FragmentInput fsInput;
initializeInputStruct(fsInput, attributes);
fsInput.featureIds = featureIds;
fsInput.metadata = metadata;
fsInput.metadataClass = metadataClass;
fsInput.metadataStatistics = metadataStatistics;
fragmentMain(fsInput, material);
}
`;var w2=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) {
initializeFeatureIds(featureIds, attributes);
initializeFeatureIdAliases(featureIds);
}
`;var v2=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes)
{
initializeFeatureIds(featureIds, attributes);
initializeFeatureIdAliases(featureIds);
setFeatureIdVaryings();
}
`;var Fi={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};Fi.process=function(e,t,n){let i=e.shaderBuilder;TGe(i);let o=e.runtimeNode.node.instances;c(o)&&AGe(e,o,n),CGe(e,t,n),i.addVertexLines(v2),i.addFragmentLines(w2)};function TGe(e){e.addStruct(Fi.STRUCT_ID_FEATURE_IDS_VS,Fi.STRUCT_NAME_FEATURE_IDS,ge.VERTEX),e.addStruct(Fi.STRUCT_ID_FEATURE_IDS_FS,Fi.STRUCT_NAME_FEATURE_IDS,ge.FRAGMENT),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ge.VERTEX),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,ge.FRAGMENT),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ge.VERTEX),e.addFunction(Fi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,Fi.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,ge.FRAGMENT),e.addFunction(Fi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,Fi.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,ge.VERTEX)}function AGe(e,t,n){let i=t.featureIds,o=t.attributes[0].count;for(let r=0;r<i.length;r++){let s=i[r],a=s.positionalLabel;s instanceof An.FeatureIdAttribute?EGe(e,s,a):hse(e,s,a,o,1,n);let l=s.label;c(l)&&mse(e,a,l,ge.BOTH)}}function CGe(e,t,n){let i=t.featureIds,r=$t.getAttributeBySemantic(t,ht.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],l=a.positionalLabel,u=ge.BOTH;a instanceof An.FeatureIdAttribute?SGe(e,a,l):a instanceof An.FeatureIdImplicitRange?hse(e,a,l,r,void 0,n):(wGe(e,a,l,s,n),u=ge.FRAGMENT);let f=a.label;c(f)&&mse(e,l,f,u)}}function EGe(e,t,n){let i=e.shaderBuilder;i.addStructField(Fi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Fi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=`a_${r}${o}`,a=`v_${r}${o}`,l=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[l]),i.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(Fi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function SGe(e,t,n){let i=e.shaderBuilder;i.addStructField(Fi.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(Fi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let o=t.setIndex,r=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${r}${o}));`];i.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function hse(e,t,n,i,o,r){vGe(e,t,i,o,r);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let l=`v_implicit_${n}`;s.addVarying("float",l),s.addStructField(Fi.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(Fi.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(Fi.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${l} = ${a};`]),s.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${l}));`])}function wGe(e,t,n,i,o){let r=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[r]=function(){return a.texture??o.context.defaultTexture};let l=a.channels,u=e.shaderBuilder;u.addStructField(Fi.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",r,ge.FRAGMENT);let h=`v_texCoord_${a.texCoord}`,p=h,g=a.transform;if(c(g)&&!J.equals(g,J.IDENTITY)){let b=`${r}Transform`;u.addUniform("mat3",b,ge.FRAGMENT),s[b]=function(){return g},p=`vec2(${b} * vec3(${h}, 1.0))`}let m=`texture(${r}, ${p}).${l}`,y=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function mse(e,t,n,i){let o=e.shaderBuilder,r=ge.includesVertexShader(i);r&&o.addStructField(Fi.STRUCT_ID_FEATURE_IDS_VS,"int",n),o.addStructField(Fi.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];r&&o.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),o.addFunctionLines(Fi.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function vGe(e,t,n,i,o){let r=e.model,s,a;if(c(t.repeat)){let u=DGe(t,n);s=bt.createVertexBuffer({context:o.context,typedArray:u,usage:Be.STATIC_DRAW}),s.vertexArrayDestroyable=!1,r._pipelineResources.push(s),r.statistics.addBuffer(s,!1)}else a=[t.offset];let l={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:$.FLOAT,strideInBytes:$.getSizeInBytes($.FLOAT),offsetInBytes:0};e.attributes.push(l)}function DGe(e,t){let n=e.offset,i=e.repeat,o=new Float32Array(t);for(let r=0;r<t;r++)o[r]=n+Math.floor(r/i);return o}var Cb=Fi;var D2=`void metadataStage(
out Metadata metadata,
out MetadataClass metadataClass,
out MetadataStatistics metadataStatistics,
ProcessedAttributes attributes
)
{
initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
}
`;var P2=`void metadataStage(
out Metadata metadata,
out MetadataClass metadataClass,
out MetadataStatistics metadataStatistics,
ProcessedAttributes attributes
)
{
initializeMetadata(metadata, metadataClass, metadataStatistics, attributes);
setMetadataVaryings();
}
`;var Ci={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Ci.process=function(e,t,n){let{shaderBuilder:i,model:o}=e,{structuralMetadata:r={},content:s}=o,a=s?.tileset.metadataExtension?.statistics,l=PGe(r.propertyAttributes,t,a),u=OGe(r.propertyTextures,a),f=l.concat(u);MGe(i,f),FGe(i),i.addVertexLines(P2),i.addFragmentLines(D2);for(let h=0;h<l.length;h++){let p=l[h];BGe(e,p)}for(let h=0;h<u.length;h++){let p=u[h];UGe(e,p)}};function PGe(e,t,n){return c(e)?e.flatMap(i=>IGe(i,t,n)):[]}function IGe(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=$t,s=e.class.id,a=n?.classes[s],l=Object.entries(e.properties),u=new Array(l.length);for(let f=0;f<l.length;f++){let[h,p]=l[f],g=i(t,p.attribute),{glslType:m,variableName:y}=o(g);u[f]={metadataVariable:r(h),property:p,type:p.classProperty.type,glslType:m,variableName:y,propertyStatistics:a?.properties[h],shaderDestination:ge.BOTH}}return u}function OGe(e,t){return c(e)?e.flatMap(n=>RGe(n,t)):[]}function RGe(e,t){let{sanitizeGlslIdentifier:n}=$t,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,l])=>l.isGpuCompatible()),s=new Array(r.length);for(let a=0;a<r.length;a++){let[l,u]=r[a];s[a]={metadataVariable:n(l),property:u,type:u.classProperty.type,glslType:u.getGlslType(),propertyStatistics:o?.properties[l],shaderDestination:ge.FRAGMENT}}return s}function MGe(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:l,glslType:u,propertyStatistics:f}=t[a];n.add(u),c(f)&&l!==at.ENUM&&i.add(u)}let o=Ci.METADATA_CLASS_FIELDS;for(let a of n){let l=`${a}MetadataClass`;s(l,a,o)}let r=Ci.METADATA_STATISTICS_FIELDS;for(let a of i){let l=`${a}MetadataStatistics`;s(l,a,r)}function s(a,l,u){e.addStruct(a,a,ge.BOTH);for(let f=0;f<u.length;f++){let{shaderName:h}=u[f],p=u[f].type==="float"?NGe(l):l;e.addStructField(a,p,h)}}}var LGe={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function NGe(e){let t=LGe[e];return c(t)?t:e}function FGe(e){e.addStruct(Ci.STRUCT_ID_METADATA_VS,Ci.STRUCT_NAME_METADATA,ge.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_FS,Ci.STRUCT_NAME_METADATA,ge.FRAGMENT),e.addStruct(Ci.STRUCT_ID_METADATA_CLASS_VS,Ci.STRUCT_NAME_METADATA_CLASS,ge.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_CLASS_FS,Ci.STRUCT_NAME_METADATA_CLASS,ge.FRAGMENT),e.addStruct(Ci.STRUCT_ID_METADATA_STATISTICS_VS,Ci.STRUCT_NAME_METADATA_STATISTICS,ge.VERTEX),e.addStruct(Ci.STRUCT_ID_METADATA_STATISTICS_FS,Ci.STRUCT_NAME_METADATA_STATISTICS,ge.FRAGMENT),e.addFunction(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,Ci.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ge.VERTEX),e.addFunction(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,Ci.FUNCTION_SIGNATURE_INITIALIZE_METADATA,ge.FRAGMENT),e.addFunction(Ci.FUNCTION_ID_SET_METADATA_VARYINGS,Ci.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,ge.VERTEX)}function BGe(e,t){kGe(e,t),pse(e.shaderBuilder,t),_se(e.shaderBuilder,t)}function kGe(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:o,glslType:r}=t,s=yse({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:r,metadataVariable:i,shaderDestination:ge.BOTH,property:o});n.addStructField(Ci.STRUCT_ID_METADATA_VS,r,i),n.addStructField(Ci.STRUCT_ID_METADATA_FS,r,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function UGe(e,t){VGe(e,t),pse(e.shaderBuilder,t),_se(e.shaderBuilder,t)}function VGe(e,t){let{shaderBuilder:n,uniformMap:i}=e,{metadataVariable:o,glslType:r,property:s}=t,{texCoord:a,channels:l,index:u,texture:f,transform:h}=s.textureReader,p=`u_propertyTexture_${u}`;i.hasOwnProperty(p)||(n.addUniform("sampler2D",p,ge.FRAGMENT),i[p]=()=>f),n.addStructField(Ci.STRUCT_ID_METADATA_FS,r,o);let g=`attributes.texCoord_${a}`,m=g;if(c(h)&&!J.equals(h,J.IDENTITY)){let E=`${p}Transform`;n.addUniform("mat3",E,ge.FRAGMENT),i[E]=function(){return h},m=`vec2(${E} * vec3(${g}, 1.0))`}let y=`texture(${p}, ${m}).${l}`,b=s.unpackInShader(y),x=yse({valueExpression:b,renderResources:e,glslType:r,metadataVariable:o,shaderDestination:ge.FRAGMENT,property:s}),A=`metadata.${o} = ${x};`;n.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,[A])}function pse(e,t){let{classProperty:n}=t.property,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=gse(Ci.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(Ci.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,s),ge.includesVertexShader(r)&&(e.addStructField(Ci.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function _se(e,t){let{propertyStatistics:n}=t;if(!c(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===at.ENUM)return;let s=Ci.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,l=gse(s,n,a,r),u=`${r}MetadataStatistics`;e.addStructField(Ci.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_FS,l),ge.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ci.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Ci.FUNCTION_ID_INITIALIZE_METADATA_VS,l))}function gse(e,t,n,i){function o(r){let s=t[r.specName];if(c(s))return`${n}.${r.shaderName} = ${i}(${s});`}return c(t)?e.map(o).filter(c):[]}function yse(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:l,shaderDestination:u}=e;s.addUniform(l,o,u),s.addUniform(l,r,u);let{offset:f,scale:h}=n;return a[o]=()=>f,a[r]=()=>h,`czm_valueTransform(${o}, ${r}, ${t})`}var wd=Ci;var zGe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2},Eb=Object.freeze(zGe);var ra={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:dt};ra.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:l}=s;c(a)&&(e.lightingOptions.lightingModel=a),l===Eb.TRANSLUCENT?r.pass=De.TRANSLUCENT:l===Eb.OPAQUE&&(r.pass=void 0);let u=KGe(s,t);if(!u.customShaderEnabled)return;if(JGe(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,ge.BOTH),c(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,ge.VERTEX),c(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,ge.FRAGMENT);let p=zg.getDefineName(s.mode);i.addDefine(p,void 0,ge.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let g=f[p];i.addUniform(g.type,p)}let h=s.varyings;for(let p in h)if(h.hasOwnProperty(p)){let g=h[p];i.addVarying(g,p)}e.uniformMap=xt(e.uniformMap,s.uniformMap)};function HGe(e){let t={};for(let n=0;n<e.length;n++){let i=$t.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var GGe={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},jGe={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function bse(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=GGe[t],i=jGe[t];if(c(n))return{attributeField:[n,e],value:i}}function WGe(e,t){if(!c(e.vertexShaderText))return{enabled:!1};let n=e.usedVariablesVertex.attributeSet,i=xse(t,n,!1),o=Tse(t,n,!1),r,s=[],a=[];for(let l in i){if(!i.hasOwnProperty(l))continue;let f=[i[l].glslType,l];s.push(f),r=`vsInput.attributes.${l} = attributes.${l};`,a.push(r)}for(let l=0;l<o.length;l++){let u=o[l],f=bse(u);if(!c(f))return ra._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${u}, disabling custom vertex shader`),{enabled:!1};s.push(f.attributeField),r=`vsInput.attributes.${u} = ${f.value};`,a.push(r)}return{enabled:!0,attributeFields:s,initializationLines:a}}function qGe(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function YGe(e,t){if(!c(e.fragmentShaderText))return{enabled:!1};let n=e.usedVariablesFragment.attributeSet,i=xse(t,n,!0),o=Tse(t,n,!0),r,s=[],a=[];for(let u in i){if(!i.hasOwnProperty(u))continue;let h=[i[u].glslType,u];s.push(h),r=`fsInput.attributes.${u} = attributes.${u};`,a.push(r)}for(let u=0;u<o.length;u++){let f=o[u],h=bse(f);if(!c(h))return ra._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${f}, disabling custom fragment shader.`),{enabled:!1};s.push(h.attributeField),r=`fsInput.attributes.${f} = ${h.value};`,a.push(r)}let l=qGe(e);return{enabled:!0,attributeFields:s.concat(l.attributeFields),initializationLines:l.initializationLines.concat(a)}}var XGe={positionWC:!0,positionEC:!0};function xse(e,t,n){let i={};for(let o in e){if(!e.hasOwnProperty(o))continue;let r=e[o],s=o;n&&o==="normalMC"?s="normalEC":n&&o==="tangentMC"&&(s="tangentEC",r.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=r)}return i}function Tse(e,t,n){let i=[];for(let o in t){if(!t.hasOwnProperty(o)||XGe.hasOwnProperty(o))continue;let r=o;n&&o==="normalEC"?r="normalMC":n&&o==="tangentEC"&&(r="tangentMC"),e.hasOwnProperty(r)||i.push(o)}return i}function KGe(e,t){let n=HGe(t.attributes),i=WGe(e,n),o=YGe(e,n),s=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&o.enabled;return{vertexLines:i,fragmentLines:o,customShaderEnabled:i.enabled||o.enabled,shouldComputePositionWC:s}}function $Ge(e,t){let n=ra.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,ra.STRUCT_NAME_ATTRIBUTES,ge.VERTEX);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,l]=i[s];e.addStructField(n,a,l)}n=ra.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,ra.STRUCT_NAME_VERTEX_INPUT,ge.VERTEX),e.addStructField(n,ra.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Cb.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,wd.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,wd.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,wd.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ra.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(r,ra.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,ge.VERTEX),e.addFunctionLines(r,o)}function ZGe(e,t){let n=ra.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,ra.STRUCT_NAME_ATTRIBUTES,ge.FRAGMENT);let{attributeFields:i,initializationLines:o}=t;for(let s=0;s<i.length;s++){let[a,l]=i[s];e.addStructField(n,a,l)}n=ra.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,ra.STRUCT_NAME_FRAGMENT_INPUT,ge.FRAGMENT),e.addStructField(n,ra.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,Cb.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,wd.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,wd.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,wd.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let r=ra.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(r,ra.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,ge.FRAGMENT),e.addFunctionLines(r,o)}var QGe=[];function JGe(e,t,n){let{vertexLines:i,fragmentLines:o}=n,r=QGe;i.enabled&&($Ge(e,i),r.length=0,r.push("#line 0",t.vertexShaderText,E2),e.addVertexLines(r)),o.enabled&&(ZGe(e,o),r.length=0,r.push("#line 0",t.fragmentShaderText,S2),e.addFragmentLines(r))}var I2=ra;var Vv={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};Vv.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=c(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,ge.VERTEX),i.addFunction(Vv.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,Vv.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,ge.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let l=s[a],u=l.quantization;if(!c(u))continue;let f=l.semantic===ht.POSITION,h=l.semantic===ht.TEXCOORD;if(r&&!f&&!h)continue;let p=$t.getAttributeInfo(l);t5e(i,p),e5e(e,p)}};function e5e(e,t){let n=e.shaderBuilder,i=e.uniformMap,o=t.variableName,r=t.attribute.quantization;if(r.octEncoded){let s=`model_normalizationRange_${o}`;n.addUniform("float",s,ge.VERTEX),i[s]=function(){return r.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${o}`,a=`model_quantizedVolumeStepSize_${o}`,l=t.glslType;n.addUniform(l,s,ge.VERTEX),n.addUniform(l,a,ge.VERTEX);let u=r.quantizedVolumeOffset,f=r.quantizedVolumeStepSize;/^color_\d+$/.test(o)&&(u=Ase(u,0),f=Ase(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function Ase(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function t5e(e,t){let n=t.variableName,i=t.attribute.quantization,o;i.octEncoded?o=n5e(n,i):o=i5e(n),e.addFunctionLines(Vv.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[o])}function n5e(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,o=`model_normalizationRange_${e}`,r=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${o})${r};`}function i5e(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,o=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${o};`}var O2=Vv;var R2=`void geometryStage(out ProcessedAttributes attributes)
{
attributes.positionMC = v_positionMC;
attributes.positionEC = v_positionEC;
#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE)
attributes.positionWC = v_positionWC;
#endif
#ifdef HAS_NORMALS
attributes.normalEC = normalize(v_normalEC);
#endif
#ifdef HAS_TANGENTS
attributes.tangentEC = normalize(v_tangentEC);
#endif
#ifdef HAS_BITANGENTS
attributes.bitangentEC = normalize(v_bitangentEC);
#endif
setDynamicVaryings(attributes);
}
`;var M2=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal)
{
vec4 computedPosition;
vec3 positionMC = attributes.positionMC;
v_positionMC = positionMC;
v_positionEC = (modelView * vec4(positionMC, 1.0)).xyz;
#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
vec3 position2D = attributes.position2D;
vec3 positionEC = (u_modelView2D * vec4(position2D, 1.0)).xyz;
computedPosition = czm_projection * vec4(positionEC, 1.0);
#else
computedPosition = czm_projection * vec4(v_positionEC, 1.0);
#endif
#if defined(COMPUTE_POSITION_WC_CUSTOM_SHADER) || defined(COMPUTE_POSITION_WC_STYLE) || defined(COMPUTE_POSITION_WC_ATMOSPHERE) || defined(ENABLE_CLIPPING_POLYGONS)
v_positionWC = (czm_model * vec4(positionMC, 1.0)).xyz;
#endif
#ifdef HAS_NORMALS
v_normalEC = normalize(normal * attributes.normalMC);
#endif
#ifdef HAS_TANGENTS
v_tangentEC = normalize(normal * attributes.tangentMC);
#endif
#ifdef HAS_BITANGENTS
v_bitangentEC = normalize(normal * attributes.bitangentMC);
#endif
setDynamicVaryings(attributes);
return computedPosition;
}
`;var zv=`vec2 computeSt(float featureId)
{
float stepX = model_textureStep.x;
float centerX = model_textureStep.y;
#ifdef MULTILINE_BATCH_TEXTURE
float stepY = model_textureStep.z;
float centerY = model_textureStep.w;
float xId = mod(featureId, model_textureDimensions.x);
float yId = floor(featureId / model_textureDimensions.x);
return vec2(centerX + (xId * stepX), centerY + (yId * stepY));
#else
return vec2(centerX + (featureId * stepX), 0.5);
#endif
}
void selectedFeatureIdStage(out SelectedFeature feature, FeatureIds featureIds)
{
int featureId = featureIds.SELECTED_FEATURE_ID;
if (featureId < model_featuresLength)
{
vec2 featureSt = computeSt(float(featureId));
feature.id = featureId;
feature.st = featureSt;
feature.color = texture(model_batchTexture, featureSt);
}
else
{
feature.id = model_featuresLength + 1;
feature.st = vec2(0.0);
feature.color = vec4(1.0);
}
#ifdef HAS_NULL_FEATURE_ID
if (featureId == model_nullFeatureId) {
feature.id = featureId;
feature.st = vec2(0.0);
feature.color = vec4(1.0);
}
#endif
}
`;var Hv={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};Hv.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=o5e(o,r,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),r5e(i);let l=s.featureIds.nullFeatureId,u=e.uniformMap;c(l)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return l}),s.shaderDestination===ge.BOTH&&i.addVertexLines(zv),i.addFragmentLines(zv)};function Cse(e){return e instanceof An.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Ese(e){return e instanceof An.FeatureIdTexture?ge.FRAGMENT:ge.BOTH}function o5e(e,t,n){let i,o;return c(t.instances)&&(o=$t.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),c(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Ese(o),featureIdDefine:Cse(o)}):(o=$t.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Ese(o),featureIdDefine:Cse(o)})}function r5e(e){e.addStructField(Hv.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(Hv.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(Hv.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Sb=Hv;var ks={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};ks.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(ks.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",ge.VERTEX),i.addStruct(ks.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",ge.FRAGMENT),i.addStruct(Sb.STRUCT_ID_SELECTED_FEATURE,Sb.STRUCT_NAME_SELECTED_FEATURE,ge.BOTH),i.addFunction(ks.FUNCTION_ID_INITIALIZE_ATTRIBUTES,ks.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,ge.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(ks.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(ks.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(ks.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,ks.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,ge.VERTEX),i.addFunction(ks.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,ks.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,ge.FRAGMENT),o.type===Tr.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,ge.FRAGMENT);let r=n.mode!==oe.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=c(e.runtimeNode.node.instances),a=r&&!s,l=t.attributes.length;for(let u=0;u<l;u++){let f=t.attributes[u],h=nn.getAttributeLocationCount(f.type);if(!c(f.buffer)&&!c(f.constant))throw new C("Attributes must be provided as a Buffer or constant value");let p=f.semantic===ht.POSITION,g;h>1?(g=e.attributeIndex,e.attributeIndex+=h):p&&!a?g=0:g=e.attributeIndex++,s5e(e,f,g,h,r,s)}p5e(i,t.attributes),t.primitiveType===Me.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(M2),i.addFragmentLines(R2)};function s5e(e,t,n,i,o,r){let s=e.shaderBuilder,a=$t.getAttributeInfo(t),l=o&&!r;i>1?l5e(e,t,n,i):c5e(e,t,n,l),f5e(s,a,l),u5e(s,a),c(t.semantic)&&a5e(s,t),d5e(s,a,o),h5e(s,a,l),m5e(s,a)}function a5e(e,t){let{semantic:n,setIndex:i}=t;switch(n){case ht.NORMAL:e.addDefine("HAS_NORMALS");break;case ht.TANGENT:e.addDefine("HAS_TANGENTS");break;case ht.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case ht.TEXCOORD:case ht.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function c5e(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:l}=c(o)?o:t;r===ht.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=r===ht.POSITION,f=u?0:n,h=nn.getNumberOfComponents(a),p={index:f,value:c(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:h,componentDatatype:l,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:h,componentDatatype:$.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function l5e(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=c(o)?o:t,u=nn.getNumberOfComponents(s)/i,f=$.getSizeInBytes(a),h=u*f,p=t.byteStride;for(let g=0;g<i;g++){let m=t.byteOffset+g*h,y={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:m,strideInBytes:p,normalize:r};e.attributes.push(y)}}function u5e(e,t){let n=t.variableName,i=`v_${n}`,o;n==="normalMC"?(i="v_normalEC",o=t.glslType):n==="tangentMC"?(o="vec3",i="v_tangentEC"):o=t.glslType,e.addVarying(o,i)}function f5e(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,s;t.isQuantized?(r=`a_quantized_${o}`,s=t.quantizedGlslType):(r=`a_${o}`,s=t.glslType);let a=i===ht.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function d5e(e,t,n){let i=ks.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=ks.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:r,glslType:s}=t;r==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(o,"vec3","tangentEC")):r==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(o,"vec3","normalEC")):(e.addStructField(i,s,r),e.addStructField(o,s,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function h5e(e,t,n){let i=ks.FUNCTION_ID_INITIALIZE_ATTRIBUTES,o=t.variableName;if(o==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];o==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,s)}function m5e(e,t){let{semantic:n,setIndex:i}=t.attribute;if(c(n)&&!c(i))return;let o=ks.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=ks.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function p5e(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===ht.NORMAL?n=!0:r.semantic===ht.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(ks.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(ks.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var L2=ks;var N2=`#ifdef USE_IBL_LIGHTING
vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
{
#if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL)
vec3 viewDirection = -normalize(position);
vec3 iblColor = textureIBL(viewDirection, normal, material);
return iblColor;
#endif
return vec3(0.0);
}
#endif
#ifdef USE_CLEARCOAT
vec3 addClearcoatReflection(vec3 baseLayerColor, vec3 position, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material)
{
vec3 viewDirection = -normalize(position);
vec3 halfwayDirection = normalize(viewDirection + lightDirection);
vec3 normal = material.clearcoatNormal;
float NdotL = clamp(dot(normal, lightDirection), 0.001, 1.0);
vec3 f0 = vec3(0.04);
vec3 f90 = vec3(1.0);
float NdotV = clamp(dot(normal, viewDirection), 0.0, 1.0);
vec3 F = fresnelSchlick2(f0, f90, NdotV);
float roughness = material.clearcoatRoughness;
float alphaRoughness = roughness * roughness;
float directStrength = computeDirectSpecularStrength(normal, lightDirection, viewDirection, halfwayDirection, alphaRoughness);
vec3 directReflection = F * directStrength * NdotL;
vec3 color = lightColorHdr * directReflection;
#ifdef SPECULAR_IBL
vec3 reflectMC = normalize(model_iblReferenceFrameMatrix * reflect(-viewDirection, normal));
vec3 iblColor = computeSpecularIBL(reflectMC, NdotV, f0, roughness);
color += iblColor * material.occlusion;
#endif
float clearcoatFactor = material.clearcoatFactor;
vec3 clearcoatColor = color * clearcoatFactor;
return baseLayerColor * (1.0 - clearcoatFactor * F) + clearcoatColor;
}
#endif
#if defined(LIGHTING_PBR) && defined(HAS_NORMALS)
vec3 computePbrLighting(in czm_modelMaterial material, in vec3 position)
{
#ifdef USE_CUSTOM_LIGHT_COLOR
vec3 lightColorHdr = model_lightColorHdr;
#else
vec3 lightColorHdr = czm_lightColorHdr;
#endif
vec3 viewDirection = -normalize(position);
vec3 normal = material.normalEC;
vec3 lightDirection = normalize(czm_lightDirectionEC);
vec3 directLighting = czm_pbrLighting(viewDirection, normal, lightDirection, material);
vec3 directColor = lightColorHdr * directLighting;
vec3 color = directColor + material.emissive;
#ifdef USE_IBL_LIGHTING
color += computeIBL(position, normal, lightDirection, lightColorHdr, material);
#endif
#ifdef USE_CLEARCOAT
color = addClearcoatReflection(color, position, lightDirection, lightColorHdr, material);
#endif
return color;
}
#endif
void lightingStage(inout czm_modelMaterial material, ProcessedAttributes attributes)
{
#ifdef LIGHTING_PBR
#ifdef HAS_NORMALS
vec3 color = computePbrLighting(material, attributes.positionEC);
#else
vec3 color = material.diffuse * material.occlusion + material.emissive;
#endif
#ifndef HDR
color = czm_pbrNeutralTonemapping(color);
#endif
#else // unlit
vec3 color = material.diffuse;
#endif
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
color = czm_gammaCorrect(color);
#elif !defined(HDR)
color = czm_linearToSrgb(color);
#endif
material.diffuse = color;
}
`;var _5e={UNLIT:0,PBR:1},Up=Object.freeze(_5e);var Sse={name:"LightingPipelineStage"};Sse.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(c(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,ge.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",ge.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===Up.PBR?o.addDefine("LIGHTING_PBR",void 0,ge.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,ge.FRAGMENT),o.addFragmentLines(N2)};var F2=Sse;var B2=`bool isDefaultStyleColor(vec3 color)
{
return all(greaterThan(color, vec3(1.0 - czm_epsilon3)));
}
vec3 blend(vec3 sourceColor, vec3 styleColor, float styleColorBlend)
{
vec3 blendColor = mix(sourceColor, styleColor, styleColorBlend);
vec3 color = isDefaultStyleColor(styleColor.rgb) ? sourceColor : blendColor;
return color;
}
vec2 computeTextureTransform(vec2 texCoord, mat3 textureTransform)
{
return vec2(textureTransform * vec3(texCoord, 1.0));
}
#ifdef HAS_NORMAL_TEXTURE
vec2 getNormalTexCoords()
{
vec2 texCoord = TEXCOORD_NORMAL;
#ifdef HAS_NORMAL_TEXTURE_TRANSFORM
texCoord = vec2(u_normalTextureTransform * vec3(texCoord, 1.0));
#endif
return texCoord;
}
#endif
#if defined(HAS_NORMAL_TEXTURE) || defined(HAS_CLEARCOAT_NORMAL_TEXTURE)
vec3 computeTangent(in vec3 position, in vec2 normalTexCoords)
{
vec2 tex_dx = dFdx(normalTexCoords);
vec2 tex_dy = dFdy(normalTexCoords);
float determinant = tex_dx.x * tex_dy.y - tex_dy.x * tex_dx.y;
vec3 tangent = tex_dy.t * dFdx(position) - tex_dx.t * dFdy(position);
return tangent / determinant;
}
#endif
#ifdef USE_ANISOTROPY
struct NormalInfo {
vec3 tangent;
vec3 bitangent;
vec3 normal;
vec3 geometryNormal;
};
NormalInfo getNormalInfo(ProcessedAttributes attributes)
{
vec3 geometryNormal = attributes.normalEC;
#ifdef HAS_NORMAL_TEXTURE
vec2 normalTexCoords = getNormalTexCoords();
#endif
#ifdef HAS_BITANGENTS
vec3 tangent = attributes.tangentEC;
vec3 bitangent = attributes.bitangentEC;
#else // Assume HAS_NORMAL_TEXTURE
vec3 tangent = computeTangent(attributes.positionEC, normalTexCoords);
tangent = normalize(tangent - geometryNormal * dot(geometryNormal, tangent));
vec3 bitangent = normalize(cross(geometryNormal, tangent));
#endif
#ifdef HAS_NORMAL_TEXTURE
mat3 tbn = mat3(tangent, bitangent, geometryNormal);
vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb;
normalSample = 2.0 * normalSample - 1.0;
#ifdef HAS_NORMAL_TEXTURE_SCALE
normalSample.xy *= u_normalTextureScale;
#endif
vec3 normal = normalize(tbn * normalSample);
#else
vec3 normal = geometryNormal;
#endif
#ifdef HAS_DOUBLE_SIDED_MATERIAL
if (czm_backFacing()) {
tangent *= -1.0;
bitangent *= -1.0;
normal *= -1.0;
geometryNormal *= -1.0;
}
#endif
NormalInfo normalInfo;
normalInfo.tangent = tangent;
normalInfo.bitangent = bitangent;
normalInfo.normal = normal;
normalInfo.geometryNormal = geometryNormal;
return normalInfo;
}
#endif
#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
vec3 getNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
{
vec2 normalTexCoords = getNormalTexCoords();
#ifdef HAS_BITANGENTS
vec3 t = attributes.tangentEC;
vec3 b = attributes.bitangentEC;
#else
vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
t = normalize(t - geometryNormal * dot(geometryNormal, t));
vec3 b = normalize(cross(geometryNormal, t));
#endif
mat3 tbn = mat3(t, b, geometryNormal);
vec3 normalSample = texture(u_normalTexture, normalTexCoords).rgb;
normalSample = 2.0 * normalSample - 1.0;
#ifdef HAS_NORMAL_TEXTURE_SCALE
normalSample.xy *= u_normalTextureScale;
#endif
return normalize(tbn * normalSample);
}
#endif
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
vec3 getClearcoatNormalFromTexture(ProcessedAttributes attributes, vec3 geometryNormal)
{
vec2 normalTexCoords = TEXCOORD_CLEARCOAT_NORMAL;
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_TRANSFORM
normalTexCoords = vec2(u_clearcoatNormalTextureTransform * vec3(normalTexCoords, 1.0));
#endif
#ifdef HAS_BITANGENTS
vec3 t = attributes.tangentEC;
vec3 b = attributes.bitangentEC;
#else
vec3 t = computeTangent(attributes.positionEC, normalTexCoords);
t = normalize(t - geometryNormal * dot(geometryNormal, t));
vec3 b = normalize(cross(geometryNormal, t));
#endif
mat3 tbn = mat3(t, b, geometryNormal);
vec3 normalSample = texture(u_clearcoatNormalTexture, normalTexCoords).rgb;
normalSample = 2.0 * normalSample - 1.0;
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE_SCALE
normalSample.xy *= u_clearcoatNormalTextureScale;
#endif
return normalize(tbn * normalSample);
}
#endif
#ifdef HAS_NORMALS
vec3 computeNormal(ProcessedAttributes attributes)
{
vec3 normal = attributes.normalEC;
#if defined(HAS_NORMAL_TEXTURE) && !defined(HAS_WIREFRAME)
normal = getNormalFromTexture(attributes, normal);
#endif
#ifdef HAS_DOUBLE_SIDED_MATERIAL
if (czm_backFacing()) {
normal = -normal;
}
#endif
return normal;
}
#endif
#ifdef HAS_BASE_COLOR_TEXTURE
vec4 getBaseColorFromTexture()
{
vec2 baseColorTexCoords = TEXCOORD_BASE_COLOR;
#ifdef HAS_BASE_COLOR_TEXTURE_TRANSFORM
baseColorTexCoords = computeTextureTransform(baseColorTexCoords, u_baseColorTextureTransform);
#endif
vec4 baseColorWithAlpha = czm_srgbToLinear(texture(u_baseColorTexture, baseColorTexCoords));
#ifdef HAS_BASE_COLOR_FACTOR
baseColorWithAlpha *= u_baseColorFactor;
#endif
return baseColorWithAlpha;
}
#endif
#ifdef HAS_EMISSIVE_TEXTURE
vec3 getEmissiveFromTexture()
{
vec2 emissiveTexCoords = TEXCOORD_EMISSIVE;
#ifdef HAS_EMISSIVE_TEXTURE_TRANSFORM
emissiveTexCoords = computeTextureTransform(emissiveTexCoords, u_emissiveTextureTransform);
#endif
vec3 emissive = czm_srgbToLinear(texture(u_emissiveTexture, emissiveTexCoords).rgb);
#ifdef HAS_EMISSIVE_FACTOR
emissive *= u_emissiveFactor;
#endif
return emissive;
}
#endif
#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
void setSpecularGlossiness(inout czm_modelMaterial material)
{
#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE
vec2 specularGlossinessTexCoords = TEXCOORD_SPECULAR_GLOSSINESS;
#ifdef HAS_SPECULAR_GLOSSINESS_TEXTURE_TRANSFORM
specularGlossinessTexCoords = computeTextureTransform(specularGlossinessTexCoords, u_specularGlossinessTextureTransform);
#endif
vec4 specularGlossiness = czm_srgbToLinear(texture(u_specularGlossinessTexture, specularGlossinessTexCoords));
vec3 specular = specularGlossiness.rgb;
float glossiness = specularGlossiness.a;
#ifdef HAS_LEGACY_SPECULAR_FACTOR
specular *= u_legacySpecularFactor;
#endif
#ifdef HAS_GLOSSINESS_FACTOR
glossiness *= u_glossinessFactor;
#endif
#else
#ifdef HAS_LEGACY_SPECULAR_FACTOR
vec3 specular = clamp(u_legacySpecularFactor, vec3(0.0), vec3(1.0));
#else
vec3 specular = vec3(1.0);
#endif
#ifdef HAS_GLOSSINESS_FACTOR
float glossiness = clamp(u_glossinessFactor, 0.0, 1.0);
#else
float glossiness = 1.0;
#endif
#endif
#ifdef HAS_DIFFUSE_TEXTURE
vec2 diffuseTexCoords = TEXCOORD_DIFFUSE;
#ifdef HAS_DIFFUSE_TEXTURE_TRANSFORM
diffuseTexCoords = computeTextureTransform(diffuseTexCoords, u_diffuseTextureTransform);
#endif
vec4 diffuse = czm_srgbToLinear(texture(u_diffuseTexture, diffuseTexCoords));
#ifdef HAS_DIFFUSE_FACTOR
diffuse *= u_diffuseFactor;
#endif
#elif defined(HAS_DIFFUSE_FACTOR)
vec4 diffuse = clamp(u_diffuseFactor, vec4(0.0), vec4(1.0));
#else
vec4 diffuse = vec4(1.0);
#endif
material.diffuse = diffuse.rgb * (1.0 - czm_maximumComponent(specular));
material.alpha = diffuse.a;
material.specular = specular;
material.roughness = 1.0 - glossiness;
}
#elif defined(LIGHTING_PBR)
float setMetallicRoughness(inout czm_modelMaterial material)
{
#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE
vec2 metallicRoughnessTexCoords = TEXCOORD_METALLIC_ROUGHNESS;
#ifdef HAS_METALLIC_ROUGHNESS_TEXTURE_TRANSFORM
metallicRoughnessTexCoords = computeTextureTransform(metallicRoughnessTexCoords, u_metallicRoughnessTextureTransform);
#endif
vec3 metallicRoughness = texture(u_metallicRoughnessTexture, metallicRoughnessTexCoords).rgb;
float metalness = clamp(metallicRoughness.b, 0.0, 1.0);
float roughness = clamp(metallicRoughness.g, 0.0, 1.0);
#ifdef HAS_METALLIC_FACTOR
metalness = clamp(metalness * u_metallicFactor, 0.0, 1.0);
#endif
#ifdef HAS_ROUGHNESS_FACTOR
roughness = clamp(roughness * u_roughnessFactor, 0.0, 1.0);
#endif
#else
#ifdef HAS_METALLIC_FACTOR
float metalness = clamp(u_metallicFactor, 0.0, 1.0);
#else
float metalness = 1.0;
#endif
#ifdef HAS_ROUGHNESS_FACTOR
float roughness = clamp(u_roughnessFactor, 0.0, 1.0);
#else
float roughness = 1.0;
#endif
#endif
const vec3 REFLECTANCE_DIELECTRIC = vec3(0.04);
vec3 f0 = mix(REFLECTANCE_DIELECTRIC, material.baseColor.rgb, metalness);
material.specular = f0;
material.diffuse = mix(material.baseColor.rgb, vec3(0.0), metalness);
material.roughness = roughness;
return metalness;
}
#ifdef USE_SPECULAR
void setSpecular(inout czm_modelMaterial material, in float metalness)
{
#ifdef HAS_SPECULAR_TEXTURE
vec2 specularTexCoords = TEXCOORD_SPECULAR;
#ifdef HAS_SPECULAR_TEXTURE_TRANSFORM
specularTexCoords = computeTextureTransform(specularTexCoords, u_specularTextureTransform);
#endif
float specularWeight = texture(u_specularTexture, specularTexCoords).a;
#ifdef HAS_SPECULAR_FACTOR
specularWeight *= u_specularFactor;
#endif
#else
#ifdef HAS_SPECULAR_FACTOR
float specularWeight = u_specularFactor;
#else
float specularWeight = 1.0;
#endif
#endif
#ifdef HAS_SPECULAR_COLOR_TEXTURE
vec2 specularColorTexCoords = TEXCOORD_SPECULAR_COLOR;
#ifdef HAS_SPECULAR_COLOR_TEXTURE_TRANSFORM
specularColorTexCoords = computeTextureTransform(specularColorTexCoords, u_specularColorTextureTransform);
#endif
vec3 specularColorSample = texture(u_specularColorTexture, specularColorTexCoords).rgb;
vec3 specularColorFactor = czm_srgbToLinear(specularColorSample);
#ifdef HAS_SPECULAR_COLOR_FACTOR
specularColorFactor *= u_specularColorFactor;
#endif
#else
#ifdef HAS_SPECULAR_COLOR_FACTOR
vec3 specularColorFactor = u_specularColorFactor;
#else
vec3 specularColorFactor = vec3(1.0);
#endif
#endif
material.specularWeight = specularWeight;
vec3 f0 = material.specular;
vec3 dielectricSpecularF0 = min(f0 * specularColorFactor, vec3(1.0));
material.specular = mix(dielectricSpecularF0, material.baseColor.rgb, metalness);
}
#endif
#ifdef USE_ANISOTROPY
void setAnisotropy(inout czm_modelMaterial material, in NormalInfo normalInfo)
{
mat2 rotation = mat2(u_anisotropy.xy, -u_anisotropy.y, u_anisotropy.x);
float anisotropyStrength = u_anisotropy.z;
vec2 direction = vec2(1.0, 0.0);
#ifdef HAS_ANISOTROPY_TEXTURE
vec2 anisotropyTexCoords = TEXCOORD_ANISOTROPY;
#ifdef HAS_ANISOTROPY_TEXTURE_TRANSFORM
anisotropyTexCoords = computeTextureTransform(anisotropyTexCoords, u_anisotropyTextureTransform);
#endif
vec3 anisotropySample = texture(u_anisotropyTexture, anisotropyTexCoords).rgb;
direction = anisotropySample.rg * 2.0 - vec2(1.0);
anisotropyStrength *= anisotropySample.b;
#endif
direction = rotation * direction;
mat3 tbn = mat3(normalInfo.tangent, normalInfo.bitangent, normalInfo.normal);
vec3 anisotropicT = tbn * normalize(vec3(direction, 0.0));
vec3 anisotropicB = cross(normalInfo.geometryNormal, anisotropicT);
material.anisotropicT = anisotropicT;
material.anisotropicB = anisotropicB;
material.anisotropyStrength = anisotropyStrength;
}
#endif
#ifdef USE_CLEARCOAT
void setClearcoat(inout czm_modelMaterial material, in ProcessedAttributes attributes)
{
#ifdef HAS_CLEARCOAT_TEXTURE
vec2 clearcoatTexCoords = TEXCOORD_CLEARCOAT;
#ifdef HAS_CLEARCOAT_TEXTURE_TRANSFORM
clearcoatTexCoords = computeTextureTransform(clearcoatTexCoords, u_clearcoatTextureTransform);
#endif
float clearcoatFactor = texture(u_clearcoatTexture, clearcoatTexCoords).r;
#ifdef HAS_CLEARCOAT_FACTOR
clearcoatFactor *= u_clearcoatFactor;
#endif
#else
#ifdef HAS_CLEARCOAT_FACTOR
float clearcoatFactor = u_clearcoatFactor;
#else
float clearcoatFactor = 0.0;
#endif
#endif
#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE
vec2 clearcoatRoughnessTexCoords = TEXCOORD_CLEARCOAT_ROUGHNESS;
#ifdef HAS_CLEARCOAT_ROUGHNESS_TEXTURE_TRANSFORM
clearcoatRoughnessTexCoords = computeTextureTransform(clearcoatRoughnessTexCoords, u_clearcoatRoughnessTextureTransform);
#endif
float clearcoatRoughness = texture(u_clearcoatRoughnessTexture, clearcoatRoughnessTexCoords).g;
#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
clearcoatRoughness *= u_clearcoatRoughnessFactor;
#endif
#else
#ifdef HAS_CLEARCOAT_ROUGHNESS_FACTOR
float clearcoatRoughness = u_clearcoatRoughnessFactor;
#else
float clearcoatRoughness = 0.0;
#endif
#endif
material.clearcoatFactor = clearcoatFactor;
material.clearcoatRoughness = clearcoatRoughness;
#ifdef HAS_CLEARCOAT_NORMAL_TEXTURE
material.clearcoatNormal = getClearcoatNormalFromTexture(attributes, attributes.normalEC);
#else
material.clearcoatNormal = attributes.normalEC;
#endif
}
#endif
#endif
void materialStage(inout czm_modelMaterial material, ProcessedAttributes attributes, SelectedFeature feature)
{
#ifdef USE_ANISOTROPY
NormalInfo normalInfo = getNormalInfo(attributes);
material.normalEC = normalInfo.normal;
#elif defined(HAS_NORMALS)
material.normalEC = computeNormal(attributes);
#endif
vec4 baseColorWithAlpha = vec4(1.0);
#ifdef HAS_BASE_COLOR_TEXTURE
baseColorWithAlpha = getBaseColorFromTexture();
#elif defined(HAS_BASE_COLOR_FACTOR)
baseColorWithAlpha = u_baseColorFactor;
#endif
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
baseColorWithAlpha = v_pointCloudColor;
#elif defined(HAS_COLOR_0)
vec4 color = attributes.color_0;
#ifdef HAS_SRGB_COLOR
color = czm_srgbToLinear(color);
#endif
baseColorWithAlpha *= color;
#endif
#ifdef USE_CPU_STYLING
baseColorWithAlpha.rgb = blend(baseColorWithAlpha.rgb, feature.color.rgb, model_colorBlend);
#endif
material.baseColor = baseColorWithAlpha;
material.diffuse = baseColorWithAlpha.rgb;
material.alpha = baseColorWithAlpha.a;
#ifdef HAS_OCCLUSION_TEXTURE
vec2 occlusionTexCoords = TEXCOORD_OCCLUSION;
#ifdef HAS_OCCLUSION_TEXTURE_TRANSFORM
occlusionTexCoords = computeTextureTransform(occlusionTexCoords, u_occlusionTextureTransform);
#endif
material.occlusion = texture(u_occlusionTexture, occlusionTexCoords).r;
#endif
#ifdef HAS_EMISSIVE_TEXTURE
material.emissive = getEmissiveFromTexture();
#elif defined(HAS_EMISSIVE_FACTOR)
material.emissive = u_emissiveFactor;
#endif
#if defined(LIGHTING_PBR) && defined(USE_SPECULAR_GLOSSINESS)
setSpecularGlossiness(material);
#elif defined(LIGHTING_PBR)
float metalness = setMetallicRoughness(material);
#ifdef USE_SPECULAR
setSpecular(material, metalness);
#endif
#ifdef USE_ANISOTROPY
setAnisotropy(material, normalInfo);
#endif
#ifdef USE_CLEARCOAT
setClearcoat(material, attributes);
#endif
#endif
}
`;var{Material:g5e,MetallicRoughness:v9,SpecularGlossiness:D9,Specular:wse,Clearcoat:vse}=An,Dse={name:"MaterialPipelineStage",_processTexture:Sl,_processTextureTransform:Pse};Dse.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e,a=c(o.classificationType),l=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:h}=n.context;b5e(i,r,s,u,f,h,l),c(i.specularGlossiness)?x5e(i.specularGlossiness,r,s,u,l):(c(i.specular)&&$t.supportedExtensions.KHR_materials_specular&&T5e(i.specular,r,s,u,l),c(i.anisotropy)&&$t.supportedExtensions.KHR_materials_anisotropy&&C5e(i.anisotropy,r,s,u,l),c(i.clearcoat)&&$t.supportedExtensions.KHR_materials_clearcoat&&E5e(i.clearcoat,r,s,u,l),S5e(i.metallicRoughness,r,s,u,l));let p=$t.getAttributeBySemantic(t,ht.NORMAL),g=e.lightingOptions;i.unlit||!p||a?g.lightingModel=Up.UNLIT:g.lightingModel=Up.PBR;let m=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=m;let y=e.alphaOptions;i.alphaMode===Ip.BLEND?y.pass=De.TRANSLUCENT:i.alphaMode===Ip.MASK&&(y.alphaCutoff=i.alphaCutoff),s.addFragmentLines(B2),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,ge.BOTH)};function Pse(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,ge.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,ge.FRAGMENT),t[s]=function(){return n.transform}}function y5e(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,ge.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,ge.FRAGMENT),t[s]=function(){return n.scale}}function Sl(e,t,n,i,o,r){e.addUniform("sampler2D",i,ge.FRAGMENT),t[i]=function(){return n.texture??r};let s=`HAS_${o}_TEXTURE`;e.addDefine(s,void 0,ge.FRAGMENT);let l=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${o}`;e.addDefine(u,l,ge.FRAGMENT);let f=n.transform;c(f)&&!J.equals(f,J.IDENTITY)&&Pse(e,t,n,i,o);let{scale:h}=n;c(h)&&h!==1&&y5e(e,t,n,i,o)}function b5e(e,t,n,i,o,r,s){let{emissiveFactor:a,emissiveTexture:l,normalTexture:u,occlusionTexture:f}=e;c(a)&&!d.equals(a,g5e.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",ge.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,ge.FRAGMENT),c(l)&&!s&&Sl(n,t,l,"u_emissiveTexture","EMISSIVE",r)),c(u)&&!s&&Sl(n,t,u,"u_normalTexture","NORMAL",o),c(f)&&!s&&Sl(n,t,f,"u_occlusionTexture","OCCLUSION",i)}function x5e(e,t,n,i,o){let{diffuseTexture:r,diffuseFactor:s,specularGlossinessTexture:a,specularFactor:l,glossinessFactor:u}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,ge.FRAGMENT),c(r)&&!o&&Sl(n,t,r,"u_diffuseTexture","DIFFUSE",i),c(s)&&!se.equals(s,D9.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",ge.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,ge.FRAGMENT)),c(a)&&!o&&Sl(n,t,a,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),c(l)&&!d.equals(l,D9.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",ge.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,ge.FRAGMENT)),c(u)&&u!==D9.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",ge.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,ge.FRAGMENT))}function T5e(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:l}=e;n.addDefine("USE_SPECULAR",void 0,ge.FRAGMENT),c(r)&&!o&&Sl(n,t,r,"u_specularTexture","SPECULAR",i),c(s)&&s!==wse.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",ge.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,ge.FRAGMENT)),c(a)&&!o&&Sl(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),c(l)&&!d.equals(l,wse.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",ge.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,ge.FRAGMENT))}var A5e=new d;function C5e(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,ge.FRAGMENT),c(a)&&!o&&Sl(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let l=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",ge.FRAGMENT),t.u_anisotropy=function(){return d.fromElements(l,u,r,A5e)}}function E5e(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:l,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,ge.FRAGMENT),c(r)&&r!==vse.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",ge.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,ge.FRAGMENT)),c(s)&&!o&&Sl(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),c(a)&&r!==vse.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",ge.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,ge.FRAGMENT)),c(l)&&!o&&Sl(n,t,l,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),c(u)&&!o&&Sl(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function S5e(e,t,n,i,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,ge.FRAGMENT);let r=e.baseColorTexture;c(r)&&!o&&Sl(n,t,r,"u_baseColorTexture","BASE_COLOR",i);let s=e.baseColorFactor;c(s)&&!se.equals(s,v9.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",ge.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,ge.FRAGMENT));let a=e.metallicRoughnessTexture;c(a)&&!o&&Sl(n,t,a,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let l=e.metallicFactor;c(l)&&l!==v9.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",ge.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,ge.FRAGMENT));let u=e.roughnessFactor;c(u)&&u!==v9.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",ge.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,ge.FRAGMENT))}var k2=Dse;var zc={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};zc.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(zc.METADATA_PICKING_VALUE_TYPE,"float",ge.FRAGMENT),i.addDefine(zc.METADATA_PICKING_VALUE_STRING,"0.0",ge.FRAGMENT),i.addDefine(zc.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",ge.FRAGMENT),i.addDefine(zc.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",ge.FRAGMENT),i.addDefine(zc.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",ge.FRAGMENT),i.addDefine(zc.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",ge.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",ge.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${zc.METADATA_PICKING_VALUE_TYPE} value = ${zc.METADATA_PICKING_VALUE_TYPE}(${zc.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${zc.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${zc.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${zc.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${zc.METADATA_PICKING_VALUE_COMPONENT_W};`],ge.FRAGMENT)};var yf=zc;var U2=`void morphTargetsStage(inout ProcessedAttributes attributes)
{
vec3 positionMC = attributes.positionMC;
attributes.positionMC = getMorphedPosition(positionMC);
#ifdef HAS_NORMALS
vec3 normalMC = attributes.normalMC;
attributes.normalMC = getMorphedNormal(normalMC);
#endif
#ifdef HAS_TANGENTS
vec3 tangentMC = attributes.tangentMC;
attributes.tangentMC = getMorphedTangent(tangentMC);
#endif
}
`;var Da={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Da.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,ge.VERTEX),O5e(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let l=t.morphTargets[a].attributes,u=l.length;for(let f=0;f<u;f++){let h=l[f],p=h.semantic;p!==ht.POSITION&&p!==ht.NORMAL&&p!==ht.TANGENT||(v5e(e,h,e.attributeIndex,a),e.attributeIndex++)}}R5e(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,ge.VERTEX),n.addVertexLines(U2);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=xt(s,e.uniformMap)};var w5e={attributeString:void 0,functionId:void 0};function v5e(e,t,n,i){let o=e.shaderBuilder;D5e(e,t,n);let r=P5e(t,w5e);I5e(o,r,i)}function D5e(e,t,n){let i={index:n,value:c(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:nn.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function P5e(e,t){switch(e.semantic){case ht.POSITION:t.attributeString="Position",t.functionId=Da.FUNCTION_ID_GET_MORPHED_POSITION;break;case ht.NORMAL:t.attributeString="Normal",t.functionId=Da.FUNCTION_ID_GET_MORPHED_NORMAL;break;case ht.TANGENT:t.attributeString="Tangent",t.functionId=Da.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function I5e(e,t,n){let i=t.attributeString,o=`a_target${i}_${n}`,r=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",o),e.addFunctionLines(t.functionId,[r])}function O5e(e){e.addFunction(Da.FUNCTION_ID_GET_MORPHED_POSITION,Da.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,ge.VERTEX),e.addFunctionLines(Da.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Da.FUNCTION_ID_GET_MORPHED_NORMAL,Da.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,ge.VERTEX),e.addFunctionLines(Da.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Da.FUNCTION_ID_GET_MORPHED_TANGENT,Da.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,ge.VERTEX),e.addFunctionLines(Da.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function R5e(e){e.addFunctionLines(Da.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Da.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Da.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var V2=Da;var Ise={name:"PickingPipelineStage"};Ise.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,s=e.model,a=o.node.instances;if(e.hasPropertyTable)M5e(e,t,a,i);else if(c(a))L5e(e,i);else{let l=Ose(e),u=i.createPickId(l);s._pipelineResources.push(u),s._pickIds.push(u),r.addUniform("vec4","czm_pickColor",ge.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor"}};function Ose(e,t){let n=e.model;if(c(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(Tr.is3DTiles(n.type)){let r=n.content;o={content:r,primitive:r.tileset,detail:i}}else o={primitive:n,detail:i};return o.id=n.id,c(t)&&(o.instanceId=t),o}function M5e(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;c(i.featureTableId)?o=i.featureTableId:c(n)?(r=$t.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=$t.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let l=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",ge.FRAGMENT);let f=l.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))"}function L5e(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let h=0;h<n;h++){let p=Ose(e,h),g=t.createPickId(p);s.push(g),i[h]=g;let m=g.color;o[h*4+0]=G.floatToByte(m.red),o[h*4+1]=G.floatToByte(m.green),o[h*4+2]=G.floatToByte(m.blue),o[h*4+3]=G.floatToByte(m.alpha)}r._pickIds=i;let a=bt.createVertexBuffer({context:t,typedArray:o,usage:Be.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:$.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,ge.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor"}var z2=Ise;var N5e={ADD:0,REPLACE:1},Yo=Object.freeze(N5e);var H2=`float getPointSizeFromAttenuation(vec3 positionEC) {
float pointSize = model_pointCloudParameters.x;
float geometricError = model_pointCloudParameters.y;
float depthMultiplier = model_pointCloudParameters.z;
float depth = -positionEC.z;
return min((geometricError / depth) * depthMultiplier, pointSize);
}
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
float pointCloudShowStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
float tiles3d_tileset_time = model_pointCloudParameters.w;
return float(getShowFromStyle(attributes, metadata, tiles3d_tileset_time));
}
#endif
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
vec4 pointCloudColorStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
float tiles3d_tileset_time = model_pointCloudParameters.w;
return getColorFromStyle(attributes, metadata, tiles3d_tileset_time);
}
#endif
#ifdef HAS_POINT_CLOUD_POINT_SIZE_STYLE
float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
float tiles3d_tileset_time = model_pointCloudParameters.w;
return float(getPointSizeFromStyle(attributes, metadata, tiles3d_tileset_time));
}
#elif defined(HAS_POINT_CLOUD_ATTENUATION)
float pointCloudPointSizeStylingStage(in ProcessedAttributes attributes, in Metadata metadata) {
return getPointSizeFromAttenuation(v_positionEC);
}
#endif
#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
float pointCloudBackFaceCullingStage() {
#if defined(HAS_NORMALS) && !defined(HAS_DOUBLE_SIDED_MATERIAL)
return step(-v_normalEC.z, 0.0);
#else
return 1.0;
#endif
}
#endif
`;var F5e=new se,Mse={name:"PointCloudStylingPipelineStage"};Mse.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=c(s)?s.propertyAttributes:void 0,l=c(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,u=!c(a)&&l;if(c(r)&&!u){let y=V5e(a),b=z5e(r,y);H5e(i,b);let A=G5e(b).indexOf("normalMC")>=0,E=$t.getAttributeBySemantic(t,ht.NORMAL);if(A&&!E)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,ge.VERTEX),b.styleTranslucent&&(e.alphaOptions.pass=De.TRANSLUCENT)}let f=o.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,ge.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,ge.VERTEX);let h,p,g;Tr.is3DTiles(o.type)&&(p=!0,h=o.content,g=h.tile.refine===Yo.ADD),i.addUniform("vec4","model_pointCloudParameters",ge.VERTEX),i.addVertexLines(H2);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=F5e,b=1;p&&(b=g?5:h.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??b,y.x*=n.pixelRatio;let x=B5e(e,t,f,h);y.y=x*f.geometricErrorScale;let A=n.context,E=n.camera.frustum,S;return n.mode===oe.SCENE2D||E instanceof on?S=Number.POSITIVE_INFINITY:S=A.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=S,p&&(y.w=h.tileset.timeSinceLoad),y}};var Rse=new d;function B5e(e,t,n,i){if(c(i)){let f=i.tile.geometricError;if(f>0)return f}if(c(n.baseResolution))return n.baseResolution;let o=$t.getAttributeBySemantic(t,ht.POSITION),r=o.count,s=e.runtimeNode.transform,a=d.subtract(o.max,o.min,Rse);a=F.multiplyByPointAsVector(s,a,Rse);let l=a.x*a.y*a.z;return O.cbrt(l/r)}var k5e={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},U5e={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function V5e(e){let t=We(U5e);if(!c(e))return t;for(let n=0;n<e.length;n++){let o=e[n].properties;for(let r in o)o.hasOwnProperty(r)&&(t[r]=`metadata.${r}`)}return t}var P9="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function z5e(e,t){let n=k5e,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${P9})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${P9})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${P9})`,t,i),n.styleTranslucent=c(n.colorStyleFunction)&&i.translucent,n}function H5e(e,t){let n=t.colorStyleFunction;c(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,ge.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;c(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,ge.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;c(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,ge.VERTEX),e.addVertexLines(o))}function I9(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function G5e(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return c(t)&&I9(t,o),c(n)&&I9(n,o),c(i)&&I9(i,o),o}var G2=Mse;var j2=`void primitiveOutlineStage() {
v_outlineCoordinates = a_outlineCoordinates;
}
`;var W2=`void primitiveOutlineStage(inout czm_modelMaterial material) {
if (!model_showOutline) {
return;
}
float outlineX =
texture(model_outlineTexture, vec2(v_outlineCoordinates.x, 0.5)).r;
float outlineY =
texture(model_outlineTexture, vec2(v_outlineCoordinates.y, 0.5)).r;
float outlineZ =
texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r;
float outlineness = max(outlineX, max(outlineY, outlineZ));
material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness);
}
`;var Lse={name:"PrimitiveOutlinePipelineStage"};Lse.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,ge.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:nn.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",ge.FRAGMENT);let a=MA.createTexture(n.context);o.model_outlineTexture=function(){return a};let l=e.model;i.addUniform("vec4","model_outlineColor",ge.FRAGMENT),o.model_outlineColor=function(){return l.outlineColor},i.addUniform("bool","model_showOutline",ge.FRAGMENT),o.model_showOutline=function(){return l.showOutline},i.addVertexLines(j2),i.addFragmentLines(W2)};var q2=Lse;var Nse={name:"PrimitiveStatisticsPipelineStage",_countGeometry:Fse,_count2DPositions:Bse,_countMorphTargetAttributes:kse,_countMaterialTextures:Use,_countFeatureIdTextures:Vse,_countBinaryMetadata:zse};Nse.process=function(e,t,n){let i=e.model,o=i.statistics;Fse(o,t),Bse(o,e.runtimePrimitive),kse(o,t),Use(o,t.material),Vse(o,t.featureIds),zse(o,i)};function Fse(e,t){let n=c(t.indices)?t.indices.count:$t.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Me.POINTS?e.pointsLength+=n:Me.isTriangles(i)&&(e.trianglesLength+=j5e(i,n));let o=t.attributes,r=o.length;for(let l=0;l<r;l++){let u=o[l];if(c(u.buffer)){let f=c(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;c(s)&&c(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(c(a)&&c(a.buffer)){let l=c(a.typedArray);e.addBuffer(a.buffer,l)}}function j5e(e,t){switch(e){case Me.TRIANGLES:return t/3;case Me.TRIANGLE_STRIP:case Me.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Bse(e,t){let n=t.positionBuffer2D;c(n)&&e.addBuffer(n,!0)}function kse(e,t){let n=t.morphTargets;if(!c(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let l=0;l<a;l++){let u=s[l];c(u.buffer)&&e.addBuffer(u.buffer,i)}}}function Use(e,t){let n=W5e(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];c(r)&&c(r.texture)&&e.addTexture(r.texture)}}function W5e(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return c(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function Vse(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof An.FeatureIdTexture){let r=o.textureReader;c(r.texture)&&e.addTexture(r.texture)}}}function zse(e,t){let n=t.structuralMetadata;c(n)&&(q5e(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!c(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function q5e(e,t){let n=t.propertyTextures;if(!c(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;c(u.texture)&&e.addTexture(u.texture)}}}var Y2=Nse;var Y5e=new F,X5e=new F,Hse={name:"SceneMode2DPipelineStage"};Hse.process=function(e,t,n){let i=$t.getAttributeBySemantic(t,ht.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,l=F.multiplyTransformation(s,a,Y5e),u=Z5e(e,l,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let h=e.runtimeNode.node.instances;if(c(h))return;if(c(i.typedArray)){let y=e6e(i,l,u,n);f.positionBuffer2D=y,r._modelResources.push(y),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,ge.VERTEX),o.addUniform("mat4","u_modelView2D",ge.VERTEX);let p=F.fromTranslation(u.center,new F),g=n.context,m={u_modelView2D:function(){return F.multiplyTransformation(g.uniformState.view,p,X5e)}};e.uniformMap=xt(m,e.uniformMap)};var K5e=new d,$5e=new d;function Z5e(e,t,n){let i=F.multiplyByPoint(t,e.positionMin,K5e),o=Hi.computeActualEllipsoidPosition(n,i,i),r=F.multiplyByPoint(t,e.positionMax,$5e),s=Hi.computeActualEllipsoidPosition(n,r,r);return le.fromCornerPoints(o,s,new le)}var Gse=new d;function Q5e(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=d.fromArray(e,s,Gse),l=d.multiplyComponents(a,r,a),u=d.add(l,o,l);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function J5e(e,t,n,i){let o;c(e.quantization)?o=Q5e(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=c(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let l=r;l<s;l+=a){let u=d.fromArray(o,l,Gse);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=F.multiplyByPoint(t,u,u),h=Hi.computeActualEllipsoidPosition(i,f,f),p=d.subtract(h,n,h);o[l]=p.x,o[l+1]=p.y,o[l+2]=p.z}return o}function e6e(e,t,n,i){let o=We(i);o.mode=oe.COLUMBUS_VIEW;let r=n.center,s=J5e(e,t,r,o),a=bt.createVertexBuffer({context:i.context,typedArray:s,usage:Be.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var X2=Hse;var K2=`void skinningStage(inout ProcessedAttributes attributes)
{
mat4 skinningMatrix = getSkinningMatrix();
mat3 skinningMatrixMat3 = mat3(skinningMatrix);
vec4 positionMC = vec4(attributes.positionMC, 1.0);
attributes.positionMC = vec3(skinningMatrix * positionMC);
#ifdef HAS_NORMALS
vec3 normalMC = attributes.normalMC;
attributes.normalMC = skinningMatrixMat3 * normalMC;
#endif
#ifdef HAS_TANGENTS
vec3 tangentMC = attributes.tangentMC;
attributes.tangentMC = skinningMatrixMat3 * tangentMC;
#endif
}
`;var wb={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};wb.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,ge.VERTEX),n6e(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,ge.VERTEX),n.addVertexLines(K2);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=xt(r,e.uniformMap)};function t6e(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===ht.JOINTS||r.semantic===ht.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function n6e(e,t){e.addFunction(wb.FUNCTION_ID_GET_SKINNING_MATRIX,wb.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,ge.VERTEX),e.addFunctionLines(wb.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=t6e(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let l=r[o],u=`skinnedMatrix += a_weights_${i}.${l} * u_jointMatrices[int(a_joints_${i}.${l})];`;e.addFunctionLines(wb.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(wb.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var $2=wb;var Z2=`void verticalExaggerationStage(
inout ProcessedAttributes attributes
) {
vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0);
vec2 vertexAzimuth = normalize(vertexPositionENU.xy);
float azimuthalCurvature = dot(vertexAzimuth * vertexAzimuth, czm_eyeEllipsoidCurvature);
float eyeToCenter = 1.0 / azimuthalCurvature + czm_eyeHeight;
vec3 vertexPositionEC = (czm_modelView * vec4(attributes.positionMC, 1.0)).xyz;
vec3 centerToVertex = eyeToCenter * czm_eyeEllipsoidNormalEC + vertexPositionEC;
vec3 vertexNormal = normalize(centerToVertex);
float verticalDistance = dot(vertexPositionEC, czm_eyeEllipsoidNormalEC);
float horizontalDistance = length(vertexPositionEC - verticalDistance * czm_eyeEllipsoidNormalEC);
float sinTheta = horizontalDistance / (eyeToCenter + verticalDistance);
bool isSmallAngle = clamp(sinTheta, 0.0, 0.05) == sinTheta;
float exactVersine = 1.0 - dot(czm_eyeEllipsoidNormalEC, vertexNormal);
float smallAngleVersine = 0.5 * sinTheta * sinTheta;
float versine = isSmallAngle ? smallAngleVersine : exactVersine;
float dHeight = dot(vertexPositionEC, vertexNormal) - eyeToCenter * versine;
float vertexHeight = czm_eyeHeight + dHeight;
vec3 vertexNormalMC = (czm_inverseModelView * vec4(vertexNormal, 0.0)).xyz;
vertexNormalMC = normalize(vertexNormalMC);
float stretch = u_verticalExaggerationAndRelativeHeight.x;
float shift = u_verticalExaggerationAndRelativeHeight.y;
float exaggeration = (vertexHeight - shift) * (stretch - 1.0);
attributes.positionMC += exaggeration * vertexNormalMC;
}
`;var jse={name:"VerticalExaggerationPipelineStage"},i6e=new z;jse.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(Z2),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,ge.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",ge.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return z.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,i6e)}};var Q2=jse;var O9={};function o6e(e){let t=Fe.createTypedArray(e,e*2),n=e,i=0;for(let o=0;o<n;o+=3)t[i++]=o,t[i++]=o+1,t[i++]=o+1,t[i++]=o+2,t[i++]=o+2,t[i++]=o;return t}function r6e(e,t){let n=t.length,i=Fe.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],l=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=l,i[o++]=l,i[o++]=s}return i}function s6e(e){let t=e-2,n=2+t*4,i=Fe.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=r;return i}function a6e(e,t){let i=t.length-2,o=2+i*4,r=Fe.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let l=t[a],u=t[a+1],f=t[a+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=l}return r}function c6e(e){let t=e-2,n=2+t*4,i=Fe.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=0;return i}function l6e(e,t){let i=t.length-2,o=2+i*4,r=Fe.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let l=0;l<i;l++){let u=t[l+1],f=t[l+2];r[s++]=u,r[s++]=f,r[s++]=f,r[s++]=a}return r}O9.createWireframeIndices=function(e,t,n){let i=c(n);if(e===Me.TRIANGLES)return i?r6e(t,n):o6e(t);if(e===Me.TRIANGLE_STRIP)return i?a6e(t,n):s6e(t);if(e===Me.TRIANGLE_FAN)return i?l6e(t,n):c6e(t)};O9.getWireframeIndicesCount=function(e,t){return e===Me.TRIANGLES?t*2:e===Me.TRIANGLE_STRIP||e===Me.TRIANGLE_FAN?2+(t-2)*4:t};var Gv=O9;var Wse={name:"WireframePipelineStage"};Wse.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,ge.FRAGMENT);let o=e.model,r=u6e(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,l=e.count;e.primitiveType=Me.LINES,e.count=Gv.getWireframeIndicesCount(a,l)};function u6e(e,t,n){let o=$t.getAttributeBySemantic(e,ht.POSITION).count,r=n.context.webgl2,s;if(c(t)){let f=t.buffer,h=t.count;c(f)&&r?(s=f.sizeInBytes===h?new Uint8Array(h):Fe.createTypedArray(o,h),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,l=Gv.createWireframeIndices(a,o,s),u=Fe.fromSizeInBytes(l.BYTES_PER_ELEMENT);return bt.createIndexBuffer({context:n.context,typedArray:l,usage:Be.STATIC_DRAW,indexDatatype:u})}var J2=Wse;function qse(e){e=e??W.EMPTY_OBJECT;let t=e.primitive,n=e.node,i=e.model;T.typeOf.object("options.primitive",t),T.typeOf.object("options.node",n),T.typeOf.object("options.model",i),this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}qse.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,s=o.style,a=e.context.webgl2,u=e.mode!==oe.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,f=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,h=c(n.morphTargets)&&n.morphTargets.length>0,p=c(i.skin),g=c(r),y=!(g&&c(r.fragmentShaderText))||r.mode!==zg.REPLACE_MATERIAL,b=$t.hasQuantizedAttributes(n.attributes),x=o.debugWireframe&&Me.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),A=o.pointCloudShading,E=c(A)&&A.attenuation,S=c(A)&&A.backFaceCulling,v=n.primitiveType===Me.POINTS&&(c(s)||E||S),P=o._enableShowOutline&&c(n.outlineCoordinates),M=f6e(o,i,n),R=c(o.classificationType);u&&t.push(X2),t.push(L2),x&&t.push(J2),R&&t.push(x2),h&&t.push(V2),p&&t.push($2),v&&t.push(G2),b&&t.push(O2),y&&t.push(k2),t.push(Cb),t.push(wd),t.push(yf),M.hasPropertyTable&&(t.push(Sb),t.push(b2),t.push(C2)),f&&t.push(Q2),g&&t.push(I2),t.push(F2),o.allowPicking&&t.push(z2),P&&t.push(q2),t.push(y2),t.push(Y2)};function f6e(e,t,n){let i;return c(t.instances)&&(i=$t.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),c(i))?{hasFeatureIds:!0,hasPropertyTable:c(i.propertyTableId)}:(i=$t.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),c(i)?{hasFeatureIds:!0,hasPropertyTable:c(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var eB=qse;function R9(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.skin",e.skin),T.typeOf.object("options.sceneGraph",e.sceneGraph),this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],d6e(this)}Object.defineProperties(R9.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function d6e(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let l=0;l<o;l++){let u=i[l].index,f=r[u];s.push(f);let h=n[l],p=Yse(f,h,new F);a.push(p)}}function Yse(e,t,n){let i=F.multiplyTransformation(e.transformToRoot,e.transform,n);return n=F.multiplyTransformation(i,t,n),n}R9.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],o=this.inverseBindMatrices[n];e[n]=Yse(i,o,e[n])}};var tB=R9;function h6e(){this.pass=void 0,this.alphaCutoff=void 0}var nB=h6e;function m6e(e){T.typeOf.object("model",e),this.shaderBuilder=new MT,this.model=e,this.uniformMap={},this.alphaOptions=new nB,this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:Dc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1}var iB=m6e;var oB=`void silhouetteStage(inout vec4 color) {
if(model_silhouettePass) {
color = czm_gammaCorrect(model_silhouetteColor);
}
}
`;var rB=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) {
#ifdef HAS_NORMALS
if(model_silhouettePass) {
vec3 normal = normalize(czm_normal3D * attributes.normalMC);
normal.x *= czm_projection[0][0];
normal.y *= czm_projection[1][1];
positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixelRatio / czm_viewport.z;
}
#endif
}
`;var sB={name:"ModelSilhouettePipelineStage"};sB.silhouettesLength=0;sB.process=function(e,t,n){c(t._silhouetteId)||(t._silhouetteId=++sB.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,ge.BOTH),i.addVertexLines(rB),i.addFragmentLines(oB),i.addUniform("vec4","model_silhouetteColor",ge.FRAGMENT),i.addUniform("float","model_silhouetteSize",ge.VERTEX),i.addUniform("bool","model_silhouettePass",ge.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=xt(o,e.uniformMap),e.hasSilhouette=!0};var aB=sB;var cB=`void modelSplitterStage()
{
#ifndef SHADOW_MAP
if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
#endif
}
`;var lB={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};lB.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,ge.FRAGMENT),i.addFragmentLines(cB);let o={};i.addUniform("float",lB.SPLIT_DIRECTION_UNIFORM_NAME,ge.FRAGMENT),o[lB.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=xt(o,e.uniformMap)};var uB=lB;function p6e(e,t){T.typeOf.object("modelRenderResources",e),T.typeOf.object("runtimeNode",t),this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=We(e.uniformMap),this.alphaOptions=We(e.alphaOptions),this.renderStateOptions=We(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0}var fB=p6e;function _6e(e){e=e??W.EMPTY_OBJECT,this.lightingModel=e.lightingModel??Up.UNLIT}var dB=_6e;function g6e(e,t){T.typeOf.object("nodeRenderResources",e),T.typeOf.object("runtimePrimitive",t),this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=We(e.uniformMap),this.alphaOptions=We(e.alphaOptions),this.renderStateOptions=We(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=c(n.indices)?n.indices.count:$t.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=$t.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=d.clone(i.min,new d),this.positionMax=d.clone(i.max,new d),this.boundingSphere=le.fromCornerPoints(this.positionMin,this.positionMax,new le),this.lightingOptions=new dB,this.pickId=void 0}var hB=g6e;function L9(e){e=e??W.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources;T.typeOf.object("options.command",t),T.typeOf.object("options.primitiveRenderResources",n);let i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==Un.CESIUM_3D_TILE,this._classifies3DTiles=o!==Un.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],T6e(this)}function y6e(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:ft.KEEP,zFail:ft.DECREMENT_WRAP,zPass:ft.KEEP},backFunction:e,backOperation:{fail:ft.KEEP,zFail:ft.INCREMENT_WRAP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Dc.LESS_OR_EQUAL},depthMask:!1}}var b6e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND},x6e={stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},backFunction:Vn.NOT_EQUAL,backOperation:{fail:ft.ZERO,zFail:ft.ZERO,zPass:ft.ZERO},reference:0,mask:kt.CLASSIFICATION_MASK},stencilMask:kt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},$se=[];function T6e(e){let t=e._command,n=$se;if(e._useDebugWireframe){t.pass=De.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=jv(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let l=r[a];l.count*=2,l.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=De.TERRAIN_CLASSIFICATION,s=M9(t,r),a=Xse(t,r);n.length=0,n.push(s,a),e._commandListTerrain=jv(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=Kse(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=De.CESIUM_3D_TILE_CLASSIFICATION,s=M9(t,r),a=Xse(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=jv(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=Kse(e,n,e._commandList3DTilesPicking))}}function jv(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let l=0;l<s;l++){let u=o[l],f=r[l];for(let h=0;h<a;h++){let p=t[h],g=Je.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function M9(e,t){let n=Je.shallowClone(e);n.cull=!1,n.pass=t;let i=t===De.TERRAIN_CLASSIFICATION?Vn.ALWAYS:Vn.EQUAL,o=y6e(i);return n.renderState=ze.fromCache(o),n}function Xse(e,t){let n=Je.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=ze.fromCache(b6e),n}var A6e=[];function Kse(e,t,n){let i=ze.fromCache(x6e),o=t[0],r=t[1],s=Je.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=Je.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let l=A6e;return l.length=0,l.push(s,a),jv(e,l,n)}Object.defineProperties(L9.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=le.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});L9.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){t.push.apply(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrain),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=De.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=M9(this._command,o),s=$se;s.length=0,s.push(r),this._commandListIgnoreShow=jv(this,s,this._commandListIgnoreShow)}t.push.apply(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&t.push.apply(t,this._commandListTerrainPicking),this._classifies3DTiles&&t.push.apply(t,this._commandList3DTilesPicking)),t};var mB=L9;function pB(e){e=e??W.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources;T.typeOf.object("options.command",t),T.typeOf.object("options.primitiveRenderResources",n);let i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o;let r=t.pass===De.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,l=n.hasSilhouette,u=!r&&!l,f=n.hasSkipLevelOfDetail&&!r,h=l;this._command=t,this._modelMatrix=F.clone(t.modelMatrix),this._boundingVolume=le.clone(t.boundingVolume),this._modelMatrix2D=new F,this._boundingVolume2D=new le,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=h,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,C6e(this)}function Vp(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}Vp.clone=function(e){return new Vp({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function C6e(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;e._originalCommand=new Vp({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Vp({command:I6e(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Vp({command:F6e(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Vp({command:B6e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Vp({command:O6e(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Vp({command:R6e(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand))}Object.defineProperties(pB.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=le.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,S6e(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,w6e(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,v6e(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,D6e(this))}}});function E6e(e,t){let n=e._modelMatrix;e._modelMatrix2D=F.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=O.sign(n[13])*2*O.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=le.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function S6e(e){let t=e.shadows,n=Tn.castShadows(t),i=Tn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let s=o[r];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function w6e(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateBackFaceCulling){let r=o.command,s=We(r.renderState,!0);s.cull.enabled=t,r.renderState=ze.fromCache(s)}}}function v6e(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateCullFace){let r=o.command,s=We(r.renderState,!0);s.cull.face=t,r.renderState=ze.fromCache(s)}}}function D6e(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateDebugShowBoundingVolume){let r=o.command;r.debugShowBoundingVolume=t}}}pB.prototype.pushCommands=function(e,t){let n=Zse(this,e);n&&!this._has2DCommands&&(P6e(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(E6e(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&c(i)&&(i!==im.ALL_OPAQUE&&XA(t,this._translucentCommand,n),i===im.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||XA(o._backfaceCommands,this._skipLodBackfaceCommand,n),M6e(this,r,n),XA(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){XA(t,this._silhouetteModelCommand,n);return}return XA(t,this._originalCommand,n),t}};pB.prototype.pushSilhouetteCommands=function(e,t){let n=Zse(this,e);return XA(t,this._silhouetteColorCommand,n),t};function XA(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function Zse(e,t){if(t.mode!==oe.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*O.PI;return o<s&&r>s||o<-s&&r>-s}function YA(e,t){if(!c(t))return;let n=Vp.clone(t),i=Je.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function P6e(e){YA(e,e._originalCommand),YA(e,e._translucentCommand),YA(e,e._skipLodBackfaceCommand),YA(e,e._skipLodStencilCommand),YA(e,e._silhouetteModelCommand),YA(e,e._silhouetteColorCommand)}function I6e(e){let t=Je.shallowClone(e);t.pass=De.TRANSLUCENT;let n=We(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=un.ALPHA_BLEND,t.renderState=ze.fromCache(n),t}function O6e(e,t){let n=t._silhouetteId%255,i=Je.shallowClone(e),o=We(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ne.ALWAYS,backFunction:ne.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.REPLACE},backOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=ze.fromCache(o),i}function R6e(e,t){let n=t._silhouetteId%255,i=Je.shallowClone(e),o=We(e.renderState,!0);o.cull.enabled=!1,(e.pass===De.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=De.TRANSLUCENT,o.depthMask=!1,o.blending=un.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ne.NOTEQUAL,backFunction:ne.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.KEEP},backOperation:{fail:ne.KEEP,zFail:ne.KEEP,zPass:ne.KEEP}};let s=We(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=ze.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function M6e(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=L6e(o);if(r!==s){let a=N6e(r),l=We(o.renderState,!0);l.stencilTest.reference=a,o.renderState=ze.fromCache(l),n&&(i.derivedCommand2D.renderState=l)}}function L6e(e){return(e.renderState.stencilTest.reference&kt.SKIP_LOD_MASK)>>>kt.SKIP_LOD_BIT_SHIFT}function N6e(e){return kt.CESIUM_3D_TILE_MASK|e<<kt.SKIP_LOD_BIT_SHIFT}function F6e(e){let t=Je.shallowClone(e),n=We(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Ti.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=We(t.uniformMap),o=new z(5,5);return i.u_polygonOffset=function(){return o},t.renderState=ze.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function B6e(e){let t=Je.shallowClone(e),n=We(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=kt.SKIP_LOD_MASK,i.reference=kt.CESIUM_3D_TILE_MASK,i.frontFunction=Vn.GREATER_OR_EQUAL,i.frontOperation.zPass=ft.REPLACE,i.backFunction=Vn.GREATER_OR_EQUAL,i.backOperation.zPass=ft.REPLACE,n.stencilMask=kt.CESIUM_3D_TILE_MASK|kt.SKIP_LOD_MASK,t.renderState=ze.fromCache(n),t}var _B=pB;var gB=`precision highp float;
czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) {
czm_modelVertexOutput vsOutput;
vsOutput.positionMC = positionMC;
vsOutput.pointSize = 1.0;
return vsOutput;
}
void main()
{
ProcessedAttributes attributes;
initializeAttributes(attributes);
#ifdef USE_DEQUANTIZATION
dequantizationStage(attributes);
#endif
#ifdef HAS_MORPH_TARGETS
morphTargetsStage(attributes);
#endif
#ifdef HAS_SKINNING
skinningStage(attributes);
#endif
#ifdef HAS_PRIMITIVE_OUTLINE
primitiveOutlineStage();
#endif
#ifdef HAS_BITANGENTS
attributes.bitangentMC = normalize(cross(attributes.normalMC, attributes.tangentMC) * attributes.tangentSignMC);
#endif
FeatureIds featureIds;
featureIdStage(featureIds, attributes);
#ifdef HAS_SELECTED_FEATURE_ID
SelectedFeature feature;
selectedFeatureIdStage(feature, featureIds);
cpuStylingStage(attributes.positionMC, feature);
#endif
#if defined(USE_2D_POSITIONS) || defined(USE_2D_INSTANCING)
mat4 modelView = czm_modelView3D;
mat3 normal = czm_normal3D;
#else
mat4 modelView = czm_modelView;
mat3 normal = czm_normal;
#endif
#ifdef HAS_INSTANCING
#ifdef USE_LEGACY_INSTANCING
mat4 instanceModelView;
mat3 instanceModelViewInverseTranspose;
legacyInstancingStage(attributes, instanceModelView, instanceModelViewInverseTranspose);
modelView = instanceModelView;
normal = instanceModelViewInverseTranspose;
#else
instancingStage(attributes);
#endif
#ifdef USE_PICKING
v_pickColor = a_pickColor;
#endif
#endif
Metadata metadata;
MetadataClass metadataClass;
MetadataStatistics metadataStatistics;
metadataStage(metadata, metadataClass, metadataStatistics, attributes);
#ifdef HAS_VERTICAL_EXAGGERATION
verticalExaggerationStage(attributes);
#endif
#ifdef HAS_CUSTOM_VERTEX_SHADER
czm_modelVertexOutput vsOutput = defaultVertexOutput(attributes.positionMC);
customShaderStage(vsOutput, attributes, featureIds, metadata, metadataClass, metadataStatistics);
#endif
vec4 positionClip = geometryStage(attributes, modelView, normal);
#ifdef HAS_ATMOSPHERE
atmosphereStage(attributes);
#endif
#ifdef ENABLE_CLIPPING_POLYGONS
modelClippingPolygonsStage(attributes);
#endif
#ifdef HAS_SILHOUETTE
silhouetteStage(attributes, positionClip);
#endif
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
float show = pointCloudShowStylingStage(attributes, metadata);
#else
float show = 1.0;
#endif
#ifdef HAS_POINT_CLOUD_BACK_FACE_CULLING
show *= pointCloudBackFaceCullingStage();
#endif
#ifdef HAS_POINT_CLOUD_COLOR_STYLE
v_pointCloudColor = pointCloudColorStylingStage(attributes, metadata);
#endif
#ifdef PRIMITIVE_TYPE_POINTS
#ifdef HAS_CUSTOM_VERTEX_SHADER
gl_PointSize = vsOutput.pointSize;
#elif defined(HAS_POINT_CLOUD_POINT_SIZE_STYLE) || defined(HAS_POINT_CLOUD_ATTENUATION)
gl_PointSize = pointCloudPointSizeStylingStage(attributes, metadata);
#else
gl_PointSize = 1.0;
#endif
gl_PointSize *= show;
#endif
gl_Position = positionClip;
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
v_pointCloudShow = show;
#endif
}
`;var yB=`precision highp float;
czm_modelMaterial defaultModelMaterial()
{
czm_modelMaterial material;
material.diffuse = vec3(0.0);
material.specular = vec3(1.0);
material.roughness = 1.0;
material.occlusion = 1.0;
material.normalEC = vec3(0.0, 0.0, 1.0);
material.emissive = vec3(0.0);
material.alpha = 1.0;
return material;
}
vec4 handleAlpha(vec3 color, float alpha)
{
#ifdef ALPHA_MODE_MASK
if (alpha < u_alphaCutoff) {
discard;
}
#endif
return vec4(color, alpha);
}
SelectedFeature selectedFeature;
void main()
{
#ifdef HAS_POINT_CLOUD_SHOW_STYLE
if (v_pointCloudShow == 0.0)
{
discard;
}
#endif
#ifdef HAS_MODEL_SPLITTER
modelSplitterStage();
#endif
czm_modelMaterial material = defaultModelMaterial();
ProcessedAttributes attributes;
geometryStage(attributes);
FeatureIds featureIds;
featureIdStage(featureIds, attributes);
Metadata metadata;
MetadataClass metadataClass;
MetadataStatistics metadataStatistics;
metadataStage(metadata, metadataClass, metadataStatistics, attributes);
#ifndef METADATA_PICKING_ENABLED
#ifdef HAS_SELECTED_FEATURE_ID
selectedFeatureIdStage(selectedFeature, featureIds);
#endif
#ifndef CUSTOM_SHADER_REPLACE_MATERIAL
materialStage(material, attributes, selectedFeature);
#endif
#ifdef HAS_CUSTOM_FRAGMENT_SHADER
customShaderStage(material, attributes, featureIds, metadata, metadataClass, metadataStatistics);
#endif
lightingStage(material, attributes);
#ifdef HAS_SELECTED_FEATURE_ID
cpuStylingStage(material, selectedFeature);
#endif
#ifdef HAS_MODEL_COLOR
modelColorStage(material);
#endif
#ifdef HAS_PRIMITIVE_OUTLINE
primitiveOutlineStage(material);
#endif
vec4 color = handleAlpha(material.diffuse, material.alpha);
#else
vec4 metadataValues = vec4(0.0, 0.0, 0.0, 0.0);
metadataPickingStage(metadata, metadataClass, metadataValues);
vec4 color = metadataValues;
#endif
#ifdef HAS_CLIPPING_PLANES
modelClippingPlanesStage(color);
#endif
#ifdef ENABLE_CLIPPING_POLYGONS
modelClippingPolygonsStage();
#endif
#ifndef METADATA_PICKING_ENABLED
#if defined(HAS_SILHOUETTE) && defined(HAS_NORMALS)
silhouetteStage(color);
#endif
#ifdef HAS_ATMOSPHERE
atmosphereStage(color, attributes);
#endif
#endif
out_FragColor = color;
}
`;function Qse(){}Qse.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=k6e(e,n,t),o=U6e(e,i,t),r=e.model;return c(r.classificationType)?new mB({primitiveRenderResources:e,command:o}):new _B({primitiveRenderResources:e,command:o})};function k6e(e,t,n){t.addVertexLines(gB),t.addFragmentLines(yB);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function U6e(e,t,n){let i=V6e(e),o=new ni({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=e.alphaOptions.pass,a=r.sceneGraph,l=n.mode===oe.SCENE3D,u,f;if(!l&&!n.scene3DOnly&&r._projectTo2D)u=F.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new F),f=e.runtimePrimitive.boundingSphere2D;else{let x=l?a._computedModelMatrix:a._computedModelMatrix2D;u=F.multiplyTransformation(x,e.runtimeNode.computedTransform,new F),f=le.transform(e.boundingSphere,u)}let h=We(ze.fromCache(e.renderStateOptions),!0);h.cull.face=$t.getCullFace(u,e.primitiveType),h=ze.fromCache(h);let p=c(r.classificationType),g=p?!1:Tn.castShadows(r.shadows),m=p?!1:Tn.receiveShadows(r.shadows),y=p?void 0:e.pickId;return new Je({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:h,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:y,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:g,receiveShadows:m})}function V6e(e){let t=e.wireframeIndexBuffer;if(c(t))return t;let n=e.indices;if(c(n)){if(!c(n.buffer))throw new C("Indices must be provided as a Buffer");return n.buffer}}var bB=Qse;function lu(e){e=e??W.EMPTY_OBJECT;let t=e.modelComponents;T.typeOf.object("options.model",e.model),T.typeOf.object("options.modelComponents",t),this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=F.clone(F.IDENTITY),this._computedModelMatrix2D=F.clone(F.IDENTITY),this._axisCorrectionMatrix=$t.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new F),this._runtimeArticulations={},z6e(this)}Object.defineProperties(lu.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function z6e(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;Jse(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let A=0;A<s;A++){let E=r[A],S=new n2({articulation:E,sceneGraph:e}),v=S.name;a[v]=S}let l=t.nodes,u=l.length;e._runtimeNodes=new Array(u);let h=n.nodes.length,p=F.IDENTITY;for(let A=0;A<h;A++){let E=n.nodes[A],S=eae(e,E,p);e._rootNodes.push(S)}let g=t.skins,m=e._runtimeSkins,y=g.length;for(let A=0;A<y;A++){let E=g[A];m.push(new tB({skin:E,sceneGraph:e}))}let b=e._skinnedNodes,x=b.length;for(let A=0;A<x;A++){let E=b[A],S=e._runtimeNodes[E],P=l[E].skin.index;S._runtimeSkin=m[P],S.updateJointMatrices()}e.applyArticulations()}function Jse(e,t){let n=e._components,i=e._model;e._computedModelMatrix=F.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=F.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=F.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var H6e=new d;function G6e(e,t){let n=e._computedModelMatrix,i=F.getTranslation(n,H6e);if(!d.equals(i,d.ZERO))e._computedModelMatrix2D=Ot.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=Ot.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=F.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=le.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function eae(e,t,n){let i=[],o=$t.getNodeTransform(t),r=t.children.length;for(let f=0;f<r;f++){let h=t.children[f],p=F.multiplyTransformation(n,o,new F),g=eae(e,h,p);i.push(g)}let s=new g2({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new eB({primitive:t.primitives[f],node:t,model:e._model}));let l=t.index;e._runtimeNodes[l]=s,c(t.skin)&&e._skinnedNodes.push(l);let u=t.name;if(c(u)){let f=e._model,h=new l2(f,s);f._nodesByName[u]=h}return l}var j6e=new d,W6e=new d,q6e=new d,Y6e=new d;lu.prototype.buildDrawCommands=function(e){let t=this._model,n=new iB(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages,o,r,s;for(o=0;o<i.length;o++)i[o].process(n,t,e);let a=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,j6e),l=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,W6e);for(o=0;o<this._runtimeNodes.length;o++){let u=this._runtimeNodes[o];if(!c(u))continue;u.configurePipeline();let f=u.pipelineStages,h=new fB(n,u);for(r=0;r<f.length;r++)f[r].process(h,u.node,e);let p=u.computedTransform;for(r=0;r<u.runtimePrimitives.length;r++){let g=u.runtimePrimitives[r];g.configurePipeline(e);let m=g.pipelineStages,y=new hB(h,g);for(s=0;s<m.length;s++)m[s].process(y,g.primitive,e);g.boundingSphere=le.clone(y.boundingSphere,new le);let b=F.multiplyByPoint(p,y.positionMin,q6e),x=F.multiplyByPoint(p,y.positionMax,Y6e);d.minimumByComponent(a,b,a),d.minimumByComponent(a,x,a),d.maximumByComponent(l,x,l),d.maximumByComponent(l,b,l);let A=bB.buildModelDrawCommand(y,e);g.drawCommand=A}}this._boundingSphere=le.fromCornerPoints(a,l,new le),this._boundingSphere=le.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=le.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=le.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};lu.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;c(n.color)&&t.push(Ab),!c(n.classificationType)&&(n.imageBasedLighting.enabled&&t.push(JF),n.isClippingEnabled()&&t.push(r2),n.isClippingPolygonsEnabled()&&t.push(c2),n.hasSilhouette(e)&&t.push(aB),c(n.splitDirection)&&n.splitDirection!==qr.NONE&&t.push(uB),Tr.is3DTiles(n.type)&&t.push(XF),i&&t.push(ZF))};lu.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!c(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==oe.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let a=r.runtimePrimitives[i];for(o=0;o<a.updateStages.length;o++)a.updateStages[o].update(a,this)}}};lu.prototype.updateModelMatrix=function(e,t){Jse(this,e),t.mode!==oe.SCENE3D&&G6e(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};lu.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function tae(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let l=0;l<r;l++){let u=t.getChild(l);tae(e,u,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let l=0;l<a;l++){let u=s[l];i(u,o)}}function xB(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],l=e._runtimeNodes[a];tae(e,l,t,n,i)}}var X6e={backFaceCulling:void 0};lu.prototype.updateBackFaceCulling=function(e){let t=X6e;t.backFaceCulling=e,xB(this,!1,K6e,t)};function K6e(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var $6e={shadowMode:void 0};lu.prototype.updateShadows=function(e){let t=$6e;t.shadowMode=e,xB(this,!1,Z6e,t)};function Z6e(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var Q6e={debugShowBoundingVolume:void 0};lu.prototype.updateShowBoundingVolume=function(e){let t=Q6e;t.debugShowBoundingVolume=e,xB(this,!1,J6e,t)};function J6e(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var nae=[],eje={frameState:void 0,hasSilhouette:void 0};lu.prototype.pushDrawCommands=function(e){let t=nae;t.length=0;let n=eje;n.hasSilhouette=this._model.hasSilhouette(e),n.frameState=e,xB(this,!0,tje,n),e.commandList.push.apply(e.commandList,t)};function tje(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=nae,s=e.drawCommand;s.pushCommands(n,n.commandList),i&&!o.pick&&s.pushSilhouetteCommands(n,r)}lu.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],o=n[1],r=this._runtimeArticulations[i];c(r)&&r.setArticulationStage(o,t)};lu.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var TB=lu;function Hg(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Et}Object.defineProperties(Hg.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});Hg.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};Hg.prototype.addBuffer=function(e,t){if(T.typeOf.object("buffer",e),T.typeOf.bool("hasCpuCopy",t),!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};Hg.prototype.addTexture=function(e){T.typeOf.object("texture",e),this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};Hg.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};Hg.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};Hg.prototype.addBatchTexture=function(e){T.typeOf.object("batchTexture",e),this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var AB=Hg;var sae=jr(lO(),1);var iae={},vb=Uint32Array.BYTES_PER_ELEMENT;iae.parse=function(e,t){t=t??0,T.defined("arrayBuffer",e);let n=new Uint8Array(e),i=new DataView(e);t+=vb;let o=i.getUint32(t,!0);if(o!==1)throw new ae(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=vb,t+=vb;let r=i.getUint32(t,!0);if(r===0)throw new ae("Feature table must have a byte length greater than zero");t+=vb;let s=i.getUint32(t,!0);t+=vb;let a=i.getUint32(t,!0);t+=vb;let l=i.getUint32(t,!0);t+=vb;let u=sr(n,t,r);t+=r;let f=new Uint8Array(e,t,s);t+=s;let h,p;a>0&&(h=sr(n,t,a),t+=a,l>0&&(p=new Uint8Array(e,t,l),t+=l));let g=new tm(u,f),m=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=m,!c(m))throw new ae("Feature table global property: POINTS_LENGTH must be defined");let y=g.getGlobalProperty("RTC_CENTER",$.FLOAT,3);c(y)&&(y=d.unpack(y));let b=nje(g,h);if(b.rtcCenter=y,b.pointsLength=m,!b.hasPositions){let x=ije(g);b.positions=x,b.hasPositions=b.hasPositions||c(x)}if(!b.hasPositions)throw new ae("Either POSITION or POSITION_QUANTIZED must be defined.");if(!b.hasNormals){let x=rje(g);b.normals=x,b.hasNormals=b.hasNormals||c(x)}if(!b.hasColors){let x=oje(g);b.colors=x,b.hasColors=b.hasColors||c(x),b.hasConstantColor=c(b.constantColor),b.isTranslucent=c(x)&&x.isTranslucent}if(!b.hasBatchIds){let x=sje(g);b.batchIds=x,b.hasBatchIds=b.hasBatchIds||c(x)}if(b.hasBatchIds){let x=g.getGlobalProperty("BATCH_LENGTH");if(!c(x))throw new ae("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");b.batchLength=x}return c(p)&&(p=new Uint8Array(p),b.batchTableJson=h,b.batchTableBinary=p),b};function nje(e,t){let n=e.json,i,o,r,s=c(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=c(t)&&c(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;c(a)&&(r=a.properties);let l,u,f,h,p;if(c(s)){o=s.properties;let m=s.byteOffset,y=s.byteLength;if(!c(o)||!c(m)||!c(y))throw new ae("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+y),l=c(o.POSITION),u=c(o.RGB)||c(o.RGBA),f=c(o.NORMAL),h=c(o.BATCH_ID),p=c(o.RGBA)}let g;return c(i)&&(g={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:xt(o,r),dequantizeInShader:!0}),{draco:g,hasPositions:l,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:h}}function ije(e){let t=e.json,n;if(c(t.POSITION))return n=e.getPropertyArray("POSITION",$.FLOAT,3),{name:ht.POSITION,semantic:ht.POSITION,typedArray:n,isQuantized:!1,componentDatatype:$.FLOAT,type:nn.VEC3};if(c(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",$.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",$.FLOAT,3);if(!c(i))throw new ae("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",$.FLOAT,3);if(!c(r))throw new ae("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:ht.POSITION,semantic:ht.POSITION,typedArray:n,isQuantized:!0,componentDatatype:$.FLOAT,type:nn.VEC3,quantizedRange:o,quantizedVolumeOffset:d.unpack(r),quantizedVolumeScale:d.unpack(i),quantizedComponentDatatype:$.UNSIGNED_SHORT,quantizedType:nn.VEC3}}}function oje(e){let t=e.json,n;if(c(t.RGBA))return n=e.getPropertyArray("RGBA",$.UNSIGNED_BYTE,4),{name:ht.COLOR,semantic:ht.COLOR,setIndex:0,typedArray:n,componentDatatype:$.UNSIGNED_BYTE,type:nn.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(c(t.RGB))return n=e.getPropertyArray("RGB",$.UNSIGNED_BYTE,3),{name:"COLOR",semantic:ht.COLOR,setIndex:0,typedArray:n,componentDatatype:$.UNSIGNED_BYTE,type:nn.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(c(t.RGB565))return n=e.getPropertyArray("RGB565",$.UNSIGNED_SHORT,1),{name:"COLOR",semantic:ht.COLOR,setIndex:0,typedArray:n,componentDatatype:$.FLOAT,type:nn.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(c(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",$.UNSIGNED_BYTE,4),o=i[3],r=G.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:ht.COLOR,semantic:ht.COLOR,setIndex:0,constantColor:r,componentDatatype:$.FLOAT,type:nn.VEC4,isQuantized:!1,isTranslucent:s}}}function rje(e){let t=e.json,n;if(c(t.NORMAL))return n=e.getPropertyArray("NORMAL",$.FLOAT,3),{name:ht.NORMAL,semantic:ht.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:$.FLOAT,type:nn.VEC3};if(c(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",$.UNSIGNED_BYTE,2),{name:ht.NORMAL,semantic:ht.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:nn.VEC2,quantizedComponentDatatype:$.UNSIGNED_BYTE,componentDatatype:$.FLOAT,type:nn.VEC3}}function sje(e){let t=e.json;if(c(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",$.UNSIGNED_SHORT,1);return{name:ht.FEATURE_ID,semantic:ht.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:$.fromTypedArray(n),type:nn.SCALAR}}}var KA=iae;var aje=An.Components,cje=An.Scene,lje=An.Node,uje=An.Primitive,fje=An.Attribute,oae=An.Quantization,dje=An.FeatureIdAttribute,hje=An.Material,mje=An.MetallicRoughness;function Gg(e){e=e??W.EMPTY_OBJECT;let t=e.arrayBuffer,n=e.byteOffset??0;T.typeOf.object("options.arrayBuffer",t),this._arrayBuffer=t,this._byteOffset=n,this._loadAttributesFor2D=e.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=gt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=F.IDENTITY}c(Object.create)&&(Gg.prototype=Object.create($i.prototype),Gg.prototype.constructor=Gg);Object.defineProperties(Gg.prototype,{cacheKey:{get:function(){}},components:{get:function(){return this._components}},transform:{get:function(){return this._transform}}});Gg.prototype.load=function(){if(c(this._promise))return this._promise;this._parsedContent=KA.parse(this._arrayBuffer,this._byteOffset),this._state=gt.PROCESSING,this._promise=Promise.resolve(this)};Gg.prototype.process=function(e){if(c(this._error)){let t=this._error;throw this._error=void 0,t}if(this._state===gt.READY)return!0;if(this._state===gt.PROCESSING){if(c(this._decodePromise))return!1;this._decodePromise=pje(this,e.context)}return!1};function pje(e,t){let i=e._parsedContent.draco,o;if(c(i)?o=yg.decodePointCloud(i,t):o=Promise.resolve(),!!c(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return c(r)&&_je(e,i,r),vje(e,t),e._state=gt.READY,e}).catch(function(r){e.unload(),e._state=gt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function _je(e,t,n){e._state=gt.READY;let i=e._parsedContent,o;if(c(n.POSITION)){if(o={name:"POSITION",semantic:ht.POSITION,typedArray:n.POSITION.array,componentDatatype:$.FLOAT,type:nn.VEC3,isQuantized:!1},c(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,l=a.range,u=d.fromElements(l,l,l),f=d.unpack(a.minValues),h=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=h,o.quantizedVolumeOffset=f,o.quantizedVolumeScale=u,o.quantizedComponentDatatype=h<=255?$.UNSIGNED_BYTE:$.UNSIGNED_SHORT,o.quantizedType=nn.VEC3}i.positions=o}if(c(n.NORMAL)){if(o={name:"NORMAL",semantic:ht.NORMAL,typedArray:n.NORMAL.array,componentDatatype:$.FLOAT,type:nn.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},c(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=$.UNSIGNED_BYTE,o.quantizedType=nn.VEC2}i.normals=o}if(c(n.RGBA)?i.colors={name:"COLOR",semantic:ht.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:$.UNSIGNED_BYTE,type:nn.VEC4,normalized:!0,isTranslucent:!0}:c(n.RGB)&&(i.colors={name:"COLOR",semantic:ht.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:$.UNSIGNED_BYTE,type:nn.VEC3,normalized:!0,isTranslucent:!1}),c(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:ht.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:$.fromTypedArray(a),type:nn.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let l=n[a];c(r)||(r={}),i.hasDracoBatchTable=!0;let u=l.data;r[a]={byteOffset:u.byteOffset,type:gje(u.componentsPerAttribute),componentType:yje(u.componentDatatype),typedArray:l.array}}i.batchTableJson=r}function gje(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4";default:throw new C("componentsPerAttribute must be a number from 1-4")}}function yje(e){switch(e){case ne.BYTE:return"BYTE";case ne.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ne.SHORT:return"SHORT";case ne.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ne.INT:return"INT";case ne.UNSIGNED_INT:return"UNSIGNED_INT";case ne.DOUBLE:return"DOUBLE";case ne.FLOAT:return"FLOAT";default:throw new C("value is not a valid WebGL constant")}}function Wv(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new oae,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new oae;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=d.ZERO;let l=t.quantizedVolumeScale;o.quantizedVolumeDimensions=l,o.quantizedVolumeStepSize=d.divideByScalar(l,a,new d),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new fje;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=t.normalized??!1,r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=Ln.decodeRGB565(i)),c(t.constantColor)){let a=new Array(4);r.constant=G.pack(t.constantColor,a)}else{let a=bt.createVertexBuffer({typedArray:i,context:n,usage:Be.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===ht.POSITION&&s&&(r.typedArray=i),r}var rae,CB;function bje(e){if(!c(CB)){rae=new sae.default(0),CB=new Array(e);for(let t=0;t<e;++t)CB[t]=rae.random()}return CB}var xje=new d,Tje=new d,Aje=new d;function Cje(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=bje(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,l=d.fromElements(s,s,s,xje),u=d.fromElements(a,a,a,Tje),f,h,p;if(e.isQuantized)l=d.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<o;++f)h=Math.floor(r[f]*i),p=d.unpack(t,h*3,Aje),d.minimumByComponent(l,p,l),d.maximumByComponent(u,p,u);e.min=d.clone(l),e.max=d.clone(u)}var Eje={name:ht.COLOR,semantic:ht.COLOR,setIndex:0,constantColor:G.DARKGRAY,componentDatatype:$.FLOAT,type:nn.VEC4,isQuantized:!1,isTranslucent:!1};function Sje(e,t,n){let i=[],o,r=t.positions;return c(r)&&(Cje(r),o=Wv(e,r,n),o.count=t.pointsLength,i.push(o)),c(t.normals)&&(o=Wv(e,t.normals,n),i.push(o)),c(t.colors)?(o=Wv(e,t.colors,n),i.push(o)):(o=Wv(e,Eje,n),i.push(o)),c(t.batchIds)&&(o=Wv(e,t.batchIds,n),i.push(o)),i}function wje(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableBinary,r=!c(e.batchIds);return c(o)||e.hasDracoBatchTable?Fg({count:n??i,batchTable:e.batchTableJson,binaryBody:o,parseAsPropertyAttributes:r,customAttributeOutput:t}):new oa({schema:{},propertyTables:[]})}function vje(e,t){let n=e._parsedContent,i=new mje;i.metallicFactor=0,i.roughnessFactor=.9;let o=new hje;o.metallicRoughness=i;let r=n.colors;c(r)&&r.isTranslucent&&(o.alphaMode=Ip.BLEND);let s=!c(n.normals);o.unlit=s;let a=new uje;if(a.attributes=Sje(e,n,t),a.primitiveType=Me.POINTS,a.material=o,c(n.batchIds)){let g=new dje;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let l=new lje;l.index=0,l.primitives=[a];let u=new cje;u.nodes=[l],u.upAxis=Fo.Z,u.forwardAxis=Fo.X;let f=new aje;f.scene=u,f.nodes=[l];let h=[];f.structuralMetadata=wje(n,h),h.length>0&&Dje(e,a,h,t),c(n.rtcCenter)&&(f.transform=F.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;c(p)&&p.isQuantized&&(f.transform=F.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function Dje(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],l=bt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Be.STATIC_DRAW});l.vertexArrayDestroyable=!1,e._buffers.push(l),a.buffer=l,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}Gg.prototype.unload=function(){let e=this._buffers;for(let t=0;t<e.length;t++)e[t].destroy();e.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0};var EB=Gg;var Pje=new d,Ije=new d,Oje=new d,Rje=new F,Mje=new F,Lje=new F,Nje=new he,Fje=new le;function qv(e,t,n,i,o,r,s){if(T.typeOf.object("model",e),T.typeOf.object("ray",t),T.typeOf.object("frameState",n),!e._ready||n.mode===oe.MORPHING)return;let a=Number.MAX_VALUE,l=e.sceneGraph,u=l._runtimeNodes;for(let f=0;f<u.length;f++){let h=u[f],p=h.node,g=F.clone(h.computedTransform,Rje),m=F.clone(l.computedModelMatrix,Mje),y=p.instances;c(y)&&y.transformInWorldSpace&&(m=F.multiplyTransformation(e.modelMatrix,l.components.transform,m),g=F.multiplyTransformation(l.axisCorrectionMatrix,h.computedTransform,g));let b=F.multiplyTransformation(m,g,Lje);n.mode!==oe.SCENE3D&&(b=Ot.basisTo2D(n.mapProjection,b,b));let x=[];if(c(y)){let E=y.attributes[0].count,S=y.attributes[0].componentDatatype,v=12,P=h.transformsTypedArray;if(!c(P)){let M=h.instancingTransformsBuffer;c(M)&&n.context.webgl2&&(P=$.createTypedArray(S,E*v),M.getBufferData(P))}if(c(P))for(let M=0;M<E;M++){let R=M*v,L=new F(P[R],P[R+1],P[R+2],P[R+3],P[R+4],P[R+5],P[R+6],P[R+7],P[R+8],P[R+9],P[R+10],P[R+11],0,0,0,1);y.transformInWorldSpace?(F.multiplyTransformation(L,g,L),F.multiplyTransformation(m,L,L)):F.multiplyTransformation(L,b,L),x.push(L)}}x.length===0&&x.push(b);let A=h.runtimePrimitives.length;for(let E=0;E<A;E++){let S=h.runtimePrimitives[E],v=S.primitive;if(c(S.boundingSphere)&&!c(y)){let X=le.transform(S.boundingSphere,b,Fje),te=Qn.raySphere(t,X);if(!c(te))continue}let P=$t.getAttributeBySemantic(v,ht.POSITION),M=P.byteOffset,R=P.byteStride,L=P.count;if(!c(v.indices))continue;let B=v.indices.typedArray;if(!c(B)){let X=v.indices.buffer,te=v.indices.count,K=v.indices.indexDatatype;c(X)&&n.context.webgl2&&(K===Fe.UNSIGNED_BYTE?B=new Uint8Array(te):K===Fe.UNSIGNED_SHORT?B=new Uint16Array(te):K===Fe.UNSIGNED_INT&&(B=new Uint32Array(te)),X.getBufferData(B))}let _=P.typedArray,w=P.componentDatatype,D=P.type,I=P.quantization;c(I)&&(w=P.quantization.componentDatatype,D=P.quantization.type);let N=nn.getNumberOfComponents(D),k=$.getSizeInBytes(w),H=!c(_)&&c(R)&&R!==N*k,V=N,j=0;H&&(V=R/k,j=M/k);let U=L*V;if(!c(_)){let X=P.buffer;c(X)&&n.context.webgl2&&(_=$.createTypedArray(w,U),X.getBufferData(_,H?0:M,0,U)),I&&P.normalized&&(_=Ln.dequantize(_,w,D,L))}if(!c(B)||!c(_))return;r=r??ie.default,i=i??1,o=o??0;let q=B.length;for(let X=0;X<q;X+=3){let te=B[X],K=B[X+1],Z=B[X+2];for(let ee of x){let me=N9(_,te,j,V,I,ee,i,o,r,Pje),xe=N9(_,K,j,V,I,ee,i,o,r,Ije),ue=N9(_,Z,j,V,I,ee,i,o,r,Oje),ye=Qn.rayTriangleParametric(t,me,xe,ue,e.backFaceCulling??!0);c(ye)&&ye<a&&ye>=0&&(a=ye)}}}}if(a!==Number.MAX_VALUE){if(s=_n.getPoint(t,a,s),n.mode!==oe.SCENE3D){d.fromElements(s.y,s.z,s.x,s);let f=n.mapProjection,h=f.ellipsoid,p=f.unproject(s,Nje);h.cartographicToCartesian(p,s)}return s}}function N9(e,t,n,i,o,r,s,a,l,u){let f=n+t*i;if(u.x=e[f],u.y=e[f+1],u.z=e[f+2],c(o))if(o.octEncoded){if(u=Ln.octDecodeInRange(u,o.normalizationRange,u),o.octEncodedZXY){let h=u.x;u.x=u.z,u.z=u.y,u.y=h}}else u=d.multiplyComponents(u,o.quantizedVolumeStepSize,u),u=d.add(u,o.quantizedVolumeOffset,u);return u=F.multiplyByPoint(r,u,u),s!==1&&Rr.getPosition(u,l,s,a,u),u}function io(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.loader",e.loader),T.typeOf.object("options.resource",e.resource),this._loader=e.loader,this._resource=e.resource,this.type=e.type??Tr.GLTF,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=c(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=J.clone(J.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new WF(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=G.clone(e.color),this._colorBlendMode=e.colorBlendMode??kc.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??G.RED;this._silhouetteColor=G.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??De.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new le,this._initialRadius=void 0,this._heightReference=e.heightReference??qe.NONE,this._heightDirty=this._heightReference!==qe.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0;let o=e.scene;c(o)&&c(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new Mp(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;c(s)&&s.owner===void 0?xs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0,this._clippingPlanesMatrix=F.clone(F.IDENTITY);let a=e.clippingPolygons;c(a)&&a.owner===void 0?Zh.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._lightColor=d.clone(e.lightColor),this._imageBasedLighting=c(e.imageBasedLighting)?e.imageBasedLighting:new lA,this._shouldDestroyImageBasedLighting=!c(e.imageBasedLighting),this._environmentMapManager=void 0;let l=new Og(e.environmentMapOptions);Og.setOwner(l,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Tn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Tr.GLTF&&dt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new At(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??qr.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??G.BLACK,this._classificationType=e.classificationType,this._statistics=new AB,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new pe,this._readyEvent=new pe,this._texturesReadyEvent=new pe,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function F9(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function Bje(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let s=i[r],a=new YF({model:e,propertyTable:s});n.push(a)}return n}function kje(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,s,a;for(o=0;o<e.nodes.length;o++)if(a=e.nodes[o],c(a.instances)&&(s=$t.getFeatureIdsByLabel(a.instances.featureIds,i),c(s)&&c(s.propertyTableId)))return s.propertyTableId;for(o=0;o<e.nodes.length;o++)for(a=e.nodes[o],r=0;r<a.primitives.length;r++){let l=a.primitives[r],u=$t.getFeatureIdsByLabel(l.featureIds,n);if(c(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function U9(e,t){if(!c(e)&&!c(t))return!1;if(c(e)!==c(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(io.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return this._loader.incrementallyLoadTextures??!1}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){T.defined("pointCloudShading",e),e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far must be greater than near");this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){U9(e,this._color)&&this.resetDrawCommands(),this._color=G.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!G.equals(e,this._silhouetteColor)){let t=U9(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=G.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},boundingSphere:{get:function(){if(!this._ready)throw new C("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");let e=c(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return lae(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Tr.GLTF&&dt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),T.typeOf.string("value",e),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),T.typeOf.string("value",e),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(xs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Zh.setOwner(e,this,"_clippingPolygons"),this.resetDrawCommands())}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},lightColor:{get:function(){return this._lightColor},set:function(e){c(e)!==c(this._lightColor)&&this.resetDrawCommands(),this._lightColor=d.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){T.typeOf.object("imageBasedLighting",e),e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){T.typeOf.object("environmentMapManager",e),e!==this.environmentMapManager&&(Og.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});io.prototype.getNode=function(e){if(!this._ready)throw new C("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");return T.typeOf.string("name",e),this._nodesByName[e]};io.prototype.setArticulationStage=function(e,t){if(T.typeOf.number("value",t),!this._ready)throw new C("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");this._sceneGraph.setArticulationStage(e,t)};io.prototype.applyArticulations=function(){if(!this._ready)throw new C("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");this._sceneGraph.applyArticulations()};io.prototype.getExtension=function(e){if(T.typeOf.string("extensionName",e),!this._ready)throw new C("The model is not loaded. Use Model.readyEvent or wait for Model.ready to be true.");return this._loader.components.extensions[e]};io.prototype.makeStyleDirty=function(){this._styleDirty=!0};io.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var Uje=new F,Vje=new J,zje=new F;io.prototype.update=function(e){let t=!1;try{t=Hje(this,e)}catch(n){if(!this._loader.incrementallyLoadTextures&&n.name==="TextureError")F9(this,n);else{let i=$t.getError("model",this._resource,n);F9(this,i)}}if(Gje(this,e),jje(this,e),Wje(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let n=this._loader.components;if(!c(n)){if(this._loader.isUnloaded())return;let r=$t.getError("model",this._resource,new ae("Failed to load model."));F9(r),this._rejectLoad=this._rejectLoad&&this._rejectLoad(r)}let i=n.structuralMetadata;c(i)&&i.propertyTableCount>0&&Bje(this,i);let o=new TB({model:this,modelComponents:n});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!(!this._resourcesLoaded||e.mode===oe.MORPHING)){if(qje(this),Yje(this),Xje(this,e),Kje(this),$je(this,e),Zje(this,e),Qje(this,e),Jje(this,e),e9e(this,e),t9e(this,e),n9e(this,e),this._defaultTexture=e.context.defaultTexture,i9e(this,e),o9e(this,e),r9e(this),s9e(this,e),u9e(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),c9e(this),f9e(this,e),d9e(this),h9e(this,e)}};function Hje(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function Gje(e,t){c(e._customShader)&&e._customShader.update(t)}function jje(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!c(e._imageBasedLighting.sphericalHarmonicCoefficients)||!c(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function Wje(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function qje(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;c(n)&&n.propertyTableCount>0&&(e.featureTableId=kje(t,e),e._styleDirty=!0,e.resetDrawCommands())}function Yje(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function Xje(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r<i;r++)n[r].update(t),n[r].styleCommandsNeededDirty&&(o=!0);o&&cae(e)}function cae(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=im.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function Kje(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function $je(e,t){e._silhouetteDirty&&(uae(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function Zje(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function Qje(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function Jje(e,t){let n=0;e.isClippingPolygonsEnabled()&&(e._clippingPolygons.owner===e&&(e._clippingPolygons.update(t),e._clippingPolygons.queueCommands(t)),n=e._clippingPolygons.clippingPolygonsState),n!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=n)}function e9e(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function t9e(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function n9e(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function i9e(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function o9e(e,t){if(!F.equals(e.modelMatrix,e._modelMatrix)){if(t.mode!==oe.SCENE3D&&e._projectTo2D)throw new C("Model.modelMatrix cannot be changed in 2D or Columbus View if projectTo2D is true.");e._updateModelMatrix=!0,e._modelMatrix=F.clone(e.modelMatrix,e._modelMatrix)}}var jg=new d,B9=new he;function r9e(e){if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0)return;c(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0);let t=e._scene;if(!c(t)||e.heightReference===qe.NONE){if(e.heightReference!==qe.NONE)throw new C("Height reference is not supported without a scene.");e._clampedModelMatrix=void 0;return}let n=t.ellipsoid??ie.default,i=e.modelMatrix;jg.x=i[12],jg.y=i[13],jg.z=i[14];let o=n.cartesianToCartographic(jg);c(e._clampedModelMatrix)||(e._clampedModelMatrix=F.clone(i,new F)),e._removeUpdateHeightCallback=t.updateHeight(o,aae(e,n,o),e.heightReference);let r=t.getHeight(o,e.heightReference);if(c(r)){let s=aae(e,n,o);he.clone(o,B9),B9.height=r,s(B9)}e._heightDirty=!1,e._updateModelMatrix=!0}function s9e(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=c(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;lae(e,n),a9e(e,n,t)}function lae(e,t){e._clampedScale=c(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=d.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=le.transform(e._boundingSphere,t,e._boundingSphere)}function a9e(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);F.getTranslation(t,jg),e._sceneMode!==oe.SCENE3D&&Hi.computeActualEllipsoidPosition(n,jg,jg);let s=e._boundingSphere.radius,a=m9e(jg,s,n),l=1/a;Math.min(l*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=c(e.maximumScale)?Math.min(e.maximumScale,i):i}function c9e(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let o=0;o<i;++o)n[o].object.id=t}var l9e=new J(1,0,0,0,0,1,0,-1,0);function u9e(e,t){let n=c(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=Vje,s=Uje;if(s=F.multiply(o.uniformState.view3D,i,s),r=F.getRotation(s,r),r=J.transpose(r,r),e._iblReferenceFrameMatrix=J.multiply(l9e,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=zje;a=F.multiply(o.uniformState.view3D,i,a),a=F.multiply(a,e._clippingPlanes.modelMatrix,a),e._clippingPlanesMatrix=F.inverseTranspose(a,e._clippingPlanesMatrix)}}function f9e(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=c(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(o,t),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;c(e.classificationType)||(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function d9e(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(c(e._credit)){let s=At.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=At.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let o=e._gltfCredits,r=o.length;for(let s=0;s<r;s++){let a=At.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function h9e(e,t){let n=_9e(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(g9e(e,t),e._sceneGraph.pushDrawCommands(t))}var k9=new le;function m9e(e,t,n){return k9.center=e,k9.radius=t,n.camera.getPixelSize(k9,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var SB=new d;function aae(e,t,n){return function(i){e.heightReference===qe.CLIP_TO_GROUND?n.height>=i.height&&(i.height=n.height):NT(e.heightReference)&&(i.height+=n.height),t.cartographicToCartesian(i,SB);let o=e._clampedModelMatrix;F.clone(e.modelMatrix,o),o[12]=SB.x,o[13]=SB.y,o[14]=SB.z,e._heightDirty=!0}}var p9e=new d;function _9e(e,t){let n=e.distanceDisplayCondition;if(!c(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===oe.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=F.getTranslation(e.modelMatrix,p9e);Hi.computeActualEllipsoidPosition(t,s,s),r=d.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function g9e(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}io.prototype.isTranslucent=function(){let e=this.color;return c(e)&&e.alpha>0&&e.alpha<1};io.prototype.isInvisible=function(){let e=this.color;return c(e)&&e.alpha===0};function uae(e){return e.context.stencilBuffer}io.prototype.hasSilhouette=function(e){return uae(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!c(this._classificationType)};io.prototype.hasSkipLevelOfDetail=function(e){if(!Tr.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};io.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return c(e)&&e.enabled&&e.length!==0};io.prototype.pick=function(e,t,n,i,o){return qv(this,e,t,n,i,o)};io.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return c(e)&&e.enabled&&e.length!==0};io.prototype.isDestroyed=function(){return!1};io.prototype.destroy=function(){let e=this._loader;c(e)&&e.destroy();let t=this._featureTables;if(c(t)){let r=t.length;for(let s=0;s<r;s++)t[s].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),c(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0);let n=this._clippingPlanes;c(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0;let i=this._clippingPolygons;c(i)&&!i.isDestroyed()&&i.owner===this&&i.destroy(),this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let o=this._environmentMapManager;!o.isDestroyed()&&o.owner===this&&o.destroy(),this._environmentMapManager=void 0,de(this)};io.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};io.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};io.fromGltfAsync=async function(e){if(e=e??W.EMPTY_OBJECT,!c(e.url)&&!c(e.gltf))throw new C("options.url is required.");let t=e.url??e.gltf,n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:c(e.classificationType)},i=e.basePath??"",o=we.createIfNeeded(i);c(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=we.createIfNeeded(t);let r=new em(n),a=c(e.content)?Tr.TILE_GLTF:Tr.GLTF,l=n.gltfResource,u=Yv(r,a,e);u.resource=l,u.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(g){throw r.destroy(),$t.getError("model",l,g)}let f=e.gltfCallback;c(f)&&(T.typeOf.func("options.gltfCallback",f),f(r.gltfJson));let h=new io(u),p=h._resource.credits;if(c(p)){let g=p.length;for(let m=0;m<g;m++)h._resourceCredits.push(At.clone(p[m]))}return h};io.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:c(e.classificationType)},n=new OF(t);try{await n.load();let i=Yv(n,Tr.TILE_B3DM,e);return new io(i)}catch(i){throw n.destroy(),i}};io.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new EB(t);try{await n.load();let i=Yv(n,Tr.TILE_PNTS,e);return new io(i)}catch(i){throw n.destroy(),i}};io.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new kF(t);try{await n.load();let i=Yv(n,Tr.TILE_I3DM,e);return new io(i)}catch(i){throw n.destroy(),i}};io.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new MF(t),i=Yv(n,Tr.TILE_GEOJSON,e);return new io(i)};var y9e=new G;io.prototype.applyColorAndShow=function(e){let t=G.clone(this._color,y9e),n=c(e)&&c(e.color),i=c(e)&&c(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):G.clone(G.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,U9(t,this._color)&&this.resetDrawCommands()};io.prototype.applyStyle=function(e){let t=this.type===Tr.TILE_PNTS,n=c(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=c(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=c(i)&&c(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),cae(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function Yv(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var om=io;function kr(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(kr.prototype,{featuresLength:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;return c(t)&&c(t[n])?t[n].featuresLength:0}},pointsLength:{get:function(){return this._model.statistics.pointsLength}},trianglesLength:{get:function(){return this._model.statistics.trianglesLength}},geometryByteLength:{get:function(){return this._model.statistics.geometryByteLength}},texturesByteLength:{get:function(){return this._model.statistics.texturesByteLength}},batchTableByteLength:{get:function(){let e=this._model.statistics;return e.propertyTablesByteLength+e.batchTexturesByteLength}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){let e=this._model,t=e.featureTables,n=e.featureTableId;if(c(t)&&c(t[n]))return t[n]}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});kr.prototype.getTextureIds=function(){return this._model.statistics.getTextureIds()};kr.prototype.getTextureByteLengthById=function(e){return this._model.statistics.getTextureByteLengthById(e)};kr.prototype.getExtension=function(e){return this._model.getExtension(e)};kr.prototype.getFeature=function(e){let t=this._model,n=t.featureTableId;if(!c(n))throw new C("No feature ID set is selected. Make sure Cesium3DTileset.featureIdLabel or Cesium3DTileset.instanceFeatureIdLabel is defined");let i=t.featureTables[n];if(!c(i))throw new C("No feature table found for the selected feature ID set");let o=i.featuresLength;if(!c(e)||e<0||e>=o)throw new C(`featureId is required and must be between 0 and featuresLength - 1 (${o-1}).`);return i.getFeature(e)};kr.prototype.hasProperty=function(e,t){let n=this._model,i=n.featureTableId;return c(i)?n.featureTables[i].hasProperty(e,t):!1};kr.prototype.applyDebugSettings=function(e,t){t=e?t:G.WHITE,this.featuresLength===0?this._model.color=t:c(this.batchTable)&&this.batchTable.setAllColor(t)};kr.prototype.applyStyle=function(e){this._model.style=e};kr.prototype.update=function(e,t){let n=this._model,i=this._tile;n.colorBlendAmount=e.colorBlendAmount,n.colorBlendMode=e.colorBlendMode,n.modelMatrix=i.computedTransform,n.customShader=e.customShader,n.featureIdLabel=e.featureIdLabel,n.instanceFeatureIdLabel=e.instanceFeatureIdLabel,n.lightColor=e.lightColor,n.imageBasedLighting=e.imageBasedLighting,n.backFaceCulling=e.backFaceCulling,n.shadows=e.shadows,n.showCreditsOnScreen=e.showCreditsOnScreen,n.splitDirection=e.splitDirection,n.debugWireframe=e.debugWireframe,n.showOutline=e.showOutline,n.outlineColor=e.outlineColor,n.pointCloudShading=e.pointCloudShading;let o=e.clippingPlanes;n.referenceMatrix=e.clippingPlanesOriginMatrix,c(o)&&i.clippingPlanesDirty&&(n._clippingPlanes=o.enabled&&i._isClipped?o:void 0);let r=e.environmentMapManager;n.environmentMapManager!==o&&(n._environmentMapManager=r),c(o)&&c(n._clippingPlanes)&&n._clippingPlanes!==o&&(n._clippingPlanes=o,n._clippingPlanesState=0);let s=e.clippingPolygons;c(s)&&i.clippingPolygonsDirty&&(n._clippingPolygons=s.enabled&&i._isClippedByPolygon?s:void 0),c(s)&&c(n._clippingPolygons)&&n._clippingPolygons!==s&&(n._clippingPolygons=s,n._clippingPolygonsState=0),n.update(t),!this._ready&&n.ready&&(n.activeAnimations.addAll({loop:au.REPEAT}),this._ready=!0)};kr.prototype.isDestroyed=function(){return!1};kr.prototype.destroy=function(){return this._model=this._model&&this._model.destroy(),de(this)};kr.fromGltf=async function(e,t,n,i){let o=new kr(e,t,n),s=Xv(e,t,o,{gltf:i,basePath:n}),a=e.vectorClassificationOnly?void 0:e.classificationType;s.classificationType=a;let l=await om.fromGltfAsync(s);return o._model=l,o};kr.fromB3dm=async function(e,t,n,i,o){let r=new kr(e,t,n),a=Xv(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=e.vectorClassificationOnly?void 0:e.classificationType;a.classificationType=l;let u=await om.fromB3dm(a);return r._model=u,r};kr.fromI3dm=async function(e,t,n,i,o){let r=new kr(e,t,n),a=Xv(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=await om.fromI3dm(a);return r._model=l,r};kr.fromPnts=async function(e,t,n,i,o){let r=new kr(e,t,n),a=Xv(e,t,r,{arrayBuffer:i,byteOffset:o,resource:n}),l=await om.fromPnts(a);return r._model=l,r};kr.fromGeoJson=async function(e,t,n,i){let o=new kr(e,t,n),s=Xv(e,t,o,{geoJson:i,resource:n}),a=await om.fromGeoJson(s);return o._model=a,o};kr.prototype.pick=function(e,t,n){if(!c(this._model)||!this._ready)return;let i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight;return this._model.pick(e,t,i,o,ie.WGS84,n)};function Xv(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:De.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return xt(i,o)}var bf=kr;function xf(e,t,n){this._tileset=e,this._tile=t,this._resource=n,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}Object.defineProperties(xf.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},batchTable:{get:function(){}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},group:{get:function(){return this._group},set:function(e){this._group=e}}});xf.fromJson=function(e,t,n,i){let o=new xf(e,t,n);return o._tileset.loadTileset(o._resource,i,o._tile),o._ready=!0,o};xf.prototype.hasProperty=function(e,t){return!1};xf.prototype.getFeature=function(e){};xf.prototype.applyDebugSettings=function(e,t){};xf.prototype.applyStyle=function(e){};xf.prototype.update=function(e,t){};xf.prototype.pick=function(e,t,n){};xf.prototype.isDestroyed=function(){return!1};xf.prototype.destroy=function(){return de(this)};var wB=xf;var vB=`uniform sampler2D u_atlas;
#ifdef VECTOR_TILE
uniform vec4 u_highlightColor;
#endif
in vec2 v_textureCoordinates;
in vec4 v_pickColor;
in vec4 v_color;
in float v_splitDirection;
#ifdef SDF
in vec4 v_outlineColor;
in float v_outlineWidth;
#endif
#ifdef FRAGMENT_DEPTH_CHECK
in vec4 v_textureCoordinateBounds;
in vec4 v_originTextureCoordinateAndTranslate;
in vec4 v_compressed;
in mat2 v_rotationMatrix;
const float SHIFT_LEFT12 = 4096.0;
const float SHIFT_LEFT1 = 2.0;
const float SHIFT_RIGHT12 = 1.0 / 4096.0;
const float SHIFT_RIGHT1 = 1.0 / 2.0;
float getGlobeDepth(vec2 adjustedST, vec2 depthLookupST, bool applyTranslate, vec2 dimensions, vec2 imageSize)
{
vec2 lookupVector = imageSize * (depthLookupST - adjustedST);
lookupVector = v_rotationMatrix * lookupVector;
vec2 labelOffset = (dimensions - imageSize) * (depthLookupST - vec2(0.0, v_originTextureCoordinateAndTranslate.y));
vec2 translation = v_originTextureCoordinateAndTranslate.zw;
if (applyTranslate)
{
translation += (dimensions * v_originTextureCoordinateAndTranslate.xy * vec2(1.0, 0.0));
}
vec2 st = ((lookupVector - translation + labelOffset) + gl_FragCoord.xy) / czm_viewport.zw;
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));
if (logDepthOrDepth == 0.0)
{
return 0.0;
}
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
return eyeCoordinate.z / eyeCoordinate.w;
}
#endif
#ifdef SDF
float getDistance(vec2 position)
{
return texture(u_atlas, position).r;
}
vec4 getSDFColor(vec2 position, float outlineWidth, vec4 outlineColor, float smoothing)
{
float distance = getDistance(position);
if (outlineWidth > 0.0)
{
float outlineEdge = clamp(SDF_EDGE - outlineWidth, 0.0, SDF_EDGE);
float outlineFactor = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
vec4 sdfColor = mix(outlineColor, v_color, outlineFactor);
float alpha = smoothstep(outlineEdge - smoothing, outlineEdge + smoothing, distance);
return vec4(sdfColor.rgb, sdfColor.a * alpha);
}
else
{
float alpha = smoothstep(SDF_EDGE - smoothing, SDF_EDGE + smoothing, distance);
return vec4(v_color.rgb, v_color.a * alpha);
}
}
#endif
void main()
{
if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
vec4 color = texture(u_atlas, v_textureCoordinates);
#ifdef SDF
float outlineWidth = v_outlineWidth;
vec4 outlineColor = v_outlineColor;
float distance = getDistance(v_textureCoordinates);
#if (__VERSION__ == 300 || defined(GL_OES_standard_derivatives))
float smoothing = fwidth(distance);
vec2 sampleOffset = 0.354 * vec2(dFdx(v_textureCoordinates) + dFdy(v_textureCoordinates));
vec4 center = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
vec4 color1 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
vec4 color2 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, sampleOffset.y), outlineWidth, outlineColor, smoothing);
vec4 color3 = getSDFColor(v_textureCoordinates + vec2(-sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
vec4 color4 = getSDFColor(v_textureCoordinates + vec2(sampleOffset.x, -sampleOffset.y), outlineWidth, outlineColor, smoothing);
color = (center + color1 + color2 + color3 + color4)/5.0;
#else
float smoothing = 1.0/32.0;
color = getSDFColor(v_textureCoordinates, outlineWidth, outlineColor, smoothing);
#endif
color = czm_gammaCorrect(color);
#else
color = czm_gammaCorrect(color);
color *= czm_gammaCorrect(v_color);
#endif
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
if (color.a < 0.005)
{
discard;
}
#else
#ifdef OPAQUE
if (color.a < 0.995)
{
discard;
}
#else
if (color.a >= 0.995)
{
discard;
}
#endif
#endif
#ifdef VECTOR_TILE
color *= u_highlightColor;
#endif
out_FragColor = color;
#ifdef LOG_DEPTH
czm_writeLogDepth();
#endif
#ifdef FRAGMENT_DEPTH_CHECK
float temp = v_compressed.y;
temp = temp * SHIFT_RIGHT1;
float temp2 = (temp - floor(temp)) * SHIFT_LEFT1;
bool enableDepthTest = temp2 != 0.0;
bool applyTranslate = floor(temp) != 0.0;
if (enableDepthTest) {
temp = v_compressed.z;
temp = temp * SHIFT_RIGHT12;
vec2 dimensions;
dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
dimensions.x = floor(temp);
temp = v_compressed.w;
temp = temp * SHIFT_RIGHT12;
vec2 imageSize;
imageSize.y = (temp - floor(temp)) * SHIFT_LEFT12;
imageSize.x = floor(temp);
vec2 adjustedST = v_textureCoordinates - v_textureCoordinateBounds.xy;
adjustedST = adjustedST / vec2(v_textureCoordinateBounds.z - v_textureCoordinateBounds.x, v_textureCoordinateBounds.w - v_textureCoordinateBounds.y);
float epsilonEyeDepth = v_compressed.x + czm_epsilon1;
float globeDepth1 = getGlobeDepth(adjustedST, v_originTextureCoordinateAndTranslate.xy, applyTranslate, dimensions, imageSize);
if (globeDepth1 != 0.0 && globeDepth1 > epsilonEyeDepth)
{
float globeDepth2 = getGlobeDepth(adjustedST, vec2(0.0, 1.0), applyTranslate, dimensions, imageSize);
if (globeDepth2 != 0.0 && globeDepth2 > epsilonEyeDepth)
{
float globeDepth3 = getGlobeDepth(adjustedST, vec2(1.0, 1.0), applyTranslate, dimensions, imageSize);
if (globeDepth3 != 0.0 && globeDepth3 > epsilonEyeDepth)
{
discard;
}
}
}
}
#endif
}
`;var DB=`#ifdef INSTANCED
in vec2 direction;
#endif
in vec4 positionHighAndScale;
in vec4 positionLowAndRotation;
in vec4 compressedAttribute0;
in vec4 compressedAttribute1;
in vec4 compressedAttribute2;
in vec4 eyeOffset;
in vec4 scaleByDistance;
in vec4 pixelOffsetScaleByDistance;
in vec4 compressedAttribute3;
in vec2 sdf;
in float splitDirection;
#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
in vec4 textureCoordinateBoundsOrLabelTranslate;
#endif
#ifdef VECTOR_TILE
in float a_batchId;
#endif
out vec2 v_textureCoordinates;
#ifdef FRAGMENT_DEPTH_CHECK
out vec4 v_textureCoordinateBounds;
out vec4 v_originTextureCoordinateAndTranslate;
out vec4 v_compressed;
out mat2 v_rotationMatrix;
#endif
out vec4 v_pickColor;
out vec4 v_color;
out float v_splitDirection;
#ifdef SDF
out vec4 v_outlineColor;
out float v_outlineWidth;
#endif
const float UPPER_BOUND = 32768.0;
const float SHIFT_LEFT16 = 65536.0;
const float SHIFT_LEFT12 = 4096.0;
const float SHIFT_LEFT8 = 256.0;
const float SHIFT_LEFT7 = 128.0;
const float SHIFT_LEFT5 = 32.0;
const float SHIFT_LEFT3 = 8.0;
const float SHIFT_LEFT2 = 4.0;
const float SHIFT_LEFT1 = 2.0;
const float SHIFT_RIGHT12 = 1.0 / 4096.0;
const float SHIFT_RIGHT8 = 1.0 / 256.0;
const float SHIFT_RIGHT7 = 1.0 / 128.0;
const float SHIFT_RIGHT5 = 1.0 / 32.0;
const float SHIFT_RIGHT3 = 1.0 / 8.0;
const float SHIFT_RIGHT2 = 1.0 / 4.0;
const float SHIFT_RIGHT1 = 1.0 / 2.0;
vec4 addScreenSpaceOffset(vec4 positionEC, vec2 imageSize, float scale, vec2 direction, vec2 origin, vec2 translate, vec2 pixelOffset, vec3 alignedAxis, bool validAlignedAxis, float rotation, bool sizeInMeters, out mat2 rotationMatrix, out float mpp)
{
vec2 halfSize = imageSize * scale * 0.5;
halfSize *= ((direction * 2.0) - 1.0);
vec2 originTranslate = origin * abs(halfSize);
#if defined(ROTATION) || defined(ALIGNED_AXIS)
if (validAlignedAxis || rotation != 0.0)
{
float angle = rotation;
if (validAlignedAxis)
{
vec4 projectedAlignedAxis = czm_modelView3D * vec4(alignedAxis, 0.0);
angle += sign(-projectedAlignedAxis.x) * acos(sign(projectedAlignedAxis.y) * (projectedAlignedAxis.y * projectedAlignedAxis.y) /
(projectedAlignedAxis.x * projectedAlignedAxis.x + projectedAlignedAxis.y * projectedAlignedAxis.y));
}
float cosTheta = cos(angle);
float sinTheta = sin(angle);
rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);
halfSize = rotationMatrix * halfSize;
}
else
{
rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
}
#endif
mpp = czm_metersPerPixel(positionEC);
positionEC.xy += (originTranslate + halfSize) * czm_branchFreeTernary(sizeInMeters, 1.0, mpp);
positionEC.xy += (translate + pixelOffset) * mpp;
return positionEC;
}
#ifdef VERTEX_DEPTH_CHECK
float getGlobeDepth(vec4 positionEC)
{
vec4 posWC = czm_eyeToWindowCoordinates(positionEC);
float globeDepth = czm_unpackDepth(texture(czm_globeDepthTexture, posWC.xy / czm_viewport.zw));
if (globeDepth == 0.0)
{
return 0.0;
}
vec4 eyeCoordinate = czm_windowToEyeCoordinates(posWC.xy, globeDepth);
return eyeCoordinate.z / eyeCoordinate.w;
}
#endif
void main()
{
vec3 positionHigh = positionHighAndScale.xyz;
vec3 positionLow = positionLowAndRotation.xyz;
float scale = positionHighAndScale.w;
#if defined(ROTATION) || defined(ALIGNED_AXIS)
float rotation = positionLowAndRotation.w;
#else
float rotation = 0.0;
#endif
float compressed = compressedAttribute0.x;
vec2 pixelOffset;
pixelOffset.x = floor(compressed * SHIFT_RIGHT7);
compressed -= pixelOffset.x * SHIFT_LEFT7;
pixelOffset.x -= UPPER_BOUND;
vec2 origin;
origin.x = floor(compressed * SHIFT_RIGHT5);
compressed -= origin.x * SHIFT_LEFT5;
origin.y = floor(compressed * SHIFT_RIGHT3);
compressed -= origin.y * SHIFT_LEFT3;
#ifdef FRAGMENT_DEPTH_CHECK
vec2 depthOrigin = origin.xy;
#endif
origin -= vec2(1.0);
float show = floor(compressed * SHIFT_RIGHT2);
compressed -= show * SHIFT_LEFT2;
#ifdef INSTANCED
vec2 textureCoordinatesBottomLeft = czm_decompressTextureCoordinates(compressedAttribute0.w);
vec2 textureCoordinatesRange = czm_decompressTextureCoordinates(eyeOffset.w);
vec2 textureCoordinates = textureCoordinatesBottomLeft + direction * textureCoordinatesRange;
#else
vec2 direction;
direction.x = floor(compressed * SHIFT_RIGHT1);
direction.y = compressed - direction.x * SHIFT_LEFT1;
vec2 textureCoordinates = czm_decompressTextureCoordinates(compressedAttribute0.w);
#endif
float temp = compressedAttribute0.y * SHIFT_RIGHT8;
pixelOffset.y = -(floor(temp) - UPPER_BOUND);
vec2 translate;
translate.y = (temp - floor(temp)) * SHIFT_LEFT16;
temp = compressedAttribute0.z * SHIFT_RIGHT8;
translate.x = floor(temp) - UPPER_BOUND;
translate.y += (temp - floor(temp)) * SHIFT_LEFT8;
translate.y -= UPPER_BOUND;
temp = compressedAttribute1.x * SHIFT_RIGHT8;
float temp2 = floor(compressedAttribute2.w * SHIFT_RIGHT2);
vec2 imageSize = vec2(floor(temp), temp2);
#ifdef FRAGMENT_DEPTH_CHECK
float labelHorizontalOrigin = floor(compressedAttribute2.w - (temp2 * SHIFT_LEFT2));
float applyTranslate = 0.0;
if (labelHorizontalOrigin != 0.0)
{
applyTranslate = 1.0;
labelHorizontalOrigin -= 2.0;
depthOrigin.x = labelHorizontalOrigin + 1.0;
}
depthOrigin = vec2(1.0) - (depthOrigin * 0.5);
#endif
#ifdef EYE_DISTANCE_TRANSLUCENCY
vec4 translucencyByDistance;
translucencyByDistance.x = compressedAttribute1.z;
translucencyByDistance.z = compressedAttribute1.w;
translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
temp = compressedAttribute1.y * SHIFT_RIGHT8;
translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
#endif
#if defined(VERTEX_DEPTH_CHECK) || defined(FRAGMENT_DEPTH_CHECK)
temp = compressedAttribute3.w;
temp = temp * SHIFT_RIGHT12;
vec2 dimensions;
dimensions.y = (temp - floor(temp)) * SHIFT_LEFT12;
dimensions.x = floor(temp);
#endif
#ifdef ALIGNED_AXIS
vec3 alignedAxis = czm_octDecode(floor(compressedAttribute1.y * SHIFT_RIGHT8));
temp = compressedAttribute2.z * SHIFT_RIGHT5;
bool validAlignedAxis = (temp - floor(temp)) * SHIFT_LEFT1 > 0.0;
#else
vec3 alignedAxis = vec3(0.0);
bool validAlignedAxis = false;
#endif
vec4 pickColor;
vec4 color;
temp = compressedAttribute2.y;
temp = temp * SHIFT_RIGHT8;
pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
temp = floor(temp) * SHIFT_RIGHT8;
pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
pickColor.r = floor(temp);
temp = compressedAttribute2.x;
temp = temp * SHIFT_RIGHT8;
color.b = (temp - floor(temp)) * SHIFT_LEFT8;
temp = floor(temp) * SHIFT_RIGHT8;
color.g = (temp - floor(temp)) * SHIFT_LEFT8;
color.r = floor(temp);
temp = compressedAttribute2.z * SHIFT_RIGHT8;
bool sizeInMeters = floor((temp - floor(temp)) * SHIFT_LEFT7) > 0.0;
temp = floor(temp) * SHIFT_RIGHT8;
pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
pickColor /= 255.0;
color.a = floor(temp);
color /= 255.0;
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
vec4 positionEC = czm_modelViewRelativeToEye * p;
#if defined(FRAGMENT_DEPTH_CHECK) || defined(VERTEX_DEPTH_CHECK)
float eyeDepth = positionEC.z;
#endif
positionEC = czm_eyeOffset(positionEC, eyeOffset.xyz);
positionEC.xyz *= show;
#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(EYE_DISTANCE_PIXEL_OFFSET) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
float lengthSq;
if (czm_sceneMode == czm_sceneMode2D)
{
lengthSq = czm_eyeHeight2D.y;
}
else
{
lengthSq = dot(positionEC.xyz, positionEC.xyz);
}
#endif
#ifdef EYE_DISTANCE_SCALING
float distanceScale = czm_nearFarScalar(scaleByDistance, lengthSq);
scale *= distanceScale;
translate *= distanceScale;
if (scale == 0.0)
{
positionEC.xyz = vec3(0.0);
}
#endif
float translucency = 1.0;
#ifdef EYE_DISTANCE_TRANSLUCENCY
translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
if (translucency == 0.0)
{
positionEC.xyz = vec3(0.0);
}
#endif
#ifdef EYE_DISTANCE_PIXEL_OFFSET
float pixelOffsetScale = czm_nearFarScalar(pixelOffsetScaleByDistance, lengthSq);
pixelOffset *= pixelOffsetScale;
#endif
#ifdef DISTANCE_DISPLAY_CONDITION
float nearSq = compressedAttribute3.x;
float farSq = compressedAttribute3.y;
if (lengthSq < nearSq || lengthSq > farSq)
{
positionEC.xyz = vec3(0.0);
}
#endif
mat2 rotationMatrix;
float mpp;
#ifdef DISABLE_DEPTH_DISTANCE
float disableDepthTestDistance = compressedAttribute3.z;
#endif
#ifdef VERTEX_DEPTH_CHECK
if (lengthSq < disableDepthTestDistance) {
float depthsilon = 10.0;
vec2 labelTranslate = textureCoordinateBoundsOrLabelTranslate.xy;
vec4 pEC1 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
float globeDepth1 = getGlobeDepth(pEC1);
if (globeDepth1 != 0.0 && pEC1.z + depthsilon < globeDepth1)
{
vec4 pEC2 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(0.0, 1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
float globeDepth2 = getGlobeDepth(pEC2);
if (globeDepth2 != 0.0 && pEC2.z + depthsilon < globeDepth2)
{
vec4 pEC3 = addScreenSpaceOffset(positionEC, dimensions, scale, vec2(1.0), origin, labelTranslate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
float globeDepth3 = getGlobeDepth(pEC3);
if (globeDepth3 != 0.0 && pEC3.z + depthsilon < globeDepth3)
{
positionEC.xyz = vec3(0.0);
}
}
}
}
#endif
positionEC = addScreenSpaceOffset(positionEC, imageSize, scale, direction, origin, translate, pixelOffset, alignedAxis, validAlignedAxis, rotation, sizeInMeters, rotationMatrix, mpp);
gl_Position = czm_projection * positionEC;
v_textureCoordinates = textureCoordinates;
#ifdef LOG_DEPTH
czm_vertexLogDepth();
#endif
#ifdef DISABLE_DEPTH_DISTANCE
if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
{
disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
}
if (disableDepthTestDistance != 0.0)
{
float zclip = gl_Position.z / gl_Position.w;
bool clipped = (zclip < -1.0 || zclip > 1.0);
if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
{
gl_Position.z = -gl_Position.w;
#ifdef LOG_DEPTH
v_depthFromNearPlusOne = 1.0;
#endif
}
}
#endif
#ifdef FRAGMENT_DEPTH_CHECK
if (sizeInMeters) {
translate /= mpp;
dimensions /= mpp;
imageSize /= mpp;
}
#if defined(ROTATION) || defined(ALIGNED_AXIS)
v_rotationMatrix = rotationMatrix;
#else
v_rotationMatrix = mat2(1.0, 0.0, 0.0, 1.0);
#endif
float enableDepthCheck = 0.0;
if (lengthSq < disableDepthTestDistance)
{
enableDepthCheck = 1.0;
}
float dw = floor(clamp(dimensions.x, 0.0, SHIFT_LEFT12));
float dh = floor(clamp(dimensions.y, 0.0, SHIFT_LEFT12));
float iw = floor(clamp(imageSize.x, 0.0, SHIFT_LEFT12));
float ih = floor(clamp(imageSize.y, 0.0, SHIFT_LEFT12));
v_compressed.x = eyeDepth;
v_compressed.y = applyTranslate * SHIFT_LEFT1 + enableDepthCheck;
v_compressed.z = dw * SHIFT_LEFT12 + dh;
v_compressed.w = iw * SHIFT_LEFT12 + ih;
v_originTextureCoordinateAndTranslate.xy = depthOrigin;
v_originTextureCoordinateAndTranslate.zw = translate;
v_textureCoordinateBounds = textureCoordinateBoundsOrLabelTranslate;
#endif
#ifdef SDF
vec4 outlineColor;
float outlineWidth;
temp = sdf.x;
temp = temp * SHIFT_RIGHT8;
outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
temp = floor(temp) * SHIFT_RIGHT8;
outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
outlineColor.r = floor(temp);
temp = sdf.y;
temp = temp * SHIFT_RIGHT8;
float temp3 = (temp - floor(temp)) * SHIFT_LEFT8;
temp = floor(temp) * SHIFT_RIGHT8;
outlineWidth = (temp - floor(temp)) * SHIFT_LEFT8;
outlineColor.a = floor(temp);
outlineColor /= 255.0;
v_outlineWidth = outlineWidth / 255.0;
v_outlineColor = outlineColor;
v_outlineColor.a *= translucency;
#endif
v_pickColor = pickColor;
v_color = color;
v_color.a *= translucency;
v_splitDirection = splitDirection;
}
`;var b9e=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),ss=b9e;function zp(e){T.defined("billboardCollection",e),this._billboardCollection=e,this._id=void 0,this._loadState=ss.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(zp.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===ss.LOADED}},hasImage:{get:function(){return this._loadState!==ss.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});zp.prototype.unload=async function(){this._loadState!==ss.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=ss.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};zp.prototype.loadImage=async function(e,t){if(this._id===e)return;let n=this._billboardCollection,i=n.billboardTextureCache,o=i.get(e);if(c(o)&&t.loadState===ss.LOADING||t.loadState===ss.LOADED){zp.clone(o,this);return}c(o)||(o=new zp(n),i.set(e,o)),o._id=this._id=e,o._loadState=this._loadState=ss.LOADING,o._loadError=this._loadError=void 0;let r,s=this._billboardCollection.textureAtlas;try{r=await s.addImage(e,t)}catch(l){if(o._loadState=ss.ERROR,o._loadError=l,this._id!==e)return;this._loadState=ss.ERROR,this._loadError=l;return}if(!c(r)||r===-1){if(o._loadState=ss.FAILED,o._index=-1,this._id!==e)return;this._loadState=ss.FAILED,this._index=-1;return}o._index=r,o._loadState=ss.LOADED;let a=s.rectangles[r];o._width=a.width,o._height=a.height,this._id===e&&(this._index=r,this._loadState=ss.LOADED,this._width=a.width,this._height=a.height,this.dirty=!0)};zp.prototype.addImageSubRegion=async function(e,t){this._id=e,this._loadState=ss.LOADING,this._loadError=void 0,this._hasSubregion=!0;let n,i=this._billboardCollection.textureAtlas;try{n=await i.addImageSubRegion(e,t)}catch(o){this._loadState=ss.ERROR,this._loadError=o;return}if(!c(n)||n===-1){this._loadState=ss.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=n,this._loadState=ss.LOADED,this.dirty=!0};zp.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};zp.clone=function(e,t){if(t._id=e._id,t._loadState=e._loadState,t._loadError=void 0,t._index=e._index,t._width=e._width,t._height=e._height,t._hasSubregion=e._hasSubregion,e.ready){t.dirty=!0;return}return(async()=>{let i=e._id;await e._billboardCollection.textureAtlas._indexPromiseById.get(i),t._id===i&&(e._hasSubregion&&await Promise.resolve(),t._id=i,t._loadState=e._loadState,t._loadError=e._loadError,t._index=e._index,t._width=e._width,t._height=e._height,t.dirty=!0)})(),t};var Wg=zp;function di(e,t){if(e=e??W.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Bt.clone(n)}if(c(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Bt.clone(i)}if(c(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=Bt.clone(o)}if(c(r)){if(r.far<=r.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");r=Lt.clone(r)}this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),this._actualPosition=d.clone(this._position),this._pixelOffset=z.clone(e.pixelOffset??z.ZERO),this._translate=new z(0,0),this._eyeOffset=d.clone(e.eyeOffset??d.ZERO),this._heightReference=e.heightReference??qe.NONE,this._verticalOrigin=e.verticalOrigin??Fn.CENTER,this._horizontalOrigin=e.horizontalOrigin??xi.CENTER,this._scale=e.scale??1,this._color=G.clone(e.color??G.WHITE),this._rotation=e.rotation??0,this._alignedAxis=d.clone(e.alignedAxis??d.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new Wg(t),this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image,a=e.imageId;c(s)&&(c(a)||(typeof s=="string"?a=s:c(s.src)?a=s.src:a=jn()),this._imageTexture.loadImage(a,s)),c(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(a,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=oe.SCENE3D,this._clusterShow=!0,this._outlineColor=G.clone(e.outlineColor??G.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??qr.NONE}var fae=di.SHOW_INDEX=0,IB=di.POSITION_INDEX=1,_ae=di.PIXEL_OFFSET_INDEX=2,x9e=di.EYE_OFFSET_INDEX=3,T9e=di.HORIZONTAL_ORIGIN_INDEX=4,A9e=di.VERTICAL_ORIGIN_INDEX=5,C9e=di.SCALE_INDEX=6,dae=di.IMAGE_INDEX_INDEX=7,hae=di.COLOR_INDEX=8,E9e=di.ROTATION_INDEX=9,S9e=di.ALIGNED_AXIS_INDEX=10,w9e=di.SCALE_BY_DISTANCE_INDEX=11,v9e=di.TRANSLUCENCY_BY_DISTANCE_INDEX=12,D9e=di.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,P9e=di.DISTANCE_DISPLAY_CONDITION=14,I9e=di.DISABLE_DEPTH_DISTANCE=15;di.TEXTURE_COORDINATE_BOUNDS=16;var mae=di.SDF_INDEX=17,O9e=di.SPLIT_DIRECTION_INDEX=18;di.NUMBER_OF_PROPERTIES=19;function Xo(e,t){let n=e._billboardCollection;c(n)&&(n._updateBillboard(e,t),e._dirty=!0)}Object.defineProperties(di.prototype,{show:{get:function(){return this._show},set:function(e){T.typeOf.bool("value",e),this._show!==e&&(this._show=e,Xo(this,fae))}},position:{get:function(){return this._position},set:function(e){T.typeOf.object("value",e);let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),this._updateClamping(),Xo(this,IB))}},heightReference:{get:function(){return this._heightReference},set:function(e){T.typeOf.number("value",e);let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Xo(this,IB))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){T.typeOf.object("value",e);let t=this._pixelOffset;z.equals(t,e)||(z.clone(e,t),Xo(this,_ae))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");let t=this._scaleByDistance;Bt.equals(t,e)||(this._scaleByDistance=Bt.clone(e,t),Xo(this,w9e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");let t=this._translucencyByDistance;Bt.equals(t,e)||(this._translucencyByDistance=Bt.clone(e,t),Xo(this,v9e))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");let t=this._pixelOffsetScaleByDistance;Bt.equals(t,e)||(this._pixelOffsetScaleByDistance=Bt.clone(e,t),Xo(this,D9e))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){T.typeOf.object("value",e);let t=this._eyeOffset;d.equals(t,e)||(d.clone(e,t),Xo(this,x9e))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){T.typeOf.number("value",e),this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Xo(this,T9e))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){T.typeOf.number("value",e),this._verticalOrigin!==e&&(this._verticalOrigin=e,Xo(this,A9e))}},scale:{get:function(){return this._scale},set:function(e){T.typeOf.number("value",e),this._scale!==e&&(this._scale=e,Xo(this,C9e))}},color:{get:function(){return this._color},set:function(e){T.typeOf.object("value",e);let t=this._color;G.equals(t,e)||(G.clone(e,t),Xo(this,hae))}},rotation:{get:function(){return this._rotation},set:function(e){T.typeOf.number("value",e),this._rotation!==e&&(this._rotation=e,Xo(this,E9e))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){T.typeOf.object("value",e);let t=this._alignedAxis;d.equals(t,e)||(d.clone(e,t),Xo(this,S9e))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){c(e)&&T.typeOf.number("width",e),this._width!==e&&(this._width=e,Xo(this,dae))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){c(e)&&T.typeOf.number("height",e),this._height!==e&&(this._height=e,Xo(this,dae))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){T.typeOf.bool("value",e),this._sizeInMeters!==e&&(this._sizeInMeters=e,Xo(this,hae))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Lt.equals(e,this._distanceDisplayCondition)){if(c(e)&&(T.typeOf.object("value",e),e.far<=e.near))throw new C("far distance must be greater than near distance.");this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition),Xo(this,P9e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(c(e)&&(T.typeOf.number("value",e),e<0))throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Xo(this,I9e))}},id:{get:function(){return this._id},set:function(e){this._id=e,c(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,c(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!c(e)){this._imageTexture.unload();return}let t;typeof e=="string"?t=e:e instanceof we?t=e._url:c(e.src)?t=e.src:t=jn(),this._imageTexture.loadImage(t,e)}},ready:{get:function(){return this._imageTexture.ready}},loadError:{get:function(){return this._imageTexture.loadError}},textureDirty:{get:function(){return this._imageTexture.dirty},set:function(e){this._imageTexture.dirty=e}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=d.clone(e,this._actualClampedPosition),Xo(this,IB)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Xo(this,fae))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new C("value is required.");let t=this._outlineColor;G.equals(t,e)||(G.clone(e,t),Xo(this,mae))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Xo(this,mae))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Xo(this,O9e))}}});di.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};di.prototype._updateClamping=function(){di._updateClamping(this._billboardCollection,this)};var Kv=new he;di._updateClamping=function(e,t){if(!c(e)||!c(e._scene)){if(t._heightReference!==qe.NONE)throw new C("Height reference is not supported without a scene.");return}let n=e._scene,i=n.ellipsoid??ie.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===qe.NONE||r)&&c(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0),t._heightReference===qe.NONE||!c(t._position))return;c(t._removeCallbackFunc)&&t._removeCallbackFunc();let s=i.cartesianToCartographic(t._position);if(!c(s)){t._actualClampedPosition=void 0;return}function a(u){let f=i.cartographicToCartesian(u,t._clampedPosition);if(NT(t._heightReference))t._mode===oe.SCENE3D?(u.height+=s.height,i.cartographicToCartesian(u,f)):f.x+=s.height;else if(t._heightReference===qe.CLIP_TO_GROUND)if(t._mode===oe.SCENE3D){let h=i.cartesianToCartographic(u,Kv);s.height>=h.height&&(h.height=s.height),i.cartographicToCartesian(h,u)}else s.height>=u.x&&(u.x=s.height);t._clampedPosition=f}t._removeCallbackFunc=n.updateHeight(s,a,t._heightReference),he.clone(s,Kv);let l=n.getHeight(s,t._heightReference);c(l)&&(Kv.height=l),a(Kv)};di.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};di.prototype.setImage=function(e,t){T.typeOf.string("id",e),T.defined("image",t),this._imageTexture.loadImage(e,t)};di.prototype.setImageTexture=function(e){T.defined("billboardTexture",e),Wg.clone(e,this._imageTexture)};di.prototype.setImageSubRegion=function(e,t){T.typeOf.string("id",e),T.defined("subRegion",t),this._imageTexture.addImageSubRegion(e,t)};di.prototype._setTranslate=function(e){if(!c(e))throw new C("value is required.");let t=this._translate;z.equals(t,e)||(z.clone(e,t),Xo(this,_ae))};di.prototype._getActualPosition=function(){return c(this._clampedPosition)?this._clampedPosition:this._actualPosition};di.prototype._setActualPosition=function(e){c(this._clampedPosition)||d.clone(e,this._actualPosition),Xo(this,IB)};var pae=new se;di._computeActualPosition=function(e,t,n,i){return c(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===oe.SCENE3D?t:(F.multiplyByPoint(i,t,pae),Hi.computeActualEllipsoidPosition(n,pae))};var gae=new d;di._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=F.multiplyByPoint(e,t,gae),a=Hi.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(c(a))return z.add(a,i,a),a};var PB=new z(0,0);di.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;if(c(t)||(t=new z),!c(n))throw new C("Billboard must be in a collection. Was it removed?");if(!c(e))throw new C("scene is required.");z.clone(this._pixelOffset,PB),z.add(PB,this._translate,PB);let i=n.modelMatrix,o=this._position;if(c(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==oe.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,l=s.unproject(o,Kv);o=a.cartographicToCartesian(l,gae),i=F.IDENTITY}return di._computeScreenSpacePosition(i,o,this._eyeOffset,PB,e,t)};di.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===xi.RIGHT?s-=i:e.horizontalOrigin===xi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Fn.BOTTOM||e.verticalOrigin===Fn.BASELINE?a-=o:e.verticalOrigin===Fn.CENTER&&(a-=o*.5),c(n)||(n=new Ke),n.x=s,n.y=a,n.width=i,n.height=o,n};di.prototype.equals=function(e){return this===e||c(e)&&this._id===e._id&&d.equals(this._position,e._position)&&this.image===e.image&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&G.equals(this._color,e._color)&&z.equals(this._pixelOffset,e._pixelOffset)&&z.equals(this._translate,e._translate)&&d.equals(this._eyeOffset,e._eyeOffset)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Bt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Lt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};di.prototype._destroy=function(){c(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),c(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var ao=di;var R9e={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2},Po=Object.freeze(R9e);var M9e={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},sa=Object.freeze(M9e);var L9e=ao.SHOW_INDEX,$v=ao.POSITION_INDEX,yae=ao.PIXEL_OFFSET_INDEX,bae=ao.EYE_OFFSET_INDEX,N9e=ao.HORIZONTAL_ORIGIN_INDEX,F9e=ao.VERTICAL_ORIGIN_INDEX,B9e=ao.SCALE_INDEX,Db=ao.IMAGE_INDEX_INDEX,xae=ao.COLOR_INDEX,k9e=ao.ROTATION_INDEX,U9e=ao.ALIGNED_AXIS_INDEX,Tae=ao.SCALE_BY_DISTANCE_INDEX,Aae=ao.TRANSLUCENCY_BY_DISTANCE_INDEX,Cae=ao.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Eae=ao.DISTANCE_DISPLAY_CONDITION,V9e=ao.DISABLE_DEPTH_DISTANCE,z9e=ao.TEXTURE_COORDINATE_BOUNDS,Sae=ao.SDF_INDEX,wae=ao.SPLIT_DIRECTION_INDEX,q9=ao.NUMBER_OF_PROPERTIES,oo,H9e={positionHighAndScale:0,positionLowAndRotation:1,compressedAttribute0:2,compressedAttribute1:3,compressedAttribute2:4,eyeOffset:5,scaleByDistance:6,pixelOffsetScaleByDistance:7,compressedAttribute3:8,textureCoordinateBoundsOrLabelTranslate:9,a_batchId:10,sdf:11,splitDirection:12},G9e={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,splitDirection:13};function Af(e){e=e??W.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;c(t)||(t=new LT),this._textureAtlas=t,this._textureAtlasGUID=t.guid,this._destroyTextureAtlas=!0,this._billboardTextureCache=new Map,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(q9),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new le,this._baseVolumeWC=new le,this._baseVolume2D=new le,this._boundingVolume=new le,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Po.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._buffersUsage=[Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW],this._highlightColor=G.clone(G.WHITE),this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor};let n=this._scene;c(n)&&c(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)c(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(Af.prototype,{length:{get:function(){return Y9(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){T.defined("textureAtlas",e),this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}},sizeInBytes:{get:function(){return this._textureAtlas.sizeInBytes}},ready:{get:function(){return this._allBillboardsReady}},billboardTextureCache:{get:function(){return this._billboardTextureCache}}});function vae(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Af.prototype.add=function(e){let t=new ao(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Af.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Af.prototype.removeAll=function(){vae(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function Y9(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];c(s)&&(s._index=r++,t.push(s))}e._billboards=t}}Af.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Af.prototype.contains=function(e){return c(e)&&e._billboardCollection===this};Af.prototype.get=function(e){return T.typeOf.number("index",e),Y9(this),this._billboards[e]};var V9;function j9e(e){let n=e.cache.billboardCollection_indexBufferBatched;if(c(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s+0,o[r+4]=s+2,o[r+5]=s+3;return n=bt.createIndexBuffer({context:e,typedArray:o,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferBatched=n,n}function W9e(e){let t=e.cache.billboardCollection_indexBufferInstanced;return c(t)||(t=bt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function q9e(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return c(t)||(t=bt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Be.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Af.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<q9;++i){let o=n[i]===0?Be.STATIC_DRAW:Be.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function Y9e(e,t,n,i,o,r){let s=[{index:oo.positionHighAndScale,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[$v]},{index:oo.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[$v]},{index:oo.compressedAttribute0,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[yae]},{index:oo.compressedAttribute1,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Aae]},{index:oo.compressedAttribute2,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[xae]},{index:oo.eyeOffset,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[bae]},{index:oo.scaleByDistance,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Tae]},{index:oo.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Cae]},{index:oo.compressedAttribute3,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Eae]},{index:oo.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[z9e]},{index:oo.splitDirection,componentsPerAttribute:1,componentDatatype:$.FLOAT,usage:n[wae]}];i&&s.push({index:oo.direction,componentsPerAttribute:2,componentDatatype:$.FLOAT,vertexBuffer:q9e(e)}),c(o)&&s.push({index:oo.a_batchId,componentsPerAttribute:1,componentDatatype:$.FLOAT,bufferUsage:Be.STATIC_DRAW}),r&&s.push({index:oo.sdf,componentsPerAttribute:2,componentDatatype:$.FLOAT,usage:n[Sae]});let a=i?t:4*t;return new X_(e,s,a,i)}var z9=new Hn;function Dae(e,t,n,i){let o,r=n[oo.positionHighAndScale],s=n[oo.positionLowAndRotation],a=i._getActualPosition();e._mode===oe.SCENE3D&&(le.expand(e._baseVolume,a,e._baseVolume),e._boundingVolumeDirty=!0),Hn.fromCartesian(a,z9);let l=i.scale,u=i.rotation;u!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,l);let f=z9.high,h=z9.low;e._instanced?(o=i._index,r(o,f.x,f.y,f.z,l),s(o,h.x,h.y,h.z,u)):(o=i._index*4,r(o+0,f.x,f.y,f.z,l),r(o+1,f.x,f.y,f.z,l),r(o+2,f.x,f.y,f.z,l),r(o+3,f.x,f.y,f.z,l),s(o+0,h.x,h.y,h.z,u),s(o+1,h.x,h.y,h.z,u),s(o+2,h.x,h.y,h.z,u),s(o+3,h.x,h.y,h.z,u))}var wl=new z,Tf=32768,$A=65536,H9=4096,rm=256,X9e=128,K9e=32,$9e=8,Pae=4,Z9e=1/256,Iae=0,Oae=2,Rae=3,Mae=1,X9=new Ke;function Lae(e,t,n,i){let o,r=n[oo.compressedAttribute0],s=i.pixelOffset,a=s.x,l=s.y,u=i._translate,f=u.x,h=u.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(a+f),Math.abs(-l+h));let p=i.horizontalOrigin,g=i._verticalOrigin,m=i.show&&i.clusterShow;i.color.alpha===0&&(m=!1),g===Fn.BASELINE&&(g=Fn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&p===xi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&g===Fn.CENTER;let y=0,b=0,x=0,A=0;if(i.ready){let N=i.computeTextureCoordinates(X9);y=N.x,b=N.y,x=N.width,A=N.height}let E=y+x,S=b+A,v=Math.floor(O.clamp(a,-Tf,Tf)+Tf)*X9e;v+=(p+1)*K9e,v+=(g+1)*$9e,v+=(m?1:0)*Pae;let P=Math.floor(O.clamp(l,-Tf,Tf)+Tf)*rm,M=Math.floor(O.clamp(f,-Tf,Tf)+Tf)*rm,R=(O.clamp(h,-Tf,Tf)+Tf)*Z9e,L=Math.floor(R),B=Math.floor((R-L)*rm);P+=L,M+=B,wl.x=y,wl.y=b;let _=Ln.compressTextureCoordinates(wl);wl.x=E;let w=Ln.compressTextureCoordinates(wl);wl.y=S;let D=Ln.compressTextureCoordinates(wl);wl.x=y;let I=Ln.compressTextureCoordinates(wl);e._instanced?(o=i._index,r(o,v,P,M,_)):(o=i._index*4,r(o+0,v+Iae,P,M,_),r(o+1,v+Oae,P,M,w),r(o+2,v+Rae,P,M,D),r(o+3,v+Mae,P,M,I))}function Nae(e,t,n,i){let o,r=n[oo.compressedAttribute1],s=i.alignedAxis;d.equals(s,d.ZERO)||(e._shaderAlignedAxis=!0);let a=0,l=1,u=1,f=1,h=i.translucencyByDistance;c(h)&&(a=h.near,l=h.nearValue,u=h.far,f=h.farValue,(l!==1||f!==1)&&(e._shaderTranslucencyByDistance=!0));let p=i.width??0;e._maxSize=Math.max(e._maxSize,p);let g=O.clamp(p,0,$A),m=0;Math.abs(d.magnitudeSquared(s)-1)<O.EPSILON6&&(m=Ln.octEncodeFloat(s)),l=O.clamp(l,0,1),l=l===1?255:l*255|0,g=g*rm+l,f=O.clamp(f,0,1),f=f===1?255:f*255|0,m=m*rm+f,e._instanced?(o=i._index,r(o,g,m,a,u)):(o=i._index*4,r(o+0,g,m,a,u),r(o+1,g,m,a,u),r(o+2,g,m,a,u),r(o+3,g,m,a,u))}function j9(e,t,n,i){let o,r=n[oo.compressedAttribute2],s=i.color,a=c(e._batchTable)?G.WHITE:i.getPickId(t.context).color,l=i.sizeInMeters?1:0,u=Math.abs(d.magnitudeSquared(i.alignedAxis)-1)<O.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&l===1;let f=i.height??0;e._maxSize=Math.max(e._maxSize,f);let h=i._labelHorizontalOrigin??-2;h+=2;let p=f*Pae+h,g=G.floatToByte(s.red),m=G.floatToByte(s.green),y=G.floatToByte(s.blue),b=g*$A+m*rm+y;g=G.floatToByte(a.red),m=G.floatToByte(a.green),y=G.floatToByte(a.blue);let x=g*$A+m*rm+y,A=G.floatToByte(s.alpha)*$A+G.floatToByte(a.alpha)*rm;A+=l*2+u,e._instanced?(o=i._index,r(o,b,x,A,p)):(o=i._index*4,r(o+0,b,x,A,p),r(o+1,b,x,A,p),r(o+2,b,x,A,p),r(o+3,b,x,A,p))}function W9(e,t,n,i){let o,r=n[oo.eyeOffset],s=i.eyeOffset,a=s.z;if(i._heightReference!==qe.NONE&&(a*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(s.x),Math.abs(s.y),Math.abs(a)),e._instanced){if(wl.x=0,wl.y=0,i.ready){let u=i.computeTextureCoordinates(X9);wl.x=u.width,wl.y=u.height}let l=Ln.compressTextureCoordinates(wl);o=i._index,r(o,s.x,s.y,a,l)}else o=i._index*4,r(o+0,s.x,s.y,a,0),r(o+1,s.x,s.y,a,0),r(o+2,s.x,s.y,a,0),r(o+3,s.x,s.y,a,0)}function Fae(e,t,n,i){let o,r=n[oo.scaleByDistance],s=0,a=1,l=1,u=1,f=i.scaleByDistance;c(f)&&(s=f.near,a=f.nearValue,l=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,l,u)):(o=i._index*4,r(o+0,s,a,l,u),r(o+1,s,a,l,u),r(o+2,s,a,l,u),r(o+3,s,a,l,u))}function Bae(e,t,n,i){let o,r=n[oo.pixelOffsetScaleByDistance],s=0,a=1,l=1,u=1,f=i.pixelOffsetScaleByDistance;c(f)&&(s=f.near,a=f.nearValue,l=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),e._instanced?(o=i._index,r(o,s,a,l,u)):(o=i._index*4,r(o+0,s,a,l,u),r(o+1,s,a,l,u),r(o+2,s,a,l,u),r(o+3,s,a,l,u))}function kae(e,t,n,i){let o,r=n[oo.compressedAttribute3],s=0,a=Number.MAX_VALUE,l=i.distanceDisplayCondition;c(l)&&(s=l.near,a=l.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance,f=of(i.heightReference)&&t.context.depthTexture;c(u)||(u=f?5e3:0),u*=u,(f||u>0)&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let h,p;c(i._labelDimensions)?(p=i._labelDimensions.x,h=i._labelDimensions.y):(p=i.width??0,h=i.height??0);let g=Math.floor(O.clamp(p,0,H9)),m=Math.floor(O.clamp(h,0,H9)),y=g*H9+m;e._instanced?(o=i._index,r(o,s,a,u,y)):(o=i._index*4,r(o+0,s,a,u,y),r(o+1,s,a,u,y),r(o+2,s,a,u,y),r(o+3,s,a,u,y))}function Uae(e,t,n,i){if(of(i.heightReference)){let p=e._scene,g=t.context,m=t.globeTranslucencyState.translucent,y=c(p.globe)&&p.globe.depthTestAgainstTerrain;e._shaderClampToGround=g.depthTexture&&!m&&y}let o,r=n[oo.textureCoordinateBoundsOrLabelTranslate];if(ut.maximumVertexTextureImageUnits>0){let p=0,g=0;c(i._labelTranslate)&&(p=i._labelTranslate.x,g=i._labelTranslate.y),e._instanced?(o=i._index,r(o,p,g,0,0)):(o=i._index*4,r(o+0,p,g,0,0),r(o+1,p,g,0,0),r(o+2,p,g,0,0),r(o+3,p,g,0,0));return}let s=0,a=0,l=0,u=0;if(i.ready){let p=i.computeTextureCoordinates(X9);s=p.x,a=p.y,l=p.width,u=p.height}let f=s+l,h=a+u;e._instanced?(o=i._index,r(o,s,a,f,h)):(o=i._index*4,r(o+0,s,a,f,h),r(o+1,s,a,f,h),r(o+2,s,a,f,h),r(o+3,s,a,f,h))}function Q9e(e,t,n,i){if(!c(e._batchTable))return;let o=n[oo.a_batchId],r=i._batchIndex,s;e._instanced?(s=i._index,o(s,r)):(s=i._index*4,o(s+0,r),o(s+1,r),o(s+2,r),o(s+3,r))}function Vae(e,t,n,i){if(!e._sdf)return;let o,r=n[oo.sdf],s=i.outlineColor,a=i.outlineWidth,l=G.floatToByte(s.red),u=G.floatToByte(s.green),f=G.floatToByte(s.blue),h=l*$A+u*rm+f,p=a/sa.RADIUS,g=G.floatToByte(s.alpha)*$A+G.floatToByte(p)*rm;e._instanced?(o=i._index,r(o,h,g)):(o=i._index*4,r(o+0,h+Iae,g),r(o+1,h+Oae,g),r(o+2,h+Rae,g),r(o+3,h+Mae,g))}function zae(e,t,n,i){let o=n[oo.splitDirection],r=0,s=i.splitDirection;c(s)&&(r=s);let a;e._instanced?(a=i._index,o(a,r)):(a=i._index*4,o(a+0,r),o(a+1,r),o(a+2,r),o(a+3,r))}function J9e(e,t,n,i){Dae(e,t,n,i),Lae(e,t,n,i),Nae(e,t,n,i),j9(e,t,n,i),W9(e,t,n,i),Fae(e,t,n,i),Bae(e,t,n,i),kae(e,t,n,i),Uae(e,t,n,i),Q9e(e,t,n,i),Vae(e,t,n,i),zae(e,t,n,i)}function G9(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let l=0;l<n;++l){let u=t[l],f=u.position,h=ao._computeActualPosition(u,f,i,o);c(h)&&(u._setActualPosition(h),r?a.push(h):le.expand(s,h,s))}r&&le.fromPoints(a,s)}function eWe(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&G9(e,i,i.length,t,r,!0)):n===oe.MORPHING?G9(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&G9(e,o,e._billboardsToUpdateIndex,t,r,!1)}function tWe(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);let r=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+r}function nWe(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = texture(billboard_texture, v_textureCoordinates);
}
`,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=De.OVERLAY,i}var iWe=[];Af.prototype.update=function(e){if(Y9(this),!this.show)return;let t=e.context;this._instanced=t.instancedArrays,oo=this._instanced?G9e:H9e,V9=this._instanced?W9e:j9e;let n=this._billboards,i=n.length,o=!0;for(let R=0;R<i;++R){let L=n[R];c(L.loadError)&&(console.error(`Error loading image for billboard: ${L.loadError}`),L.image=void 0),L.textureDirty&&this._updateBillboard(L,Db),L.show&&(o=o&&L.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!c(r.texture))return;eWe(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,l=this._propertiesChanged,u=r.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let h,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let R=0;R<q9;++R)l[R]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=Y9e(t,i,this._buffersUsage,this._instanced,this._batchTable,this._sdf),h=this._vaf.writers;for(let R=0;R<i;++R){let L=this._billboards[R];L._dirty=!1,L.textureDirty=!1,J9e(this,e,h,L)}this._vaf.commit(V9(t))}this._billboardsToUpdateIndex=0}else if(a>0){let R=iWe;R.length=0,(l[$v]||l[k9e]||l[B9e])&&R.push(Dae),(l[Db]||l[yae]||l[N9e]||l[F9e]||l[L9e])&&(R.push(Lae),this._instanced&&R.push(W9)),(l[Db]||l[U9e]||l[Aae])&&(R.push(Nae),R.push(j9)),(l[Db]||l[xae])&&R.push(j9),(l[Db]||l[bae])&&R.push(W9),l[Tae]&&R.push(Fae),l[Cae]&&R.push(Bae),(l[Eae]||l[V9e]||l[Db]||l[$v])&&R.push(kae),(l[Db]||l[$v])&&R.push(Uae),l[Sae]&&R.push(Vae),l[wae]&&R.push(zae);let L=R.length;if(h=this._vaf.writers,a/i>.1){for(let B=0;B<a;++B){let _=s[B];_._dirty=!1,_.textureDirty=!1;for(let w=0;w<L;++w)R[w](this,e,h,_)}this._vaf.commit(V9(t))}else{for(let B=0;B<a;++B){let _=s[B];_._dirty=!1,_.textureDirty=!1;for(let w=0;w<L;++w)R[w](this,e,h,_);this._instanced?this._vaf.subCommit(_._index,1):this._vaf.subCommit(_._index*4,4)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>i*1.5&&(s.length=i),!c(this._vaf)||!c(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=F.IDENTITY;e.mode===oe.SCENE3D?(y=this.modelMatrix,m=le.clone(this._baseVolumeWC,this._boundingVolume)):m=le.clone(this._baseVolume2D,this._boundingVolume),tWe(this,e,m);let b=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,b){this._blendOption===Po.OPAQUE||this._blendOption===Po.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:ne.LESS},depthMask:!0}):this._rsOpaque=void 0;let R=this._blendOption===Po.TRANSLUCENT;this._blendOption===Po.TRANSLUCENT||this._blendOption===Po.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:R?ne.LEQUAL:ne.LESS},depthMask:R,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let x,A,E,S,v,P=ut.maximumVertexTextureImageUnits>0;if(b||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){x=DB,A=vB,v=[],c(this._batchTable)&&(v.push("VECTOR_TILE"),x=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(x),A=this._batchTable.getFragmentShaderCallback(!1,void 0)(A)),E=new He({defines:v,sources:[x]}),this._instanced&&E.defines.push("INSTANCED"),this._shaderRotation&&E.defines.push("ROTATION"),this._shaderAlignedAxis&&E.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&E.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&E.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&E.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&E.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&E.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&(P?E.defines.push("VERTEX_DEPTH_CHECK"):E.defines.push("FRAGMENT_DEPTH_CHECK"));let R=1-sa.CUTOFF;this._sdf&&E.defines.push("SDF");let L=c(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Po.OPAQUE_AND_TRANSLUCENT&&(S=new He({defines:["OPAQUE",L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=en.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:oo}),S=new He({defines:["TRANSLUCENT",L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=en.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:oo})),this._blendOption===Po.OPAQUE&&(S=new He({defines:[L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._sp=en.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:oo})),this._blendOption===Po.TRANSLUCENT&&(S=new He({defines:[L],sources:[A]}),this._shaderClampToGround&&(P?S.defines.push("VERTEX_DEPTH_CHECK"):S.defines.push("FRAGMENT_DEPTH_CHECK")),this._sdf&&(S.defines.push("SDF"),S.defines.push(`SDF_EDGE ${R}`)),this._spTranslucent=en.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:E,fragmentShaderSource:S,attributeLocations:oo})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let M=e.commandList;if(p.render||p.pick){let R=this._colorCommands,L=this._blendOption===Po.OPAQUE,B=this._blendOption===Po.OPAQUE_AND_TRANSLUCENT,_=this._vaf.va,w=_.length,D=this._uniforms,I;c(this._batchTable)?(D=this._batchTable.getUniformMapCallback()(D),I=this._batchTable.getPickId()):I="v_pickColor",R.length=w;let N=B?w*2:w;for(let k=0;k<N;++k){let H=R[k];c(H)||(H=R[k]=new Je);let V=L||B&&k%2===0;H.pass=V||!B?De.OPAQUE:De.TRANSLUCENT,H.owner=this;let j=B?Math.floor(k/2):k;H.boundingVolume=m,H.modelMatrix=y,H.count=_[j].indicesCount,H.shaderProgram=V?this._sp:this._spTranslucent,H.uniformMap=D,H.vertexArray=_[j].va,H.renderState=V?this._rsOpaque:this._rsTranslucent,H.debugShowBoundingVolume=this.debugShowBoundingVolume,H.pickId=I,this._instanced&&(H.count=6,H.instanceCount=i),M.push(H)}this.debugShowTextureAtlas&&(c(this.debugCommand)||(this.debugCommand=nWe(this,e.context)),M.push(this.debugCommand))}this._allBillboardsReady=o};Af.prototype.isDestroyed=function(){return!1};Af.prototype.destroy=function(){return c(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),vae(this._billboards),de(this)};var Cf=Af;function oWe(e,t,n,i,o){return function(){let r=document.createElement("canvas"),s=o+2*i;r.height=r.width=s;let a=r.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),r}}var ZA=oWe;function aa(e,t,n,i,o){this._content=e,this._billboard=n,this._label=i,this._polyline=o,this._batchId=t,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),QA(this)}var rWe=new he;Object.defineProperties(aa.prototype,{show:{get:function(){return this._label.show},set:function(e){this._label.show=e,this._billboard.show=e,this._polyline.show=e}},color:{get:function(){return this._color},set:function(e){this._color=G.clone(e,this._color),QA(this)}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=e,QA(this)}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=G.clone(e,this._pointOutlineColor),QA(this)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=e,QA(this)}},labelColor:{get:function(){return this._label.fillColor},set:function(e){this._label.fillColor=e,this._polyline.show=this._label.show&&e.alpha>0}},labelOutlineColor:{get:function(){return this._label.outlineColor},set:function(e){this._label.outlineColor=e}},labelOutlineWidth:{get:function(){return this._label.outlineWidth},set:function(e){this._label.outlineWidth=e}},font:{get:function(){return this._label.font},set:function(e){this._label.font=e}},labelStyle:{get:function(){return this._label.style},set:function(e){this._label.style=e}},labelText:{get:function(){return this._label.text},set:function(e){c(e)||(e=""),this._label.text=e}},backgroundColor:{get:function(){return this._label.backgroundColor},set:function(e){this._label.backgroundColor=e}},backgroundPadding:{get:function(){return this._label.backgroundPadding},set:function(e){this._label.backgroundPadding=e}},backgroundEnabled:{get:function(){return this._label.showBackground},set:function(e){this._label.showBackground=e}},scaleByDistance:{get:function(){return this._label.scaleByDistance},set:function(e){this._label.scaleByDistance=e,this._billboard.scaleByDistance=e}},translucencyByDistance:{get:function(){return this._label.translucencyByDistance},set:function(e){this._label.translucencyByDistance=e,this._billboard.translucencyByDistance=e}},distanceDisplayCondition:{get:function(){return this._label.distanceDisplayCondition},set:function(e){this._label.distanceDisplayCondition=e,this._polyline.distanceDisplayCondition=e,this._billboard.distanceDisplayCondition=e}},heightOffset:{get:function(){return this._heightOffset},set:function(e){let t=this._heightOffset??0,n=this._content.tileset.ellipsoid,i=n.cartesianToCartographic(this._billboard.position,rWe);i.height=i.height-t+e;let o=n.cartographicToCartesian(i);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=e}},anchorLineEnabled:{get:function(){return this._polyline.show},set:function(e){this._polyline.show=e}},anchorLineColor:{get:function(){return this._polyline.material.uniforms.color},set:function(e){this._polyline.material.uniforms.color=G.clone(e,this._polyline.material.uniforms.color)}},image:{get:function(){return this._billboardImage},set:function(e){let t=this._billboardImage!==e;this._billboardImage=e,t&&QA(this)}},disableDepthTestDistance:{get:function(){return this._label.disableDepthTestDistance},set:function(e){this._label.disableDepthTestDistance=e,this._billboard.disableDepthTestDistance=e}},horizontalOrigin:{get:function(){return this._billboard.horizontalOrigin},set:function(e){this._billboard.horizontalOrigin=e}},verticalOrigin:{get:function(){return this._billboard.verticalOrigin},set:function(e){this._billboard.verticalOrigin=e}},labelHorizontalOrigin:{get:function(){return this._label.horizontalOrigin},set:function(e){this._label.horizontalOrigin=e}},labelVerticalOrigin:{get:function(){return this._label.verticalOrigin},set:function(e){this._label.verticalOrigin=e}},content:{get:function(){return this._content}},tileset:{get:function(){return this._content.tileset}},primitive:{get:function(){return this._content.tileset}},pickIds:{get:function(){let e=this._pickIds;return e[0]=this._billboard.pickId,e[1]=this._label.pickId,e[2]=this._polyline.pickId,e}}});aa.defaultColor=G.WHITE;aa.defaultPointOutlineColor=G.BLACK;aa.defaultPointOutlineWidth=0;aa.defaultPointSize=8;function QA(e){let t=e._billboard;if(c(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(c(e._billboardImage))return;let n=e._color??aa.defaultColor,i=e._pointOutlineColor??aa.defaultPointOutlineColor,o=e._pointOutlineWidth??aa.defaultPointOutlineWidth,r=e._pointSize??aa.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,l=e._billboardOutlineWidth,u=e._billboardSize;if(G.equals(n,s)&&G.equals(i,a)&&o===l&&r===u)return;e._billboardColor=G.clone(n,e._billboardColor),e._billboardOutlineColor=G.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let f=n.alpha,h=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([h,r,p,o]);t.setImage(g,ZA(f,h,p,o,r))}aa.prototype.hasProperty=function(e){return this._content.batchTable.hasProperty(this._batchId,e)};aa.prototype.getPropertyIds=function(e){return this._content.batchTable.getPropertyIds(this._batchId,e)};aa.prototype.getProperty=function(e){return this._content.batchTable.getProperty(this._batchId,e)};aa.prototype.getPropertyInherited=function(e){return ta.getPropertyInherited(this._content,this._batchId,e)};aa.prototype.setProperty=function(e,t){this._content.batchTable.setProperty(this._batchId,e,t),this._content.featurePropertiesDirty=!0};aa.prototype.isExactClass=function(e){return this._content.batchTable.isExactClass(this._batchId,e)};aa.prototype.isClass=function(e){return this._content.batchTable.isClass(this._batchId,e)};aa.prototype.getExactClassName=function(){return this._content.batchTable.getExactClassName(this._batchId)};var qg=aa;function sWe(e,t,n,i,o){let r=e.measureText(t);if(!!/\S/.test(t)){let a=document.defaultView.getComputedStyle(e.canvas).getPropertyValue("font-size").replace("px",""),l=document.createElement("canvas"),u=100,f=r.width+u|0,h=3*a,p=h/2;l.width=f,l.height=h;let g=l.getContext("2d");g.font=n,g.fillStyle="white",g.fillRect(0,0,l.width+1,l.height+1),i&&(g.strokeStyle="black",g.lineWidth=e.lineWidth,g.strokeText(t,u/2,p)),o&&(g.fillStyle="black",g.fillText(t,u/2,p));let m=g.getImageData(0,0,f,h).data,y=m.length,b=f*4,x,A,E,S;for(x=0;x<y;++x)if(m[x]!==255){E=x/b|0;break}for(x=y-1;x>=0;--x)if(m[x]!==255){S=x/b|0;break}let v=-1;for(x=0;x<f&&v===-1;++x)for(A=0;A<h;++A){let P=x*4+A*b;if(m[P]!==255||m[P+1]!==255||m[P+2]!==255||m[P+3]!==255){v=x;break}}return{width:r.width,height:S-E,ascent:p-E,descent:S-p,minx:v-u/2}}return{width:r.width,height:0,ascent:0,descent:0,minx:0}}var Pb;function aWe(e,t){if(!c(e))throw new C("text is required.");if(e==="")return;t=t??W.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,o=t.fill??!0,r=t.strokeWidth??1,s=t.backgroundColor??G.TRANSPARENT,a=t.padding??0,l=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});c(Pb)||(c(f.imageSmoothingEnabled)?Pb="imageSmoothingEnabled":c(f.mozImageSmoothingEnabled)?Pb="mozImageSmoothingEnabled":c(f.webkitImageSmoothingEnabled)?Pb="webkitImageSmoothingEnabled":c(f.msImageSmoothingEnabled)&&(Pb="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=r,f[Pb]=!1,u.style.visibility="hidden",document.body.appendChild(u);let h=sWe(f,e,n,i,o);u.dimensions=h,document.body.removeChild(u),u.style.visibility="";let p=-h.minx,g=Math.ceil(h.width)+p+l,m=h.height+l,y=m-h.ascent+a,b=m-y+l;if(u.width=g,u.height=m,f.font=n,f.lineJoin="round",f.lineWidth=r,f[Pb]=!1,s!==G.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let x=t.strokeColor??G.BLACK;f.strokeStyle=x.toCssColorString(),f.strokeText(e,p+a,b)}if(o){let x=t.fillColor??G.WHITE;f.fillStyle=x.toCssColorString(),f.fillText(e,p+a,b)}return u}var JA=aWe;var Jae=jr(Wae(),1);var lWe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2},Ko=Object.freeze(lWe);var qae={},Yae=0,uWe=256,fWe=new G(.165,.165,.165,.8),dWe=new z(7,5),as=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function Ib(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function Qv(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function Jv(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Kae(e){let t=qae[e._font];if(!c(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(Jv(n,"line-height"));isNaN(i)&&(i=void 0),t={family:Jv(n,"font-family"),size:Jv(n,"font-size").replace("px",""),style:Jv(n,"font-style"),weight:Jv(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Yae<uWe&&(qae[e._font]=t,Yae++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function vd(e,t){if(e=e??W.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than 0.0.");let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Bt.clone(n)}if(c(i)){if(i.far<=i.near)throw new C("pixelOffsetScaleByDistance.far must be greater than pixelOffsetScaleByDistance.near.");i=Bt.clone(i)}if(c(o)){if(o.far<=o.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");o=Bt.clone(o)}if(c(r)){if(r.far<=r.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");r=Lt.clone(r)}this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=G.clone(e.fillColor??G.WHITE),this._outlineColor=G.clone(e.outlineColor??G.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=G.clone(e.backgroundColor??fWe),this._backgroundPadding=z.clone(e.backgroundPadding??dWe),this._style=e.style??Ko.FILL,this._verticalOrigin=e.verticalOrigin??Fn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??xi.LEFT,this._pixelOffset=z.clone(e.pixelOffset??z.ZERO),this._eyeOffset=d.clone(e.eyeOffset??d.ZERO),this._position=d.clone(e.position??d.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=e.heightReference??qe.NONE,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,Kae(this),this._updateClamping()}Object.defineProperties(vd.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new C("value is required.");if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;c(r)&&(r.show=e)}let n=this._backgroundBillboard;c(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){if(!c(e))throw new C("value is required.");let t=this._position;if(!d.equals(t,e)){d.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o].billboard;c(s)&&(s.position=e)}let i=this._backgroundBillboard;c(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(!c(e))throw new C("value is required.");if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;c(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;c(n)&&(n.heightReference=e),Qv(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(!c(e))throw new C("value is required.");if(this._text!==e){this._text=e;let t=vd.filterUnsupportedCharacters(e);this._renderedText=vd.enableRightToLeftDetection?yWe(t):t,Ib(this)}}},font:{get:function(){return this._font},set:function(e){if(!c(e))throw new C("value is required.");this._font!==e&&(this._font=e,Ib(this),Kae(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){if(!c(e))throw new C("value is required.");let t=this._fillColor;G.equals(t,e)||(G.clone(e,t),Ib(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new C("value is required.");let t=this._outlineColor;G.equals(t,e)||(G.clone(e,t),Ib(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!c(e))throw new C("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,Ib(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){if(!c(e))throw new C("value is required.");this._showBackground!==e&&(this._showBackground=e,Ib(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){if(!c(e))throw new C("value is required.");let t=this._backgroundColor;if(!G.equals(t,e)){G.clone(e,t);let n=this._backgroundBillboard;c(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){if(!c(e))throw new C("value is required.");let t=this._backgroundPadding;z.equals(t,e)||(z.clone(e,t),Qv(this))}},style:{get:function(){return this._style},set:function(e){if(!c(e))throw new C("value is required.");this._style!==e&&(this._style=e,Ib(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){if(!c(e))throw new C("value is required.");let t=this._pixelOffset;if(!z.equals(t,e)){z.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;c(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");let t=this._translucencyByDistance;if(!Bt.equals(t,e)){this._translucencyByDistance=Bt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;c(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");let t=this._pixelOffsetScaleByDistance;if(!Bt.equals(t,e)){this._pixelOffsetScaleByDistance=Bt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;c(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");let t=this._scaleByDistance;if(!Bt.equals(t,e)){this._scaleByDistance=Bt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;c(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){if(!c(e))throw new C("value is required.");let t=this._eyeOffset;if(!d.equals(t,e)){d.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];c(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;c(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){if(!c(e))throw new C("value is required.");this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Qv(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(!c(e))throw new C("value is required.");if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;c(n)&&(n.verticalOrigin=e),Qv(this)}}},scale:{get:function(){return this._scale},set:function(e){if(!c(e))throw new C("value is required.");if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;c(n)&&(n.scale=e*this._relativeSize),Qv(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far must be greater than near");if(!Lt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;c(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(c(e)&&e<0)throw new C("disableDepthTestDistance must be greater than 0.0.");this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;c(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;c(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!c(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=d.clone(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;c(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];c(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;c(n)&&(n.clusterShow=e)}}}});vd.prototype._updateClamping=function(){ao._updateClamping(this._labelCollection,this)};vd.prototype.computeScreenSpacePosition=function(e,t){if(!c(e))throw new C("scene is required.");c(t)||(t=new z);let i=this._labelCollection.modelMatrix,o=c(this._actualClampedPosition)?this._actualClampedPosition:this._position;return ao._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};vd.getScreenSpaceBoundingBox=function(e,t,n){let i=0,o=0,r=0,s=0,a=e.totalScale,l=e._backgroundBillboard;if(c(l))i=t.x+l._translate.x,o=t.y-l._translate.y,r=l.width*a,s=l.height*a,e.verticalOrigin===Fn.BOTTOM||e.verticalOrigin===Fn.BASELINE?o-=s:e.verticalOrigin===Fn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let u=0,f=0,h=e._glyphs,p=h.length;for(let g=0;g<p;++g){let m=h[g],y=m.billboard;if(!c(y))continue;let b=t.x+y._translate.x,x=t.y-y._translate.y,A=m.dimensions.width*a,E=m.dimensions.height*a;e.verticalOrigin===Fn.BOTTOM||e.verticalOrigin===Fn.BASELINE?x-=E:e.verticalOrigin===Fn.CENTER&&(x-=E*.5),e._verticalOrigin===Fn.TOP?x+=sa.PADDING*a:(e._verticalOrigin===Fn.BOTTOM||e._verticalOrigin===Fn.BASELINE)&&(x-=sa.PADDING*a),i=Math.min(i,b),o=Math.min(o,x),u=Math.max(u,b+A),f=Math.max(f,x+E)}r=u-i,s=f-o}return c(n)||(n=new Ke),n.x=i,n.y=o,n.width=r,n.height=s,n};vd.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};vd.prototype.equals=function(e){return this===e||c(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&d.equals(this._position,e._position)&&G.equals(this._fillColor,e._fillColor)&&G.equals(this._outlineColor,e._outlineColor)&&G.equals(this._backgroundColor,e._backgroundColor)&&z.equals(this._backgroundPadding,e._backgroundPadding)&&z.equals(this._pixelOffset,e._pixelOffset)&&d.equals(this._eyeOffset,e._eyeOffset)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Bt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Lt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};vd.prototype.isDestroyed=function(){return!1};vd.enableRightToLeftDetection=!1;function hWe(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=as.LTR,a="",l=e.length;for(let u=0;u<l;++u){let f=e.charAt(u);t.test(f)?a=as.RTL:n.test(f)?a=as.LTR:i.test(f)?a=as.BRACKETS:a=as.WEAK,u===0&&(s=a),s===a&&a!==as.BRACKETS?r+=f:(r!==""&&o.push({Type:s,Word:r}),s=a,r=f)}return o.push({Type:a,Word:r}),o}function mWe(e){return e.split("").reverse().join("")}function eD(e,t,n){return e.slice(0,t)+n+e.slice(t)}function pWe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var _We="\u05D0-\u05EA",gWe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Xae=new RegExp(`[${_We}${gWe}]`);function yWe(e){let t=e.split(`
`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=Xae.test(o.charAt(0)),s=hWe(o,Xae),a=0,l="";for(let u=0;u<s.length;++u){let f=s[u],h=f.Type===as.BRACKETS?pWe(f.Word):mWe(f.Word);r?f.Type===as.RTL?(l=h+l,a=0):f.Type===as.LTR?(l=eD(l,a,f.Word),a+=f.Word.length):(f.Type===as.WEAK||f.Type===as.BRACKETS)&&(f.Type===as.WEAK&&s[u-1].Type===as.BRACKETS?l=h+l:s[u-1].Type===as.RTL?(l=h+l,a=0):s.length>u+1?s[u+1].Type===as.RTL?(l=h+l,a=0):(l=eD(l,a,f.Word),a+=f.Word.length):l=eD(l,0,h)):f.Type===as.RTL?l=eD(l,a,h):f.Type===as.LTR?(l+=f.Word,a=l.length):(f.Type===as.WEAK||f.Type===as.BRACKETS)&&(u>0&&s[u-1].Type===as.RTL?s.length>u+1?s[u+1].Type===as.RTL?l=eD(l,a,h):(l+=f.Word,a=l.length):l+=f.Word:(l+=f.Word,a=l.length))}n+=l,i<t.length-1&&(n+=`
`)}return n}var Ob=vd;var ece=jr($ae(),1);function xWe(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var TWe=1.2,Zae="ID_WHITE_PIXEL",K9=new z(4,4),AWe=new Ke(1,1,1,1);function CWe(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=K9.x,o.height=K9.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(Zae,o),n.addImageSubRegion(Zae,AWe)}let i=e.add({collection:t});return i.setImageTexture(n),i}var Hp={};function EWe(e,t,n,i,o,r){return Hp.font=t,Hp.fillColor=n,Hp.strokeColor=i,Hp.strokeWidth=o,Hp.padding=sa.PADDING,Hp.fill=r===Ko.FILL||r===Ko.FILL_AND_OUTLINE,Hp.stroke=r===Ko.OUTLINE||r===Ko.FILL_AND_OUTLINE,Hp.backgroundColor=G.BLACK,JA(e,Hp)}function $9(e,t){let n=t.billboard;c(n)&&(n.show=!1,c(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var SWe=new ece.default,wWe=/\s/;function vWe(e,t){let n=t._renderedText,i=SWe.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length;if(t._relativeSize=t._fontSize/sa.FONT_SIZE,o<s)for(let g=o;g<s;++g)$9(e,r[g]);r.length=o;let a=t.show&&t._showBackground&&n.split(`
`).join("").length>0,l=t._backgroundBillboard,u=e._backgroundBillboardCollection;a?(c(l)||(l=CWe(u,e),t._backgroundBillboard=l),l.color=t._backgroundColor,l.show=t._show,l.position=t._position,l.eyeOffset=t._eyeOffset,l.pixelOffset=t._pixelOffset,l.horizontalOrigin=xi.LEFT,l.verticalOrigin=t._verticalOrigin,l.heightReference=t._heightReference,l.scale=t.totalScale,l.pickPrimitive=t,l.id=t._id,l.translucencyByDistance=t._translucencyByDistance,l.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,l.scaleByDistance=t._scaleByDistance,l.distanceDisplayCondition=t._distanceDisplayCondition,l.disableDepthTestDistance=t._disableDepthTestDistance,l.clusterShow=t.clusterShow):c(l)&&(u.remove(l),t._backgroundBillboard=l=void 0);let f=e._glyphBillboardCollection,h=f.billboardTextureCache,p=e._textDimensionsCache;for(let g=0;g<o;++g){let m=i[g],y=t._verticalOrigin,b=JSON.stringify([m,t._fontFamily,t._fontStyle,t._fontWeight,+y]),x=p[b],A=h.get(b);if(!c(A)||!c(x)){A=new Wg(f),h.set(b,A);let P=`${t._fontStyle} ${t._fontWeight} ${sa.FONT_SIZE}px ${t._fontFamily}`,M=EWe(m,P,G.WHITE,G.WHITE,0,Ko.FILL);if(x=M.dimensions,p[b]=x,M.width>0&&M.height>0&&!wWe.test(m)){let R=(0,Jae.default)(M,{cutoff:sa.CUTOFF,radius:sa.RADIUS}),L=M.getContext("2d"),B=M.width,_=M.height,w=L.getImageData(0,0,B,_);for(let D=0;D<B;D++)for(let I=0;I<_;I++){let N=I*B+D,k=R[N]*255,H=N*4;w.data[H+0]=k,w.data[H+1]=k,w.data[H+2]=k,w.data[H+3]=k}L.putImageData(w,0,0),A.loadImage(b,M)}}let E=r[g];if(c(E)||(E=new xWe,E.dimensions=x,E.billboardTexture=A,r[g]=E),E.billboardTexture.id!==b&&(E.billboardTexture=A,E.dimensions=x),!A.hasImage){$9(e,E);continue}let S=E.billboard,v=e._spareBillboards;c(S)||(v.length>0?S=v.pop():(S=f.add({collection:e}),S._labelDimensions=new z,S._labelTranslate=new z),E.billboard=S),S.setImageTexture(A),S.show=t._show,S.position=t._position,S.eyeOffset=t._eyeOffset,S.pixelOffset=t._pixelOffset,S.horizontalOrigin=xi.LEFT,S.verticalOrigin=t._verticalOrigin,S.heightReference=t._heightReference,S.scale=t.totalScale,S.pickPrimitive=t,S.id=t._id,S.translucencyByDistance=t._translucencyByDistance,S.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,S.scaleByDistance=t._scaleByDistance,S.distanceDisplayCondition=t._distanceDisplayCondition,S.disableDepthTestDistance=t._disableDepthTestDistance,S._batchIndex=t._batchIndex,S.outlineColor=t.outlineColor,t.style===Ko.FILL_AND_OUTLINE?(S.color=t._fillColor,S.outlineWidth=t.outlineWidth):t.style===Ko.FILL?(S.color=t._fillColor,S.outlineWidth=0):t.style===Ko.OUTLINE&&(S.color=G.TRANSPARENT,S.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function Qae(e,t,n){return t===xi.CENTER?-e/2:t===xi.RIGHT?-(e+n.x):n.x}var lr=new z,DWe=new z;function PWe(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],s=Number.NEGATIVE_INFINITY,a=0,l=1,u=t.length,f=e._backgroundBillboard,h=z.clone(c(f)?e._backgroundPadding:z.ZERO,DWe);h.x/=e._relativeSize,h.y/=e._relativeSize;for(let L=0;L<u;++L){if(n.charAt(L)===`
`){r.push(i),++l,i=0;continue}let _=t[L].dimensions;c(_)&&(a=Math.max(a,_.height-_.descent),s=Math.max(s,_.descent),i+=_.width-_.minx,L<u-1&&(i+=t[L+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let p=a+s,g=e.totalScale,m=e._horizontalOrigin,y=e._verticalOrigin,b=0,x=r[b],A=Qae(x,m,h),E=(c(e._lineHeight)?e._lineHeight:TWe*e._fontSize)/e._relativeSize,S=E*(l-1),v=o,P=p+S;c(f)&&(v+=h.x*2,P+=h.y*2,f._labelHorizontalOrigin=m),lr.x=A*g,lr.y=0;let M=!0,R=0;for(let L=0;L<u;++L){if(n.charAt(L)===`
`){++b,R+=E,x=r[b],A=Qae(x,m,h),lr.x=A*g,M=!0;continue}let B=t[L],_=B.dimensions;if(c(_)&&(y===Fn.TOP?(lr.y=_.height-a-h.y,lr.y+=sa.PADDING):y===Fn.CENTER?lr.y=(S+_.height-a)/2:y===Fn.BASELINE?(lr.y=S,lr.y-=sa.PADDING):(lr.y=S+s+h.y,lr.y-=sa.PADDING),lr.y=(lr.y-_.descent-R)*g,M&&(lr.x-=sa.PADDING*g,M=!1),c(B.billboard)&&(B.billboard._setTranslate(lr),B.billboard._labelDimensions.x=v,B.billboard._labelDimensions.y=P,B.billboard._labelHorizontalOrigin=m),L<u-1)){let w=t[L+1];lr.x+=(_.width-_.minx+w.dimensions.minx)*g}}if(c(f)&&n.split(`
`).join("").length>0&&(m===xi.CENTER?A=-o/2-h.x:m===xi.RIGHT?A=-(o+h.x*2):A=0,lr.x=A*g,y===Fn.TOP?lr.y=p-a-s:y===Fn.CENTER?lr.y=(p-a)/2-s:y===Fn.BASELINE?lr.y=-h.y-s:lr.y=0,lr.y=lr.y*g,f.width=v,f.height=P,f._setTranslate(lr),f._labelTranslate=z.clone(lr,f._labelTranslate)),of(e.heightReference))for(let L=0;L<u;++L){let _=t[L].billboard;c(_)&&(_._labelTranslate=z.clone(lr,_._labelTranslate))}}function tce(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)$9(e,n[i]);c(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,c(t._removeCallbackFunc)&&t._removeCallbackFunc(),de(t)}function sm(e){e=e??W.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new Cf({scene:this._scene,textureAtlas:new LT({initialSize:K9})});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new Wg(t),this._glyphBillboardCollection=new Cf({scene:this._scene,batchTable:this._batchTable}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=G.clone(G.WHITE),this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Po.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(sm.prototype,{length:{get:function(){return this._labels.length}},sizeInBytes:{get:function(){return this._glyphBillboardCollection.sizeInBytes+this._backgroundBillboardCollection.sizeInBytes}},ready:{get:function(){let e=this._backgroundBillboardCollection.get(0);return c(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}}});sm.prototype.add=function(e){let t=new Ob(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};sm.prototype.remove=function(e){if(c(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),tce(this,e),!0}return!1};sm.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)tce(this,e[t]);e.length=0};sm.prototype.contains=function(e){return c(e)&&e._labelCollection===this};sm.prototype.get=function(e){if(!c(e))throw new C("index is required.");return this._labels[e]};sm.prototype.update=function(e){if(!this.show)return;let t=this._glyphBillboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=this._labelsToUpdate.length;for(let r=0;r<i;++r){let s=this._labelsToUpdate[r];if(s.isDestroyed())continue;let a=s._glyphs.length;s._rebindAllGlyphs&&(vWe(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(PWe(s),s._repositionAllGlyphs=!1);let l=s._glyphs.length-a;this._totalGlyphCount+=l}let o=n.length>0?Po.TRANSLUCENT:this.blendOption;t.blendOption=o,n.blendOption=o,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};sm.prototype.isDestroyed=function(){return!1};sm.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),de(this)};var Gp=sm;var RB=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec3 position2DHigh;
in vec3 position2DLow;
in vec3 prevPosition3DHigh;
in vec3 prevPosition3DLow;
in vec3 prevPosition2DHigh;
in vec3 prevPosition2DLow;
in vec3 nextPosition3DHigh;
in vec3 nextPosition3DLow;
in vec3 nextPosition2DHigh;
in vec3 nextPosition2DLow;
in vec4 texCoordExpandAndBatchIndex;
out vec2 v_st;
out float v_width;
out vec4 v_pickColor;
out float v_polylineAngle;
void main()
{
float texCoord = texCoordExpandAndBatchIndex.x;
float expandDir = texCoordExpandAndBatchIndex.y;
bool usePrev = texCoordExpandAndBatchIndex.z < 0.0;
float batchTableIndex = texCoordExpandAndBatchIndex.w;
vec2 widthAndShow = batchTable_getWidthAndShow(batchTableIndex);
float width = widthAndShow.x + 0.5;
float show = widthAndShow.y;
if (width < 1.0)
{
show = 0.0;
}
vec4 pickColor = batchTable_getPickColor(batchTableIndex);
vec4 p, prev, next;
if (czm_morphTime == 1.0)
{
p = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);
prev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);
next = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);
}
else if (czm_morphTime == 0.0)
{
p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);
prev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);
next = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);
}
else
{
p = czm_columbusViewMorph(
czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),
czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),
czm_morphTime);
prev = czm_columbusViewMorph(
czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),
czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),
czm_morphTime);
next = czm_columbusViewMorph(
czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),
czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),
czm_morphTime);
}
#ifdef DISTANCE_DISPLAY_CONDITION
vec3 centerHigh = batchTable_getCenterHigh(batchTableIndex);
vec4 centerLowAndRadius = batchTable_getCenterLowAndRadius(batchTableIndex);
vec3 centerLow = centerLowAndRadius.xyz;
float radius = centerLowAndRadius.w;
vec2 distanceDisplayCondition = batchTable_getDistanceDisplayCondition(batchTableIndex);
float lengthSq;
if (czm_sceneMode == czm_sceneMode2D)
{
lengthSq = czm_eyeHeight2D.y;
}
else
{
vec4 center = czm_translateRelativeToEye(centerHigh.xyz, centerLow.xyz);
lengthSq = max(0.0, dot(center.xyz, center.xyz) - radius * radius);
}
float nearSq = distanceDisplayCondition.x * distanceDisplayCondition.x;
float farSq = distanceDisplayCondition.y * distanceDisplayCondition.y;
if (lengthSq < nearSq || lengthSq > farSq)
{
show = 0.0;
}
#endif
float polylineAngle;
vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, polylineAngle);
gl_Position = czm_viewportOrthographic * positionWC * show;
v_st.s = texCoord;
v_st.t = czm_writeNonPerspective(clamp(expandDir, 0.0, 1.0), gl_Position.w);
v_width = width;
v_pickColor = pickColor;
v_polylineAngle = polylineAngle;
}
`;var Hc={};Hc.numberOfPoints=function(e,t,n){let i=d.distance(e,t);return Math.ceil(i/n)};Hc.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var IWe=new he;Hc.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o<n;o++){let r=e[o];i[o]=t.cartesianToCartographic(r,IWe).height}return i};var OWe=new F,RWe=new d,nce=new d,MWe=new sn(d.UNIT_X,0),ice=new d,LWe=new sn(d.UNIT_X,0),NWe=new d,FWe=new d,Q9=[];function rce(e,t,n){let i=Q9;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let s=(n-t)/e;for(o=0;o<e;o++){let a=t+o*s;i[o]=a}return i}var LB=new he,MB=new he,Yg=new d,J9=new d,BWe=new d,Z9=new J_,tD=new Ja;function kWe(e,t,n,i,o,r,s,a){let l=i.scaleToGeodeticSurface(e,J9),u=i.scaleToGeodeticSurface(t,BWe),f=Hc.numberOfPoints(e,t,n),h=i.cartesianToCartographic(l,LB),p=i.cartesianToCartographic(u,MB),g=rce(f,o,r);Z9.setEndPoints(h,p);let m=Z9.surfaceDistance/f,y=a;h.height=o;let b=i.cartographicToCartesian(h,Yg);d.pack(b,s,y),y+=3;for(let x=1;x<f;x++){let A=Z9.interpolateUsingSurfaceDistance(x*m,MB);A.height=g[x],b=i.cartographicToCartesian(A,Yg),d.pack(b,s,y),y+=3}return y}function UWe(e,t,n,i,o,r,s,a){let l=i.cartesianToCartographic(e,LB),u=i.cartesianToCartographic(t,MB),f=Hc.numberOfPointsRhumbLine(l,u,n);l.height=0,u.height=0;let h=rce(f,o,r);tD.ellipsoid.equals(i)||(tD=new Ja(void 0,void 0,i)),tD.setEndPoints(l,u);let p=tD.surfaceDistance/f,g=a;l.height=o;let m=i.cartographicToCartesian(l,Yg);d.pack(m,s,g),g+=3;for(let y=1;y<f;y++){let b=tD.interpolateUsingSurfaceDistance(y*p,MB);b.height=h[y],m=i.cartographicToCartesian(b,Yg),d.pack(m,s,g),g+=3}return g}Hc.wrapLongitude=function(e,t){let n=[],i=[];if(c(e)&&e.length>0){t=t??F.IDENTITY;let o=F.inverseTransformation(t,OWe),r=F.multiplyByPoint(o,d.ZERO,RWe),s=d.normalize(F.multiplyByPointAsVector(o,d.UNIT_Y,nce),nce),a=sn.fromPointNormal(r,s,MWe),l=d.normalize(F.multiplyByPointAsVector(o,d.UNIT_X,ice),ice),u=sn.fromPointNormal(r,l,LWe),f=1;n.push(d.clone(e[0]));let h=n[0],p=e.length;for(let g=1;g<p;++g){let m=e[g];if(sn.getPointDistance(u,h)<0||sn.getPointDistance(u,m)<0){let y=Qn.lineSegmentPlane(h,m,a,NWe);if(c(y)){let b=d.multiplyByScalar(s,5e-9,FWe);sn.getPointDistance(a,h)<0&&d.negate(b,b),n.push(d.add(y,b,new d)),i.push(f+1),d.negate(b,b),n.push(d.add(y,b,new d)),f=1}}n.push(d.clone(e[g])),f++,h=m}i.push(f)}return{positions:n,lengths:i}};Hc.generateArc=function(e){c(e)||(e={});let t=e.positions;if(!c(t))throw new C("options.positions is required.");let n=t.length,i=e.ellipsoid??ie.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],J9);if(o=r?o[0]:o,o!==0){let b=i.geodeticSurfaceNormal(y,Yg);d.multiplyByScalar(b,o,b),d.add(y,b,y)}return[y.x,y.y,y.z]}let s=e.minDistance;if(!c(s)){let y=e.granularity??O.RADIANS_PER_DEGREE;s=O.chordLength(y,i.maximumRadius)}let a=0,l;for(l=0;l<n-1;l++)a+=Hc.numberOfPoints(t[l],t[l+1],s);let u=(a+1)*3,f=new Array(u),h=0;for(l=0;l<n-1;l++){let y=t[l],b=t[l+1],x=r?o[l]:o,A=r?o[l+1]:o;h=kWe(y,b,s,i,x,A,f,h)}Q9.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,LB);g.height=r?o[n-1]:o;let m=i.cartographicToCartesian(g,Yg);return d.pack(m,f,u-3),f};var oce=new he,VWe=new he;Hc.generateRhumbArc=function(e){c(e)||(e={});let t=e.positions;if(!c(t))throw new C("options.positions is required.");let n=t.length,i=e.ellipsoid??ie.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let x=i.scaleToGeodeticSurface(t[0],J9);if(o=r?o[0]:o,o!==0){let A=i.geodeticSurfaceNormal(x,Yg);d.multiplyByScalar(A,o,A),d.add(x,A,x)}return[x.x,x.y,x.z]}let s=e.granularity??O.RADIANS_PER_DEGREE,a=0,l,u=i.cartesianToCartographic(t[0],oce),f;for(l=0;l<n-1;l++)f=i.cartesianToCartographic(t[l+1],VWe),a+=Hc.numberOfPointsRhumbLine(u,f,s),u=he.clone(f,oce);let h=(a+1)*3,p=new Array(h),g=0;for(l=0;l<n-1;l++){let x=t[l],A=t[l+1],E=r?o[l]:o,S=r?o[l+1]:o;g=UWe(x,A,s,i,E,S,p,g)}Q9.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,LB);y.height=r?o[n-1]:o;let b=i.cartographicToCartesian(y,Yg);return d.pack(b,p,h-3),p};Hc.generateCartesianArc=function(e){let t=Hc.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};Hc.generateCartesianRhumbArc=function(e){let t=Hc.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=d.unpack(t,o*3);return i};var Bi=Hc;function uu(e,t){e=e??W.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,c(this._material)||(this._material=Xi.fromType(Xi.ColorType,{color:new G(1,1,1,1)}));let n=e.positions;c(n)||(n=[]),this._positions=n,this._actualPositions=xo(n,d.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(d.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;c(t)&&(i=F.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=Bi.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(ace),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=le.fromPoints(this._actualPositions),this._boundingVolumeWC=le.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new le}var sce=uu.POSITION_INDEX=0,zWe=uu.SHOW_INDEX=1,HWe=uu.WIDTH_INDEX=2,GWe=uu.MATERIAL_INDEX=3,nD=uu.POSITION_SIZE_INDEX=4,jWe=uu.DISTANCE_DISPLAY_CONDITION=5,ace=uu.NUMBER_OF_PROPERTIES=6;function jp(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;c(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(uu.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new C("value is required.");e!==this._show&&(this._show=e,jp(this,zWe))}},positions:{get:function(){return this._positions},set:function(e){if(!c(e))throw new C("value is required.");let t=xo(e,d.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(d.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&jp(this,nD),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=le.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=le.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),jp(this,sce),this.update()}},material:{get:function(){return this._material},set:function(e){if(!c(e))throw new C("material is required.");this._material!==e&&(this._material=e,jp(this,GWe))}},width:{get:function(){return this._width},set:function(e){if(!c(e))throw new C("value is required.");let t=this._width;e!==t&&(this._width=e,jp(this,HWe))}},loop:{get:function(){return this._loop},set:function(e){if(!c(e))throw new C("value is required.");if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!d.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(d.clone(t[0]))):t.length>2&&d.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,jp(this,nD)}}},id:{get:function(){return this._id},set:function(e){this._id=e,c(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!c(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");Lt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition),jp(this,jWe))}}});uu.prototype.update=function(){let e=F.IDENTITY;c(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[sce]>0||this._propertiesChanged[nD]>0;if((!F.equals(e,this._modelMatrix)||i)&&(this._segments=Bi.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=le.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=F.clone(e,this._modelMatrix),this._segments.positions.length!==t)jp(this,nD);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){jp(this,nD);break}}};uu.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};uu.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<ace-1;++t)e[t]=0};uu.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Dd=uu;var WWe=Dd.SHOW_INDEX,qWe=Dd.WIDTH_INDEX,tW=Dd.POSITION_INDEX,YWe=Dd.MATERIAL_INDEX,cce=Dd.POSITION_SIZE_INDEX,XWe=Dd.DISTANCE_DISPLAY_CONDITION,pce=Dd.NUMBER_OF_PROPERTIES,vl={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function Pd(e){e=e??W.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(pce),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Be.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=G.clone(G.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Pd.prototype,{length:{get:function(){return nW(this),this._polylines.length}}});Pd.prototype.add=function(e){let t=new Dd(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Pd.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,c(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};Pd.prototype.removeAll=function(){iW(this),xce(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Pd.prototype.contains=function(e){return c(e)&&e._polylineCollection===this};Pd.prototype.get=function(e){if(!c(e))throw new C("index is required.");return nW(this),this._polylines[e]};function KWe(e,t){c(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:$.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:$.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:$.FLOAT,componentsPerAttribute:2}];e._batchTable=new zT(t,n,e._polylines.length)}var _ce=new Hn,gce=new se,yce=new z;Pd.prototype.update=function(e){if(nW(this),this._polylines.length===0||!this.show)return;tqe(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(ut.maximumVertexTextureImageUnits===0)throw new ae("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");KWe(this,t),this._createBatchTable=!1}if(this._createVertexArray||ZWe(this))fce(this,t,n);else if(this._polylinesUpdated){let l=this._polylinesToUpdate;if(this._mode!==oe.SCENE3D){let u=l.length;for(let f=0;f<u;++f)i=l[f],i.update()}if(o[cce]||o[YWe])fce(this,t,n);else{let u=l.length,f=this._polylineBuckets;for(let h=0;h<u;++h){i=l[h],o=i._propertiesChanged;let p=i._bucket,g=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){o[tW]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((o[WWe]||o[qWe])&&this._batchTable.setBatchedAttribute(i._index,0,new z(i._width,i._show)),this._batchTable.attributes.length>2){if(o[tW]||o[cce]){let m=e.mode===oe.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Hn.fromCartesian(m.center,_ce),b=se.fromElements(y.low.x,y.low.y,y.low.z,m.radius,gce);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,b)}if(o[XWe]){let m=yce;m.x=0,m.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;c(y)&&(m.x=y.near,m.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}l.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let l=0;l<pce;++l)o[l]=0;let r=F.IDENTITY;e.mode===oe.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!c(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=ze.fromCache({depthMask:a,depthTest:{enabled:a}})),(!c(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=ze.fromCache({blending:un.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let l=this._colorCommands;$We(this,e,l,r)}};var iD=new le,lce=new le;function $We(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,l=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let m=0;m<g;++m){let y=u[m],b=y.buckets,x=b.length;for(let A=0;A<x;++A){let E=b[A],S=E.offset,v=E.bucket.shaderProgram,P=E.bucket.polylines,M=P.length,R,L,B=0,_,w;for(let D=0;D<M;++D){let I=P[D],N=JWe(I._material);if(N!==R){if(c(R)&&B>0){let j=L.isTranslucent();a>=s?(_=new Je({owner:e}),n.push(_)):_=n[a],++a,w=xt(p(L._uniforms),e._uniformMap),_.boundingVolume=le.clone(iD,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=j?e._translucentRS:e._opaqueRS,_.pass=j?De.TRANSLUCENT:De.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=w,_.count=B,_.offset=S,S+=B,B=0,l=!0,r.push(_)}L=I._material,L.update(o),R=N}let k=I._locatorBuckets,H=k.length;for(let j=0;j<H;++j){let U=k[j];U.locator===E&&(B+=U.count)}let V;t.mode===oe.SCENE3D?V=I._boundingVolumeWC:t.mode===oe.COLUMBUS_VIEW?V=I._boundingVolume2D:t.mode===oe.SCENE2D?c(I._boundingVolume2D)&&(V=le.clone(I._boundingVolume2D,lce),V.center.x=0):c(I._boundingVolumeWC)&&c(I._boundingVolume2D)&&(V=le.union(I._boundingVolumeWC,I._boundingVolume2D,lce)),l?(l=!1,le.clone(V,iD)):le.union(V,iD,iD)}c(R)&&B>0&&(a>=s?(_=new Je({owner:e}),n.push(_)):_=n[a],++a,w=xt(p(L._uniforms),e._uniformMap),_.boundingVolume=le.clone(iD,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=L.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=L.isTranslucent()?De.TRANSLUCENT:De.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=w,_.count=B,_.offset=S,l=!0,r.push(_)),R=void 0}}n.length=a}Pd.prototype.isDestroyed=function(){return!1};Pd.prototype.destroy=function(){return bce(this),iW(this),xce(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),de(this)};function ZWe(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[tW]?(i.bufferUsage!==Be.STREAM_DRAW&&(t=!0,i.bufferUsage=Be.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Be.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Be.STATIC_DRAW):i.frameCount--),t}var uce=[0,0,0];function fce(e,t,n){e._createVertexArray=!1,iW(e),bce(e),eqe(e);let i=[[]],o=i[0],r=e._batchTable,s=e._useHighlightColor,a=[0],l=0,u=[[]],f=0,h=e._polylineBuckets,p,g;for(p in h)h.hasOwnProperty(p)&&(g=h[p],g.updateShader(t,r,s),f+=g.lengthOfPositions);if(f>0){let m=e._mode,y=new Float32Array(6*f*3),b=new Float32Array(f*4),x,A=0,E=0,S=0;for(p in h)if(h.hasOwnProperty(p)){g=h[p],g.write(y,b,A,E,S,r,t,n),m===oe.MORPHING&&(c(x)||(x=new Float32Array(6*f*3)),g.writeForMorph(x,A));let w=g.lengthOfPositions;A+=6*w*3,E+=w*4,S+=w*4,l=g.updateIndices(i,a,u,l)}let v=e._positionBufferUsage.bufferUsage,P=Be.STATIC_DRAW;e._positionBuffer=bt.createVertexBuffer({context:t,typedArray:y,usage:v});let M;c(x)&&(M=bt.createVertexBuffer({context:t,typedArray:x,usage:v})),e._texCoordExpandAndBatchIndexBuffer=bt.createVertexBuffer({context:t,typedArray:b,usage:P});let R=3*Float32Array.BYTES_PER_ELEMENT,L=4*Float32Array.BYTES_PER_ELEMENT,B=0,_=i.length;for(let w=0;w<_;++w)if(o=i[w],o.length>0){let D=new Uint16Array(o),I=bt.createIndexBuffer({context:t,typedArray:D,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});B+=a[w];let N=6*(w*(R*O.SIXTY_FOUR_KILOBYTES)-B*R),k=R+N,H=R+k,V=R+H,j=R+V,U=R+j,q=w*(L*O.SIXTY_FOUR_KILOBYTES)-B*L,X=[{index:vl.position3DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:vl.position3DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:vl.position2DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:vl.position2DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:vl.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:H,strideInBytes:6*R},{index:vl.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:vl.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:H,strideInBytes:6*R},{index:vl.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:vl.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:vl.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:vl.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:vl.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:$.FLOAT,offsetInBytes:U,strideInBytes:6*R},{index:vl.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:$.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:q}],te,K,Z,ee;m===oe.SCENE3D?(K=e._positionBuffer,te="vertexBuffer",Z=uce,ee="value"):m===oe.SCENE2D||m===oe.COLUMBUS_VIEW?(K=uce,te="value",Z=e._positionBuffer,ee="vertexBuffer"):(K=M,te="vertexBuffer",Z=e._positionBuffer,ee="vertexBuffer"),X[0][te]=K,X[1][te]=K,X[2][ee]=Z,X[3][ee]=Z,X[4][te]=K,X[5][te]=K,X[6][ee]=Z,X[7][ee]=Z,X[8][te]=K,X[9][te]=K,X[10][ee]=Z,X[11][ee]=Z;let me=new ni({context:t,attributes:X,indexBuffer:I});e._vertexArrays.push({va:me,buckets:u[w]})}}}function QWe(e,t){return t instanceof Rt?t.id:t}var NB=[];function JWe(e){let t=Xi._uniformList[e.type],n=t.length;NB.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];NB[i]=r,NB[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(NB,QWe)}`}function eqe(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let l=a.material,u=i[l.type];c(u)||(u=i[l.type]=new am(l,t,n)),u.addPolyline(a)}}}function tqe(e,t){let n=t.mode;(e._mode!==n||!F.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=F.clone(e.modelMatrix),e._createVertexArray=!0)}function nW(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s<r;++s)o=e._polylines[s],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function iW(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;c(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function bce(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Pd.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function xce(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function eW(e,t,n){this.count=e,this.offset=t,this.bucket=n}function am(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}am.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};am.prototype.updateShader=function(e,t,n){if(c(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),zt.isInternetExplorer()||i.push("CLIP_POLYLINE");let o=new He({defines:i,sources:[`in vec4 v_pickColor;
`,this.material.shaderSource,YT]}),r=t.getVertexShaderCallback()(RB),s=new He({defines:i,sources:[af,r]});this.shaderProgram=en.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:vl})};function Tce(e){return d.dot(d.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(sn.ORIGIN_ZX_PLANE)===Wt.INTERSECTING}am.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===oe.SCENE3D||!Tce(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let o=0;o<t;++o)n+=i[o]*4-4;return n};var Ts=new d,Ef=new d,Sf=new d,FB=new d,nqe=new se,iqe=new z;am.prototype.write=function(e,t,n,i,o,r,s,a){let l=this.mode,u=a.ellipsoid.maximumRadius*O.PI,f=this.polylines,h=f.length;for(let p=0;p<h;++p){let g=f[p],m=g.width,y=g.show&&m>0,b=g._index,x=this.getSegments(g,a),A=x.positions,E=x.lengths,S=A.length,v=g.getPickId(s).color,P=0,M=0,R;for(let H=0;H<S;++H){H===0?g._loop?R=A[S-2]:(R=FB,d.subtract(A[0],A[1],R),d.add(A[0],R,R)):R=A[H-1],d.clone(R,Ef),d.clone(A[H],Ts),H===S-1?g._loop?R=A[1]:(R=FB,d.subtract(A[S-1],A[S-2],R),d.add(A[S-1],R,R)):R=A[H+1],d.clone(R,Sf);let V=E[P];H===M+V&&(M+=V,++P);let j=H-M===0,U=H===M+E[P]-1;l===oe.SCENE2D&&(Ef.z=0,Ts.z=0,Sf.z=0),(l===oe.SCENE2D||l===oe.MORPHING)&&(j||U)&&u-Math.abs(Ts.x)<1&&((Ts.x<0&&Ef.x>0||Ts.x>0&&Ef.x<0)&&d.clone(Ts,Ef),(Ts.x<0&&Sf.x>0||Ts.x>0&&Sf.x<0)&&d.clone(Ts,Sf));let q=j?2:0,X=U?2:4;for(let te=q;te<X;++te){Hn.writeElements(Ts,e,n),Hn.writeElements(Ef,e,n+6),Hn.writeElements(Sf,e,n+12);let K=te-2<0?-1:1;t[o]=H/(S-1),t[o+1]=2*(te%2)-1,t[o+2]=K,t[o+3]=b,n+=6*3,o+=4}}let L=nqe;L.x=G.floatToByte(v.red),L.y=G.floatToByte(v.green),L.z=G.floatToByte(v.blue),L.w=G.floatToByte(v.alpha);let B=iqe;B.x=m,B.y=y?1:0;let _=l===oe.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,w=Hn.fromCartesian(_.center,_ce),D=w.high,I=se.fromElements(w.low.x,w.low.y,w.low.z,_.radius,gce),N=yce;N.x=0,N.y=Number.MAX_VALUE;let k=g.distanceDisplayCondition;c(k)&&(N.x=k.near,N.y=k.far),r.setBatchedAttribute(b,0,B),r.setBatchedAttribute(b,1,L),r.attributes.length>2&&(r.setBatchedAttribute(b,2,D),r.setBatchedAttribute(b,3,I),r.setBatchedAttribute(b,4,N))}};var oqe=new d,rqe=new d,sqe=new d,dce=new d;am.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,l=s._segments.lengths,u=a.length,f=0,h=0;for(let p=0;p<u;++p){let g;p===0?s._loop?g=a[u-2]:(g=dce,d.subtract(a[0],a[1],g),d.add(a[0],g,g)):g=a[p-1],g=F.multiplyByPoint(n,g,rqe);let m=F.multiplyByPoint(n,a[p],oqe),y;p===u-1?s._loop?y=a[1]:(y=dce,d.subtract(a[u-1],a[u-2],y),d.add(a[u-1],y,y)):y=a[p+1],y=F.multiplyByPoint(n,y,sqe);let b=l[f];p===h+b&&(h+=b,++f);let x=p-h===0,A=p===h+l[f]-1,E=x?2:0,S=A?2:4;for(let v=E;v<S;++v)Hn.writeElements(m,e,t),Hn.writeElements(g,e,t+6),Hn.writeElements(y,e,t+12),t+=6*3}}};var aqe=new Array(1);am.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new eW(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],l=0;a.length>0&&(l=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let h=0;h<f;++h){let p=u[h];p._locatorBuckets=[];let g;if(this.mode===oe.SCENE3D){g=aqe;let y=p._actualPositions.length;if(y>0)g[0]=y;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let y=0;for(let b=0;b<m;++b){let x=g[b]-1;for(let A=0;A<x;++A)l+4>O.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:y}),y=0,t.push(4),a=[],e.push(a),l=0,r.count=s,s=0,i=0,r=new eW(0,0,this),n[++o]=[r]),a.push(l,l+2,l+1),a.push(l+1,l+2,l+3),y+=6,s+=6,i+=6,l+=4}p._locatorBuckets.push({locator:r,count:y}),l+4>O.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),l=0,r.count=s,i=0,s=0,r=new eW(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};am.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o<i;++o){let r=t[o];if(r===e)break;n+=r._actualLength}return n};var eC={positions:void 0,lengths:void 0},hce=new Array(1),cqe=new d,lqe=new he;am.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===oe.SCENE3D)return hce[0]=n.length,eC.positions=n,eC.lengths=hce,eC;Tce(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,l=cqe;for(let u=0;u<s;++u)a=n[u],l=F.multiplyByPoint(r,a,l),o.push(t.project(i.cartesianToCartographic(l,lqe)));if(o.length>0){e._boundingVolume2D=le.fromPoints(o,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new d(u.z,u.x,u.y)}return eC.positions=o,eC.lengths=e._segments.lengths,eC};var mce;am.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*O.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=mce,l=6*s*3;!c(a)||a.length<l?a=mce=new Float32Array(l):a.length>l&&(a=new Float32Array(a.buffer,0,l));let u=this.getSegments(t,i),f=u.positions,h=u.lengths,p=0,g=0,m=0,y;s=f.length;for(let b=0;b<s;++b){b===0?t._loop?y=f[s-2]:(y=FB,d.subtract(f[0],f[1],y),d.add(f[0],y,y)):y=f[b-1],d.clone(y,Ef),d.clone(f[b],Ts),b===s-1?t._loop?y=f[1]:(y=FB,d.subtract(f[s-1],f[s-2],y),d.add(f[s-1],y,y)):y=f[b+1],d.clone(y,Sf);let x=h[g];b===m+x&&(m+=x,++g);let A=b-m===0,E=b===m+h[g]-1;o===oe.SCENE2D&&(Ef.z=0,Ts.z=0,Sf.z=0),(o===oe.SCENE2D||o===oe.MORPHING)&&(A||E)&&r-Math.abs(Ts.x)<1&&((Ts.x<0&&Ef.x>0||Ts.x>0&&Ef.x<0)&&d.clone(Ts,Ef),(Ts.x<0&&Sf.x>0||Ts.x>0&&Sf.x<0)&&d.clone(Ts,Sf));let S=A?2:0,v=E?2:4;for(let P=S;P<v;++P)Hn.writeElements(Ts,a,p),Hn.writeElements(Ef,a,p+6),Hn.writeElements(Sf,a,p+12),p+=6*3}n.copyFromArrayView(a,6*3*Float32Array.BYTES_PER_ELEMENT*e)}};var cm=Pd;function Xg(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._billboardCollection=new Cf({batchTable:e.batchTable}),this._labelCollection=new Gp({batchTable:e.batchTable}),this._polylineCollection=new cm,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Xg.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.sizeInBytes,t=this._labelCollection.sizeInBytes;return e+t}}});function uqe(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+ce.packedLength+ie.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,ce.pack(n,s,a),a+=ce.packedLength,ie.pack(t,s,a),s}var fqe=new bi("createVectorTilePoints",5),dqe=new d;function hqe(e,t){let n=e._positions,i=e._packedBuffer;c(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=uqe(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=fqe.scheduleTask(r,o);if(c(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let l=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let h=e._batchIds,p=n.length/3;for(let g=0;g<p;++g){let m=h[g],y=d.unpack(n,g*3,dqe),b=l.add();b.position=y,b._batchIndex=m;let x=u.add();x.text=" ",x.position=y,x._batchIndex=m;let A=f.add();A.positions=[d.clone(y),d.clone(y)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}Xg.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let l=r[a],u=n.get(a),f=i.get(a),h=o.get(a);t[l]=new qg(e,l,u,f,h)}};Xg.prototype.applyDebugSettings=function(e,t){e?(G.clone(t,this._billboardCollection._highlightColor),G.clone(t,this._labelCollection._highlightColor),G.clone(t,this._polylineCollection._highlightColor)):(G.clone(G.WHITE,this._billboardCollection._highlightColor),G.clone(G.WHITE,this._labelCollection._highlightColor),G.clone(G.WHITE,this._polylineCollection._highlightColor))};function mqe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.pointSize=qg.defaultPointSize,s.color=qg.defaultColor,s.pointOutlineColor=qg.defaultPointOutlineColor,s.pointOutlineWidth=qg.defaultPointOutlineWidth,s.labelColor=G.WHITE,s.labelOutlineColor=G.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Ko.FILL,s.labelText=void 0,s.backgroundColor=new G(.165,.165,.165,.8),s.backgroundPadding=new z(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=G.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=xi.CENTER,s.verticalOrigin=Fn.CENTER,s.labelHorizontalOrigin=xi.RIGHT,s.labelVerticalOrigin=Fn.BASELINE}}var pqe=new G,_qe=new G,gqe=new G,yqe=new G,bqe=new G,xqe=new G,oD=new Bt,rD=new Bt,oW=new Lt;Xg.prototype.applyStyle=function(e,t){if(!c(e)){mqe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];if(c(e.show)&&(s.show=e.show.evaluate(s)),c(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),c(e.color)&&(s.color=e.color.evaluateColor(s,pqe)),c(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,_qe)),c(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),c(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,gqe)),c(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,yqe)),c(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),c(e.font)&&(s.font=e.font.evaluate(s)),c(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),c(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,c(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,bqe)),c(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),c(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),c(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);c(a)?(oD.near=a.x,oD.nearValue=a.y,oD.far=a.z,oD.farValue=a.w,s.scaleByDistance=oD):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(c(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);c(a)?(rD.near=a.x,rD.nearValue=a.y,rD.far=a.z,rD.farValue=a.w,s.translucencyByDistance=rD):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(c(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);c(a)?(oW.near=a.x,oW.far=a.y,s.distanceDisplayCondition=oW):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;c(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),c(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),c(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,xqe)),c(e.image)?s.image=e.image.evaluate(s):s.image=void 0,c(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),c(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),c(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),c(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),c(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};Xg.prototype.update=function(e){if(!this._ready&&(c(this._promise)||(this._promise=hqe(this,e.mapProjection.ellipsoid)),c(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};Xg.prototype.isDestroyed=function(){return!1};Xg.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),de(this)};var BB=Xg;function Wp(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=e.ellipsoid??ie.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??d.ZERO,this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Un.BOTH}Object.defineProperties(Wp.prototype,{trianglesLength:{get:function(){return c(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return c(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function Tqe(e){let t=new Float64Array(3+d.packedLength+ie.packedLength+ce.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,d.pack(e._center,t,n),n+=d.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,ce.pack(e._rectangle,t,n),t}function Aqe(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=Pn.unpack(t,n),n+=Pn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let l=G.unpack(t,n);n+=G.packedLength;let u=t[n++],f=t[n++],h=t[n++],p=new Array(h);for(let g=0;g<h;++g)p[g]=t[n++];s[a]=new Cp({color:l,offset:u,count:f,batchIds:p})}}var Cqe=new bi("createVectorTilePolygons",5),Eqe=new G;function Sqe(e){if(c(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!c(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ce.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let g=e._batchTable,m=s.length;for(let y=0;y<m;++y){let b=g.getColor(y,Eqe);s[y]=b.toRgba()}a=e._packedBuffer=Tqe(e)}let l=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,h=e._polygonMaximumHeights;c(f)&&c(h)&&(f=f.slice(),h=h.slice(),l.push(f.buffer,h.buffer),u.minimumHeights=f,u.maximumHeights=h);let p=Cqe.scheduleTask(u,l);if(c(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(g.packedBuffer),y=m[0];Aqe(e,m),e._indices=Fe.getSizeInBytes(y)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),wqe(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function wqe(e){c(e._primitive)||(e._primitive=new hA({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}Wp.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Wp.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Wp.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Wp.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Wp.prototype.update=function(e){if(!this._ready){if(c(this._promise)||(this._promise=Sqe(this)),c(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Wp.prototype.isDestroyed=function(){return!1};Wp.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var kB=Wp;var UB=`in vec4 currentPosition;
in vec4 previousPosition;
in vec4 nextPosition;
in vec2 expandAndWidth;
in float a_batchId;
uniform mat4 u_modifiedModelView;
void main()
{
float expandDir = expandAndWidth.x;
float width = abs(expandAndWidth.y) + 0.5;
bool usePrev = expandAndWidth.y < 0.0;
vec4 p = u_modifiedModelView * currentPosition;
vec4 prev = u_modifiedModelView * previousPosition;
vec4 next = u_modifiedModelView * nextPosition;
float angle;
vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle);
gl_Position = czm_viewportOrthographic * positionWC;
}
`;function Id(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ie.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=G.clone(G.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Id.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function vqe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+ie.packedLength+d.packedLength,a=new Float64Array(s),l=0;return a[l++]=n,a[l++]=i,ce.pack(t,a,l),l+=ce.packedLength,ie.pack(o,a,l),l+=ie.packedLength,d.pack(r,a,l),a}var Dqe=new bi("createVectorTilePolylines",5),tC={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function Pqe(e,t){if(c(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;c(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=vqe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],l={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=Dqe.scheduleTask(l,a);if(c(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let h=f.indexDatatype;e._indices=h===Fe.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),Iqe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Iqe(e,t){if(!c(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,l=i.byteLength+n.byteLength+o.byteLength;l+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=l;let u=bt.createVertexBuffer({context:t,typedArray:i,usage:Be.STATIC_DRAW}),f=bt.createVertexBuffer({context:t,typedArray:n,usage:Be.STATIC_DRAW}),h=bt.createVertexBuffer({context:t,typedArray:o,usage:Be.STATIC_DRAW}),p=bt.createVertexBuffer({context:t,typedArray:r,usage:Be.STATIC_DRAW}),g=bt.createVertexBuffer({context:t,typedArray:s,usage:Be.STATIC_DRAW}),m=bt.createIndexBuffer({context:t,typedArray:a,usage:Be.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),y=[{index:tC.previousPosition,vertexBuffer:u,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:tC.currentPosition,vertexBuffer:f,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:tC.nextPosition,vertexBuffer:h,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:tC.expandAndWidth,vertexBuffer:p,componentDatatype:$.FLOAT,componentsPerAttribute:2},{index:tC.a_batchId,vertexBuffer:g,componentDatatype:$.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:y,indexBuffer:m}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var sD=new F,Ace=new d;function Oqe(e,t){c(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,sD),F.multiplyByPoint(sD,e._center,Ace),F.setTranslation(sD,Ace,sD),sD},u_highlightColor:function(){return e._highlightColor}})}function Rqe(e){if(c(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=ze.fromCache({blending:un.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var Mqe=`uniform vec4 u_highlightColor;
void main()
{
out_FragColor = u_highlightColor;
}
`;function Lqe(e,t){if(c(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(UB),o=n.getFragmentShaderCallback(!1,void 0,!1)(Mqe),r=new He({defines:["VECTOR_TILE",zt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[af,i]}),s=new He({defines:["VECTOR_TILE"],sources:[o]});e._sp=en.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:tC})}function Nqe(e,t){if(!c(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new Je({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:De.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Id.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!c(n)||!c(i))return;let r,s,a=n.length,l=0,u=0;for(r=0;r<a;++r)n[r]===t&&(l+=o[r+1]-o[r]);if(l===0)return;let f=new Float64Array(l*3);for(r=0;r<a;++r)if(n[r]===t){let h=o[r],p=o[r+1]-h;for(s=0;s<p;++s){let g=(h+s)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};Id.prototype.getPositions=function(e){return Id.getPolylinePositions(this,e)};Id.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new ta(e,r)}};Id.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Fqe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=G.WHITE}}var Bqe=new G,kqe=G.WHITE,Uqe=!0;Id.prototype.applyStyle=function(e,t){if(!c(e)){Fqe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=c(e.color)?e.color.evaluateColor(s,Bqe):kqe,s.show=c(e.show)?e.show.evaluate(s):Uqe}};Id.prototype.update=function(e){let t=e.context;if(!this._ready){if(c(this._promise)||(this._promise=Pqe(this,t)),c(this._error)){let i=this._error;throw this._error=void 0,i}return}Oqe(this,t),Lqe(this,t),Rqe(this);let n=e.passes;(n.render||n.pick)&&Nqe(this,e)};Id.prototype.isDestroyed=function(){return!1};Id.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),de(this)};var nC=Id;var VB=`in vec3 startEllipsoidNormal;
in vec3 endEllipsoidNormal;
in vec4 startPositionAndHeight;
in vec4 endPositionAndHeight;
in vec4 startFaceNormalAndVertexCorner;
in vec4 endFaceNormalAndHalfWidth;
in float a_batchId;
uniform mat4 u_modifiedModelView;
uniform vec2 u_minimumMaximumVectorHeights;
out vec4 v_startPlaneEC;
out vec4 v_endPlaneEC;
out vec4 v_rightPlaneEC;
out float v_halfWidth;
out vec3 v_volumeUpEC;
void main()
{
float isEnd = floor(startFaceNormalAndVertexCorner.w * 0.251);
float isTop = floor(startFaceNormalAndVertexCorner.w * mix(0.51, 0.19, isEnd));
vec3 forward = endPositionAndHeight.xyz - startPositionAndHeight.xyz;
vec3 right = normalize(cross(forward, startEllipsoidNormal));
vec4 position = vec4(startPositionAndHeight.xyz, 1.0);
position.xyz += forward * isEnd;
v_volumeUpEC = czm_normal * normalize(cross(right, forward));
float offset;
vec3 ellipsoidNormal = mix(startEllipsoidNormal, endEllipsoidNormal, isEnd);
offset = mix(startPositionAndHeight.w, endPositionAndHeight.w, isEnd);
offset = mix(u_minimumMaximumVectorHeights.y, u_minimumMaximumVectorHeights.x, isTop) - offset;
position.xyz += offset * ellipsoidNormal;
position = u_modifiedModelView * position;
right = czm_normal * right;
vec3 scratchNormal = mix(-startFaceNormalAndVertexCorner.xyz, endFaceNormalAndHalfWidth.xyz, isEnd);
scratchNormal = cross(scratchNormal, mix(startEllipsoidNormal, endEllipsoidNormal, isEnd));
vec3 miterPushNormal = czm_normal * normalize(scratchNormal);
offset = 2.0 * endFaceNormalAndHalfWidth.w * max(0.0, czm_metersPerPixel(position));
offset = offset / dot(miterPushNormal, right);
position.xyz += miterPushNormal * (offset * sign(0.5 - mod(startFaceNormalAndVertexCorner.w, 2.0)));
gl_Position = czm_depthClamp(czm_projection * position);
position = u_modifiedModelView * vec4(startPositionAndHeight.xyz, 1.0);
vec3 startNormalEC = czm_normal * startFaceNormalAndVertexCorner.xyz;
v_startPlaneEC = vec4(startNormalEC, -dot(startNormalEC, position.xyz));
v_rightPlaneEC = vec4(right, -dot(right, position.xyz));
position = u_modifiedModelView * vec4(endPositionAndHeight.xyz, 1.0);
vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz;
v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz));
v_halfWidth = endFaceNormalAndHalfWidth.w;
}
`;var zB=`in vec4 v_startPlaneEC;
in vec4 v_endPlaneEC;
in vec4 v_rightPlaneEC;
in float v_halfWidth;
in vec3 v_volumeUpEC;
uniform vec4 u_highlightColor;
void main()
{
float logDepthOrDepth = czm_branchFreeTernary(czm_sceneMode == czm_sceneMode2D, gl_FragCoord.z, czm_unpackDepth(texture(czm_globeDepthTexture, gl_FragCoord.xy / czm_viewport.zw)));
if (logDepthOrDepth == 0.0) {
#ifdef DEBUG_SHOW_VOLUME
out_FragColor = vec4(0.0, 0.0, 1.0, 0.5);
return;
#else // DEBUG_SHOW_VOLUME
discard;
#endif // DEBUG_SHOW_VOLUME
}
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
eyeCoordinate /= eyeCoordinate.w;
float halfMaxWidth = v_halfWidth * czm_metersPerPixel(eyeCoordinate);
halfMaxWidth += halfMaxWidth * (1.0 - dot(-normalize(eyeCoordinate.xyz), v_volumeUpEC));
float widthwiseDistance = czm_planeDistance(v_rightPlaneEC, eyeCoordinate.xyz);
float distanceFromStart = czm_planeDistance(v_startPlaneEC, eyeCoordinate.xyz);
float distanceFromEnd = czm_planeDistance(v_endPlaneEC, eyeCoordinate.xyz);
if (abs(widthwiseDistance) > halfMaxWidth || distanceFromStart < 0.0 || distanceFromEnd < 0.0) {
#ifdef DEBUG_SHOW_VOLUME
out_FragColor = vec4(logDepthOrDepth, 0.0, 0.0, 0.5);
return;
#else // DEBUG_SHOW_VOLUME
discard;
#endif // DEBUG_SHOW_VOLUME
}
out_FragColor = u_highlightColor;
czm_writeDepthClamp();
}
`;function qp(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ie.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new z(fi._defaultMinTerrainHeight,fi._defaultMaxTerrainHeight),this._boundingVolume=Pn.fromRectangle(e.rectangle,fi._defaultMinTerrainHeight,fi._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=G.clone(G.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(qp.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Vqe(e,t,n){let i=fi.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,l=e._rectangle;Pn.fromRectangle(l,o,r,n,a)}function zqe(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+ce.packedLength+ie.packedLength+d.packedLength,a=new Float64Array(s),l=0;return a[l++]=n,a[l++]=i,ce.pack(t,a,l),l+=ce.packedLength,ie.pack(o,a,l),l+=ie.packedLength,d.pack(r,a,l),a}var Hqe=new bi("createVectorTileClampedPolylines"),Kg={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function Gqe(e,t){if(c(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;c(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=zqe(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],l={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=Hqe.scheduleTask(l,a);if(c(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let h=f.indexDatatype;e._indices=h===Fe.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),jqe(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function jqe(e,t){if(!c(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,l=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=o.byteLength+r.byteLength,f+=s.byteLength+a.byteLength,f+=l.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let h=bt.createVertexBuffer({context:t,typedArray:n,usage:Be.STATIC_DRAW}),p=bt.createVertexBuffer({context:t,typedArray:i,usage:Be.STATIC_DRAW}),g=bt.createVertexBuffer({context:t,typedArray:o,usage:Be.STATIC_DRAW}),m=bt.createVertexBuffer({context:t,typedArray:r,usage:Be.STATIC_DRAW}),y=bt.createVertexBuffer({context:t,typedArray:s,usage:Be.STATIC_DRAW}),b=bt.createVertexBuffer({context:t,typedArray:a,usage:Be.STATIC_DRAW}),x=bt.createVertexBuffer({context:t,typedArray:l,usage:Be.STATIC_DRAW}),A=bt.createIndexBuffer({context:t,typedArray:u,usage:Be.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?Fe.UNSIGNED_SHORT:Fe.UNSIGNED_INT}),E=[{index:Kg.startEllipsoidNormal,vertexBuffer:h,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:Kg.endEllipsoidNormal,vertexBuffer:p,componentDatatype:$.FLOAT,componentsPerAttribute:3},{index:Kg.startPositionAndHeight,vertexBuffer:g,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Kg.endPositionAndHeight,vertexBuffer:m,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Kg.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Kg.endFaceNormalAndHalfWidth,vertexBuffer:b,componentDatatype:$.FLOAT,componentsPerAttribute:4},{index:Kg.a_batchId,vertexBuffer:x,componentDatatype:$.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new ni({context:t,attributes:E,indexBuffer:A}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var aD=new F,Cce=new d;function Wqe(e,t){c(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return F.clone(n,aD),F.multiplyByPoint(aD,e._center,Cce),F.setTranslation(aD,Cce,aD),aD},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function Ece(e){return ze.fromCache({cull:{enabled:!0,face:Ti.FRONT},blending:un.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.EQUAL,backOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})}function qqe(e){c(e._rs)||(e._rs=Ece(!1),e._rs3DTiles=Ece(!0))}function Yqe(e,t){if(c(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(VB),o=n.getFragmentShaderCallback(!1,void 0,!0)(zB),r=new He({defines:["VECTOR_TILE",zt.isInternetExplorer()?"":"CLIP_POLYLINE"],sources:[af,i]}),s=new He({defines:["VECTOR_TILE"],sources:[o]});e._sp=en.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Kg})}function Xqe(e,t){let n=e._command;if(!c(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new Je({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:De.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=Je.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=De.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===Un.TERRAIN||i===Un.BOTH)&&t.commandList.push(n),(i===Un.CESIUM_3D_TILE||i===Un.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}qp.prototype.getPositions=function(e){return nC.getPolylinePositions(this,e)};qp.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new ta(e,r)}};qp.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Kqe(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=G.WHITE}}var $qe=new G,Zqe=G.WHITE,Qqe=!0;qp.prototype.applyStyle=function(e,t){if(!c(e)){Kqe(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=c(e.color)?e.color.evaluateColor(s,$qe):Zqe,s.show=c(e.show)?e.show.evaluate(s):Qqe}};function Jqe(e){return fi.initialize().then(function(){Vqe(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}qp.prototype.update=function(e){let t=e.context;if(!this._ready){if(c(this._promise)||(this._promise=Jqe(this).then(Gqe(this,t))),c(this._error)){let i=this._error;throw this._error=void 0,i}return}Wqe(this,t),Yqe(this,t),qqe(this);let n=e.passes;(n.render||n.pick)&&Xqe(this,e)};qp.prototype.isDestroyed=function(){return!1};qp.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),de(this)};var HB=qp;var rW=32767,e7e=new he,t7e=new d;function n7e(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),l=e.subarray(2*r,3*r);Ln.zigZagDeltaDecode(s,a,l);let u=new Float64Array(e.length);for(let f=0;f<r;++f){let h=s[f],p=a[f],g=l[f],m=O.lerp(t.west,t.east,h/rW),y=O.lerp(t.south,t.north,p/rW),b=O.lerp(n,i,g/rW),x=he.fromRadians(m,y,b,e7e),A=o.cartographicToCartesian(x,t7e);d.pack(A,u,f*3)}return u}var GB=n7e;function Rd(e,t,n,i,o){this._tileset=e,this._tile=t,this._resource=n,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,a7e(this,i,o)}Object.defineProperties(Rd.prototype,{featuresLength:{get:function(){return c(this._batchTable)?this._batchTable.featuresLength:0}},pointsLength:{get:function(){return c(this._points)?this._points.pointsLength:0}},trianglesLength:{get:function(){let e=0;return c(this._polygons)&&(e+=this._polygons.trianglesLength),c(this._polylines)&&(e+=this._polylines.trianglesLength),e}},geometryByteLength:{get:function(){let e=0;return c(this._polygons)&&(e+=this._polygons.geometryByteLength),c(this._polylines)&&(e+=this._polylines.geometryByteLength),e}},texturesByteLength:{get:function(){return c(this._points)?this._points.texturesByteLength:0}},batchTableByteLength:{get:function(){return c(this._batchTable)?this._batchTable.batchTableByteLength:0}},innerContents:{get:function(){}},ready:{get:function(){return this._ready}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){return this._resource.getUrlComponent(!0)}},metadata:{get:function(){return this._metadata},set:function(e){this._metadata=e}},batchTable:{get:function(){return this._batchTable}},group:{get:function(){return this._group},set:function(e){this._group=e}}});function i7e(e){return function(t,n){c(e._polygons)&&e._polygons.updateCommands(t,n)}}function o7e(e,t){let n,i,o,r,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,l=e.POINTS_LENGTH??0;if(s>0&&c(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&c(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(l>0&&c(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,l)}let u=c(n)||c(i)||c(o),f=s>0&&!c(n)||a>0&&!c(i)||l>0&&!c(o);if(u&&f)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!c(n)&&!c(i)&&!c(o)){let p=0;if(!c(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!c(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!c(o)&&l>0)for(o=new Uint16Array(l),r=0;r<l;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var Od=Uint32Array.BYTES_PER_ELEMENT;function r7e(e){return new nC(e)}function s7e(e){return new HB(e)}function a7e(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=Od;let r=o.getUint32(n,!0);if(r!==1)throw new ae(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=Od;let s=o.getUint32(n,!0);if(n+=Od,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=Od,a===0)throw new ae("Feature table must have a byte length greater than zero");let l=o.getUint32(n,!0);n+=Od;let u=o.getUint32(n,!0);n+=Od;let f=o.getUint32(n,!0);n+=Od;let h=o.getUint32(n,!0);n+=Od;let p=o.getUint32(n,!0);n+=Od;let g=o.getUint32(n,!0);n+=Od;let m=o.getUint32(n,!0);n+=Od;let y=sr(i,n,a);n+=a;let b=new Uint8Array(t,n,l);n+=l;let x,A;u>0&&(x=sr(i,n,u),n+=u,f>0&&(A=new Uint8Array(t,n,f),A=new Uint8Array(A),n+=f));let E=y.POLYGONS_LENGTH??0,S=y.POLYLINES_LENGTH??0,v=y.POINTS_LENGTH??0,P=E+S+v,M=new cg(e,P,x,A,i7e(e));if(e._batchTable=M,P===0)return;let R=new tm(y,b),L=R.getGlobalProperty("REGION");if(!c(L))throw new ae("Feature table global property: REGION must be defined");let B=ce.unpack(L),_=L[4],w=L[5],D=e._tile.computedTransform,I=R.getGlobalProperty("RTC_CENTER",$.FLOAT,3);c(I)?(I=d.unpack(I),F.multiplyByPoint(D,I,I)):(I=ce.center(B),I.height=O.lerp(_,w,.5),I=ie.WGS84.cartographicToCartesian(I));let N=o7e(y,b);if(n+=(4-n%4)%4,E>0){R.featuresLength=E;let k=R.getPropertyArray("POLYGON_COUNTS",$.UNSIGNED_INT,1)??R.getPropertyArray("POLYGON_COUNT",$.UNSIGNED_INT,1);if(!c(k))throw new ae("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let H=R.getPropertyArray("POLYGON_INDEX_COUNTS",$.UNSIGNED_INT,1)??R.getPropertyArray("POLYGON_INDEX_COUNT",$.UNSIGNED_INT,1);if(!c(H))throw new ae("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=k.reduce(function(K,Z){return K+Z*2},0),j=H.reduce(function(K,Z){return K+Z},0),U=new Uint32Array(t,n,j);n+=h;let q=new Uint16Array(t,n,V);n+=p;let X,te;c(y.POLYGON_MINIMUM_HEIGHTS)&&c(y.POLYGON_MAXIMUM_HEIGHTS)&&(X=R.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",$.FLOAT,1),te=R.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",$.FLOAT,1)),e._polygons=new kB({positions:q,counts:k,indexCounts:H,indices:U,minimumHeight:_,maximumHeight:w,polygonMinimumHeights:X,polygonMaximumHeights:te,center:I,rectangle:B,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:M,batchIds:N.polygons,modelMatrix:D})}if(S>0){R.featuresLength=S;let k=R.getPropertyArray("POLYLINE_COUNTS",$.UNSIGNED_INT,1)??R.getPropertyArray("POLYLINE_COUNT",$.UNSIGNED_INT,1);if(!c(k))throw new ae("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let H=R.getPropertyArray("POLYLINE_WIDTHS",$.UNSIGNED_SHORT,1);if(!c(H)){H=new Uint16Array(S);for(let te=0;te<S;++te)H[te]=2}let V=k.reduce(function(te,K){return te+K*3},0),j=new Uint16Array(t,n,V);n+=g;let U=e._tileset,q=U.examineVectorLinesFunction;if(c(q)){let te=GB(new Uint16Array(j),B,_,w,ie.WGS84);c7e(te,k,N.polylines,M,e.url,q)}let X=r7e;c(U.classificationType)&&(X=s7e),e._polylines=X({positions:j,widths:H,counts:k,batchIds:N.polylines,minimumHeight:_,maximumHeight:w,center:I,rectangle:B,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:M,classificationType:U.classificationType,keepDecodedPositions:U.vectorKeepDecodedPositions})}if(v>0){let k=new Uint16Array(t,n,v*3);n+=m,e._points=new BB({positions:k,batchIds:N.points,minimumHeight:_,maximumHeight:w,rectangle:B,batchTable:M})}}function sW(e){let t=e.featuresLength;if(!c(e._features)&&t>0){let n=new Array(t);c(e._polygons)&&e._polygons.createFeatures(e,n),c(e._polylines)&&e._polylines.createFeatures(e,n),c(e._points)&&e._points.createFeatures(e,n),e._features=n}}Rd.prototype.hasProperty=function(e,t){return this._batchTable.hasProperty(e,t)};Rd.prototype.getFeature=function(e){let t=this.featuresLength;if(!c(e)||e<0||e>=t)throw new C(`batchId is required and between zero and featuresLength - 1 (${t-1}).`);return c(this._features)||sW(this),this._features[e]};Rd.prototype.applyDebugSettings=function(e,t){c(this._polygons)&&this._polygons.applyDebugSettings(e,t),c(this._polylines)&&this._polylines.applyDebugSettings(e,t),c(this._points)&&this._points.applyDebugSettings(e,t)};Rd.prototype.applyStyle=function(e){c(this._features)||sW(this),c(this._polygons)&&this._polygons.applyStyle(e,this._features),c(this._polylines)&&this._polylines.applyStyle(e,this._features),c(this._points)&&this._points.applyStyle(e,this._features)};Rd.prototype.update=function(e,t){let n=!0;c(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(t),n=n&&this._polygons.ready),c(this._polylines)&&(this._polylines.update(t),n=n&&this._polylines.ready),c(this._points)&&(this._points.update(t),n=n&&this._points.ready),c(this._batchTable)&&n&&(c(this._features)||sW(this),this._batchTable.update(e,t),this._ready=!0)};Rd.prototype.pick=function(e,t,n){};Rd.prototype.getPolylinePositions=function(e){let t=this._polylines;if(c(t))return t.getPositions(e)};Rd.prototype.isDestroyed=function(){return!1};Rd.prototype.destroy=function(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),de(this)};function c7e(e,t,n,i,o,r){let s=t.length,a=0;for(let l=0;l<s;l++){let u=t[l]*3,f=e.slice(a,a+u);a+=u,r(f,n[l],o,i)}}var jB=Rd;var Sce={b3dm:function(e,t,n,i,o){return bf.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return bf.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return bf.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return mN.fromTileType(e,t,n,i,o,Sce)},externalTileset:function(e,t,n,i){return wB.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new TN(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new jB(e,t,n,i,o)},subt:function(e,t,n,i,o){return Av.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return Av.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new ae("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),l=new Uint8Array(i,o,a);return bf.fromGltf(e,t,n,l)},gltf:function(e,t,n,i){return bf.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return bf.fromGeoJson(e,t,n,i)}},iC=Sce;var l7e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5},$o=Object.freeze(l7e);var Md={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};Md.isBinaryFormat=function(e){switch(e){case Md.BATCHED_3D_MODEL:case Md.INSTANCED_3D_MODEL:case Md.COMPOSITE:case Md.POINT_CLOUD:case Md.VECTOR:case Md.GEOMETRY:case Md.IMPLICIT_SUBTREE:case Md.VOXEL_BINARY:case Md.GLTF_BINARY:return!0;default:return!1}};var Us=Object.freeze(Md);var u7e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0},Ld=Object.freeze(u7e);var Vs={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},Yp=new Array(Vs.NUMBER_OF_PASSES);Yp[Vs.RENDER]=Object.freeze({pass:Vs.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Yp[Vs.PICK]=Object.freeze({pass:Vs.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Yp[Vs.SHADOW]=Object.freeze({pass:Vs.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Yp[Vs.PRELOAD]=Object.freeze({pass:Vs.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Yp[Vs.PRELOAD_FLIGHT]=Object.freeze({pass:Vs.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Yp[Vs.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Vs.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Yp[Vs.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Vs.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Yp[Vs.MOST_DETAILED_PICK]=Object.freeze({pass:Vs.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Vs.getPassOptions=function(e){return Yp[e]};var Uo=Object.freeze(Vs);function lm(e,t){this._tileset=e,this._tile=t,this.featurePropertiesDirty=!1}Object.defineProperties(lm.prototype,{featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){}},ready:{get:function(){return!0}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(e){throw new C("Empty3DTileContent cannot have content metadata")}},batchTable:{get:function(){}},group:{get:function(){},set:function(e){throw new C("Empty3DTileContent cannot have group metadata")}}});lm.prototype.hasProperty=function(e,t){return!1};lm.prototype.getFeature=function(e){};lm.prototype.applyDebugSettings=function(e,t){};lm.prototype.applyStyle=function(e){};lm.prototype.update=function(e,t){};lm.prototype.pick=function(e,t,n){};lm.prototype.isDestroyed=function(){return!1};lm.prototype.destroy=function(){return de(this)};var cD=lm;function Xp(e){e=e??W.EMPTY_OBJECT;let t=e.content,n=e.class;T.typeOf.object("options.content",t),T.typeOf.object("options.class",n),this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Xp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Xp.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};Xp.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};Xp.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};Xp.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};Xp.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};Xp.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};Xp.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var WB=Xp;function aW(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!c(n))return;if(!c(e.schema)){aW._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??W.EMPTY_OBJECT;if(c(n.class)){let o=i[n.class];return new WB({content:n,class:o})}}aW._oneTimeWarning=dt;var oC=aW;function f7e(e,t){let n=e.metadataExtension;if(!c(n))return;let i=n.groups,o=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(s){return s===o});return r>=0?i[r]:void 0}var rC=f7e;function Kp(e){e=e??W.EMPTY_OBJECT;let t=e.tile,n=e.class;T.typeOf.object("options.tile",t),T.typeOf.object("options.class",n),this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Kp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Kp.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};Kp.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};Kp.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};Kp.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};Kp.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};Kp.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};Kp.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var qB=Kp;function cW(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!c(n))return;if(!c(e.schema)){cW._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??W.EMPTY_OBJECT;if(c(n.class)){let o=i[n.class];return new qB({tile:n,class:o})}}cW._oneTimeWarning=dt;var YB=cW;function d7e(e){let t=new Uint8Array(e),n=Wh(t);if(n==="glTF"&&(n="glb"),Us.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=h7e(t);if(c(i.root))return{contentType:Us.EXTERNAL_TILESET,jsonPayload:i};if(c(i.asset))return{contentType:Us.GLTF,jsonPayload:i};if(c(i.tileAvailability))return{contentType:Us.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(c(i.type))return{contentType:Us.GEOJSON,jsonPayload:i};if(c(i.voxelTable))return{contentType:Us.VOXEL_JSON,jsonPayload:i};throw new ae("Invalid tile content.")}function h7e(e){let t;try{t=sr(e)}catch{throw new ae("Invalid tile content.")}return t}var $g=d7e;function wf(e,t,n,i){this._tileset=e,this._tile=t,this._tilesetResource=n,this._contents=[],this._contentsCreated=!1;let o=c(i.contents)?i.contents:i.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let r=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(r),this._requests=new Array(r),this._ready=!1,this._innerContentResources=new Array(r),this._serverKeys=new Array(r);for(let s=0;s<r;s++){let a=n.getDerivedResource({url:o[s].uri}),l=Tc.getServerKey(a.getUrlComponent());this._innerContentResources[s]=a,this._serverKeys[s]=l}}Object.defineProperties(wf.prototype,{featurePropertiesDirty:{get:function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)if(e[n].featurePropertiesDirty)return!0;return!1},set:function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].featurePropertiesDirty=e}},featuresLength:{get:function(){return 0}},pointsLength:{get:function(){return 0}},trianglesLength:{get:function(){return 0}},geometryByteLength:{get:function(){return 0}},texturesByteLength:{get:function(){return 0}},batchTableByteLength:{get:function(){return 0}},innerContents:{get:function(){return this._contents}},ready:{get:function(){return this._contentsCreated?this._ready:!1}},tileset:{get:function(){return this._tileset}},tile:{get:function(){return this._tile}},url:{get:function(){}},metadata:{get:function(){},set:function(){throw new C("Multiple3DTileContent cannot have metadata")}},batchTable:{get:function(){}},group:{get:function(){},set:function(){throw new C("Multiple3DTileContent cannot have group metadata")}},innerContentUrls:{get:function(){return this._innerContentHeaders.map(function(e){return e.uri})}}});function lW(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function wce(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}wf.prototype.requestInnerContents=function(){if(!m7e(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let e=this._innerContentHeaders;lW(this,e.length);let t=this._cancelCount;for(let n=0;n<e.length;n++)this._arrayFetchPromises[n]=p7e(this,n,t,this._tile._contentState);return _7e(this)};function m7e(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];c(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!Tc.serverHasOpenSlots(n,t[n]))return!1;return Tc.heapHasOpenSlots(e.length)}function p7e(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],l=new ir({throttle:!0,throttleByServer:!0,type:gs.TILES3D,priorityFunction:s,serverKey:a});o.request=l,e._requests[t]=l;let u=o.fetchArrayBuffer();if(c(u))return u.then(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Zn.CANCELLED){wce(e,i);return}return lW(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Zn.CANCELLED){wce(e,i);return}lW(e,-1),vce(e,t,f)}})}async function _7e(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>g7e(e,r,s)),o=await Promise.all(i);if(e._contentsCreated=!0,e._contents=o.filter(c),e._externalTilesetCount===e._contents.length){let r=e._tile;r.hasRenderableContent=!1}return o}async function g7e(e,t,n){if(c(t))try{let i=$g(t),o=e._tileset,r=e._innerContentResources[n],s=e._tile;i.contentType===Us.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Us.GEOMETRY||i.contentType===Us.VECTOR;let a,l=iC[i.contentType];c(i.binaryPayload)?a=await Promise.resolve(l(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(l(o,s,r,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let h=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=h.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=oC(o,u));let f=rC(o,u);return c(f)&&(a.group=new uA({metadata:f})),a}catch(i){vce(e,n,i)}}function vce(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=c(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}wf.prototype.cancelRequests=function(){for(let e=0;e<this._requests.length;e++){let t=this._requests[e];c(t)&&t.cancel()}};wf.prototype.hasProperty=function(e,t){return!1};wf.prototype.getFeature=function(e){};wf.prototype.applyDebugSettings=function(e,t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyDebugSettings(e,t)};wf.prototype.applyStyle=function(e){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].applyStyle(e)};wf.prototype.update=function(e,t){let n=this._contents,i=n.length,o=!0;for(let r=0;r<i;++r)n[r].update(e,t),o=o&&n[r].ready;!this._ready&&o&&(this._ready=!0)};wf.prototype.pick=function(e,t,n){if(!this._ready)return;let i,o=Number.POSITIVE_INFINITY,r=this._contents,s=r.length;for(let a=0;a<s;++a){let l=r[a].pick(e,t,n);if(!c(l))continue;let u=d.distance(e.origin,l);u<o&&(i=l,o=u)}if(c(i))return n};wf.prototype.isDestroyed=function(){return!1};wf.prototype.destroy=function(){let e=this._contents,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return de(this)};var XB=wf;var Dce=Math.cos,Pce=Math.sin,y7e=Math.sqrt,uW={};uW.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,l=e.nwCorner,u=e.boundingRectangle,f=l.latitude-e.granYCos*i+o*e.granXSin,h=Dce(f),p=Pce(f),g=a.z*p,m=l.longitude+i*e.granYSin+o*e.granXCos,y=h*Dce(m),b=h*Pce(m),x=a.x*y,A=a.y*b,E=y7e(x*y+A*b+g*p);if(r.x=x/E,r.y=A/E,r.z=g/E,n){let S=e.stNwCorner;c(S)?(f=S.latitude-e.stGranYCos*i+o*e.stGranXSin,m=S.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var b7e=new Ri,vf=new d,x7e=new he,KB=new d,lD=new Oi;function Ice(e,t,n,i,o,r,s){let a=Math.cos(t),l=i*a,u=n*a,f=Math.sin(t),h=i*f,p=n*f;lD._ellipsoid=ie.default,vf=lD.project(e,vf),vf=d.subtract(vf,KB,vf);let g=Ri.fromRotation(t,b7e);vf=Ri.multiplyByVector(g,vf,vf),vf=d.add(vf,KB,vf),e=lD.unproject(vf,e),r-=1,s-=1;let m=e.latitude,y=m+r*p,b=m-l*s,x=m-l*s+r*p,A=Math.max(m,y,b,x),E=Math.min(m,y,b,x),S=e.longitude,v=S+r*u,P=S+s*h,M=S+s*h+r*u,R=Math.max(S,v,P,M),L=Math.min(S,v,P,M);return{north:A,south:E,east:R,west:L,granYCos:l,granYSin:h,granXCos:u,granXSin:p,nwCorner:e}}uW.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,l=e.west,u=e.north,f=e.south,h=!1,p=!1;u===O.PI_OVER_TWO&&(h=!0),f===-O.PI_OVER_TWO&&(p=!0);let g,m=u-f;l>a?g=O.TWO_PI-l+a:g=a-l;let y=Math.ceil(g/t)+1,b=Math.ceil(m/t)+1,x=g/(y-1),A=m/(b-1),E=ce.northwest(e,r),S=ce.center(e,x7e);(n!==0||i!==0)&&(S.longitude<E.longitude&&(S.longitude+=O.TWO_PI),lD._ellipsoid=ie.default,KB=lD.project(S,KB));let v=A,P=x,M=0,R=0,L=ce.clone(e,o),B={granYCos:v,granYSin:M,granXCos:P,granXSin:R,nwCorner:E,boundingRectangle:L,width:y,height:b,northCap:h,southCap:p};if(n!==0){let _=Ice(E,n,x,A,S,y,b);if(u=_.north,f=_.south,a=_.east,l=_.west,u<-O.PI_OVER_TWO||u>O.PI_OVER_TWO||f<-O.PI_OVER_TWO||f>O.PI_OVER_TWO)throw new C("Rotated rectangle is invalid. It crosses over either the north or south pole.");B.granYCos=_.granYCos,B.granYSin=_.granYSin,B.granXCos=_.granXCos,B.granXSin=_.granXSin,L.north=u,L.south=f,L.east=a,L.west=l}if(i!==0){n=n-i;let _=ce.northwest(L,s),w=Ice(_,n,x,A,S,y,b);B.stGranYCos=w.granYCos,B.stGranXCos=w.granXCos,B.stGranYSin=w.granYSin,B.stGranXSin=w.granXSin,B.stNwCorner=_,B.stWest=w.west,B.stSouth=w.south}return B};var zs=uW;var T7e=new le,A7e=new le,C7e=new d,E7e=new ce;function Oce(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,l=2,u=0,f=4;r&&(l-=1,a-=1,u+=1,f-=2),s&&(l-=1,a-=1,u+=1,f-=2),u+=l*o+2*a-f;let h=new Float64Array(u*3),p=0,g=0,m,y=C7e;if(r)zs.computePosition(t,n,!1,g,0,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;else for(m=0;m<o;m++)zs.computePosition(t,n,!1,g,m,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;for(m=o-1,g=1;g<i;g++)zs.computePosition(t,n,!1,g,m,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;if(g=i-1,!s)for(m=o-2;m>=0;m--)zs.computePosition(t,n,!1,g,m,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;for(m=0,g=i-2;g>0;g--)zs.computePosition(t,n,!1,g,m,y),h[p++]=y.x,h[p++]=y.y,h[p++]=y.z;let b=h.length/3*2,x=Fe.createTypedArray(h.length/3,b),A=0;for(let S=0;S<h.length/3-1;S++)x[A++]=S,x[A++]=S+1;x[A++]=h.length/3-1,x[A++]=0;let E=new ct({attributes:new hn,primitiveType:Me.LINES});return E.attributes.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:h}),E.indices=x,E}function S7e(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=Oce(e,t),s=t.height,a=t.width,l=si.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),u=l.length,f=new Float64Array(u*2);f.set(l);let h=si.scaleToGeodeticHeight(r.attributes.position.values,i,o);f.set(h,u),r.attributes.position.values=f;let p=t.northCap,g=t.southCap,m=4;p&&(m-=1),g&&(m-=1);let y=(f.length/3+m)*2,b=Fe.createTypedArray(f.length/3,y);u=f.length/6;let x=0;for(let E=0;E<u-1;E++)b[x++]=E,b[x++]=E+1,b[x++]=E+u,b[x++]=E+u+1;b[x++]=u-1,b[x++]=0,b[x++]=u+u-1,b[x++]=u,b[x++]=0,b[x++]=u;let A;if(p)A=s-1;else{let E=a-1;b[x++]=E,b[x++]=E+u,A=a+s-2}if(b[x++]=A,b[x++]=A+u,!g){let E=a+A-1;b[x++]=E,b[x]=E+u}return r.indices=b,r}function aC(e){e=e??W.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??O.RADIANS_PER_DEGREE,i=e.ellipsoid??ie.default,o=e.rotation??0;if(!c(t))throw new C("rectangle is required.");if(ce._validate(t),t.north<t.south)throw new C("options.rectangle.north must be greater than options.rectangle.south");let r=e.height??0,s=e.extrudedHeight??r;this._rectangle=ce.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,s),this._rotation=o,this._extrudedHeight=Math.min(r,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}aC.packedLength=ce.packedLength+ie.packedLength+5;aC.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,ce.pack(e._rectangle,t,n),n+=ce.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var Rce=new ce,Mce=ie.clone(ie.UNIT_SPHERE),sC={rectangle:Rce,ellipsoid:Mce,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};aC.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i=ce.unpack(e,t,Rce);t+=ce.packedLength;let o=ie.unpack(e,t,Mce);t+=ie.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++],u=e[t];return c(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=ie.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=l,n._offsetAttribute=u===-1?void 0:u,n):(sC.granularity=r,sC.height=s,sC.rotation=a,sC.extrudedHeight=l,sC.offsetAttribute=u===-1?void 0:u,new aC(sC))};var w7e=new he;aC.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=zs.computeOptions(t,e._granularity,e._rotation,0,E7e,w7e),o,r;if(O.equalsEpsilon(t.north,t.south,O.EPSILON10)||O.equalsEpsilon(t.east,t.west,O.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,l=!O.equalsEpsilon(s,a,0,O.EPSILON2),u;if(l){if(o=S7e(e,i),c(e._offsetAttribute)){let p=o.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===Zt.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===Zt.NONE?0:1,g=g.fill(u)),o.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=le.fromRectangle3D(t,n,s,A7e),h=le.fromRectangle3D(t,n,a,T7e);r=le.union(f,h)}else{if(o=Oce(e,i),o.attributes.position.values=si.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),c(e._offsetAttribute)){let f=o.attributes.position.values.length;u=e._offsetAttribute===Zt.NONE?0:1;let h=new Uint8Array(f/3).fill(u);o.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:h})}r=le.fromRectangle3D(t,n,s)}return new ct({attributes:o.attributes,indices:o.indices,primitiveType:Me.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var cC=aC;function uC(e){T.typeOf.object("options",e),T.typeOf.object("options.rectangle",e.rectangle),this.rectangle=ce.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new d,this.northeastCornerCartesian=new d,this.westNormal=new d,this.southNormal=new d,this.eastNormal=new d,this.northNormal=new d;let t=e.ellipsoid??ie.WGS84;O7e(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(uC.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});uC.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=Pn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)};var Lce=new d,$B=new d,Nce=new d,v7e=new d,D7e=new d,P7e=new d,I7e=new d,Df=new he,Fce=new sn(d.UNIT_X,0),lC=new _n;function O7e(e,t,n){n.cartographicToCartesian(ce.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ce.northeast(t),e.northeastCornerCartesian),Df.longitude=t.west,Df.latitude=(t.south+t.north)*.5,Df.height=0;let i=n.cartographicToCartesian(Df,P7e),o=d.cross(i,d.UNIT_Z,v7e);d.normalize(o,e.westNormal),Df.longitude=t.east;let r=n.cartographicToCartesian(Df,I7e),s=d.cross(d.UNIT_Z,r,Lce);d.normalize(s,e.eastNormal);let a=d.subtract(i,r,Lce);d.magnitude(a)===0&&(a=d.clone(o,a));let l=d.normalize(a,D7e),u=t.south,f;if(u>0){Df.longitude=(t.west+t.east)*.5,Df.latitude=u;let y=n.cartographicToCartesian(Df,lC.origin);d.clone(l,lC.direction);let b=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Fce);Qn.rayPlane(lC,b,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,$B)}else f=n.geodeticSurfaceNormalCartographic(ce.southeast(t),$B);let h=d.cross(f,a,Nce);d.normalize(h,e.southNormal);let p=t.north,g;if(p<0){Df.longitude=(t.west+t.east)*.5,Df.latitude=p;let y=n.cartographicToCartesian(Df,lC.origin);d.negate(l,lC.direction);let b=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Fce);Qn.rayPlane(lC,b,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,$B)}else g=n.geodeticSurfaceNormalCartographic(ce.northwest(t),$B);let m=d.cross(a,g,Nce);d.normalize(m,e.northNormal)}var R7e=new d,M7e=new d,L7e=new d(0,-1,0),N7e=new d(0,0,-1),Bce=new d;function F7e(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!ce.contains(e.rectangle,o)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,h=e.westNormal,p=e.southNormal,g=e.eastNormal,m=e.northNormal;t.mode!==oe.SCENE3D&&(u=t.mapProjection.project(ce.southwest(e.rectangle),R7e),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ce.northeast(e.rectangle),M7e),f.z=f.y,f.y=f.x,f.x=0,h=L7e,g=d.UNIT_Y,p=N7e,m=d.UNIT_Z);let y=d.subtract(i,u,Bce),b=d.dot(y,h),x=d.dot(y,p),A=d.subtract(i,f,Bce),E=d.dot(A,g),S=d.dot(A,m);b>0?r+=b*b:E>0&&(r+=E*E),x>0?r+=x*x:S>0&&(r+=S*S)}let s,a,l;if(t.mode===oe.SCENE3D?(s=o.height,a=e.minimumHeight,l=e.maximumHeight):(s=i.x,a=0,l=0),s>l){let u=s-l;r+=u*u}else if(s<a){let u=a-s;r+=u*u}return Math.sqrt(r)}uC.prototype.distanceToCamera=function(e){T.defined("frameState",e);let t=F7e(this,e);if(e.mode===oe.SCENE3D&&c(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};uC.prototype.intersectPlane=function(e){return T.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)};uC.prototype.createDebugVolume=function(e){T.defined("color",e);let t=new F.clone(F.IDENTITY),n=new cC({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new St({geometry:n,id:"outline",modelMatrix:t,attributes:{color:jt.fromColor(e)}});return new In({geometryInstances:i,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var Pf=uC;var uD={},B7e=new d,kce=new d,Uce=new d,Vce=new d,zce=new Pn;uD.validOutline=function(e){T.defined("positions",e);let n=Pn.fromPoints(e,zce).halfAxes,i=J.getColumn(n,0,kce),o=J.getColumn(n,1,Uce),r=J.getColumn(n,2,Vce),s=d.magnitude(i),a=d.magnitude(o),l=d.magnitude(r);return!(s===0&&(a===0||l===0)||a===0&&l===0)};uD.computeProjectTo2DArguments=function(e,t,n,i){T.defined("positions",e),T.defined("centerResult",t),T.defined("planeAxis1Result",n),T.defined("planeAxis2Result",i);let o=Pn.fromPoints(e,zce),r=o.halfAxes,s=J.getColumn(r,0,kce),a=J.getColumn(r,1,Uce),l=J.getColumn(r,2,Vce),u=d.magnitude(s),f=d.magnitude(a),h=d.magnitude(l),p=Math.min(u,f,h);if(u===0&&(f===0||h===0)||f===0&&h===0)return!1;let g,m;return(p===f||p===h)&&(g=s),p===u?g=a:p===h&&(m=a),(p===u||p===f)&&(m=l),d.normalize(g,n),d.normalize(m,i),d.clone(o.center,t),!0};function Hce(e,t,n,i,o){let r=d.subtract(e,t,B7e),s=d.dot(n,r),a=d.dot(i,r);return z.fromElements(s,a,o)}uD.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=Hce(i[r],e,t,n);return o}};uD.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return Hce(i,e,t,n,o)}};var Zg=uD;function k7e(e){let t=e.length,n=new Float64Array(t*3),i=Fe.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let l=e[a];n[o++]=l.x,n[o++]=l.y,n[o++]=l.z,i[r++]=a,i[r++]=(a+1)%t}let s=new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:n})});return new ct({attributes:s,indices:i,primitiveType:Me.LINES})}function Rb(e){e=e??W.EMPTY_OBJECT;let t=e.polygonHierarchy;T.defined("options.polygonHierarchy",t),this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=zn.computeHierarchyPackedLength(t,d)+1}Rb.fromPositions=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions}};return new Rb(t)};Rb.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),t[n]=e.packedLength,t};var U7e={polygonHierarchy:{}};Rb.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=e[t];return c(n)||(n=new Rb(U7e)),n._polygonHierarchy=i,n.packedLength=o,n};Rb.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=xo(n,d.equalsEpsilon,!0),n.length<3||!Zg.validOutline(n))return;let o=zn.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let l=0;l<o.length;l++){let u=new St({geometry:k7e(o[l])});r.push(u)}let s=Nn.combineInstances(r)[0],a=le.fromPoints(t.positions);return new ct({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Nd=Rb;var ZB=new he;function fD(e){T.typeOf.object("options",e),T.typeOf.string("options.token",e.token);let t=_g.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??ie.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=X7e(t,n,i,o);this._boundingPlanes=r;let s=Q7e(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=yW(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=d.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=yW(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=yW(r[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let l=t.getCenter();ZB=o.cartesianToCartographic(l,ZB),ZB.height=(i+n)/2,this.center=o.cartographicToCartesian(ZB,l),this._boundingSphere=le.fromPoints(s)}var V7e=new d,z7e=new he,H7e=new d,G7e=new he,j7e=new d,W7e=new d,q7e=new d,Y7e=new d;function X7e(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,V7e),a=i.cartesianToCartographic(r,z7e);a.height=n;let l=i.cartographicToCartesian(a,H7e),u=sn.fromPointNormal(l,s);o[0]=u;let f=0,h,p=[],g,m;for(h=0;h<4;h++){g=e.getVertex(h),p[h]=g,m=i.cartesianToCartographic(g,G7e),m.height=t;let b=sn.getPointDistance(u,i.cartographicToCartesian(m,j7e));b<f&&(f=b)}let y=sn.clone(u);for(y.normal=d.negate(y.normal,y.normal),y.distance=y.distance*-1+f,o[1]=y,h=0;h<4;h++){g=p[h];let b=p[(h+1)%4],x=i.geodeticSurfaceNormal(g,W7e),A=d.subtract(b,g,Y7e),E=d.cross(A,x,q7e);E=d.normalize(E,E),o[2+h]=sn.fromPointNormal(g,E)}return o}var Mb=new d,Lb=new d,Nb=new d,fW=new d,dW=new d,hW=new d,K7e=new d,$7e=new d,Z7e=new d,mW=new d,pW=new d,_W=new d,Qg=new d,um=new J;function Gce(e,t,n){Mb=e.normal,Lb=t.normal,Nb=n.normal,fW=d.multiplyByScalar(e.normal,-e.distance,fW),dW=d.multiplyByScalar(t.normal,-t.distance,dW),hW=d.multiplyByScalar(n.normal,-n.distance,hW),mW=d.multiplyByScalar(d.cross(Lb,Nb,K7e),d.dot(fW,Mb),mW),pW=d.multiplyByScalar(d.cross(Nb,Mb,$7e),d.dot(dW,Lb),pW),_W=d.multiplyByScalar(d.cross(Mb,Lb,Z7e),d.dot(hW,Nb),_W),um[0]=Mb.x,um[1]=Lb.x,um[2]=Nb.x,um[3]=Mb.y,um[4]=Lb.y,um[5]=Nb.y,um[6]=Mb.z,um[7]=Lb.z,um[8]=Nb.z;let i=J.determinant(um);return Qg=d.add(mW,pW,Qg),Qg=d.add(Qg,_W,Qg),new d(Qg.x/i,Qg.y/i,Qg.z/i)}function Q7e(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Gce(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Gce(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var gW=new d,fC=new d;function yW(e,t){let n=[];for(let i=0;i<4;i++)gW=d.subtract(t[(i+1)%4],t[i],gW),fC=d.cross(e.normal,gW,fC),fC=d.normalize(fC,fC),n[i]=d.clone(fC);return n}Object.defineProperties(fD.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var bW=new d;fD.prototype.distanceToCamera=function(e){T.defined("frameState",e);let t=e.camera.positionWC,n=[],i=[],o;sn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):sn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,sn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,l;if(n.length===1)return l=this._boundingPlanes[n[0]],a=xW(sn.projectPointOntoPlane(l,t,bW),i[0],l,o),d.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=jce(t,p[0],p[1]),d.distance(a,t)}let f=Number.MAX_VALUE,h;for(r=0;r<2;r++)l=this._boundingPlanes[n[r]],a=xW(sn.projectPointOntoPlane(l,t,bW),i[r],l,this._edgeNormals[n[r]]),h=d.distanceSquared(a,t),h<f&&(f=h);return Math.sqrt(f)}else if(n.length>3)return a=xW(sn.projectPointOntoPlane(this._boundingPlanes[1],t,bW),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),d.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?d.distance(t,this._vertices[(n[1]-2+u)%4]):d.distance(t,this._vertices[4+(n[1]-2+u)%4])};var J7e=new d,eYe=new d;function jce(e,t,n){let i=d.subtract(n,t,J7e),o=d.subtract(e,t,eYe),r=d.dot(i,o);if(r<=0)return t;let s=d.dot(i,i);return r>=s?n:(r=r/s,new d((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var tYe=new sn(d.UNIT_X,0);function xW(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let l=0;l<t.length;l++){let u=sn.fromPointNormal(t[l],i[l],tYe);sn.getPointDistance(u,e)<0||(a=jce(e,t[l],t[(l+1)%4]),r=d.distance(e,a),r<o&&(o=r,s=a))}return c(s)?s:e}fD.prototype.intersectPlane=function(e){T.defined("plane",e);let t=0,n=0;for(let i=0;i<this._vertices.length;i++)d.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?Wt.INSIDE:n===this._vertices.length?Wt.OUTSIDE:Wt.INTERSECTING};fD.prototype.createDebugVolume=function(e){T.defined("color",e);let t=new F.clone(F.IDENTITY),n=new Nd({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Nd.createGeometry(n),o=new St({geometry:i,id:"outline",modelMatrix:t,attributes:{color:jt.fromColor(e)}}),r=new Nd({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Nd.createGeometry(r),a=new St({geometry:s,id:"outline",modelMatrix:t,attributes:{color:jt.fromColor(e)}}),l=[];for(let u=0;u<4;u++){let f=new Nd({polygonHierarchy:{positions:this._planeVertices[2+u]}}),h=Nd.createGeometry(f);l[u]=new St({geometry:h,id:"outline",modelMatrix:t,attributes:{color:jt.fromColor(e)}})}return new In({geometryInstances:[l[0],l[1],l[2],l[3],a,o],appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var QB=fD;var nYe=new d(1,1,1),JB=Math.cos,e3=Math.sin;function dC(e){e=e??W.EMPTY_OBJECT;let t=e.radii??nYe,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??O.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??O.PI,a=Math.round(e.stackPartitions??10),l=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);if(a<1)throw new C("options.stackPartitions cannot be less than 1");if(l<0)throw new C("options.slicePartitions cannot be less than 0");if(u<0)throw new C("options.subdivisions must be greater than or equal to zero.");if(c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new C("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=l,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}dC.packedLength=2*d.packedLength+8;dC.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=e._offsetAttribute??-1,t};var Wce=new d,qce=new d,$p={radii:Wce,innerRadii:qce,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};dC.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i=d.unpack(e,t,Wce);t+=d.packedLength;let o=d.unpack(e,t,qce);t+=d.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return c(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=l,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=h,n._offsetAttribute=p===-1?void 0:p,n):($p.minimumClock=r,$p.maximumClock=s,$p.minimumCone=a,$p.maximumCone=l,$p.stackPartitions=u,$p.slicePartitions=f,$p.subdivisions=h,$p.offsetAttribute=p===-1?void 0:p,new dC($p))};dC.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._subdivisions,l=ie.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(o-i)/O.TWO_PI),f=Math.round(f*Math.abs(s-r)/O.PI),u<2&&(u=2),f<2&&(f=2);let h=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,y=!1;g&&(p=2,r>0&&(m=!0,h+=u),s<Math.PI&&(y=!0,h+=u));let b=a*p*(f+u),x=new Float64Array(b*3),A=2*(b+h-(u+f)*p),E=Fe.createTypedArray(b,A),S,v,P,M,R=0,L=new Array(f),B=new Array(f);for(S=0;S<f;S++)M=r+S*(s-r)/(f-1),L[S]=e3(M),B[S]=JB(M);let _=new Array(a),w=new Array(a);for(S=0;S<a;S++)P=i+S*(o-i)/(a-1),_[S]=e3(P),w[S]=JB(P);for(S=0;S<f;S++)for(v=0;v<a;v++)x[R++]=t.x*L[S]*w[v],x[R++]=t.y*L[S]*_[v],x[R++]=t.z*B[S];if(g)for(S=0;S<f;S++)for(v=0;v<a;v++)x[R++]=n.x*L[S]*w[v],x[R++]=n.y*L[S]*_[v],x[R++]=n.z*B[S];for(L.length=a,B.length=a,S=0;S<a;S++)M=r+S*(s-r)/(a-1),L[S]=e3(M),B[S]=JB(M);for(_.length=u,w.length=u,S=0;S<u;S++)P=i+S*(o-i)/(u-1),_[S]=e3(P),w[S]=JB(P);for(S=0;S<a;S++)for(v=0;v<u;v++)x[R++]=t.x*L[S]*w[v],x[R++]=t.y*L[S]*_[v],x[R++]=t.z*B[S];if(g)for(S=0;S<a;S++)for(v=0;v<u;v++)x[R++]=n.x*L[S]*w[v],x[R++]=n.y*L[S]*_[v],x[R++]=n.z*B[S];for(R=0,S=0;S<f*p;S++){let N=S*a;for(v=0;v<a-1;v++)E[R++]=N+v,E[R++]=N+v+1}let D=f*a*p;for(S=0;S<u;S++)for(v=0;v<a-1;v++)E[R++]=D+S+v*u,E[R++]=D+S+(v+1)*u;if(g)for(D=f*a*p+u*a,S=0;S<u;S++)for(v=0;v<a-1;v++)E[R++]=D+S+v*u,E[R++]=D+S+(v+1)*u;if(g){let N=f*a*p,k=N+a*u;if(m)for(S=0;S<u;S++)E[R++]=N+S,E[R++]=k+S;if(y)for(N+=a*u-u,k+=a*u-u,S=0;S<u;S++)E[R++]=N+S,E[R++]=k+S}let I=new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:x})});if(c(e._offsetAttribute)){let N=x.length,k=e._offsetAttribute===Zt.NONE?0:1,H=new Uint8Array(N/3).fill(k);I.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:H})}return new ct({attributes:I,indices:E,primitiveType:Me.LINES,boundingSphere:le.fromEllipsoid(l),offsetAttribute:e._offsetAttribute})};var If=dC;function hC(e){let t=e.radius??1,i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new If(i),this._workerName="createSphereOutlineGeometry"}hC.packedLength=If.packedLength;hC.pack=function(e,t,n){return T.typeOf.object("value",e),If.pack(e._ellipsoidGeometry,t,n)};var iYe=new If,Fb={radius:void 0,radii:new d,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};hC.unpack=function(e,t,n){let i=If.unpack(e,t,iYe);return Fb.stackPartitions=i._stackPartitions,Fb.slicePartitions=i._slicePartitions,Fb.subdivisions=i._subdivisions,c(n)?(d.clone(i._radii,Fb.radii),n._ellipsoidGeometry=new If(Fb),n):(Fb.radius=i._radii.x,new hC(Fb))};hC.createGeometry=function(e){return If.createGeometry(e._ellipsoidGeometry)};var Jg=hC;function mC(e,t){t===0&&(t=O.EPSILON7),this._boundingSphere=new le(e,t)}Object.defineProperties(mC.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});mC.prototype.distanceToCamera=function(e){T.defined("frameState",e);let t=this._boundingSphere;return Math.max(0,d.distance(t.center,e.camera.positionWC)-t.radius)};mC.prototype.intersectPlane=function(e){return T.defined("plane",e),le.intersectPlane(this._boundingSphere,e)};mC.prototype.update=function(e,t){d.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};mC.prototype.createDebugVolume=function(e){T.defined("color",e);let t=new Jg({radius:this.radius}),n=F.fromTranslation(this.center,new F.clone(F.IDENTITY)),i=new St({geometry:t,id:"outline",modelMatrix:n,attributes:{color:jt.fromColor(e)}});return new In({geometryInstances:i,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var ey=mC;var oYe=new d,rYe=new d,sYe=new d,aYe=new d;function Bb(e,t,n){n=d.cross(e,t,n);let i=d.magnitude(n);return d.multiplyByScalar(n,O.EPSILON7/i,n)}function TW(e,t){let n=d.normalize(e,aYe),i=d.equalsEpsilon(n,d.UNIT_X,O.EPSILON6)?d.UNIT_Y:d.UNIT_X;return Bb(e,i,t)}function Yce(e){let t=J.getColumn(e,0,oYe),n=J.getColumn(e,1,rYe),i=J.getColumn(e,2,sYe),o=d.equals(t,d.ZERO),r=d.equals(n,d.ZERO),s=d.equals(i,d.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=O.EPSILON7,e[4]=O.EPSILON7,e[8]=O.EPSILON7,e):(o&&!r&&!s?t=Bb(n,i,t):!o&&r&&!s?n=Bb(t,i,n):!o&&!r&&s?i=Bb(n,t,i):o?r?s||(t=TW(i,t),n=Bb(i,t,n)):(t=TW(n,t),i=Bb(n,t,i)):(n=TW(t,n),i=Bb(n,t,i)),J.setColumn(e,0,t,e),J.setColumn(e,1,n,e),J.setColumn(e,2,i,e),e)}function pC(e,t){t=Yce(t),this._orientedBoundingBox=new Pn(e,t),this._boundingSphere=le.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(pC.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});pC.prototype.distanceToCamera=function(e){return T.defined("frameState",e),Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};pC.prototype.intersectPlane=function(e){return T.defined("plane",e),this._orientedBoundingBox.intersectPlane(e)};pC.prototype.update=function(e,t){d.clone(e,this._orientedBoundingBox.center),t=Yce(t),J.clone(t,this._orientedBoundingBox.halfAxes),le.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};pC.prototype.createDebugVolume=function(e){T.defined("color",e);let t=new Mh({minimum:new d(-1,-1,-1),maximum:new d(1,1,1)}),n=F.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new St({geometry:t,id:"outline",modelMatrix:n,attributes:{color:jt.fromColor(e)}});return new In({geometryInstances:i,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})};var fu=pC;function Zo(e,t,n,i){this._tileset=e,this._header=n;let o=c(n.contents),r=o&&n.contents.length>1||ri(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=c(n.transform)?F.unpack(n.transform):F.clone(F.IDENTITY);let a=c(i)?i.computedTransform:e.modelMatrix,l=F.multiply(a,this.transform,new F),u=c(i)?i._initialTransform:F.IDENTITY;this._initialTransform=F.multiply(u,this.transform,new F),this.computedTransform=l,this.metadata=YB(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,l),this._boundingVolume2D=void 0;let f;c(s)&&c(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,l)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let h;c(n.viewerRequestVolume)&&(h=this.createBoundingVolume(n.viewerRequestVolume,l)),this._viewerRequestVolume=h,this.geometricError=n.geometricError,this._geometricError=n.geometricError,c(this._geometricError)||(this._geometricError=c(i)?i._geometricError:e._geometricError,Zo._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;c(n.refine)?((n.refine==="replace"||n.refine==="add")&&Zo._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Yo.REPLACE:Yo.ADD):c(i)?p=i.refine:p=Yo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,b,x;if(t=we.createIfNeeded(t),r)y=$o.UNLOADED,b=t.clone();else if(c(s)){let v=s.uri;c(s.url)&&(Zo._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(Zo._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new cD(e,this),m=!0,y=$o.READY):(y=$o.UNLOADED,b=t.getDerivedResource({url:v}),x=Tc.getServerKey(b.getUrlComponent()))}else g=new cD(e,this),m=!0,y=$o.READY;this._content=g,this._contentResource=b,this._contentState=y,this._expiredContent=void 0,this._serverKey=x,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let A=n.expire,E,S;c(A)&&(E=A.duration,c(A.date)&&(S=Q.fromIso8601(A.date))),this.expireDuration=E,this.expireDate=S,this.lastStyleTime=0,this._optimChildrenWithinParent=Ld.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=G.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new Q,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}Zo._deprecationWarning=Ns;Object.defineProperties(Zo.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return this._contentBoundingVolume??this._boundingVolume}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return c(this._color)||(this._color=new G),G.clone(this._color)},set:function(e){this._color=G.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||c(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===$o.READY}},contentUnloaded:{get:function(){return this._contentState===$o.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===$o.EXPIRED}},contentFailed:{get:function(){return this._contentState===$o.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var ty=new d;function cYe(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=d.multiplyByScalar(s.directionWC,e._centerZDepth,ty),l=d.add(s.positionWC,a,ty),u=d.subtract(l,r,ty);if(d.magnitude(u)>o){let S=d.normalize(u,ty),v=d.multiplyByScalar(S,o,ty),P=d.add(r,v,ty),M=d.subtract(P,s.positionWC,ty),R=d.normalize(M,ty);e._foveatedFactor=1-Math.abs(d.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===Yo.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===Uo.PRELOAD_FLIGHT||n._pass===Uo.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*m;if(e._foveatedFactor<=y)return!1;let b=m-y,x=O.clamp((e._foveatedFactor-y)/b,0,1),A=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,x),E=e._screenSpaceError===0&&c(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-A<=E}var Qce=new Q;Zo.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=n??1,r=c(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:l}=e,u=a.frustum,f=l.drawingBufferWidth,h=l.drawingBufferHeight*o,p;if(e.mode===oe.SCENE2D||u instanceof on){let g=u.offCenterFrustum;c(g)&&(u=g);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,h);p=s/m}else{let g=Math.max(this._distanceToCamera,O.EPSILON7),m=u.sseDenominator;if(p=s*h/(g*m),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,b=i.dynamicScreenSpaceErrorFactor,x=O.fog(g,y)*b;p-=x}}return p/=e.pixelRatio,p};function lYe(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=c(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function uYe(e,t){let n=t.parent,o=c(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}Zo.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=c(t)?t.computedTransform:n.modelMatrix,o=c(t)?t._visibilityPlaneMask:ys.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==ys.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=uYe(n,this),this._priorityProgressiveResolution=lYe(n,this),this.priorityDeferred=cYe(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};Zo.prototype.updateExpiration=function(){if(c(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=Q.now(Qce);Q.lessThan(this.expireDate,e)&&(this._contentState=$o.EXPIRED,this._expiredContent=this._content)}};function fYe(e){if(!c(e.expireDuration))return;let t=Q.now(Qce);Q.addSeconds(t,e.expireDuration,t),c(e.expireDate)?Q.lessThan(e.expireDate,t)&&Q.clone(t,e.expireDate):e.expireDate=Q.clone(t)}function dYe(e){return function(){return e._priority}}Zo.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?hYe(this):pYe(this)};function hYe(e){let t=e._content,n=e._tileset;if(!c(t)){let o=ri(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new XB(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(c(i))return e._contentState=$o.LOADING,i.then(o=>{if(!e.isDestroyed()&&c(o))return e._contentState=$o.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=$o.FAILED,o})}async function mYe(e,t,n,i,o){let r=e._contentState;e._contentState=$o.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Zn.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}throw e._contentState=$o.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Zn.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await _Ye(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,e._contentState=$o.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=$o.FAILED,a}}function pYe(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new ir({throttle:!0,throttleByServer:!0,type:gs.TILES3D,priorityFunction:dYe(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!c(r)){++o.statistics.numberOfAttemptedRequests;return}return mYe(e,o,i,n,r)}async function _Ye(e,t){let n=$g(t),i=e._tileset;i._disableSkipLevelOfDetail=i._disableSkipLevelOfDetail||n.contentType===Us.GEOMETRY||n.contentType===Us.VECTOR,(n.contentType===Us.IMPLICIT_SUBTREE||n.contentType===Us.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),n.contentType===Us.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,r=iC[n.contentType];if(e.isDestroyed())return;c(n.binaryPayload)?o=await Promise.resolve(r(i,e,e._contentResource,n.binaryPayload.buffer,0)):o=await Promise.resolve(r(i,e,e._contentResource,n.jsonPayload));let s=e._contentHeader;if(e.hasImplicitContentMetadata){let l=e.implicitSubtree,u=e.implicitCoordinates;o.metadata=l.getContentMetadataView(u,0)}else e.hasImplicitContent||(o.metadata=oC(i,s));let a=rC(i,s);return c(a)&&(o.group=new uA({metadata:a})),o}Zo.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};Zo.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=$o.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var Jce=new le;function CW(e,t){if(t.mode!==oe.SCENE3D&&!c(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,Jce);e._boundingVolume2D=new ey(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._boundingVolume2D:e._boundingVolume}function gYe(e,t){if(t.mode!==oe.SCENE3D&&!c(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=le.projectTo2D(n,t.mapProjection,Jce);e._contentBoundingVolume2D=new ey(i.center,i.radius)}return t.mode!==oe.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}Zo.prototype.visibility=function(e,t){let n=e.cullingVolume,i=CW(this,e),o=this._tileset,r=o.clippingPlanes;if(c(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==Wt.INSIDE,a===Wt.OUTSIDE)return ys.MASK_OUTSIDE}let s=o.clippingPolygons;if(c(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==Wt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};Zo.prototype.contentVisibility=function(e){if(!c(this._contentBoundingVolume))return Wt.INSIDE;if(this._visibilityPlaneMask===ys.MASK_INSIDE)return Wt.INSIDE;let t=e.cullingVolume,n=gYe(this,e),i=this._tileset,o=i.clippingPlanes;if(c(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==Wt.INSIDE,s===Wt.OUTSIDE)return Wt.OUTSIDE}let r=i.clippingPolygons;if(c(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==Wt.OUTSIDE,s===Wt.INSIDE)return Wt.OUTSIDE}return t.computeVisibility(n)};Zo.prototype.distanceToTile=function(e){return CW(this,e).distanceToCamera(e)};var yYe=new d;Zo.prototype.distanceToTileCenter=function(e){let n=CW(this,e).boundingVolume,i=d.subtract(n.center,e.camera.positionWC,yYe);return d.dot(e.camera.directionWC,i)};Zo.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!c(t)||t.distanceToCamera(e)===0};var ele=new J,tle=new d,bYe=new J,EW=new d,nle=new ce,ile=new Pn,AW=new F;function xYe(e,t,n){let i=d.fromElements(e[0],e[1],e[2],EW),o=J.fromArray(e,3,bYe);i=F.multiplyByPoint(t,i,i);let r=F.getMatrix3(t,ele);return o=J.multiply(r,o,o),c(n)?(n.update(i,o),n):new fu(i,o)}function Xce(e,t,n,i){let o=ce.unpack(e,0,nle),r=e[4],s=e[5],a=Pn.fromRectangle(o,r,s,ie.WGS84,ile),l=a.center,u=a.halfAxes;t=F.multiplyTransformation(t,F.inverseTransformation(n,AW),AW),l=F.multiplyByPoint(t,l,l);let f=F.getMatrix3(t,ele);return u=J.multiply(f,u,u),c(i)&&i instanceof fu?(i.update(l,u),i):new fu(l,u)}function TYe(e,t,n,i){if(!F.equalsEpsilon(t,n,O.EPSILON8))return i instanceof fu?Xce(e,t,n,i):Xce(e,t,n,void 0);let o=ce.unpack(e,0,nle);return i instanceof Pf?(i.rectangle=ce.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ie.WGS84),i):new Pf({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function AYe(e,t,n){let i=d.fromElements(e[0],e[1],e[2],EW),o=e[3];i=F.multiplyByPoint(t,i,i);let r=F.getScale(t,tle),s=d.maximumComponent(r);return o*=s,c(n)?(n.update(i,o),n):new ey(i,o)}Zo.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(c(i)&&(o=CA.parseBoundingVolumeSemantic("TILE",i)),c(o)&&(e=o),!c(e))throw new ae("boundingVolume must be defined");if(ri(e,"3DTILES_bounding_volume_S2"))return new QB(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(c(r)){let l=xYe(r,t,n);return this._verticalExaggeration!==1&&Kce(l,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l}if(c(s)){let l=TYe(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(l instanceof fu?Kce(l,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(l.minimumHeight=Rr.getHeight(l.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l.maximumHeight=Rr.getHeight(l.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),l.computeBoundingVolumes(ie.WGS84))),l}if(c(a)){let l=AYe(a,t,n);if(this._verticalExaggeration!==1){let u=Rr.getPosition(l.center,ie.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,EW),f=l.radius*this._verticalExaggeration;l.update(u,f)}return l}throw new ae("boundingVolume must contain a sphere, region, or box")};var CYe=d.unpackArray(new Array(8*3).fill(0));function Kce(e,t,n){let i=e.boundingVolume.computeCorners(CYe).map(r=>Rr.getPosition(r,ie.WGS84,t,n,r)),o=Pn.fromPoints(i,ile);e.update(o.center,o.halfAxes)}Zo.prototype.updateTransform=function(e,t){e=e??F.IDENTITY;let n=F.multiplyTransformation(e,this.transform,AW),i=!F.equals(n,this.computedTransform),o=c(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&F.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),c(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),c(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};Zo.prototype.updateGeometricErrorScale=function(){let e=F.getScale(this.computedTransform,tle),t=d.maximumComponent(e);if(this.geometricError=this._geometricError*t,!c(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function EYe(e,t,n,i){if(!i.isRender)return;let o=c(e._contentHeader)&&c(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let l;e._finalResolution?e.hasRenderableContent?l=G.WHITE:l=G.DARKGRAY:l=G.YELLOW,c(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(l)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=jt.toValue(l,u.color)}else!r&&c(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(c(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(G.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&c(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&c(e._viewerRequestVolume)?(c(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(G.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&c(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||c(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=G.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function SYe(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&c(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(c(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=$o.FAILED,o}}function wYe(e,t){let n=t.clippingPlanes,i=0;c(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function vYe(e,t){let n=t.clippingPolygons,i=0;c(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}Zo.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;wYe(this,e),vYe(this,e),EYe(this,e,t,n),SYe(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],l=a.pass===De.TRANSLUCENT;a.depthForTranslucentClassification=l}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1};var $ce=[];Zo.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(fYe(this),this._selectedFrame=0,this.lastStyleTime=0,Q.now(this._loadTimestamp),this._contentState=$o.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=$ce;try{this._content.update(e,t)}catch(i){throw this._contentState=$o.FAILED,i}$ce.length=0,t.commandList=n};function Zce(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function t3(e,t,n){return Math.max(O.normalize(e,t,n)-O.EPSILON7,0)}Zo.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,l=s+a,u=o,f=l+u,h=r,p=Math.pow(10,f),g=f+h,m=r,y=Math.pow(10,g),b=g+m,x=Math.pow(10,b),A=t3(this._depth,n.depth,i.depth);A=t?1-A:A;let S=!e.isSkippingLevelOfDetail&&this.refine===Yo.REPLACE?t3(this._priorityHolder._distanceToCamera,n.distance,i.distance):t3(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=Zce(S,a,s),P=this._priorityProgressiveResolution?0:p,M=t3(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=Zce(M,u,l),L=this.priorityDeferred?y:0,B=e._pass===Uo.PRELOAD_FLIGHT?0:x;this._priority=A+v+P+R+L+B};Zo.prototype.isDestroyed=function(){return!1};Zo.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),de(this)};var Fd=Zo;function Zp(e){e=e??W.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class;T.typeOf.object("options.group",n),T.typeOf.object("options.class",i);let o=c(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(Zp.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Zp.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};Zp.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};Zp.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};Zp.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};Zp.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};Zp.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};Zp.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var dD=Zp;function Qp(e){e=e??W.EMPTY_OBJECT;let t=e.tileset,n=e.class;T.typeOf.object("options.tileset",t),T.typeOf.object("options.class",n);let i=c(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Qp.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Qp.prototype.hasProperty=function(e){return Bn.hasProperty(e,this._properties,this._class)};Qp.prototype.hasPropertyBySemantic=function(e){return Bn.hasPropertyBySemantic(e,this._properties,this._class)};Qp.prototype.getPropertyIds=function(e){return Bn.getPropertyIds(this._properties,this._class,e)};Qp.prototype.getProperty=function(e){return Bn.getProperty(e,this._properties,this._class)};Qp.prototype.setProperty=function(e,t){return Bn.setProperty(e,t,this._properties,this._class)};Qp.prototype.getPropertyBySemantic=function(e){return Bn.getPropertyBySemantic(e,this._properties,this._class)};Qp.prototype.setPropertyBySemantic=function(e,t){return Bn.setPropertyBySemantic(e,t,this._properties,this._class)};var n3=Qp;function ole(e){e=e??W.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema;T.typeOf.object("options.metadataJson",t),T.typeOf.object("options.schema",n);let i=t.metadata??t.tileset,o;c(i)&&(o=new n3({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let l=a.length;for(let u=0;u<l;u++){let f=a[u];s.push(new dD({group:f,class:n.classes[f.class]}))}}else if(c(a)){r=Object.keys(a).sort();let l=r.length;for(let u=0;u<l;u++){let f=r[u];if(a.hasOwnProperty(f)){let h=a[f];s.push(new dD({id:f,group:a[f],class:n.classes[h.class]}))}}}this._schema=n,this._groups=s,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(ole.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var _C=ole;var rle={},DYe=new d;rle.checkChildrenWithinParent=function(e){T.typeOf.object("tile",e);let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof fu||i instanceof Pf){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=Ld.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof fu||a instanceof Pf)){e._optimChildrenWithinParent=Ld.SKIP_OPTIMIZATION;break}let l=a._orientedBoundingBox,u=d.subtract(l.center,o.center,DYe),f=d.magnitude(u);d.divideByScalar(u,f,u);let h=Math.abs(o.halfAxes[0]*u.x)+Math.abs(o.halfAxes[1]*u.y)+Math.abs(o.halfAxes[2]*u.z)+Math.abs(o.halfAxes[3]*u.x)+Math.abs(o.halfAxes[4]*u.y)+Math.abs(o.halfAxes[5]*u.z)+Math.abs(o.halfAxes[6]*u.x)+Math.abs(o.halfAxes[7]*u.y)+Math.abs(o.halfAxes[8]*u.z),p=Math.abs(l.halfAxes[0]*u.x)+Math.abs(l.halfAxes[1]*u.y)+Math.abs(l.halfAxes[2]*u.z)+Math.abs(l.halfAxes[3]*u.x)+Math.abs(l.halfAxes[4]*u.y)+Math.abs(l.halfAxes[5]*u.z)+Math.abs(l.halfAxes[6]*u.x)+Math.abs(l.halfAxes[7]*u.y)+Math.abs(l.halfAxes[8]*u.z);if(h<=p+f){e._optimChildrenWithinParent=Ld.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Ld.USE_OPTIMIZATION};var i3=rle;function hD(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(hD.prototype,{length:{get:function(){return this._length}}});function PYe(e,t,n){this.item=e,this.previous=t,this.next=n}hD.prototype.add=function(e){let t=new PYe(e,this.tail,void 0);return c(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function sle(e,t){c(t.previous)&&c(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):c(t.previous)?(t.previous.next=void 0,e.tail=t.previous):c(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}hD.prototype.remove=function(e){c(e)&&(sle(this,e),--this._length)};hD.prototype.splice=function(e,t){if(e===t)return;sle(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var o3=hD;function kb(){this._list=new o3,this._sentinel=this._list.add(),this._trimTiles=!1}kb.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};kb.prototype.touch=function(e){let t=e.cacheNode;c(t)&&this._list.splice(this._sentinel,t)};kb.prototype.add=function(e){c(e.cacheNode)||(e.cacheNode=this._list.add(e))};kb.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;c(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};kb.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=this._sentinel,r=i.head;for(;r!==o&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};kb.prototype.trim=function(){this._trimTiles=!0};var r3=kb;function s3(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function wW(e,t){let n;return t==="_loadTimestamp"?n=Q.toDate(e).getTime():n=e,n}s3.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=wW(e,n),this._referenceMaximum[n]=wW(t,n)};function IYe(e,t){let n=e.tilePropertyName;if(c(n)){let i=wW(t[n],n);return c(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var SW=[new G(.1,.1,.1,1),new G(.153,.278,.878,1),new G(.827,.231,.49,1),new G(.827,.188,.22,1),new G(1,.592,.259,1),new G(1,.843,0,1)];s3.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!c(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=IYe(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+O.EPSILON7,l=O.clamp(i-o,0,s)/s,u=SW.length-1,f=l*u,h=Math.floor(f),p=Math.ceil(f),g=f-h,m=SW[h],y=SW[p],b=G.clone(G.WHITE);b.red=O.lerp(m.red,y.red,g),b.green=O.lerp(m.green,y.green,g),b.blue=O.lerp(m.blue,y.blue,g),e._debugColor=b};s3.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(c(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=c(t)&&c(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var a3=s3;function gC(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.texturesReferenceCounterById={},this.batchTableByteLength=0}gC.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};gC.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(c(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};gC.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof bf))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i]??0;if(o===0){let r=e.getTextureByteLengthById(i);this.texturesByteLength+=r}this.texturesReferenceCounterById[i]=o+1}}let t=e.innerContents;if(c(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};gC.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof bf))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i];if(o===1){delete this.texturesReferenceCounterById[i];let r=e.getTextureByteLengthById(i);this.texturesByteLength-=r}else this.texturesReferenceCounterById[i]=o-1}}let t=e.innerContents;if(c(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};gC.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.texturesReferenceCounterById={...e.texturesReferenceCounterById},t.batchTableByteLength=e.batchTableByteLength};var fm=gC;function mD(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(mD.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});mD.prototype.makeDirty=function(){this._styleDirty=!0};mD.prototype.resetDirty=function(){this._styleDirty=!1};mD.prototype.applyStyle=function(e){if(!c(e.root)||c(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,o=t?e._selectedTiles:e._selectedTilesToStyle,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a.lastStyleTime!==n){let l=a.content;a.lastStyleTime=n,l.applyStyle(this._style),i.numberOfFeaturesStyled+=l.featuresLength,++i.numberOfTilesStyled}}};var c3=mD;function OYe(e,t,n){let i=ri(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;T.typeOf.object("implicitTiling",i),this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!c(o.box)&&!c(o.region)&&!ri(o,"3DTILES_bounding_volume_S2")&&!ri(o,"3DTILES_bounding_volume_cylinder"))throw new ae("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=o,this.refine=t.refine,this.subtreeUriTemplate=new we({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=RYe(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push(We(a,!0));let l=new we({url:a.uri});this.contentUriTemplates.push(l)}this.contentCount=this.contentHeaders.length,this.tileHeader=MYe(t),this.subdivisionScheme=cr[i.subdivisionScheme],this.branchingFactor=cr.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,c(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function RYe(e){if(ri(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return c(t.contents)?t.contents:t.content}return c(e.contents)?e.contents:c(e.content)?[e.content]:[]}function MYe(e){let t=We(e,!0);return c(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var yC=OYe;var pD={};function ale(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function vW(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function cle(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function DW(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}pD.encode2D=function(e,t){if(T.typeOf.number("x",e),T.typeOf.number("y",t),e<0||e>65535||t<0||t>65535)throw new C("inputs must be 16-bit unsigned integers");return(ale(e)|ale(t)<<1)>>>0};pD.decode2D=function(e,t){if(T.typeOf.number("mortonIndex",e),e<0||e>4294967295)throw new C("input must be a 32-bit unsigned integer");return c(t)||(t=new Array(2)),t[0]=cle(e),t[1]=cle(e>>1),t};pD.encode3D=function(e,t,n){if(T.typeOf.number("x",e),T.typeOf.number("y",t),T.typeOf.number("z",n),e<0||e>1023||t<0||t>1023||n<0||n>1023)throw new C("inputs must be 10-bit unsigned integers");return vW(e)|vW(t)<<1|vW(n)<<2};pD.decode3D=function(e,t){if(T.typeOf.number("mortonIndex",e),e<0||e>1073741823)throw new C("input must be a 30-bit unsigned integer");return c(t)||(t=new Array(3)),t[0]=DW(e),t[1]=DW(e>>1),t[2]=DW(e>>2),t};var Ub=pD;function Vo(e){if(T.typeOf.string("options.subdivisionScheme",e.subdivisionScheme),T.typeOf.number("options.subtreeLevels",e.subtreeLevels),T.typeOf.number("options.level",e.level),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),e.subdivisionScheme===cr.OCTREE&&T.typeOf.number("options.z",e.z),e.level<0)throw new C("level must be non-negative");if(e.x<0)throw new C("x must be non-negative");if(e.y<0)throw new C("y must be non-negative");if(e.subdivisionScheme===cr.OCTREE&&e.z<0)throw new C("z must be non-negative");let t=1<<e.level;if(e.x>=t)throw new C("x is out of range");if(e.y>=t)throw new C("y is out of range");if(e.subdivisionScheme===cr.OCTREE&&e.z>=t)throw new C("z is out of range");this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===cr.OCTREE&&(this.z=e.z)}Object.defineProperties(Vo.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===cr.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===cr.OCTREE?Ub.encode3D(this.x,this.y,this.z):Ub.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===cr.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});function PW(e,t){if(e.subdivisionScheme!==t.subdivisionScheme)throw new C("coordinates must have same subdivisionScheme");if(e.subtreeLevels!==t.subtreeLevels)throw new C("coordinates must have same subtreeLevels")}Vo.prototype.getDescendantCoordinates=function(e){T.typeOf.object("offsetCoordinates",e),PW(this,e);let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===cr.OCTREE){let o=(this.z<<e.level)+e.z;return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Vo.prototype.getAncestorCoordinates=function(e){if(T.typeOf.number("offsetLevels",e),e<0)throw new C("offsetLevels must be non-negative");if(e>this.level)throw new C("ancestor cannot be above the tileset root");let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===cr.OCTREE){let r=Math.floor(this.z/t);return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Vo.prototype.getOffsetCoordinates=function(e){if(T.typeOf.object("descendantCoordinates",e),!this.isEqual(e)&&!this.isAncestor(e))throw new C("this is not an ancestor of descendant");PW(this,e);let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===cr.OCTREE){let r=e.z%n;return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Vo.prototype.getChildCoordinates=function(e){T.typeOf.number("childIndex",e);let t=cr.getBranchingFactor(this.subdivisionScheme);if(e<0||t<=e)throw new C(`childIndex must be at least 0 and less than ${t}`);let n=this.level+1,i=2*this.x+e%2,o=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===cr.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Vo({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Vo.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Vo.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Vo.prototype.isAncestor=function(e){T.typeOf.object("descendantCoordinates",e),PW(this,e);let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===cr.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Vo.prototype.isEqual=function(e){return T.typeOf.object("otherCoordinates",e),this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===cr.OCTREE?this.z===e.z:!0)};Vo.prototype.isImplicitTilesetRoot=function(){return this.level===0};Vo.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Vo.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Vo.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===cr.OCTREE&&(e.z=this.z),e};var lle=[0,0,0];Vo.fromMortonIndex=function(e,t,n,i){let o;return e===cr.OCTREE?(o=Ub.decode3D(i,lle),new Vo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Ub.decode2D(i,lle),new Vo({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Vo.fromTileIndex=function(e,t,n){let i,o,r;return e===cr.OCTREE?(i=Math.floor(O.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(O.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Vo.fromMortonIndex(e,t,i,r)};var bC=Vo;function Jp(){}Jp.selectTiles=function(e,t){C.throwInstantiationError()};Jp.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Jp.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Jp.selectTile=function(e,t){if(e.contentVisibility(t)===Wt.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};Jp.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};Jp.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};Jp.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!LYe(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function LYe(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/s<1}Jp.updateTile=function(e,t){ule(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,BYe(e),e._shouldSelect=!1,e._finalResolution=!0};function ule(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];ule(r,t),e._visible=r._visible;return}if(NYe(e,t)){e._visible=!1;return}let i=e.refine===Yo.REPLACE,o=e._optimChildrenWithinParent===Ld.USE_OPTIMIZATION;if(i&&o&&n&&!FYe(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function NYe(e,t){let{parent:n,tileset:i}=e;return!c(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Yo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function FYe(e,t){let n=!1,i=e.children;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(t),n=n||r.isVisible}return n}function BYe(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var ca=Jp;function fle(){}var _D={stack:new xl,stackMaximumLength:0};fle.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:o,visitTile:r}=ca,s=_D.stack;for(s.push(i);s.length>0;){_D.stackMaximumLength=Math.max(_D.stackMaximumLength,s.length);let a=s.pop(),l=a.refine===Yo.ADD,u=a.refine===Yo.REPLACE,f=kYe(a);f&&UYe(a,s,t),(l||u&&!f)&&(VYe(e,a),o(a,t),zYe(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return _D.stack.trim(_D.stackMaximumLength),n};function kYe(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function UYe(e,t,n){let{children:i}=e;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(n),r.isVisible&&t.push(r)}}function VYe(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function zYe(e,t){e.contentAvailable&&e.contentVisibility(t)!==Wt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var l3=fle;function dle(){}var gD={stack:new xl,stackMaximumLength:0},yD={stack:new xl,stackMaximumLength:0};dle.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(ca.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;GYe(n,t),gD.stack.trim(gD.stackMaximumLength),yD.stack.trim(yD.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function IW(e,t){e.contentAvailable&&ca.selectTile(e,t)}function HYe(e,t,n){let i=e.refine===Yo.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:l}=ca;for(let m=0;m<r.length;++m)s(r[m],n);r.sort(ca.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,h=!1,p=-1,g=Number.MAX_VALUE;for(let m=0;m<r.length;++m){let y=r[m];if(y.isVisible?(t.push(y),y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),h=!0):(u||o.loadSiblings)&&(y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),a(y,n),l(y,n)),u){let b;y._inRequestVolume?y.hasRenderableContent?b=y.contentAvailable:b=jYe(y,n):b=!1,f=f&&b}}if(h||(f=!1),p!==-1&&i){let m=r[p];m._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===o.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(m._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(m._distanceToCamera,y._distanceToCamera);for(let b=0;b<r.length;++b)r[b]._priorityHolder=y}return f}function GYe(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=ca,a=gD.stack;for(a.push(e);a.length>0;){gD.stackMaximumLength=Math.max(gD.stackMaximumLength,a.length);let l=a.pop(),u=l.parent,f=!c(u)||u._refines;l._refines=i(l)?HYe(l,a,t)&&f:!1;let h=!l._refines&&f;l.hasRenderableContent?l.refine===Yo.ADD?(IW(l,t),o(l,t)):l.refine===Yo.REPLACE&&(o(l,t),h&&IW(l,t)):(n._emptyTiles.push(l),o(l,t),h&&IW(l,t)),r(l,t),s(l,t)}}function jYe(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=ca,s=!0,a=yD.stack;for(a.push(e);a.length>0;){yD.stackMaximumLength=Math.max(yD.stackMaximumLength,a.length);let l=a.pop(),u=l.children,f=u.length,h=!l.hasRenderableContent&&n(l);if(!h&&!l.contentAvailable&&(s=!1),i(l,t),l.isVisible||(o(l,t),r(l,t)),h)for(let p=0;p<f;++p){let g=u[p];a.push(g)}}return e.hasEmptyContent||s}var u3=dle;function hle(){}var bD={stack:new xl,stackMaximumLength:0},xD={stack:new xl,stackMaximumLength:0},e_={stack:new xl,stackMaximumLength:0,ancestorStack:new xl,ancestorStackMaximumLength:0},WYe=2;hle.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(ca.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;ZYe(n,t),QYe(n,t),bD.stack.trim(bD.stackMaximumLength),xD.stack.trim(xD.stackMaximumLength),e_.stack.trim(e_.stackMaximumLength),e_.ancestorStack.trim(e_.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function qYe(e,t){let{updateTile:n,touchTile:i,selectTile:o}=ca,r=xD.stack;for(r.push(e);r.length>0;){xD.stackMaximumLength=Math.max(xD.stackMaximumLength,r.length);let a=r.pop().children;for(let l=0;l<a.length;++l){let u=a[l];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),o(u,t)):u._depth-e._depth<WYe&&r.push(u))}}}function f3(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;c(n)?n._shouldSelect=!0:qYe(e,t)}function YYe(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!c(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function XYe(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||c(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function KYe(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=ca;for(let u=0;u<o.length;++u)r(o[u],n);o.sort(ca.sortChildrenByDistanceToCamera);let l=!1;for(let u=0;u<o.length;++u){let f=o[u];f.isVisible?(t.push(f),l=!0):i.loadSiblings&&(s(f,n),a(f,n))}return l}function $Ye(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:c(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function ZYe(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=ca,l=bD.stack;for(l.push(e);l.length>0;){bD.stackMaximumLength=Math.max(bD.stackMaximumLength,l.length);let u=l.pop();YYe(u,t);let f=u.parent,h=!c(f)||f._refines;u._refines=o(u)?KYe(u,l,t)&&h:!1;let p=!u._refines&&h;u.hasRenderableContent?u.refine===Yo.ADD?(f3(u,t),r(u,t)):u.refine===Yo.REPLACE&&($Ye(u,i)?(r(u,t),p&&f3(u,t)):p?(f3(u,t),r(u,t)):XYe(n,u)&&r(u,t)):(n._emptyTiles.push(u),r(u,t),p&&f3(u,t)),s(u,t),a(u,t)}}function QYe(e,t){let{selectTile:n,canTraverse:i}=ca,{stack:o,ancestorStack:r}=e_,s;for(o.push(e);o.length>0||r.length>0;){if(e_.stackMaximumLength=Math.max(e_.stackMaximumLength,o.length),e_.ancestorStackMaximumLength=Math.max(e_.ancestorStackMaximumLength,r.length),r.length>0){let u=r.peek();if(u._stackLength===o.length){r.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=o.pop();if(!c(a))continue;let l=i(a);if(a._shouldSelect)if(a.refine===Yo.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!l){n(a,t);continue}r.push(a),a._stackLength=o.length}if(l){let u=a.children;for(let f=0;f<u.length;++f){let h=u[f];h.isVisible&&o.push(h)}}}}var d3=hle;function Qo(e){e=e??W.EMPTY_OBJECT,this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new r3,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new xl,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024,T.typeOf.number.greaterThanOrEquals("cacheBytes",this._cacheBytes,0);let t=e.maximumCacheOverflowBytes??512*1024*1024;T.typeOf.number.greaterThanOrEquals("maximumCacheOverflowBytes",t,0),this._maximumCacheOverflowBytes=t,this._styleEngine=new c3,this._styleApplied=!1,this._modelMatrix=c(e.modelMatrix)?F.clone(e.modelMatrix):F.clone(F.IDENTITY),this._addHeightCallbacks=[],this._statistics=new fm,this._statisticsLast=new fm,this._statisticsPerPass=new Array(Uo.NUMBER_OF_PASSES);for(let o=0;o<Uo.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new fm;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new a3(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=O.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._ellipsoid=e.ellipsoid??ie.WGS84,this._initialClippingPlanesOriginMatrix=F.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??O.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??Tn.ENABLED,this.show=e.show??!0,this.colorBlendMode=nu.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Mp(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Ng,this.loadProgress=new pe,this.allTilesLoaded=new pe,this.initialTilesLoaded=new pe,this.tileLoad=new pe,this.tileUnload=new pe,this.tileFailed=new pe,this.tileVisible=new pe,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,c(e.clippingPlanes)&&xs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,c(e.clippingPolygons)&&Zh.setOwner(e.clippingPolygons,this,"_clippingPolygons"),c(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new lA,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new Og(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??G.BLACK,this.splitDirection=e.splitDirection??qr.NONE,this.enableCollision=e.enableCollision??!1,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&dt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(Qo.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){xs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Zh.setOwner(e,this,"_clippingPolygons")}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Ns("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){T.typeOf.bool("value",e),this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!c(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(c(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(c(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){T.typeOf.number.greaterThanOrEquals("maximumScreenSpaceError",e,0),this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumCacheOverflowBytes=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){T.defined("pointCloudShading",e),this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=F.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return c(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(F.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):F.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){T.typeOf.number.greaterThanOrEquals("foveatedConeSize",e,0),T.typeOf.number.lessThanOrEquals("foveatedConeSize",e,1),this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){T.typeOf.number.greaterThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,0),T.typeOf.number.lessThanOrEquals("foveatedMinimumScreenSpaceErrorRelaxation",e,this.maximumScreenSpaceError),this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){T.typeOf.object("imageBasedLighting",this._imageBasedLighting),e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,Tle(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),T.typeOf.string("value",e),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),T.typeOf.string("value",e),this._instanceFeatureIdLabel=e}}});Qo.fromIonAssetId=async function(e,t){T.defined("assetId",e);let n=await uf.fromAssetId(e);return Qo.fromUrl(n,t)};Qo.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=we.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await Qo.loadJson(n),r=await JYe(n,o),s=new Qo(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=r,s._geometricError=o.geometricError,s._scaledGeometricError=o.geometricError;let a=o.asset;s._asset=a,s._extras=o.extras,Tle(s);let l=c(o.asset.gltfUpAxis)?Fo.fromName(o.asset.gltfUpAxis):Fo.Y,u=t.modelUpAxis??l,f=t.modelForwardAxis??Fo.X;s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,F.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return c(g)&&g.height>fi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=Ot.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=F.clone(s._initialClippingPlanesOriginMatrix),s};Qo.loadJson=function(e){return we.createIfNeeded(e).fetchJson()};Qo.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};Qo.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!c(i))throw new ae("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new ae("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");c(t.extensionsRequired)&&Qo.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics,r=i.tilesetVersion;c(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=mle(this,e,t.root,n);c(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let l=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&l.refine===Yo.ADD;let u=l._header.children;if(c(u))for(let f=0;f<u.length;++f){let h=u[f],p=mle(this,e,h,l);l.children.push(p),p._depth=l._depth+1,a.push(p)}this._cullWithChildrenBounds&&i3.checkChildrenWithinParent(l)}return s};function mle(e,t,n,i){if(!(c(n.implicitTiling)||ri(n,"3DTILES_implicit_tiling")))return new Fd(e,t,n,i);let r=e.schema,s=new yC(t,n,r),a=new bC({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),l=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=We(n,!0);f.contents=[{uri:l}],delete f.content,delete f.extensions;let h=new Fd(e,t,f,i);return h.implicitTileset=s,h.implicitCoordinates=a,h}async function JYe(e,t){let n=ri(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(c(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Di.getSchemaLoader({resource:e});else if(c(n.schema))i=Di.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new _C({schema:i.schema,metadataJson:n});return Di.unload(i),o}var ple=new d,eXe=new he,tXe=new F,nXe=new d,iXe=new d,oXe=new d,rXe=new d;function sXe(e,t){let n,i,o,r,s,a=t.camera,l=e._root,u=l.contentBoundingVolume;if(u instanceof Pf)n=d.normalize(a.positionWC,ple),i=a.directionWC,o=a.positionCartographic.height,r=u.minimumHeight,s=u.maximumHeight;else{let y=F.inverseTransformation(l.computedTransform,tXe),b=t.mapProjection.ellipsoid,x=u.boundingVolume,A=F.multiplyByPoint(y,x.center,nXe);if(d.magnitude(A)>b.minimumRadius){let E=he.fromCartesian(A,b,eXe);n=d.normalize(a.positionWC,ple),i=a.directionWC,o=a.positionCartographic.height,r=0,s=E.height*2}else{let E=F.multiplyByPoint(y,a.positionWC,iXe);if(n=d.UNIT_Z,i=F.multiplyByPointAsVector(y,a.directionWC,oXe),i=d.normalize(i,i),o=E.z,u instanceof fu){let S=J.getColumn(x.halfAxes,2,rXe),v=d.magnitude(S);r=A.z-v,s=A.z+v}else if(u instanceof ey){let S=x.radius;r=A.z-S,s=A.z+S}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,h=r+(s-r)*f,p=s,g=O.clamp((o-h)/(p-h),0,1),m=1-Math.abs(d.dot(i,n));m=m*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function aXe(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();c(o)&&(o.then(r=>{!c(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{yle(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?TXe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function gle(e,t){return e._priority-t._priority}Qo.prototype.postPassesUpdate=function(e){c(this._root)&&(cXe(this,e),CXe(this,e),this._cache.unloadTiles(this,xle),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};Qo.prototype.prePassesUpdate=function(e){if(!c(this._root))return;pXe(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,c(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;c(n)&&n.enabled&&n.update(e),c(this._loadTimestamp)||(this._loadTimestamp=Q.clone(e.time)),this._timeSinceLoad=Math.max(Q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&sXe(this,e),e.newFrame&&this._cache.reset()};function cXe(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],s=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==$o.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function lXe(e){let t=e._requestedTiles;t.sort(gle);for(let n=0;n<t.length;++n)aXe(e,t[n])}function yle(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=c(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`),console.log(e.stack))}function uXe(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==$o.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var fXe=new he,dXe=new he,hXe=new d;function mXe(e,t,n){if(!e.enableCollision||!e.show)return;let i=e._addHeightCallbacks,o=t.boundingSphere;for(let r of i){if(r.invoked||t._wasSelectedLastFrame)continue;let s=r.ellipsoid,a=he.clone(r.positionCartographic,fXe),l=he.fromCartesian(o.center,s,dXe);c(l)&&(a.height=l.height);let u=he.toCartesian(a,s,hXe);d.distance(u,o.center)<=o.radius&&(r.invoked=!0,n.afterRender.push(()=>{c(r.callback)&&r.callback(),r.invoked=!1}))}}function pXe(e,t){uXe(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let l=0;l<n.length;++l){if(e.totalMemoryUsageInBytes>s){a=!0;break}let u=n[l];try{u.process(e,t),u.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--r.numberOfTilesProcessing,yle(f,e,u)}}e.totalMemoryUsageInBytes<i?gXe(e):a&&n.length>0&&_Xe(e)}function _Xe(e){dt("increase-screenSpaceError",`The tiles needed to meet maximumScreenSpaceError would use more memory than allocated for this tileset.
The tileset will be rendered with a larger screen space error (see memoryAdjustedScreenSpaceError).
Consider using larger values for cacheBytes and maximumCacheOverflowBytes.`),e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(gle)}function gXe(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var h3=new d,yXe={maximumFractionDigits:3};function _le(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,yXe):Math.round(t).toLocaleString()}function OW(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=d.clone(i,h3);if(c(t))o.x+=.75*(t[0]+t[3]+t[6]),o.y+=.75*(t[1]+t[4]+t[7]),o.z+=.75*(t[2]+t[5]+t[8]);else if(c(n)){let r=d.normalize(i,h3);r=d.multiplyByScalar(r,.75*n,h3),o=d.add(r,i,h3)}return o}function RW(e,t,n){let i="",o=0;if(t.debugShowGeometricError&&(i+=`
Geometric error: ${e.geometricError}`,o++),t.debugShowRenderingStatistics&&(i+=`
Commands: ${e.commandsLength}`,o++,e.content.pointsLength>0&&(i+=`
Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=`
Triangles: ${e.content.trianglesLength}`,o++),i+=`
Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=`
Texture Memory: ${_le(e.content.texturesByteLength)}`,i+=`
Geometry Memory: ${_le(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=`
Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=`
- ${s[a]}`;o+=s.length}else i+=`
Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${19-o}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(r)}function bXe(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(c(e.debugPickedTile)){let s=c(e.debugPickPosition)?e.debugPickPosition:OW(e.debugPickedTile),a=RW(e.debugPickedTile,e,s);a.pixelOffset=new z(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];RW(a,e,OW(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&RW(a,e,OW(a))}}e._tileDebugLabels.update(t)}function xXe(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(c(e._stencilClearCommand)||(e._stencilClearCommand=new ti({stencil:0,pass:De.CESIUM_3D_TILE,renderState:ze.fromCache({stencilMask:kt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:l,tileVisible:u}=e,f=n.isRender,h=i.length;for(let m=0;m<s.length;++m){let y=s[m];f&&u.raiseEvent(y),mXe(e,y,t),y.update(e,t,n),l.incrementSelectionCounts(y.content),++l.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let g=i.length-h;if(e._backfaceCommands.trim(),a){let m=e._backfaceCommands.values,y=m.length;i.length+=y;for(let b=g-1;b>=0;--b)i[h+y+b]=i[h+b];for(let b=0;b<y;++b)i[h+b]=m[b]}g=i.length-r,l.numberOfCommands=g,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(c(e._tileDebugLabels)||(e._tileDebugLabels=new Gp),bXe(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var ble=[];function TXe(e,t){let n=t,i=ble;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r<o.length;++r)i.push(o[r]);t!==n&&(AXe(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function xle(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function AXe(e,t){e._cache.unloadTile(e,t,xle),t.destroy()}Qo.prototype.trimLoadedTiles=function(){this._cache.trim()};function CXe(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;fm.clone(n,i);let l=o!==s||r!==a;l&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,l&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function EXe(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function SXe(e,t){t.frameNumber===e._updatedModelMatrixFrame&&c(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!F.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=F.clone(e.modelMatrix,e._previousModelMatrix)))}function wXe(e,t,n,i){if(t.mode===oe.MORPHING||!c(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,EXe(e),SXe(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&lXe(e),xXe(e,t,i),fm.clone(o,n),i.isRender){let s=e._credits;if(c(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let l=s[a];t.creditDisplay.addCreditToNextFrame(l)}}return r}function Tle(e){let t=e._credits;c(t)||(t=[]),t.length=0,c(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(At.clone(i))});let n=e.asset.extras;if(c(n)&&c(n.cesium)&&c(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new At(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}Qo.prototype.getTraversal=function(e){let{pass:t}=e;return t===Uo.MOST_DETAILED_PRELOAD||t===Uo.MOST_DETAILED_PICK?l3:this.isSkippingLevelOfDetail?d3:u3};Qo.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};Qo.prototype.updateForPass=function(e,t){T.typeOf.object("frameState",e),T.typeOf.object("tilesetPassState",t);let n=t.pass;if(n===Uo.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===Uo.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===Uo.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=Uo.getPassOptions(n),a=s.ignoreCommands,l=t.commandList??i,u=l.length;if(e.commandList=l,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,s.isRender){let p=this._environmentMapManager;c(this._root)&&(p.position=this.boundingSphere.center),p.update(e)}let f=this._clippingPolygons;c(f)&&f.enabled&&f.queueCommands(e);let h=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=wXe(this,e,h,s)),a&&(l.length=u),e.commandList=i,e.camera=o,e.cullingVolume=r};Qo.prototype.hasExtension=function(e){return c(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};Qo.prototype.isDestroyed=function(){return!1};Qo.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),c(this._root)){let e=ble;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,de(this)};Qo.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};Qo.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!Qo.supportedExtensions[e[t]])throw new ae(`Unsupported 3D Tiles Extension: ${e[t]}`)};var vXe=new _n,DXe=new d,PXe=new he;Qo.prototype.getHeight=function(e,t){T.typeOf.object("cartographic",e),T.typeOf.object("scene",t);let n=t.ellipsoid;c(n)||(n=ie.WGS84);let i=vXe,o=n.cartographicToCartesian(e,i.direction);d.normalize(i.direction,i.direction),i.direction=d.normalize(o,i.direction),i.direction=d.negate(o,i.direction),i.origin=d.multiplyByScalar(i.direction,-2*n.maximumRadius,i.origin);let r=this.pick(i,t.frameState,DXe);if(c(r))return n.cartesianToCartographic(r,PXe)?.height};Qo.prototype.updateHeight=function(e,t,n){n=n??ie.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a<s;++a)if(r[a]===i){r.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var IXe=new $a,OXe=new d;Qo.prototype.pick=function(e,t,n){if(!t.context.webgl2&&!this._enablePick)return;let i=this._selectedTiles,o=i.length,r=[];for(let l=0;l<o;++l){let u=i[l],f=Qn.raySphere(e,u.contentBoundingVolume.boundingSphere,IXe);!c(f)||!c(u.content)||r.push(u)}let s=r.length;r.sort((l,u)=>{let f=le.distanceSquaredTo(l.contentBoundingVolume.boundingSphere,e.origin),h=le.distanceSquaredTo(u.contentBoundingVolume.boundingSphere,e.origin);return f-h});let a;for(let l=0;l<s;++l){let f=r[l].content.pick(e,t,OXe);if(c(f))return a=d.clone(f,n),a}};var As=Qo;var RXe=new F;function ny(e,t){if(!c(e))throw new C("scene is required.");if(!c(t))throw new C("entityCollection is required.");t.collectionChanged.addEventListener(ny.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Et,this._onCollectionChanged(t,t.values,[],[])}ny.prototype.update=function(e){if(!c(e))throw new C("time is required.");let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,l,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),h;f&&(h=s.computeModelMatrix(e,RXe),l=we.createIfNeeded(Y.getValueOrUndefined(a._uri,e)));let p=c(u)?u.tilesetPrimitive:void 0;if(!f){c(p)&&(p.show=!1);continue}(!c(u)||l.url!==u.url)&&(c(p)&&i.removeAndDestroy(p),delete n[s.id],MXe(l,n,s,i)),c(p)&&(p.show=!0,c(h)&&(p.modelMatrix=h),p.maximumScreenSpaceError=Y.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};ny.prototype.isDestroyed=function(){return!1};ny.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ny.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)MW(this,e[i],t,n);return de(this)};ny.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new C("entity is required.");if(!c(t))throw new C("result is required.");let n=this._tilesetHash[e.id];if(!c(n)||n.loadFail)return lt.FAILED;let i=n.tilesetPrimitive;return c(i)?i.show?(le.clone(i.boundingSphere,t),lt.DONE):lt.FAILED:lt.PENDING};ny.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,l=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],c(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],c(r._tileset)?s.set(r.id,r):(MW(this,r,a,l),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],MW(this,r,a,l),s.remove(r.id)};function MW(e,t,n,i){let o=n[t.id];c(o)&&(c(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function MXe(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await As.fromUrl(e);if(o.id=n,i.add(o),!c(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var m3=ny;var LXe=G.WHITE,NXe=G.BLACK,FXe=new z(2,2);function xC(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(xC.prototype,{isConstant:{get:function(){return Y.isConstant(this._evenColor)&&Y.isConstant(this._oddColor)&&Y.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:fe("evenColor"),oddColor:fe("oddColor"),repeat:fe("repeat")});xC.prototype.getType=function(e){return"Checkerboard"};var BXe=new Q;xC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(BXe)),c(t)||(t={}),t.lightColor=Y.getValueOrClonedDefault(this._evenColor,e,LXe,t.lightColor),t.darkColor=Y.getValueOrClonedDefault(this._oddColor,e,NXe,t.darkColor),t.repeat=Y.getValueOrDefault(this._repeat,e,FXe),t};xC.prototype.equals=function(e){return this===e||e instanceof xC&&Y.equals(this._evenColor,e._evenColor)&&Y.equals(this._oddColor,e._oddColor)&&Y.equals(this._repeat,e._repeat)};var TD=xC;var Ale={id:void 0};function AD(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function sc(e){this._owner=e,this._entities=new Et,this._addedEntities=new Et,this._removedEntities=new Et,this._changedEntities=new Et,this._suspendCount=0,this._collectionChanged=new pe,this._id=jn(),this._show=!0,this._firing=!1,this._refire=!1}sc.prototype.suspendEvents=function(){this._suspendCount++};sc.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new C("resumeEvents can not be called before suspendEvents.");this._suspendCount--,AD(this)};Object.defineProperties(sc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(!c(e))throw new C("value is required.");if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){let r=n[t],s=i[t];r!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});sc.prototype.computeAvailability=function(){let e=Ge.MAXIMUM_VALUE,t=Ge.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(c(s)){let a=s.start,l=s.stop;Q.lessThan(a,e)&&!a.equals(Ge.MINIMUM_VALUE)&&(e=a),Q.greaterThan(l,t)&&!l.equals(Ge.MAXIMUM_VALUE)&&(t=l)}}return Ge.MAXIMUM_VALUE.equals(e)&&(e=Ge.MINIMUM_VALUE),Ge.MINIMUM_VALUE.equals(t)&&(t=Ge.MAXIMUM_VALUE),new Sn({start:e,stop:t})};sc.prototype.add=function(e){if(!c(e))throw new C("entity is required.");e instanceof rr||(e=new rr(e));let t=e.id,n=this._entities;if(n.contains(t))throw new C(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(sc.prototype._onEntityDefinitionChanged,this),AD(this),e};sc.prototype.remove=function(e){return c(e)?this.removeById(e.id):!1};sc.prototype.contains=function(e){if(!c(e))throw new C("entity is required");return this._entities.get(e.id)===e};sc.prototype.removeById=function(e){if(!c(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(sc.prototype._onEntityDefinitionChanged,this),AD(this),!0):!1};sc.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let r=0;r<t;r++){let s=n[r],a=s.id,l=i.get(a);c(l)||(s.definitionChanged.removeEventListener(sc.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),AD(this)};sc.prototype.getById=function(e){if(!c(e))throw new C("id is required.");return this._entities.get(e)};sc.prototype.getOrCreateEntity=function(e){if(!c(e))throw new C("id is required.");let t=this._entities.get(e);return c(t)||(Ale.id=e,t=new rr(Ale),this.add(t)),t};sc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),AD(this)};var la=sc;var p3={id:void 0},TC=new Array(2);function LW(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function Cle(e,t,n,i){TC[0]=n,TC[1]=i.id,t[JSON.stringify(TC)]=i.definitionChanged.addEventListener(Ur.prototype._onDefinitionChanged,e)}function Ele(e,t,n,i){TC[0]=n,TC[1]=i.id;let o=JSON.stringify(TC);t[o](),t[o]=void 0}function iy(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,l,u,f=e._composite,h=new la(e),p=e._eventHash,g;for(r=0;r<o;r++)for(u=i[r],u.collectionChanged.removeEventListener(Ur.prototype._onCollectionChanged,e),a=u.values,g=u.id,l=a.length-1;l>-1;l--)s=a[l],Ele(e,p,g,s);for(r=n-1;r>=0;r--)for(u=t[r],u.collectionChanged.addEventListener(Ur.prototype._onCollectionChanged,e),a=u.values,g=u.id,l=a.length-1;l>-1;l--){s=a[l],Cle(e,p,g,s);let y=h.getById(s.id);c(y)||(y=f.getById(s.id),c(y)?LW(y):(p3.id=s.id,y=new rr(p3)),h.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=h.values;for(r=0;r<m.length;r++)f.add(m[r]);f.resumeEvents()}function Ur(e,t){this._owner=t,this._composite=new la(this),this._suspendCount=0,this._collections=c(e)?e.slice():[],this._collectionsCopy=[],this._id=jn(),this._eventHash={},iy(this),this._shouldRecomposite=!1}Object.defineProperties(Ur.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});Ur.prototype.addCollection=function(e,t){let n=c(t);if(!c(e))throw new C("collection is required.");if(n){if(t<0)throw new C("index must be greater than or equal to zero.");if(t>this._collections.length)throw new C("index must be less than or equal to the number of collections.")}n?this._collections.splice(t,0,e):(t=this._collections.length,this._collections.push(e)),iy(this)};Ur.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),iy(this),!0):!1};Ur.prototype.removeAllCollections=function(){this._collections.length=0,iy(this)};Ur.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Ur.prototype.contains=function(e){return this._composite.contains(e)};Ur.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Ur.prototype.getCollection=function(e){if(!c(e))throw new C("index is required.","index");return this._collections[e]};Ur.prototype.getCollectionsLength=function(){return this._collections.length};function _3(e,t){if(!c(t))throw new C("collection is required.");let n=e.indexOf(t);if(n===-1)throw new C("collection is not in this composite.");return n}function Sle(e,t,n){let i=e._collections;if(t=O.clamp(t,0,i.length-1),n=O.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,iy(e)}Ur.prototype.raiseCollection=function(e){let t=_3(this._collections,e);Sle(this,t,t+1)};Ur.prototype.lowerCollection=function(e){let t=_3(this._collections,e);Sle(this,t,t-1)};Ur.prototype.raiseCollectionToTop=function(e){let t=_3(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),iy(this))};Ur.prototype.lowerCollectionToBottom=function(e){let t=_3(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),iy(this))};Ur.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Ur.prototype.resumeEvents=function(){if(this._suspendCount===0)throw new C("resumeEvents can not be called before suspendEvents.");this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(iy(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Ur.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Ur.prototype.getById=function(e){return this._composite.getById(e)};Ur.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,l,u,f=n.length,h=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];Ele(this,h,p,m);let y=m.id;for(a=o-1;a>=0;a--)l=i[a].getById(y),c(l)&&(c(u)||(u=r.getById(y),LW(u)),u.merge(l));c(u)||r.removeById(y),u=void 0}let g=t.length;for(s=0;s<g;s++){let m=t[s];Cle(this,h,p,m);let y=m.id;for(a=o-1;a>=0;a--)l=i[a].getById(y),c(l)&&(c(u)||(u=r.getById(y),c(u)?LW(u):(p3.id=y,u=new rr(p3),r.add(u))),u.merge(l));u=void 0}r.resumeEvents()};Ur.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,l=r.getById(a),u=l[t],f=!c(u),h=!0;for(let p=s-1;p>=0;p--){let g=o[p].getById(e.id);if(c(g)){let m=g[t];if(c(m)){if(h)if(h=!1,c(m.merge)&&c(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&l.propertyNames.indexOf(t)===-1&&l.addProperty(t),l[t]=u};var wle=Ur;function NW(){this._removalFunctions=[]}NW.prototype.add=function(e,t,n){if(!c(e))throw new C("event is required");let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};NW.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Ar=NW;function kW(e,t){return Q.compare(e.start,t.start)}function Vr(e){if(this._intervals=[],this._changedEvent=new pe,c(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Vr.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});Vr.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Vr))return!1;let n=this._intervals,i=e._intervals,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;r++)if(!Sn.equals(n[r],i[r],t))return!1;return!0};Vr.prototype.get=function(e){if(!c(e))throw new C("index is required.");return this._intervals[e]};Vr.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Vr.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Vr.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Vr.prototype.contains=function(e){return this.indexOf(e)>=0};var FW=new Sn;Vr.prototype.indexOf=function(e){if(!c(e))throw new C("date is required");let t=this._intervals;FW.start=e,FW.stop=e;let n=Mo(t,FW,kW);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&Sn.contains(t[n-1],e)?n-1:~n)};Vr.prototype.findInterval=function(e){e=e??W.EMPTY_OBJECT;let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let s=0,a=r.length;s<a;s++){let l=r[s];if((!c(t)||l.start.equals(t))&&(!c(n)||l.stop.equals(n))&&(!c(i)||l.isStartIncluded===i)&&(!c(o)||l.isStopIncluded===o))return r[s]}};Vr.prototype.addInterval=function(e,t){if(!c(e))throw new C("interval is required");if(e.isEmpty)return;let n=this._intervals;if(n.length===0||Q.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Mo(n,e,kW);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let o;for(i>0&&(o=Q.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((c(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(Q.greaterThan(e.stop,n[i-1].stop)?e=new Sn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Sn({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=Q.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Sn({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Sn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(o=Q.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(c(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Sn({start:e.start,stop:Q.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:Q.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Sn({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Vr.prototype.removeInterval=function(e){if(!c(e))throw new C("interval is required");if(e.isEmpty)return!1;let t=this._intervals,n=Mo(t,e,kW);n<0&&(n=~n);let i=!1;for(n>0&&(Q.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(Q.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Sn({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Sn({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new Sn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&Q.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new Sn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Sn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(Q.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Sn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Vr.prototype.intersect=function(e,t,n){if(!c(e))throw new C("other is required.");let i=new Vr,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let l=s[o],u=a[r];if(Q.lessThan(l.stop,u.start))++o;else if(Q.lessThan(u.stop,l.start))++r;else{if(c(n)||c(t)&&t(l.data,u.data)||!c(t)&&u.data===l.data){let f=Sn.intersect(l,u,new Sn,n);f.isEmpty||i.addInterval(f,t)}Q.lessThan(l.stop,u.stop)||l.stop.equals(u.stop)&&!l.isStopIncluded&&u.isStopIncluded?++o:++r}}return i};Vr.fromJulianDateArray=function(e,t){if(!c(e))throw new C("options is required.");if(!c(e.julianDates))throw new C("options.iso8601Array is required.");c(t)||(t=new Vr);let n=e.julianDates,i=n.length,o=e.dataCallback,r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,l=e.trailingInterval??!1,u,f=0;a&&(++f,u=new Sn({start:Ge.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),u.data=c(o)?o(u,t.length):t.length,t.addInterval(u));for(let h=0;h<i-1;++h){let p=n[h],g=n[h+1];u=new Sn({start:p,stop:g,isStartIncluded:t.length===f?r:!0,isStopIncluded:h===i-2?s:!1}),u.data=c(o)?o(u,t.length):t.length,t.addInterval(u),p=g}return l&&(u=new Sn({start:n[i-1],stop:Ge.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=c(o)?o(u,t.length):t.length,t.addInterval(u)),t};var ac=new op,CD=[0,31,28,31,30,31,30,31,31,30,31,30,31];function BW(e,t,n){c(n)||(n=new Q),Q.toGregorianDate(e,ac);let i=ac.millisecond+t.millisecond,o=ac.second+t.second,r=ac.minute+t.minute,s=ac.hour+t.hour,a=ac.day+t.day,l=ac.month+t.month,u=ac.year+t.year;for(i>=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),CD[2]=Th(u)?29:28;a>CD[l]||l>=13;)a>CD[l]&&(a-=CD[l],++l),l>=13&&(--l,u+=Math.floor(l/12),l=l%12,++l),CD[2]=Th(u)?29:28;return ac.millisecond=i,ac.second=o,ac.minute=r,ac.hour=s,ac.day=a,ac.month=l,ac.year=u,Q.fromGregorianDate(ac,n)}var kXe=new Q,UXe=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function vle(e,t){if(!c(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(UXe);if(!c(n))return!1;if(c(n[1])&&(t.year=Number(n[1].replace(",","."))),c(n[2])&&(t.month=Number(n[2].replace(",","."))),c(n[3])&&(t.day=Number(n[3].replace(",","."))*7),c(n[4])&&(t.day+=Number(n[4].replace(",","."))),c(n[5])&&(t.hour=Number(n[5].replace(",","."))),c(n[6])&&(t.minute=Number(n[6].replace(",","."))),c(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),Q.toGregorianDate(Q.fromIso8601(e,kXe),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var ED=new op;Vr.fromIso8601=function(e,t){if(!c(e))throw new C("options is required.");if(!c(e.iso8601))throw new C("options.iso8601 is required.");let n=e.iso8601.split("/"),i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=[];if(!vle(n[2],ED))r.push(i,o);else{let s=Q.clone(i);for(r.push(s);Q.compare(s,o)<0;)s=BW(s,ED),Q.compare(o,s)<=0&&Q.clone(o,s),r.push(s)}return Vr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Vr.fromIso8601DateArray=function(e,t){if(!c(e))throw new C("options is required.");if(!c(e.iso8601Dates))throw new C("options.iso8601Dates is required.");return Vr.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return Q.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Vr.fromIso8601DurationArray=function(e,t){if(!c(e))throw new C("options is required.");if(!c(e.epoch))throw new C("options.epoch is required.");if(!c(e.iso8601Durations))throw new C("options.iso8601Durations is required.");let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],s,a,l=i.length;for(let u=0;u<l;++u)(vle(i[u],ED)||u===0)&&(o&&c(a)?s=BW(a,ED):s=BW(n,ED),r.push(s),a=s);return Vr.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Xr=Vr;function VXe(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let l=i.get(a);c(l.data)&&r.indexOf(l.data)===-1&&t.add(l.data.definitionChanged,o)}}function Vb(){this._eventHelper=new Ar,this._definitionChanged=new pe,this._intervals=new Xr,this._intervals.changedEvent.addEventListener(Vb.prototype._intervalsChanged,this)}Object.defineProperties(Vb.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var zXe=new Q;Vb.prototype.getValue=function(e,t){c(e)||(e=Q.now(zXe));let n=this._intervals.findDataForIntervalContainingDate(e);if(c(n))return n.getValue(e,t)};Vb.prototype.equals=function(e){return this===e||e instanceof Vb&&this._intervals.equals(e._intervals,Y.equals)};Vb.prototype._intervalsChanged=function(){VXe(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Gc=Vb;function oy(){this._definitionChanged=new pe,this._composite=new Gc,this._composite.definitionChanged.addEventListener(oy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(oy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});oy.prototype.getType=function(e){if(!c(e))throw new C("time is required");let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(c(t))return t.getType(e)};var HXe=new Q;oy.prototype.getValue=function(e,t){c(e)||(e=Q.now(HXe));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(c(n))return n.getValue(e,t)};oy.prototype.equals=function(e){return this===e||e instanceof oy&&this._composite.equals(e._composite,Y.equals)};oy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var SD=oy;function ry(e){this._referenceFrame=e??zi.FIXED,this._definitionChanged=new pe,this._composite=new Gc,this._composite.definitionChanged.addEventListener(ry.prototype._raiseDefinitionChanged,this)}Object.defineProperties(ry.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});var GXe=new Q;ry.prototype.getValue=function(e,t){return c(e)||(e=Q.now(GXe)),this.getValueInReferenceFrame(e,zi.FIXED,t)};ry.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new C("time is required.");if(!c(t))throw new C("referenceFrame is required.");let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(c(i))return i.getValueInReferenceFrame(e,t,n)};ry.prototype.equals=function(e){return this===e||e instanceof ry&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,Y.equals)};ry.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Pa=ry;var jXe={ROUNDED:0,MITERED:1,BEVELED:2},ki=Object.freeze(jXe);var ua=[new d,new d],WXe=new d,qXe=new d,YXe=new d,XXe=new d,KXe=new d,$Xe=new d,ZXe=new d,QXe=new d,JXe=new d,AC=new d,g3=new d,wD={},UW=new he;function eKe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];UW=t.cartesianToCartographic(o,UW),n[i]=UW.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function VW(e,t,n,i){let o=e[0],r=e[1],s=d.angleBetween(o,r),a=Math.ceil(s/i),l=new Array(a),u;if(t===n){for(u=0;u<a;u++)l[u]=t;return l.push(n),l}let h=(n-t)/a;for(u=1;u<a;u++){let p=t+u*h;l[u]=p}return l[0]=t,l.push(n),l}var y3=new d,b3=new d;function tKe(e,t,n,i){let o=new is(n,i),r=o.projectPointOntoPlane(d.add(n,e,y3),y3),s=o.projectPointOntoPlane(d.add(n,t,b3),b3),a=z.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var nKe=new d(-1,0,0),zb=new F,iKe=new F,zW=new J,oKe=J.IDENTITY.clone(),rKe=new d,sKe=new se,Dle=new d;function t_(e,t,n,i,o,r,s,a){let l=rKe,u=sKe;zb=Ot.eastNorthUpToFixedFrame(e,o,zb),l=F.multiplyByPointAsVector(zb,nKe,l),l=d.normalize(l,l);let f=tKe(l,t,e,o);zW=J.fromRotationZ(f,zW),Dle.z=r,zb=F.multiplyTransformation(zb,F.fromRotationTranslation(zW,Dle,iKe),zb);let h=oKe;h[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)u=d.fromArray(n,g,u),u=J.multiplyByVector(h,u,u),u=F.multiplyByPoint(zb,u,u),i.push(u.x,u.y,u.z);return i}var aKe=new d;function HW(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let l=d.fromArray(e,a,aKe);i=t_(l,t,n,i,o,r[a/3],s,1)}return i}function cKe(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s;for(let l=1;l<n;l++){a=e[l];let u=a.x-r,f=a.y-s;i[o++]=u,i[o++]=0,i[o++]=f,i[o++]=u,i[o++]=0,i[o++]=f}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s,i}function Ple(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[o++]=e[a].x-r,i[o++]=0,i[o++]=e[a].y-s;return i}var Ile=new Le,Ole=new d,Rle=new J;function Mle(e,t,n,i,o,r,s,a,l,u){let f=d.angleBetween(d.subtract(t,e,AC),d.subtract(n,e,g3)),h=i===ki.BEVELED?0:Math.ceil(f/O.toRadians(5)),p;o?p=J.fromQuaternion(Le.fromAxisAngle(d.negate(e,AC),f/(h+1),Ile),Rle):p=J.fromQuaternion(Le.fromAxisAngle(e,f/(h+1),Ile),Rle);let g,m;if(t=d.clone(t,Ole),h>0){let y=u?2:1;for(let b=0;b<h;b++)t=J.multiplyByVector(p,t,t),g=d.subtract(t,e,AC),g=d.normalize(g,g),o||(g=d.negate(g,g)),m=r.scaleToGeodeticSurface(t,g3),s=t_(m,g,a,s,r,l,1,y)}else g=d.subtract(t,e,AC),g=d.normalize(g,g),o||(g=d.negate(g,g)),m=r.scaleToGeodeticSurface(t,g3),s=t_(m,g,a,s,r,l,1,1),n=d.clone(n,Ole),g=d.subtract(n,e,AC),g=d.normalize(g,g),o||(g=d.negate(g,g)),m=r.scaleToGeodeticSurface(n,g3),s=t_(m,g,a,s,r,l,1,1);return s}wD.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];z.equals(r,s)||n.push(s)}return n};wD.angleIsGreaterThanPi=function(e,t,n,i){let o=new is(n,i),r=o.projectPointOntoPlane(d.add(n,e,y3),y3),s=o.projectPointOntoPlane(d.add(n,t,b3),b3);return s.x*r.y-s.y*r.x>=0};var lKe=new d,uKe=new d;wD.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=eKe(e,r),a=i._granularity,l=i._cornerType,u=o?cKe(t,n):Ple(t,n),f=o?Ple(t,n):void 0,h=n.height/2,p=n.width/2,g=e.length,m=[],y=o?[]:void 0,b=WXe,x=qXe,A=YXe,E=XXe,S=KXe,v=$Xe,P=ZXe,M=QXe,R=JXe,L=e[0],B=e[1];E=r.geodeticSurfaceNormal(L,E),b=d.subtract(B,L,b),b=d.normalize(b,b),M=d.cross(E,b,M),M=d.normalize(M,M);let _=s[0],w=s[1];o&&(y=t_(L,M,f,y,r,_+h,1,1)),R=d.clone(L,R),L=B,x=d.negate(b,x);let D,I;for(let H=1;H<g-1;H++){let V=o?2:1;if(B=e[H+1],L.equals(B)){dt("Positions are too close and are considered equivalent with rounding error.");continue}b=d.subtract(B,L,b),b=d.normalize(b,b),E=r.geodeticSurfaceNormal(L,E);let j=d.multiplyByScalar(E,d.dot(b,E),lKe);d.subtract(b,j,j),d.normalize(j,j);let U=d.multiplyByScalar(E,d.dot(x,E),uKe);if(d.subtract(x,U,U),d.normalize(U,U),!O.equalsEpsilon(Math.abs(d.dot(j,U)),1,O.EPSILON7)){A=d.add(b,x,A),A=d.normalize(A,A),A=d.cross(A,E,A),A=d.cross(E,A,A),A=d.normalize(A,A);let X=1/Math.max(.25,d.magnitude(d.cross(A,x,AC))),te=wD.angleIsGreaterThanPi(b,x,L,r);te?(S=d.add(L,d.multiplyByScalar(A,X*p,A),S),v=d.add(S,d.multiplyByScalar(M,p,v),v),ua[0]=d.clone(R,ua[0]),ua[1]=d.clone(v,ua[1]),D=VW(ua,_+h,w+h,a),I=Bi.generateArc({positions:ua,granularity:a,ellipsoid:r}),m=HW(I,M,u,m,r,D,1),M=d.cross(E,b,M),M=d.normalize(M,M),P=d.add(S,d.multiplyByScalar(M,p,P),P),l===ki.ROUNDED||l===ki.BEVELED?Mle(S,v,P,l,te,r,m,u,w+h,o):(A=d.negate(A,A),m=t_(L,A,u,m,r,w+h,X,V)),R=d.clone(P,R)):(S=d.add(L,d.multiplyByScalar(A,X*p,A),S),v=d.add(S,d.multiplyByScalar(M,-p,v),v),ua[0]=d.clone(R,ua[0]),ua[1]=d.clone(v,ua[1]),D=VW(ua,_+h,w+h,a),I=Bi.generateArc({positions:ua,granularity:a,ellipsoid:r}),m=HW(I,M,u,m,r,D,1),M=d.cross(E,b,M),M=d.normalize(M,M),P=d.add(S,d.multiplyByScalar(M,-p,P),P),l===ki.ROUNDED||l===ki.BEVELED?Mle(S,v,P,l,te,r,m,u,w+h,o):m=t_(L,A,u,m,r,w+h,X,V),R=d.clone(P,R)),x=d.negate(b,x)}else m=t_(R,M,u,m,r,_+h,1,1),R=L;_=w,w=s[H+1],L=B}ua[0]=d.clone(R,ua[0]),ua[1]=d.clone(L,ua[1]),D=VW(ua,_+h,w+h,a),I=Bi.generateArc({positions:ua,granularity:a,ellipsoid:r}),m=HW(I,M,u,m,r,D,1),o&&(y=t_(L,M,f,y,r,w+h,1,1)),g=m.length;let N=o?g+y.length:g,k=new Float64Array(N);return k.set(m),o&&k.set(y,g),k};var dm=wD;var jW={},CC=new d,kle=new d,fKe=new d,Lle=new d,jc=[new d,new d],Ule=new d,Vle=new d,zle=new d,dKe=new d,hKe=new d,mKe=new d,pKe=new d,_Ke=new d,gKe=new d,yKe=new d,Nle=new Le,Fle=new J;function x3(e,t,n,i,o){let r=d.angleBetween(d.subtract(t,e,CC),d.subtract(n,e,kle)),s=i===ki.BEVELED?1:Math.ceil(r/O.toRadians(5))+1,a=s*3,l=new Array(a);l[a-3]=n.x,l[a-2]=n.y,l[a-1]=n.z;let u;o?u=J.fromQuaternion(Le.fromAxisAngle(d.negate(e,CC),r/s,Nle),Fle):u=J.fromQuaternion(Le.fromAxisAngle(e,r/s,Nle),Fle);let f=0;t=d.clone(t,CC);for(let h=0;h<s;h++)t=J.multiplyByVector(u,t,t),l[f++]=t.x,l[f++]=t.y,l[f++]=t.z;return l}function bKe(e){let t=Ule,n=Vle,i=zle,o=e[1];n=d.fromArray(e[1],o.length-3,n),i=d.fromArray(e[0],0,i),t=d.midpoint(n,i,t);let r=x3(t,n,i,ki.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=d.fromArray(a,a.length-3,n),i=d.fromArray(o,0,i),t=d.midpoint(n,i,t);let l=x3(t,n,i,ki.ROUNDED,!1);return[r,l]}function Ble(e,t,n,i){let o=CC;return i?o=d.add(e,t,o):(t=d.negate(t,t),o=d.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function GW(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=d.multiplyByScalar(t,n,CC),a=d.negate(s,kle),l=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let h=d.fromArray(e,f,fKe),p=d.add(h,a,Lle);o[l++]=p.x,o[l++]=p.y,o[l++]=p.z;let g=d.add(h,s,Lle);r[u--]=g.z,r[u--]=g.y,r[u--]=g.x}return i.push(o,r),i}jW.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;c(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),c(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var xKe=new d,TKe=new d;jW.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=Ule,l=Vle,u=zle,f=dKe,h=hKe,p=mKe,g=pKe,m=_Ke,y=gKe,b=yKe,x=[],A=s?[]:void 0,E=s?[]:void 0,S=n[0],v=n[1];l=d.normalize(d.subtract(v,S,l),l),a=i.geodeticSurfaceNormal(S,a),f=d.normalize(d.cross(a,l,f),f),s&&(A.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z)),g=d.clone(S,g),S=v,u=d.negate(l,u);let P,M=[],R,L=n.length;for(R=1;R<L-1;R++){a=i.geodeticSurfaceNormal(S,a),v=n[R+1],l=d.normalize(d.subtract(v,S,l),l);let _=d.multiplyByScalar(a,d.dot(l,a),xKe);d.subtract(l,_,_),d.normalize(_,_);let w=d.multiplyByScalar(a,d.dot(u,a),TKe);if(d.subtract(u,w,w),d.normalize(w,w),!O.equalsEpsilon(Math.abs(d.dot(_,w)),1,O.EPSILON7)){h=d.normalize(d.add(l,u,h),h),h=d.cross(h,a,h),h=d.cross(a,h,h),h=d.normalize(h,h);let I=o/Math.max(.25,d.magnitude(d.cross(h,u,CC))),N=dm.angleIsGreaterThanPi(l,u,S,i);h=d.multiplyByScalar(h,I,h),N?(m=d.add(S,h,m),b=d.add(m,d.multiplyByScalar(f,o,b),b),y=d.add(m,d.multiplyByScalar(f,o*2,y),y),jc[0]=d.clone(g,jc[0]),jc[1]=d.clone(b,jc[1]),P=Bi.generateArc({positions:jc,granularity:t,ellipsoid:i}),x=GW(P,f,o,x),s&&(A.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z)),p=d.clone(y,p),f=d.normalize(d.cross(a,l,f),f),y=d.add(m,d.multiplyByScalar(f,o*2,y),y),g=d.add(m,d.multiplyByScalar(f,o,g),g),r===ki.ROUNDED||r===ki.BEVELED?M.push({leftPositions:x3(m,p,y,r,N)}):M.push({leftPositions:Ble(S,d.negate(h,h),y,N)})):(y=d.add(S,h,y),b=d.add(y,d.negate(d.multiplyByScalar(f,o,b),b),b),m=d.add(y,d.negate(d.multiplyByScalar(f,o*2,m),m),m),jc[0]=d.clone(g,jc[0]),jc[1]=d.clone(b,jc[1]),P=Bi.generateArc({positions:jc,granularity:t,ellipsoid:i}),x=GW(P,f,o,x),s&&(A.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z)),p=d.clone(m,p),f=d.normalize(d.cross(a,l,f),f),m=d.add(y,d.negate(d.multiplyByScalar(f,o*2,m),m),m),g=d.add(y,d.negate(d.multiplyByScalar(f,o,g),g),g),r===ki.ROUNDED||r===ki.BEVELED?M.push({rightPositions:x3(y,p,m,r,N)}):M.push({rightPositions:Ble(S,h,m,N)})),u=d.negate(l,u)}S=v}a=i.geodeticSurfaceNormal(S,a),jc[0]=d.clone(g,jc[0]),jc[1]=d.clone(S,jc[1]),P=Bi.generateArc({positions:jc,granularity:t,ellipsoid:i}),x=GW(P,f,o,x),s&&(A.push(f.x,f.y,f.z),E.push(a.x,a.y,a.z));let B;return r===ki.ROUNDED&&(B=bKe(x)),{positions:x,corners:M,lefts:A,normals:E,endPositions:B}};var Gi=jW;var jle=new d,Wle=new d,T3=new d,A3=new d,AKe=new d,qle=new d,sy=new d,EC=new d;function Yle(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Bd(e,t,n,i,o,r){let s=e.normals,a=e.tangents,l=e.bitangents,u=d.normalize(d.cross(n,t,sy),sy);r.normal&&Gi.addAttribute(s,t,i,o),r.tangent&&Gi.addAttribute(a,u,i,o),r.bitangent&&Gi.addAttribute(l,n,i,o)}function Xle(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,l=new hn,u,f=0,h=0,p,g=0,m;for(p=0;p<i.length;p+=2)m=i[p].length-3,f+=m,g+=m*2,h+=i[p+1].length-3;for(f+=3,h+=3,p=0;p<o.length;p++){u=o[p];let ee=o[p].leftPositions;c(ee)?(m=ee.length,f+=m,g+=m):(m=o[p].rightPositions.length,h+=m,g+=m)}let y=c(r),b;y&&(b=r[0].length-3,f+=b,h+=b,b/=3,g+=b*6);let x=f+h,A=new Float64Array(x),E=t.normal?new Float32Array(x):void 0,S=t.tangent?new Float32Array(x):void 0,v=t.bitangent?new Float32Array(x):void 0,P={normals:E,tangents:S,bitangents:v},M=0,R=x-1,L,B,_,w,D=jle,I=Wle,N,k,H=b/2,V=Fe.createTypedArray(x/3,g),j=0;if(y){k=T3,N=A3;let ee=r[0];for(D=d.fromArray(a,0,D),I=d.fromArray(s,0,I),p=0;p<H;p++)k=d.fromArray(ee,(H-1-p)*3,k),N=d.fromArray(ee,(H+p)*3,N),Gi.addAttribute(A,N,M),Gi.addAttribute(A,k,void 0,R),Bd(P,D,I,M,R,t),B=M/3,w=B+1,L=(R-2)/3,_=L-1,V[j++]=L,V[j++]=B,V[j++]=_,V[j++]=_,V[j++]=B,V[j++]=w,M+=3,R-=3}let U=0,q=0,X=i[U++],te=i[U++];A.set(X,M),A.set(te,R-te.length+1),I=d.fromArray(s,q,I);let K,Z;for(m=te.length-3,p=0;p<m;p+=3)K=n.geodeticSurfaceNormal(d.fromArray(X,p,sy),sy),Z=n.geodeticSurfaceNormal(d.fromArray(te,m-p,EC),EC),D=d.normalize(d.add(K,Z,D),D),Bd(P,D,I,M,R,t),B=M/3,w=B+1,L=(R-2)/3,_=L-1,V[j++]=L,V[j++]=B,V[j++]=_,V[j++]=_,V[j++]=B,V[j++]=w,M+=3,R-=3;for(K=n.geodeticSurfaceNormal(d.fromArray(X,m,sy),sy),Z=n.geodeticSurfaceNormal(d.fromArray(te,m,EC),EC),D=d.normalize(d.add(K,Z,D),D),q+=3,p=0;p<o.length;p++){let ee;u=o[p];let me=u.leftPositions,xe=u.rightPositions,ue,ye,Ae=qle,Pe=T3,Ee=A3;if(D=d.fromArray(a,q,D),c(me)){for(Bd(P,D,I,void 0,R,t),R-=3,ue=w,ye=_,ee=0;ee<me.length/3;ee++)Ae=d.fromArray(me,ee*3,Ae),V[j++]=ue,V[j++]=ye-ee-1,V[j++]=ye-ee,Gi.addAttribute(A,Ae,void 0,R),Pe=d.fromArray(A,(ye-ee-1)*3,Pe),Ee=d.fromArray(A,ue*3,Ee),I=d.normalize(d.subtract(Pe,Ee,I),I),Bd(P,D,I,void 0,R,t),R-=3;Ae=d.fromArray(A,ue*3,Ae),Pe=d.subtract(d.fromArray(A,ye*3,Pe),Ae,Pe),Ee=d.subtract(d.fromArray(A,(ye-ee)*3,Ee),Ae,Ee),I=d.normalize(d.add(Pe,Ee,I),I),Bd(P,D,I,M,void 0,t),M+=3}else{for(Bd(P,D,I,M,void 0,t),M+=3,ue=_,ye=w,ee=0;ee<xe.length/3;ee++)Ae=d.fromArray(xe,ee*3,Ae),V[j++]=ue,V[j++]=ye+ee,V[j++]=ye+ee+1,Gi.addAttribute(A,Ae,M),Pe=d.fromArray(A,ue*3,Pe),Ee=d.fromArray(A,(ye+ee)*3,Ee),I=d.normalize(d.subtract(Pe,Ee,I),I),Bd(P,D,I,M,void 0,t),M+=3;Ae=d.fromArray(A,ue*3,Ae),Pe=d.subtract(d.fromArray(A,(ye+ee)*3,Pe),Ae,Pe),Ee=d.subtract(d.fromArray(A,ye*3,Ee),Ae,Ee),I=d.normalize(d.negate(d.add(Ee,Pe,I),I),I),Bd(P,D,I,void 0,R,t),R-=3}for(X=i[U++],te=i[U++],X.splice(0,3),te.splice(te.length-3,3),A.set(X,M),A.set(te,R-te.length+1),m=te.length-3,q+=3,I=d.fromArray(s,q,I),ee=0;ee<te.length;ee+=3)K=n.geodeticSurfaceNormal(d.fromArray(X,ee,sy),sy),Z=n.geodeticSurfaceNormal(d.fromArray(te,m-ee,EC),EC),D=d.normalize(d.add(K,Z,D),D),Bd(P,D,I,M,R,t),w=M/3,B=w-1,_=(R-2)/3,L=_+1,V[j++]=L,V[j++]=B,V[j++]=_,V[j++]=_,V[j++]=B,V[j++]=w,M+=3,R-=3;M-=3,R+=3}if(D=d.fromArray(a,a.length-3,D),Bd(P,D,I,M,R,t),y){M+=3,R-=3,k=T3,N=A3;let ee=r[1];for(p=0;p<H;p++)k=d.fromArray(ee,(b-p-1)*3,k),N=d.fromArray(ee,p*3,N),Gi.addAttribute(A,k,void 0,R),Gi.addAttribute(A,N,M),Bd(P,D,I,M,R,t),w=M/3,B=w-1,_=(R-2)/3,L=_+1,V[j++]=L,V[j++]=B,V[j++]=_,V[j++]=_,V[j++]=B,V[j++]=w,M+=3,R-=3}if(l.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:A}),t.st){let ee=new Float32Array(x/3*2),me,xe,ue=0;if(y){f/=3,h/=3;let ye=Math.PI/(b+1);xe=1/(f-b+1),me=1/(h-b+1);let Ae,Pe=b/2;for(p=Pe+1;p<b+1;p++)Ae=O.PI_OVER_TWO+ye*p,ee[ue++]=me*(1+Math.cos(Ae)),ee[ue++]=.5*(1+Math.sin(Ae));for(p=1;p<h-b+1;p++)ee[ue++]=p*me,ee[ue++]=0;for(p=b;p>Pe;p--)Ae=O.PI_OVER_TWO-p*ye,ee[ue++]=1-me*(1+Math.cos(Ae)),ee[ue++]=.5*(1+Math.sin(Ae));for(p=Pe;p>0;p--)Ae=O.PI_OVER_TWO-ye*p,ee[ue++]=1-xe*(1+Math.cos(Ae)),ee[ue++]=.5*(1+Math.sin(Ae));for(p=f-b;p>0;p--)ee[ue++]=p*xe,ee[ue++]=1;for(p=1;p<Pe+1;p++)Ae=O.PI_OVER_TWO+ye*p,ee[ue++]=xe*(1+Math.cos(Ae)),ee[ue++]=.5*(1+Math.sin(Ae))}else{for(f/=3,h/=3,xe=1/(f-1),me=1/(h-1),p=0;p<h;p++)ee[ue++]=p*me,ee[ue++]=0;for(p=f;p>0;p--)ee[ue++]=(p-1)*xe,ee[ue++]=1}l.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:ee})}return t.normal&&(l.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:P.normals})),t.tangent&&(l.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:P.tangents})),t.bitangent&&(l.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:P.bitangents})),{attributes:l,indices:V}}function CKe(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,l=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,h=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=jle,m=Wle,y=T3,b=A3,x=AKe,A=qle,E=l;for(u=0;u<s;u+=3){let S=E+l;g=d.fromArray(n,u,g),m=d.fromArray(n,u+s,m),y=d.fromArray(n,(u+3)%s,y),m=d.subtract(m,g,m),y=d.subtract(y,g,y),b=d.normalize(d.cross(m,y,b),b),t.normal&&(Gi.addAttribute(f,b,S),Gi.addAttribute(f,b,S+3),Gi.addAttribute(f,b,E),Gi.addAttribute(f,b,E+3)),(t.tangent||t.bitangent)&&(A=d.fromArray(i,u,A),t.bitangent&&(Gi.addAttribute(p,A,S),Gi.addAttribute(p,A,S+3),Gi.addAttribute(p,A,E),Gi.addAttribute(p,A,E+3)),t.tangent&&(x=d.normalize(d.cross(A,b,x),x),Gi.addAttribute(h,x,S),Gi.addAttribute(h,x,S+3),Gi.addAttribute(h,x,E),Gi.addAttribute(h,x,E+3))),E+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let S=e.tangent.values;h.set(S),h.set(S,s),e.tangent.values=h}}if(t.st){let f=e.st.values,h=new Float32Array(a*6);h.set(f),h.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(h[p++]=f[0],h[p++]=f[1],u=2;u<a;u+=2){let m=f[u],y=f[u+1];h[p++]=m,h[p++]=y,h[p++]=m,h[p++]=y}h[p++]=f[0],h[p++]=f[1]}e.st.values=h}return e}function WW(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let o=e[i],r=e[i+1],s=e[i+2];n[t++]=o,n[t++]=r,n[t++]=s,n[t++]=o,n[t++]=r,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t++]=e[2],n}function EKe(e,t){let n=new Ie({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=Gi.computePositions(e),r=Xle(o,n,i),s=e.height,a=e.extrudedHeight,l=r.attributes,u=r.indices,f=l.position.values,h=f.length,p=new Float64Array(h*6),g=new Float64Array(h);g.set(f);let m=new Float64Array(h*4);f=si.scaleToGeodeticHeight(f,s,i),m=WW(f,0,m),g=si.scaleToGeodeticHeight(g,a,i),m=WW(g,h*2,m),p.set(f),p.set(g,h),p.set(m,h*2),l.position.values=p,l=CKe(l,t);let y,b=h/3;if(e.shadowVolume){let L=l.normal.values;h=L.length;let B=new Float32Array(h*6);for(y=0;y<h;y++)L[y]=-L[y];B.set(L,h),B=WW(L,h*4,B),l.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:B}),t.normal||(l.normal=void 0)}if(c(e.offsetAttribute)){let L=new Uint8Array(b*6);if(e.offsetAttribute===Zt.TOP)L=L.fill(1,0,b).fill(1,b*2,b*4);else{let B=e.offsetAttribute===Zt.NONE?0:1;L=L.fill(B)}l.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:L})}let x=u.length,A=b+b,E=Fe.createTypedArray(p.length/3,x*2+A*3);E.set(u);let S=x;for(y=0;y<x;y+=3){let L=u[y],B=u[y+1],_=u[y+2];E[S++]=_+b,E[S++]=B+b,E[S++]=L+b}let v,P,M,R;for(y=0;y<A;y+=2)v=y+A,P=v+A,M=v+1,R=P+1,E[S++]=v,E[S++]=P,E[S++]=M,E[S++]=M,E[S++]=P,E[S++]=R;return{attributes:l,indices:E}}var Hle=new d,vD=new d,Rf=new he;function Gle(e,t,n,i,o,r){let s=d.subtract(t,e,Hle);d.normalize(s,s);let a=n.geodeticSurfaceNormal(e,vD),l=d.cross(s,a,Hle);d.multiplyByScalar(l,i,l);let u=o.latitude,f=o.longitude,h=r.latitude,p=r.longitude;d.add(e,l,vD),n.cartesianToCartographic(vD,Rf);let g=Rf.latitude,m=Rf.longitude;u=Math.min(u,g),f=Math.min(f,m),h=Math.max(h,g),p=Math.max(p,m),d.subtract(e,l,vD),n.cartesianToCartographic(vD,Rf),g=Rf.latitude,m=Rf.longitude,u=Math.min(u,g),f=Math.min(f,m),h=Math.max(h,g),p=Math.max(p,m),o.latitude=u,o.longitude=f,r.latitude=h,r.longitude=p}var Of=new d,DD=new d,Dl=new he,Pl=new he;function Kle(e,t,n,i,o){e=Yle(e,t);let r=xo(e,d.equalsEpsilon),s=r.length;if(s<2||n<=0)return new ce;let a=n*.5;Dl.latitude=Number.POSITIVE_INFINITY,Dl.longitude=Number.POSITIVE_INFINITY,Pl.latitude=Number.NEGATIVE_INFINITY,Pl.longitude=Number.NEGATIVE_INFINITY;let l,u;if(i===ki.ROUNDED){let p=r[0];d.subtract(p,r[1],Of),d.normalize(Of,Of),d.multiplyByScalar(Of,a,Of),d.add(p,Of,DD),t.cartesianToCartographic(DD,Rf),l=Rf.latitude,u=Rf.longitude,Dl.latitude=Math.min(Dl.latitude,l),Dl.longitude=Math.min(Dl.longitude,u),Pl.latitude=Math.max(Pl.latitude,l),Pl.longitude=Math.max(Pl.longitude,u)}for(let p=0;p<s-1;++p)Gle(r[p],r[p+1],t,a,Dl,Pl);let f=r[s-1];d.subtract(f,r[s-2],Of),d.normalize(Of,Of),d.multiplyByScalar(Of,a,Of),d.add(f,Of,DD),Gle(f,DD,t,a,Dl,Pl),i===ki.ROUNDED&&(t.cartesianToCartographic(DD,Rf),l=Rf.latitude,u=Rf.longitude,Dl.latitude=Math.min(Dl.latitude,l),Dl.longitude=Math.min(Dl.longitude,u),Pl.latitude=Math.max(Pl.latitude,l),Pl.longitude=Math.max(Pl.longitude,u));let h=c(o)?o:new ce;return h.north=Pl.latitude,h.south=Dl.latitude,h.east=Pl.longitude,h.west=Dl.longitude,h}function i_(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.width;T.defined("options.positions",t),T.defined("options.width",n);let i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._vertexFormat=Ie.clone(e.vertexFormat??Ie.DEFAULT),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??ki.ROUNDED,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*d.packedLength+ie.packedLength+Ie.packedLength+7}i_.pack=function(e,t,n){T.defined("value",e),T.defined("array",t),n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=d.packedLength)d.pack(i[r],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var $le=ie.clone(ie.UNIT_SPHERE),Zle=new Ie,n_={positions:void 0,ellipsoid:$le,vertexFormat:Zle,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};i_.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=e[t++],o=new Array(i);for(let m=0;m<i;++m,t+=d.packedLength)o[m]=d.unpack(e,t);let r=ie.unpack(e,t,$le);t+=ie.packedLength;let s=Ie.unpack(e,t,Zle);t+=Ie.packedLength;let a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t++]===1,g=e[t];return c(n)?(n._positions=o,n._ellipsoid=ie.clone(r,n._ellipsoid),n._vertexFormat=Ie.clone(s,n._vertexFormat),n._width=a,n._height=l,n._extrudedHeight=u,n._cornerType=f,n._granularity=h,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(n_.positions=o,n_.width=a,n_.height=l,n_.extrudedHeight=u,n_.cornerType=f,n_.granularity=h,n_.shadowVolume=p,n_.offsetAttribute=g===-1?void 0:g,new i_(n_))};i_.computeRectangle=function(e,t){e=e??W.EMPTY_OBJECT;let n=e.positions,i=e.width;T.defined("options.positions",n),T.defined("options.width",i);let o=e.ellipsoid??ie.default,r=e.cornerType??ki.ROUNDED;return Kle(n,o,i,r,t)};i_.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Yle(t,i);let o=xo(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!O.equalsEpsilon(r,s,0,O.EPSILON2),l=e._vertexFormat,u={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=r,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=EKe(u,l);else{let g=Gi.computePositions(u);if(f=Xle(g,l,i),f.attributes.position.values=si.scaleToGeodeticHeight(f.attributes.position.values,r,i),c(e._offsetAttribute)){let m=e._offsetAttribute===Zt.NONE?0:1,y=f.attributes.position.values.length,b=new Uint8Array(y/3).fill(m);f.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}}let h=f.attributes,p=le.fromVertices(h.position.values,void 0,3);return l.position||(f.attributes.position.values=void 0),new ct({attributes:h,indices:f.indices,primitiveType:Me.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};i_.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new i_({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(i_.prototype,{rectangle:{get:function(){return c(this._rectangle)||(this._rectangle=Kle(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var SC=i_;var Qle=new d,Jle=new d,SKe=new d;function wKe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function eue(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new hn,a,l=0,u=0,f,h=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,l+=p,h+=p/3*4,u+=i[f+1].length-3;for(l+=3,u+=3,f=0;f<o.length;f++){a=o[f];let N=o[f].leftPositions;c(N)?(p=N.length,l+=p,h+=p/3*2):(p=o[f].rightPositions.length,u+=p,h+=p/3*2)}let g=c(r),m;g&&(m=r[0].length-3,l+=m,u+=m,m/=3,h+=m*4);let y=l+u,b=new Float64Array(y),x=0,A=y-1,E,S,v,P,M,R,L=m/2,B=Fe.createTypedArray(y/3,h+4),_=0;if(B[_++]=x/3,B[_++]=(A-2)/3,g){n.push(x/3),R=Qle,M=Jle;let N=r[0];for(f=0;f<L;f++)R=d.fromArray(N,(L-1-f)*3,R),M=d.fromArray(N,(L+f)*3,M),Gi.addAttribute(b,M,x),Gi.addAttribute(b,R,void 0,A),S=x/3,P=S+1,E=(A-2)/3,v=E-1,B[_++]=E,B[_++]=v,B[_++]=S,B[_++]=P,x+=3,A-=3}let w=0,D=i[w++],I=i[w++];for(b.set(D,x),b.set(I,A-I.length+1),p=I.length-3,n.push(x/3,(A-2)/3),f=0;f<p;f+=3)S=x/3,P=S+1,E=(A-2)/3,v=E-1,B[_++]=E,B[_++]=v,B[_++]=S,B[_++]=P,x+=3,A-=3;for(f=0;f<o.length;f++){let N;a=o[f];let k=a.leftPositions,H=a.rightPositions,V,j=SKe;if(c(k)){for(A-=3,V=v,n.push(P),N=0;N<k.length/3;N++)j=d.fromArray(k,N*3,j),B[_++]=V-N-1,B[_++]=V-N,Gi.addAttribute(b,j,void 0,A),A-=3;n.push(V-Math.floor(k.length/6)),t===ki.BEVELED&&n.push((A-2)/3+1),x+=3}else{for(x+=3,V=P,n.push(v),N=0;N<H.length/3;N++)j=d.fromArray(H,N*3,j),B[_++]=V+N,B[_++]=V+N+1,Gi.addAttribute(b,j,x),x+=3;n.push(V+Math.floor(H.length/6)),t===ki.BEVELED&&n.push(x/3-1),A-=3}for(D=i[w++],I=i[w++],D.splice(0,3),I.splice(I.length-3,3),b.set(D,x),b.set(I,A-I.length+1),p=I.length-3,N=0;N<I.length;N+=3)P=x/3,S=P-1,v=(A-2)/3,E=v+1,B[_++]=E,B[_++]=v,B[_++]=S,B[_++]=P,x+=3,A-=3;x-=3,A+=3,n.push(x/3,(A-2)/3)}if(g){x+=3,A-=3,R=Qle,M=Jle;let N=r[1];for(f=0;f<L;f++)R=d.fromArray(N,(m-f-1)*3,R),M=d.fromArray(N,f*3,M),Gi.addAttribute(b,R,void 0,A),Gi.addAttribute(b,M,x),P=x/3,S=P-1,v=(A-2)/3,E=v+1,B[_++]=E,B[_++]=v,B[_++]=S,B[_++]=P,x+=3,A-=3;n.push(x/3)}else n.push(x/3,(A-2)/3);return B[_++]=x/3,B[_++]=(A-2)/3,s.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:b}),{attributes:s,indices:B,wallIndices:n}}function vKe(e){let t=e.ellipsoid,n=Gi.computePositions(e),i=eue(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,l=i.indices,u=a.position.values,f=u.length,h=new Float64Array(f);h.set(u);let p=new Float64Array(f*2);if(u=si.scaleToGeodeticHeight(u,r,t),h=si.scaleToGeodeticHeight(h,s,t),p.set(u),p.set(h,f),a.position.values=p,f/=3,c(e.offsetAttribute)){let E=new Uint8Array(f*2);if(e.offsetAttribute===Zt.TOP)E=E.fill(1,0,f);else{let S=e.offsetAttribute===Zt.NONE?0:1;E=E.fill(S)}a.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:E})}let g,m=l.length,y=Fe.createTypedArray(p.length/3,(m+o.length)*2);y.set(l);let b=m;for(g=0;g<m;g+=2){let E=l[g],S=l[g+1];y[b++]=E+f,y[b++]=S+f}let x,A;for(g=0;g<o.length;g++)x=o[g],A=x+f,y[b++]=x,y[b++]=A;return{attributes:a,indices:y}}function PD(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.width;T.typeOf.object("options.positions",t),T.typeOf.number("options.width",n);let i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??ki.ROUNDED,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*d.packedLength+ie.packedLength+6}PD.pack=function(e,t,n){T.typeOf.object("value",e),T.typeOf.object("array",t),n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=d.packedLength)d.pack(i[r],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var tue=ie.clone(ie.UNIT_SPHERE),ay={positions:void 0,ellipsoid:tue,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};PD.unpack=function(e,t,n){T.typeOf.object("array",e),t=t??0;let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=d.packedLength)o[p]=d.unpack(e,t);let r=ie.unpack(e,t,tue);t+=ie.packedLength;let s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t];return c(n)?(n._positions=o,n._ellipsoid=ie.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=l,n._cornerType=u,n._granularity=f,n._offsetAttribute=h===-1?void 0:h,n):(ay.positions=o,ay.width=s,ay.height=a,ay.extrudedHeight=l,ay.cornerType=u,ay.granularity=f,ay.offsetAttribute=h===-1?void 0:h,new PD(ay))};PD.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=wKe(t,i);let o=xo(t,d.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!O.equalsEpsilon(r,s,0,O.EPSILON2),l={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)l.height=r,l.extrudedHeight=s,l.offsetAttribute=e._offsetAttribute,u=vKe(l);else{let p=Gi.computePositions(l);if(u=eue(p,l.cornerType),u.attributes.position.values=si.scaleToGeodeticHeight(u.attributes.position.values,r,i),c(e._offsetAttribute)){let g=u.attributes.position.values.length,m=e._offsetAttribute===Zt.NONE?0:1,y=new Uint8Array(g/3).fill(m);u.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let f=u.attributes,h=le.fromVertices(f.position.values,void 0,3);return new ct({attributes:f,indices:u.indices,primitiveType:Me.LINES,boundingSphere:h,offsetAttribute:e._offsetAttribute})};var C3=PD;var DKe=new Xn(0);function Wc(e){oi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}c(Object.create)&&(Wc.prototype=Object.create(oi.prototype),Wc.prototype.constructor=Wc);Object.defineProperties(Wc.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Wc.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!c(t.height)&&!c(t.extrudedHeight)&&_l.isSupported(this._scene)};Wc.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||c(n)&&n!==t};Wc.prototype._computeCenter=C.throwInstantiationError;Wc.prototype._onEntityPropertyChanged=function(e,t,n,i){if(oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!c(o))return;c(o.zIndex)&&(c(o.height)||c(o.extrudedHeight))&&dt(dt.geometryZIndex),this._zIndex=o.zIndex??DKe,c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(c(r)||c(s)){let a=new Vh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new aA(this._scene,a,r,s)}};Wc.prototype.destroy=function(){c(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),oi.prototype.destroy.call(this)};Wc.getGeometryHeight=function(e,t){if(T.defined("heightReference",t),!c(e)){t!==qe.NONE&&dt(dt.geometryHeightReference);return}return of(t)?0:e};Wc.getGeometryExtrudedHeight=function(e,t){if(T.defined("extrudedHeightReference",t),!c(e)){t!==qe.NONE&&dt(dt.geometryExtrudedHeightReference);return}return of(t)?Wc.CLAMP_TO_GROUND:e};Wc.CLAMP_TO_GROUND="clamp";Wc.computeGeometryOffsetAttribute=function(e,t,n,i){(!c(e)||!c(t))&&(t=qe.NONE),(!c(n)||!c(i))&&(i=qe.NONE);let o=0;if(t!==qe.NONE&&o++,i===qe.RELATIVE_TO_GROUND&&o++,o===2)return Zt.ALL;if(o===1)return Zt.TOP};var Gn=Wc;var nue=new G,iue=d.ZERO,oue=new d,rue=new ce;function PKe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function kd(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new PKe(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}c(Object.create)&&(kd.prototype=Object.create(Gn.prototype),kd.prototype.constructor=kd);kd.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,nue)),c(o)||(o=G.WHITE),i.color=jt.fromColor(o)}return c(this._options.offsetAttribute)&&(i.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,iue,oue))),new St({id:t,geometry:new SC(this._options),attributes:i})};kd.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,nue),o={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return c(this._options.offsetAttribute)&&(o.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,iue,oue))),new St({id:t,geometry:new C3(this._options),attributes:o})};kd.prototype._computeCenter=function(e,t){let n=Y.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!c(n)||n.length===0))return d.clone(n[Math.floor(n.length/2)],t)};kd.prototype._isHidden=function(e,t){return!c(t.positions)||!c(t.width)||oi.prototype._isHidden.call(this,e,t)};kd.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.width)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.cornerType)||!Y.isConstant(t.zIndex)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};kd.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),i=Y.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),o=Y.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),r=Y.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE);c(o)&&!c(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ge.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(Ge.MINIMUM_VALUE),s.granularity=Y.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),s.cornerType=Y.getValueOrUndefined(t.cornerType,Ge.MINIMUM_VALUE),s.offsetAttribute=Gn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Gn.getGeometryHeight(n,i),o=Gn.getGeometryExtrudedHeight(o,r),o===Gn.CLAMP_TO_GROUND&&(o=fi.getMinimumMaximumHeights(SC.computeRectangle(s,rue)).minimumTerrainHeight),s.extrudedHeight=o};kd.DynamicGeometryUpdater=wC;function wC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(wC.prototype=Object.create(ii.prototype),wC.prototype.constructor=wC);wC.prototype._isHidden=function(e,t,n){let i=this._options;return!c(i.positions)||!c(i.width)||ii.prototype._isHidden.call(this,e,t,n)};wC.prototype._setOptions=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,qe.NONE),s=Y.getValueOrUndefined(t.extrudedHeight,n),a=Y.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE);c(s)&&!c(o)&&(o=0),i.positions=Y.getValueOrUndefined(t.positions,n),i.width=Y.getValueOrUndefined(t.width,n),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.cornerType=Y.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=fi.getMinimumMaximumHeights(SC.computeRectangle(i,rue)).minimumTerrainHeight),i.extrudedHeight=s};var E3=kd;function S3(){C.throwInstantiationError()}Object.defineProperties(S3.prototype,{name:{get:C.throwInstantiationError},clock:{get:C.throwInstantiationError},entities:{get:C.throwInstantiationError},isLoading:{get:C.throwInstantiationError},changedEvent:{get:C.throwInstantiationError},errorEvent:{get:C.throwInstantiationError},loadingEvent:{get:C.throwInstantiationError},show:{get:C.throwInstantiationError},clustering:{get:C.throwInstantiationError}});S3.prototype.update=function(e){C.throwInstantiationError()};S3.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Kr=S3;function hm(e,t){T.typeOf.object("ellipsoid",e),this._ellipsoid=e,this._cameraPosition=new d,this._cameraPositionInScaledSpace=new d,this._distanceToLimbInScaledSpaceSquared=0,c(t)&&(this.cameraPosition=t)}Object.defineProperties(hm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=d.magnitudeSquared(n)-1;d.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var sue=new d;hm.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,sue);return YW(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};hm.prototype.isScaledSpacePointVisible=function(e){return YW(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var IKe=new d;hm.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return c(t)&&t<0&&n.minimumRadius>-t?(o=IKe,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),YW(e,o,i)};hm.prototype.computeHorizonCullingPoint=function(e,t,n){return lue(this._ellipsoid,e,t,n)};var aue=ie.clone(ie.UNIT_SPHERE);hm.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=cue(this._ellipsoid,n,aue);return lue(o,e,t,i)};hm.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return uue(this._ellipsoid,e,t,n,i,o)};hm.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=cue(this._ellipsoid,o,aue);return uue(s,e,t,n,i,r)};var OKe=[];hm.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){T.typeOf.object("rectangle",e);let i=ce.subsample(e,t,0,OKe),o=le.fromPoints(i);if(!(d.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var RKe=new d;function cue(e,t,n){if(c(t)&&t<0&&e.minimumRadius>-t){let i=d.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,RKe);e=ie.fromCartesian3(i,n)}return e}function lue(e,t,n,i){T.typeOf.object("directionToPoint",t),T.defined("positions",n),c(i)||(i=new d);let o=hue(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let l=n[s],u=fue(e,l,o);if(u<0)return;r=Math.max(r,u)}return due(o,r,i)}var w3=new d;function uue(e,t,n,i,o,r){T.typeOf.object("directionToPoint",t),T.defined("vertices",n),T.typeOf.number("stride",i),c(r)||(r=new d),i=i??3,o=o??d.ZERO;let s=hue(e,t),a=0;for(let l=0,u=n.length;l<u;l+=i){w3.x=n[l]+o.x,w3.y=n[l+1]+o.y,w3.z=n[l+2]+o.z;let f=fue(e,w3,s);if(f<0)return;a=Math.max(a,f)}return due(s,a,r)}function YW(e,t,n){let i=t,o=n,r=d.subtract(e,i,sue),s=-d.dot(r,i);return!(o<0?s>0:s>o&&s*s/d.magnitudeSquared(r)>o)}var MKe=new d,LKe=new d;function fue(e,t,n){let i=e.transformPositionToScaledSpace(t,MKe),o=d.magnitudeSquared(i),r=Math.sqrt(o),s=d.divideByScalar(i,r,LKe);o=Math.max(1,o),r=Math.max(1,r);let a=d.dot(s,n),l=d.magnitude(d.cross(s,n,s)),u=1/r,f=Math.sqrt(o-1)*u;return 1/(a*u-l*f)}function due(e,t,n){if(!(t<=0||t===1/0||t!==t))return d.multiplyByScalar(e,t,n)}var qW=new d;function hue(e,t){return d.equals(t,d.ZERO)?t:(e.transformPositionToScaledSpace(t,qW),d.normalize(qW,qW))}var cy=hm;function Cr(e,t){if(e=e??W.EMPTY_OBJECT,c(e.disableDepthTestDistance)&&e.disableDepthTestDistance<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;if(c(n)){if(n.far<=n.near)throw new C("translucencyByDistance.far must be greater than translucencyByDistance.near.");n=Bt.clone(n)}if(c(i)){if(i.far<=i.near)throw new C("scaleByDistance.far must be greater than scaleByDistance.near.");i=Bt.clone(i)}if(c(o)){if(o.far<=o.near)throw new C("distanceDisplayCondition.far must be greater than distanceDisplayCondition.near.");o=Lt.clone(o)}this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),this._actualPosition=d.clone(this._position),this._color=G.clone(e.color??G.WHITE),this._outlineColor=G.clone(e.outlineColor??G.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??qr.NONE}var mue=Cr.SHOW_INDEX=0,gue=Cr.POSITION_INDEX=1,NKe=Cr.COLOR_INDEX=2,FKe=Cr.OUTLINE_COLOR_INDEX=3,BKe=Cr.OUTLINE_WIDTH_INDEX=4,kKe=Cr.PIXEL_SIZE_INDEX=5,UKe=Cr.SCALE_BY_DISTANCE_INDEX=6,VKe=Cr.TRANSLUCENCY_BY_DISTANCE_INDEX=7,zKe=Cr.DISTANCE_DISPLAY_CONDITION_INDEX=8,HKe=Cr.DISABLE_DEPTH_DISTANCE_INDEX=9,GKe=Cr.SPLIT_DIRECTION_INDEX=10;Cr.NUMBER_OF_PROPERTIES=11;function du(e,t){let n=e._pointPrimitiveCollection;c(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Cr.prototype,{show:{get:function(){return this._show},set:function(e){if(!c(e))throw new C("value is required.");this._show!==e&&(this._show=e,du(this,mue))}},position:{get:function(){return this._position},set:function(e){if(!c(e))throw new C("value is required.");let t=this._position;d.equals(t,e)||(d.clone(e,t),d.clone(e,this._actualPosition),du(this,gue))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");let t=this._scaleByDistance;Bt.equals(t,e)||(this._scaleByDistance=Bt.clone(e,t),du(this,UKe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far distance must be greater than near distance.");let t=this._translucencyByDistance;Bt.equals(t,e)||(this._translucencyByDistance=Bt.clone(e,t),du(this,VKe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){if(!c(e))throw new C("value is required.");this._pixelSize!==e&&(this._pixelSize=e,du(this,kKe))}},color:{get:function(){return this._color},set:function(e){if(!c(e))throw new C("value is required.");let t=this._color;G.equals(t,e)||(G.clone(e,t),du(this,NKe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){if(!c(e))throw new C("value is required.");let t=this._outlineColor;G.equals(t,e)||(G.clone(e,t),du(this,FKe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){if(!c(e))throw new C("value is required.");this._outlineWidth!==e&&(this._outlineWidth=e,du(this,BKe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(c(e)&&e.far<=e.near)throw new C("far must be greater than near");Lt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Lt.clone(e,this._distanceDisplayCondition),du(this,zKe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){if(!c(e)||e<0)throw new C("disableDepthTestDistance must be greater than or equal to 0.0.");this._disableDepthTestDistance=e,du(this,HKe)}}},id:{get:function(){return this._id},set:function(e){this._id=e,c(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,du(this,mue))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,du(this,GKe))}}});Cr.prototype.getPickId=function(e){return c(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Cr.prototype._getActualPosition=function(){return this._actualPosition};Cr.prototype._setActualPosition=function(e){d.clone(e,this._actualPosition),du(this,gue)};var pue=new se;Cr._computeActualPosition=function(e,t,n){return t.mode===oe.SCENE3D?e:(F.multiplyByPoint(n,e,pue),Hi.computeActualEllipsoidPosition(t,pue))};var _ue=new se;Cr._computeScreenSpacePosition=function(e,t,n,i){let o=F.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,_ue),_ue);return Hi.worldToWindowCoordinates(n,o,i)};Cr.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;if(c(t)||(t=new z),!c(n))throw new C("PointPrimitive must be in a collection.");if(!c(e))throw new C("scene is required.");let i=n.modelMatrix,o=Cr._computeScreenSpacePosition(i,this._actualPosition,e,t);if(c(o))return o.y=e.canvas.clientHeight-o.y,o};Cr.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,l=i;return c(n)||(n=new Ke),n.x=r,n.y=s,n.width=a,n.height=l,n};Cr.prototype.equals=function(e){return this===e||c(e)&&this._id===e._id&&d.equals(this._position,e._position)&&G.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&G.equals(this._outlineColor,e._outlineColor)&&Bt.equals(this._scaleByDistance,e._scaleByDistance)&&Bt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Lt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Cr.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Hs=Cr;var Hb=`in vec4 v_color;
in vec4 v_outlineColor;
in float v_innerPercent;
in float v_pixelDistance;
in vec4 v_pickColor;
in float v_splitDirection;
void main()
{
if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
float distanceToCenter = length(gl_PointCoord - vec2(0.5));
float maxDistance = max(0.0, 0.5 - v_pixelDistance);
float wholeAlpha = 1.0 - smoothstep(maxDistance, 0.5, distanceToCenter);
float innerAlpha = 1.0 - smoothstep(maxDistance * v_innerPercent, 0.5 * v_innerPercent, distanceToCenter);
vec4 color = mix(v_outlineColor, v_color, innerAlpha);
color.a *= wholeAlpha;
#if !defined(OPAQUE) && !defined(TRANSLUCENT)
if (color.a < 0.005)
{
discard;
}
#else
#ifdef OPAQUE
if (color.a < 0.995)
{
discard;
}
#else
if (color.a >= 0.995)
{
discard;
}
#endif
#endif
out_FragColor = czm_gammaCorrect(color);
czm_writeLogDepth();
}
`;var v3=`uniform float u_maxTotalPointSize;
in vec4 positionHighAndSize;
in vec4 positionLowAndOutline;
in vec4 compressedAttribute0;
in vec4 compressedAttribute1;
in vec4 scaleByDistance;
in vec4 distanceDisplayConditionAndDisableDepthAndSplitDirection;
out vec4 v_color;
out vec4 v_outlineColor;
out float v_innerPercent;
out float v_pixelDistance;
out vec4 v_pickColor;
out float v_splitDirection;
const float SHIFT_LEFT8 = 256.0;
const float SHIFT_RIGHT8 = 1.0 / 256.0;
void main()
{
vec3 positionHigh = positionHighAndSize.xyz;
vec3 positionLow = positionLowAndOutline.xyz;
float outlineWidthBothSides = 2.0 * positionLowAndOutline.w;
float totalSize = positionHighAndSize.w + outlineWidthBothSides;
float outlinePercent = outlineWidthBothSides / totalSize;
totalSize *= czm_pixelRatio;
float temp = compressedAttribute1.x * SHIFT_RIGHT8;
float show = floor(temp);
#ifdef EYE_DISTANCE_TRANSLUCENCY
vec4 translucencyByDistance;
translucencyByDistance.x = compressedAttribute1.z;
translucencyByDistance.z = compressedAttribute1.w;
translucencyByDistance.y = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
temp = compressedAttribute1.y * SHIFT_RIGHT8;
translucencyByDistance.w = ((temp - floor(temp)) * SHIFT_LEFT8) / 255.0;
#endif
vec4 color;
vec4 outlineColor;
vec4 pickColor;
temp = compressedAttribute0.z * SHIFT_RIGHT8;
pickColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
temp = floor(temp) * SHIFT_RIGHT8;
pickColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
pickColor.r = floor(temp);
temp = compressedAttribute0.x * SHIFT_RIGHT8;
color.b = (temp - floor(temp)) * SHIFT_LEFT8;
temp = floor(temp) * SHIFT_RIGHT8;
color.g = (temp - floor(temp)) * SHIFT_LEFT8;
color.r = floor(temp);
temp = compressedAttribute0.y * SHIFT_RIGHT8;
outlineColor.b = (temp - floor(temp)) * SHIFT_LEFT8;
temp = floor(temp) * SHIFT_RIGHT8;
outlineColor.g = (temp - floor(temp)) * SHIFT_LEFT8;
outlineColor.r = floor(temp);
temp = compressedAttribute0.w * SHIFT_RIGHT8;
pickColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
pickColor = pickColor / 255.0;
temp = floor(temp) * SHIFT_RIGHT8;
outlineColor.a = (temp - floor(temp)) * SHIFT_LEFT8;
outlineColor /= 255.0;
color.a = floor(temp);
color /= 255.0;
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
vec4 positionEC = czm_modelViewRelativeToEye * p;
#if defined(EYE_DISTANCE_SCALING) || defined(EYE_DISTANCE_TRANSLUCENCY) || defined(DISTANCE_DISPLAY_CONDITION) || defined(DISABLE_DEPTH_DISTANCE)
float lengthSq;
if (czm_sceneMode == czm_sceneMode2D)
{
lengthSq = czm_eyeHeight2D.y;
}
else
{
lengthSq = dot(positionEC.xyz, positionEC.xyz);
}
#endif
#ifdef EYE_DISTANCE_SCALING
totalSize *= czm_nearFarScalar(scaleByDistance, lengthSq);
#endif
if (totalSize > 0.0) {
totalSize += 3.0;
}
totalSize = min(totalSize, u_maxTotalPointSize);
if (totalSize < 1.0)
{
positionEC.xyz = vec3(0.0);
totalSize = 1.0;
}
float translucency = 1.0;
#ifdef EYE_DISTANCE_TRANSLUCENCY
translucency = czm_nearFarScalar(translucencyByDistance, lengthSq);
if (translucency < 0.004)
{
positionEC.xyz = vec3(0.0);
}
#endif
#ifdef DISTANCE_DISPLAY_CONDITION
float nearSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.x;
float farSq = distanceDisplayConditionAndDisableDepthAndSplitDirection.y;
if (lengthSq < nearSq || lengthSq > farSq) {
positionEC.xyz = vec3(0.0, 0.0, 1.0);
}
#endif
gl_Position = czm_projection * positionEC;
czm_vertexLogDepth();
#ifdef DISABLE_DEPTH_DISTANCE
float disableDepthTestDistance = distanceDisplayConditionAndDisableDepthAndSplitDirection.z;
if (disableDepthTestDistance == 0.0 && czm_minimumDisableDepthTestDistance != 0.0)
{
disableDepthTestDistance = czm_minimumDisableDepthTestDistance;
}
if (disableDepthTestDistance != 0.0)
{
float zclip = gl_Position.z / gl_Position.w;
bool clipped = (zclip < -1.0 || zclip > 1.0);
if (!clipped && (disableDepthTestDistance < 0.0 || (lengthSq > 0.0 && lengthSq < disableDepthTestDistance)))
{
gl_Position.z = -gl_Position.w;
#ifdef LOG_DEPTH
czm_vertexLogDepth(vec4(czm_currentFrustum.x));
#endif
}
}
#endif
v_color = color;
v_color.a *= translucency * show;
v_outlineColor = outlineColor;
v_outlineColor.a *= translucency * show;
v_innerPercent = 1.0 - outlinePercent;
v_pixelDistance = 2.0 / totalSize;
gl_PointSize = totalSize * show;
gl_Position *= show;
v_pickColor = pickColor;
v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w;
}
`;var jKe=Hs.SHOW_INDEX,$W=Hs.POSITION_INDEX,yue=Hs.COLOR_INDEX,WKe=Hs.OUTLINE_COLOR_INDEX,qKe=Hs.OUTLINE_WIDTH_INDEX,YKe=Hs.PIXEL_SIZE_INDEX,bue=Hs.SCALE_BY_DISTANCE_INDEX,xue=Hs.TRANSLUCENCY_BY_DISTANCE_INDEX,Tue=Hs.DISTANCE_DISPLAY_CONDITION_INDEX,XKe=Hs.DISABLE_DEPTH_DISTANCE_INDEX,KKe=Hs.SPLIT_DIRECTION_INDEX,ZW=Hs.NUMBER_OF_PROPERTIES,cc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Mf(e){e=e??W.EMPTY_OBJECT,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(ZW),this._maxPixelSize=1,this._baseVolume=new le,this._baseVolumeWC=new le,this._baseVolume2D=new le,this._boundingVolume=new le,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Po.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=oe.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW,Be.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Mf.prototype,{length:{get:function(){return QW(this),this._pointPrimitives.length}}});function Aue(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Mf.prototype.add=function(e){let t=new Hs(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Mf.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Mf.prototype.removeAll=function(){Aue(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function QW(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._pointPrimitives=t}}Mf.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Mf.prototype.contains=function(e){return c(e)&&e._pointPrimitiveCollection===this};Mf.prototype.get=function(e){if(!c(e))throw new C("index is required.");return QW(this),this._pointPrimitives[e]};Mf.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<ZW;++i){let o=n[i]===0?Be.STATIC_DRAW:Be.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function $Ke(e,t,n){return new X_(e,[{index:cc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[$W]},{index:cc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[$W]},{index:cc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[yue]},{index:cc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[xue]},{index:cc.scaleByDistance,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[bue]},{index:cc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:n[Tue]}],t)}var XW=new Hn;function Cue(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===oe.SCENE3D&&(le.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),Hn.fromCartesian(r,XW);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let l=n[cc.positionHighAndSize],u=XW.high;l(o,u.x,u.y,u.z,s);let f=n[cc.positionLowAndOutline],h=XW.low;f(o,h.x,h.y,h.z,a)}var D3=65536,ID=256;function Eue(e,t,n,i){let o=i._index,r=i.color,s=i.getPickId(t).color,a=i.outlineColor,l=G.floatToByte(r.red),u=G.floatToByte(r.green),f=G.floatToByte(r.blue),h=l*D3+u*ID+f;l=G.floatToByte(a.red),u=G.floatToByte(a.green),f=G.floatToByte(a.blue);let p=l*D3+u*ID+f;l=G.floatToByte(s.red),u=G.floatToByte(s.green),f=G.floatToByte(s.blue);let g=l*D3+u*ID+f,m=G.floatToByte(r.alpha)*D3+G.floatToByte(a.alpha)*ID+G.floatToByte(s.alpha),y=n[cc.compressedAttribute0];y(o,h,p,g,m)}function Sue(e,t,n,i){let o=i._index,r=0,s=1,a=1,l=1,u=i.translucencyByDistance;c(u)&&(r=u.near,s=u.nearValue,a=u.far,l=u.farValue,(s!==1||l!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=O.clamp(s,0,1),s=s===1?255:s*255|0;let h=(f?1:0)*ID+s;l=O.clamp(l,0,1),l=l===1?255:l*255|0;let p=l,g=n[cc.compressedAttribute1];g(o,h,p,r,a)}function wue(e,t,n,i){let o=i._index,r=n[cc.scaleByDistance],s=0,a=1,l=1,u=1,f=i.scaleByDistance;c(f)&&(s=f.near,a=f.nearValue,l=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,l,u)}function vue(e,t,n,i){let o=i._index,r=n[cc.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,l=i.distanceDisplayCondition;c(l)&&(s=l.near,a=l.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,h=i.splitDirection;c(h)&&(f=h),r(o,s,a,u,f)}function ZKe(e,t,n,i){Cue(e,t,n,i),Eue(e,t,n,i),Sue(e,t,n,i),wue(e,t,n,i),vue(e,t,n,i)}function KW(e,t,n,i,o,r){let s;i.mode===oe.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let l=0;l<n;++l){let u=t[l],f=u.position,h=Hs._computeActualPosition(f,i,o);c(h)&&(u._setActualPosition(h),r?a.push(h):le.expand(s,h,s))}r&&le.fromPoints(a,s)}function QKe(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==oe.SCENE3D&&!F.equals(r,e.modelMatrix)?(e._mode=n,F.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===oe.SCENE3D||n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&KW(e,i,i.length,t,r,!0)):n===oe.MORPHING?KW(e,i,i.length,t,r,!0):(n===oe.SCENE2D||n===oe.COLUMBUS_VIEW)&&KW(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function JKe(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var e$e=[];Mf.prototype.update=function(e){if(QW(this),!this.show)return;this._maxTotalPointSize=ut.maximumAliasedPointSize,QKe(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,l=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<ZW;++v)r[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=$Ke(l,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let P=this._pointPrimitives[v];P._dirty=!1,ZKe(this,l,a,P)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let v=e$e;v.length=0,(r[$W]||r[qKe]||r[YKe])&&v.push(Cue),(r[yue]||r[WKe])&&v.push(Eue),(r[jKe]||r[xue])&&v.push(Sue),r[bue]&&v.push(wue),(r[Tue]||r[XKe]||r[KKe])&&v.push(vue);let P=v.length;if(a=this._vaf.writers,o/n>.1){for(let M=0;M<o;++M){let R=i[M];R._dirty=!1;for(let L=0;L<P;++L)v[L](this,l,a,R)}this._vaf.commit()}else{for(let M=0;M<o;++M){let R=i[M];R._dirty=!1;for(let L=0;L<P;++L)v[L](this,l,a,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!c(this._vaf)||!c(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,le.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let h,p=F.IDENTITY;e.mode===oe.SCENE3D?(p=this.modelMatrix,h=le.clone(this._baseVolumeWC,this._boundingVolume)):h=le.clone(this._baseVolume2D,this._boundingVolume),JKe(this,e,h);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Po.OPAQUE||this._blendOption===Po.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:ne.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Po.TRANSLUCENT||this._blendOption===Po.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:ne.LEQUAL},depthMask:!1,blending:un.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,y;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new He({sources:[v3]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Po.OPAQUE_AND_TRANSLUCENT&&(y=new He({defines:["OPAQUE"],sources:[Hb]}),this._sp=en.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:cc}),y=new He({defines:["TRANSLUCENT"],sources:[Hb]}),this._spTranslucent=en.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:cc})),this._blendOption===Po.OPAQUE&&(y=new He({sources:[Hb]}),this._sp=en.replaceCache({context:l,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:cc})),this._blendOption===Po.TRANSLUCENT&&(y=new He({sources:[Hb]}),this._spTranslucent=en.replaceCache({context:l,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:cc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let b,x,A,E,S=e.commandList;if(u.render||f){let v=this._colorCommands,P=this._blendOption===Po.OPAQUE,M=this._blendOption===Po.OPAQUE_AND_TRANSLUCENT;b=this._vaf.va,x=b.length,v.length=x;let R=M?x*2:x;for(E=0;E<R;++E){let L=P||M&&E%2===0;A=v[E],c(A)||(A=v[E]=new Je),A.primitiveType=Me.POINTS,A.pass=L||!M?De.OPAQUE:De.TRANSLUCENT,A.owner=this;let B=M?Math.floor(E/2):E;A.boundingVolume=h,A.modelMatrix=p,A.shaderProgram=L?this._sp:this._spTranslucent,A.uniformMap=this._uniforms,A.vertexArray=b[B].va,A.renderState=L?this._rsOpaque:this._rsTranslucent,A.debugShowBoundingVolume=this.debugShowBoundingVolume,A.pickId="v_pickColor",S.push(A)}}};Mf.prototype.isDestroyed=function(){return!1};Mf.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Aue(this._pointPrimitives),de(this)};var OD=Mf;var Due=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],JW=1,RD=8,LD=class e{static from(t){if(!(t instanceof ArrayBuffer))throw new Error("Data must be an instance of ArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let o=i>>4;if(o!==JW)throw new Error(`Got v${o} data when expected v${JW}.`);let r=Due[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,t)}constructor(t,n=64,i=Float64Array,o){if(isNaN(t)||t<0)throw new Error(`Unpexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let r=Due.indexOf(this.ArrayType),s=t*2*this.ArrayType.BYTES_PER_ELEMENT,a=t*this.IndexArrayType.BYTES_PER_ELEMENT,l=(8-a%8)%8;if(r<0)throw new Error(`Unexpected typed array class: ${i}.`);o&&o instanceof ArrayBuffer?(this.data=o,this.ids=new this.IndexArrayType(this.data,RD,t),this.coords=new this.ArrayType(this.data,RD+a+l,t*2),this._pos=t*2,this._finished=!0):(this.data=new ArrayBuffer(RD+s+a+l),this.ids=new this.IndexArrayType(this.data,RD,t),this.coords=new this.ArrayType(this.data,RD+a+l,t*2),this._pos=0,this._finished=!1,new Uint8Array(this.data,0,2).set([219,(JW<<4)+r]),new Uint16Array(this.data,2,1)[0]=n,new Uint32Array(this.data,4,1)[0]=t)}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return tq(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this,l=[0,r.length-1,0],u=[];for(;l.length;){let f=l.pop()||0,h=l.pop()||0,p=l.pop()||0;if(h-p<=a){for(let b=p;b<=h;b++){let x=s[2*b],A=s[2*b+1];x>=t&&x<=i&&A>=n&&A<=o&&u.push(r[b])}continue}let g=p+h>>1,m=s[2*g],y=s[2*g+1];m>=t&&m<=i&&y>=n&&y<=o&&u.push(r[g]),(f===0?t<=m:n<=y)&&(l.push(p),l.push(g-1),l.push(1-f)),(f===0?i>=m:o>=y)&&(l.push(g+1),l.push(h),l.push(1-f))}return u}within(t,n,i){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:r,nodeSize:s}=this,a=[0,o.length-1,0],l=[],u=i*i;for(;a.length;){let f=a.pop()||0,h=a.pop()||0,p=a.pop()||0;if(h-p<=s){for(let b=p;b<=h;b++)Pue(r[2*b],r[2*b+1],t,n)<=u&&l.push(o[b]);continue}let g=p+h>>1,m=r[2*g],y=r[2*g+1];Pue(m,y,t,n)<=u&&l.push(o[g]),(f===0?t-i<=m:n-i<=y)&&(a.push(p),a.push(g-1),a.push(1-f)),(f===0?t+i>=m:n+i>=y)&&(a.push(g+1),a.push(h),a.push(1-f))}return l}};function tq(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;Iue(e,t,s,i,o,r),tq(e,t,n,i,s-1,1-r),tq(e,t,n,s+1,o,1-r)}function Iue(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let u=o-i+1,f=n-i+1,h=Math.log(u),p=.5*Math.exp(2*h/3),g=.5*Math.sqrt(h*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+g)),y=Math.min(o,Math.floor(n+(u-f)*p/u+g));Iue(e,t,n,m,y,r)}let s=t[2*n+r],a=i,l=o;for(MD(e,t,i,n),t[2*o+r]>s&&MD(e,t,i,o);a<l;){for(MD(e,t,a,l),a++,l--;t[2*a+r]<s;)a++;for(;t[2*l+r]>s;)l--}t[2*i+r]===s?MD(e,t,i,l):(l++,MD(e,t,l,o)),l<=n&&(i=l+1),n<=l&&(o=l-1)}}function MD(e,t,n,i){eq(e,n,i),eq(t,2*n,2*i),eq(t,2*n+1,2*i+1)}function eq(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function Pue(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function Ud(e){e=e??W.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=e.clusterPoints??!0,this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new pe,this.show=e.show??!0}function Oue(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var t$e=new Ke;function Rue(e,t,n,i,o){if(c(e._labelCollection)&&i._clusterLabels?o=Ob.getScreenSpaceBoundingBox(e,t,o):c(e._billboardCollection)&&i._clusterBillboards?o=ao.getScreenSpaceBoundingBox(e,t,o):c(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Hs.getScreenSpaceBoundingBox(e,t,o)),Oue(o,n),i._clusterLabels&&!c(e._labelCollection)&&c(e.id)&&Lue(i,e.id.id)&&c(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Ob.getScreenSpaceBoundingBox(s,t,t$e);Oue(a,n),o=Ke.union(o,a,o)}return o}function n$e(e,t){if(e.clusterShow=!0,!c(e._labelCollection)&&c(e.id)&&Lue(t,e.id.id)&&c(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function Mue(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function Lue(e,t){return c(e)&&c(e._collectionIndicesByEntity[t])&&c(e._collectionIndicesByEntity[t].labelIndex)}function nq(e,t,n,i,o){if(!c(e))return;let r=e.length;for(let s=0;s<r;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||o._scene.mode===oe.SCENE3D&&!i.isPointVisible(a.position))continue;let l=o._clusterLabels&&c(a._labelCollection),u=o._clusterBillboards&&c(a.id._billboard),f=o._clusterPoints&&c(a.id._point);if(l&&(f||u))continue;let h=a.computeScreenSpacePosition(n);c(h)&&t.push({index:s,collection:e,clustered:!1,coord:h})}}var i$e=new Ke,o$e=new Ke,r$e=new Ke;function s$e(e){return function(t){if(c(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!c(i)&&!c(o)&&!c(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,l=e._clusterPointCollection;c(s)?s.removeAll():s=e._clusterLabelCollection=new Gp({scene:n}),c(a)?a.removeAll():a=e._clusterBillboardCollection=new Cf({scene:n}),c(l)?l.removeAll():l=e._clusterPointCollection=new OD;let u=e._pixelRange,f=e._minimumClusterSize,h=e._previousClusters,p=[],g=e._previousHeight,m=n.camera.positionCartographic.height,y=n.ellipsoid,b=n.camera.positionWC,x=new cy(y,b),A=[];e._clusterLabels&&nq(i,A,n,x,e),e._clusterBillboards&&nq(o,A,n,x,e),e._clusterPoints&&nq(r,A,n,x,e);let E,S,v,P,M,R,L,B,_,w,D,I;if(A.length>0){let N=new LD(A.length,64,Uint32Array);for(let k=0;k<A.length;++k)N.add(A[k].coord.x,A[k].coord.y);if(N.finish(),m<g)for(v=h.length,E=0;E<v;++E){let k=h[E];if(!x.isPointVisible(k.position))continue;let H=ao._computeScreenSpacePosition(F.IDENTITY,k.position,d.ZERO,z.ZERO,n);if(!c(H))continue;let V=1-m/g,j=k.width=k.width*V,U=k.height=k.height*V;j=Math.max(j,k.minimumWidth),U=Math.max(U,k.minimumHeight);let q=H.x-j*.5,X=H.y-U*.5,te=H.x+j,K=H.y+U;for(M=N.range(q,X,te,K),R=M.length,w=0,_=[],S=0;S<R;++S)L=M[S],B=A[L],B.clustered||(++w,D=B.collection,I=B.index,_.push(D.get(I).id));if(w>=f)for(Mue(k.position,w,_,e),p.push(k),S=0;S<R;++S)A[M[S]].clustered=!0}for(v=A.length,E=0;E<v;++E){let k=A[E];if(k.clustered)continue;k.clustered=!0,D=k.collection,I=k.index;let H=D.get(I);P=Rue(H,k.coord,u,e,i$e);let V=Ke.clone(P,o$e);M=N.range(P.x,P.y,P.x+P.width,P.y+P.height),R=M.length;let j=d.clone(H.position);for(w=1,_=[H.id],S=0;S<R;++S)if(L=M[S],B=A[L],!B.clustered){let U=B.collection.get(B.index),q=Rue(U,B.coord,u,e,r$e);d.add(U.position,j,j),Ke.union(V,q,V),++w,_.push(U.id)}if(w>=f){let U=d.multiplyByScalar(j,1/w,j);for(Mue(U,w,_,e),p.push({position:U,width:V.width,height:V.height,minimumWidth:P.width,minimumHeight:P.height}),S=0;S<R;++S)A[M[S]].clustered=!0}else n$e(H,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),l.length===0&&(l.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}Ud.prototype._initialize=function(e){this._scene=e;let t=s$e(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Ud.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}},ready:{get:function(){return!this._enabledDirty&&!this._clusterDirty&&(!c(this._billboardCollection)||this._billboardCollection.ready)&&(!c(this._labelCollection)||this._labelCollection.ready)}}});function oq(e,t,n,i){return function(o){let r=this[e];c(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(c(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),c(r)&&c(s[i]))return r.get(s[i]);c(r)||(r=this[e]=new t({scene:this._scene}));let a,l,u=this[n];u.length>0?(a=u.shift(),l=r.get(a)):(l=r.add(),a=r.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),l}}function rq(e,t){let n=e._collectionIndicesByEntity[t];!c(n.billboardIndex)&&!c(n.labelIndex)&&!c(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Ud.prototype.getLabel=oq("_labelCollection",Gp,"_unusedLabelIndices","labelIndex");Ud.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._labelCollection)||!c(t)||!c(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,rq(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};Ud.prototype.getBillboard=oq("_billboardCollection",Cf,"_unusedBillboardIndices","billboardIndex");Ud.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._billboardCollection)||!c(t)||!c(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,rq(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};Ud.prototype.getPoint=oq("_pointCollection",OD,"_unusedPointIndices","pointIndex");Ud.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!c(this._pointCollection)||!c(t)||!c(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,rq(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function iq(e){if(!c(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function a$e(e){e.enabled||(c(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),c(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),c(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,iq(e._labelCollection),iq(e._billboardCollection),iq(e._pointCollection))}Ud.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;c(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;c(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,a$e(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=c(n)&&!n.ready||c(i)&&!i.ready),c(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),c(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),c(this._clusterPointCollection)&&this._clusterPointCollection.update(e),c(n)&&n.update(e),c(i)&&i.update(e),c(this._pointCollection)&&this._pointCollection.update(e)};Ud.prototype.destroy=function(){c(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var Lf=Ud;function sq(e){this._name=e,this._clock=void 0,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._entityCollection=new la(this),this._entityCluster=new Lf}Object.defineProperties(sq.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Kr.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!c(e))throw new C("value must be defined.");this._entityCluster=e}}});sq.prototype.update=function(e){return!0};var P3=sq;var Nue={};Nue.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,l=o?2*a:a,u=new Float64Array(l*3),f,h=0,p=0,g=o?a*3:0,m=o?(a+i)*3:i*3;for(f=0;f<i;f++){let y=f/i*O.TWO_PI,b=Math.cos(y),x=Math.sin(y),A=b*n,E=x*n,S=b*t,v=x*t;u[p+g]=A,u[p+g+1]=E,u[p+g+2]=s,u[p+m]=S,u[p+m+1]=v,u[p+m+2]=r,p+=3,o&&(u[h++]=A,u[h++]=E,u[h++]=s,u[h++]=S,u[h++]=v,u[h++]=r)}return u};var vC=Nue;var aq=new z,c$e=new d,l$e=new d,u$e=new d,f$e=new d;function o_(e){e=e??W.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??Ie.DEFAULT,r=e.slices??128;if(!c(t))throw new C("options.length must be defined.");if(!c(n))throw new C("options.topRadius must be defined.");if(!c(i))throw new C("options.bottomRadius must be defined.");if(r<3)throw new C("options.slices must be greater than or equal to 3.");if(c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new C("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Ie.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}o_.packedLength=Ie.packedLength+5;o_.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var Fue=new Ie,DC={vertexFormat:Fue,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};o_.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i=Ie.unpack(e,t,Fue);t+=Ie.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],l=e[t];return c(n)?(n._vertexFormat=Ie.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=l===-1?void 0:l,n):(DC.length=o,DC.topRadius=r,DC.bottomRadius=s,DC.slices=a,DC.offsetAttribute=l===-1?void 0:l,new o_(DC))};o_.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._vertexFormat,r=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r+r,a=r+s,l=s+s,u=vC.computePositions(t,n,i,r,!0),f=o.st?new Float32Array(l*2):void 0,h=o.normal?new Float32Array(l*3):void 0,p=o.tangent?new Float32Array(l*3):void 0,g=o.bitangent?new Float32Array(l*3):void 0,m,y=o.normal||o.tangent||o.bitangent;if(y){let M=o.tangent||o.bitangent,R=0,L=0,B=0,_=Math.atan2(i-n,t),w=c$e;w.z=Math.sin(_);let D=Math.cos(_),I=u$e,N=l$e;for(m=0;m<r;m++){let k=m/r*O.TWO_PI,H=D*Math.cos(k),V=D*Math.sin(k);y&&(w.x=H,w.y=V,M&&(I=d.normalize(d.cross(d.UNIT_Z,w,I),I)),o.normal&&(h[R++]=w.x,h[R++]=w.y,h[R++]=w.z,h[R++]=w.x,h[R++]=w.y,h[R++]=w.z),o.tangent&&(p[L++]=I.x,p[L++]=I.y,p[L++]=I.z,p[L++]=I.x,p[L++]=I.y,p[L++]=I.z),o.bitangent&&(N=d.normalize(d.cross(w,I,N),N),g[B++]=N.x,g[B++]=N.y,g[B++]=N.z,g[B++]=N.x,g[B++]=N.y,g[B++]=N.z))}for(m=0;m<r;m++)o.normal&&(h[R++]=0,h[R++]=0,h[R++]=-1),o.tangent&&(p[L++]=1,p[L++]=0,p[L++]=0),o.bitangent&&(g[B++]=0,g[B++]=-1,g[B++]=0);for(m=0;m<r;m++)o.normal&&(h[R++]=0,h[R++]=0,h[R++]=1),o.tangent&&(p[L++]=1,p[L++]=0,p[L++]=0),o.bitangent&&(g[B++]=0,g[B++]=1,g[B++]=0)}let b=12*r-12,x=Fe.createTypedArray(l,b),A=0,E=0;for(m=0;m<r-1;m++)x[A++]=E,x[A++]=E+2,x[A++]=E+3,x[A++]=E,x[A++]=E+3,x[A++]=E+1,E+=2;for(x[A++]=s-2,x[A++]=0,x[A++]=1,x[A++]=s-2,x[A++]=1,x[A++]=s-1,m=1;m<r-1;m++)x[A++]=s+m+1,x[A++]=s+m,x[A++]=s;for(m=1;m<r-1;m++)x[A++]=a,x[A++]=a+m,x[A++]=a+m+1;let S=0;if(o.st){let M=Math.max(n,i);for(m=0;m<l;m++){let R=d.fromArray(u,m*3,f$e);f[S++]=(R.x+M)/(2*M),f[S++]=(R.y+M)/(2*M)}}let v=new hn;o.position&&(v.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:u})),o.normal&&(v.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:h})),o.tangent&&(v.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(v.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g})),o.st&&(v.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:f})),aq.x=t*.5,aq.y=Math.max(i,n);let P=new le(d.ZERO,z.magnitude(aq));if(c(e._offsetAttribute)){t=u.length;let M=e._offsetAttribute===Zt.NONE?0:1,R=new Uint8Array(t/3).fill(M);v.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new ct({attributes:v,indices:x,primitiveType:Me.TRIANGLES,boundingSphere:P,offsetAttribute:e._offsetAttribute})};var cq;o_.getUnitCylinder=function(){return c(cq)||(cq=o_.createGeometry(new o_({topRadius:1,bottomRadius:1,length:1,vertexFormat:Ie.POSITION_ONLY}))),cq};var I3=o_;var lq=new z;function PC(e){e=e??W.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.slices??128,r=Math.max(e.numberOfVerticalLines??16,0);if(T.typeOf.number("options.positions",t),T.typeOf.number("options.topRadius",n),T.typeOf.number("options.bottomRadius",i),T.typeOf.number.greaterThanOrEquals("options.slices",o,3),c(e.offsetAttribute)&&e.offsetAttribute===Zt.TOP)throw new C("GeometryOffsetAttribute.TOP is not a supported options.offsetAttribute for this geometry.");this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}PC.packedLength=6;PC.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var Gb={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};PC.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],l=e[t];return c(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=l===-1?void 0:l,n):(Gb.length=i,Gb.topRadius=o,Gb.bottomRadius=r,Gb.slices=s,Gb.numberOfVerticalLines=a,Gb.offsetAttribute=l===-1?void 0:l,new PC(Gb))};PC.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._slices,r=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o*2,a=vC.computePositions(t,n,i,o,!1),l=o*2,u;if(r>0){let y=Math.min(r,o);u=Math.round(o/y),l+=y}let f=Fe.createTypedArray(s,l*2),h=0,p;for(p=0;p<o-1;p++)f[h++]=p,f[h++]=p+1,f[h++]=p+o,f[h++]=p+1+o;if(f[h++]=o-1,f[h++]=0,f[h++]=o+o-1,f[h++]=o,r>0)for(p=0;p<o;p+=u)f[h++]=p,f[h++]=p+o;let g=new hn;g.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:a}),lq.x=t*.5,lq.y=Math.max(i,n);let m=new le(d.ZERO,z.magnitude(lq));if(c(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===Zt.NONE?0:1,b=new Uint8Array(t/3).fill(y);g.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}return new ct({attributes:g,indices:f,primitiveType:Me.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var O3=PC;var Bue=d.ZERO,kue=new d,d$e=new d,Uue=new G;function h$e(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function hu(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new h$e(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}c(Object.create)&&(hu.prototype=Object.create(oi.prototype),hu.prototype.constructor=hu);Object.defineProperties(hu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});hu.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let a;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Uue)),c(a)||(a=G.WHITE),s.color=jt.fromColor(a)}return c(this._options.offsetAttribute)&&(s.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Bue,kue))),new St({id:t,geometry:new I3(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};hu.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Uue),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Bue,kue))),new St({id:t,geometry:new O3(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};hu.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};hu.prototype._isHidden=function(e,t){return!c(e.position)||!c(t.length)||!c(t.topRadius)||!c(t.bottomRadius)||oi.prototype._isHidden.call(this,e,t)};hu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!Y.isConstant(t.slices)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.numberOfVerticalLines)};hu.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(Ge.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(Ge.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(Ge.MINIMUM_VALUE),i.slices=Y.getValueOrUndefined(t.slices,Ge.MINIMUM_VALUE),i.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,Ge.MINIMUM_VALUE),i.offsetAttribute=n!==qe.NONE?Zt.ALL:void 0};hu.prototype._onEntityPropertyChanged=rg;hu.DynamicGeometryUpdater=IC;function IC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(IC.prototype=Object.create(ii.prototype),IC.prototype.constructor=IC);IC.prototype._isHidden=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(e.position,n,d$e);return!c(o)||!c(i.length)||!c(i.topRadius)||!c(i.bottomRadius)||ii.prototype._isHidden.call(this,e,t,n)};IC.prototype._setOptions=function(e,t,n){let i=Y.getValueOrDefault(t.heightReference,n,qe.NONE),o=this._options;o.length=Y.getValueOrUndefined(t.length,n),o.topRadius=Y.getValueOrUndefined(t.topRadius,n),o.bottomRadius=Y.getValueOrUndefined(t.bottomRadius,n),o.slices=Y.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==qe.NONE?Zt.ALL:void 0};var R3=hu;var m$e={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2},$r=Object.freeze(m$e);var p$e={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2},_o=Object.freeze(p$e);var _$e={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3},Il=Object.freeze(_$e);var Vue=jr(ql(),1);function g$e(e){if(!c(e))throw new C("uri is required.");let t=new Vue.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var ly=g$e;var y$e=O.factorial;function uq(e,t,n,i,o,r){let s=0,a,l,u;if(i>0){for(l=0;l<o;l++){for(a=!1,u=0;u<r.length&&!a;u++)l===r[u]&&(a=!0);a||(r.push(l),s+=uq(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,l=0;l<o;l++){for(a=!1,u=0;u<r.length&&!a;u++)l===r[u]&&(a=!0);a||(s*=e-n[t[l]])}return s}var M3={type:"Hermite"};M3.getRequiredDataPoints=function(e,t){if(t=t??0,!c(e))throw new C("degree is required.");if(e<0)throw new C("degree must be 0 or greater.");if(t<0)throw new C("inputOrder must be 0 or greater.");return Math.max(Math.floor((e+1)/(t+1)),2)};M3.interpolateOrderZero=function(e,t,n,i,o){c(o)||(o=new Array(i));let r,s,a,l,u,f,h=t.length,p=new Array(i);for(r=0;r<i;r++){o[r]=0;let b=new Array(h);for(p[r]=b,s=0;s<h;s++)b[s]=[]}let g=h,m=new Array(g);for(r=0;r<g;r++)m[r]=r;let y=h-1;for(l=0;l<i;l++){for(s=0;s<g;s++)f=m[s]*i+l,p[l][0].push(n[f]);for(r=1;r<g;r++){let b=!1;for(s=0;s<g-r;s++){let x=t[m[s]],A=t[m[s+r]],E;A-x<=0?(f=m[s]*i+i*r+l,E=n[f],p[l][r].push(E/y$e(r))):(E=p[l][r-1][s+1]-p[l][r-1][s],p[l][r].push(E/(A-x))),b=b||E!==0}b||(y=r-1)}}for(a=0,u=0;a<=u;a++)for(r=a;r<=y;r++){let b=uq(e,m,t,a,r,[]);for(l=0;l<i;l++){let x=p[l][r][0];o[l+a*i]+=x*b}}return o};var b$e=[];M3.interpolate=function(e,t,n,i,o,r,s){let a=i*(r+1);c(s)||(s=new Array(a));for(let x=0;x<a;x++)s[x]=0;let l=t.length,u=new Array(l*(o+1)),f;for(f=0;f<l;f++)for(let x=0;x<o+1;x++)u[f*(o+1)+x]=f;let h=u.length,p=b$e,g=x$e(p,u,t,n,i,o),m=[],y=h*(h+1)/2,b=Math.min(g,r);for(let x=0;x<=b;x++)for(f=x;f<=g;f++){m.length=0;let A=uq(e,u,t,x,f,m),E=Math.floor(f*(1-f)/2)+h*f;for(let S=0;S<i;S++){let v=Math.floor(S*y),P=p[v+E];s[S+x*i]+=P*A}}return s};function x$e(e,t,n,i,o,r){let s,a,l=-1,u=t.length,f=u*(u+1)/2;for(let h=0;h<o;h++){let p=Math.floor(h*f);for(s=0;s<u;s++)a=t[s]*o*(r+1)+h,e[p+s]=i[a];for(let g=1;g<u;g++){let m=0,y=Math.floor(g*(1-g)/2)+u*g,b=!1;for(s=0;s<u-g;s++){let x=n[t[s]],A=n[t[s+g]],E,S;if(A-x<=0)a=t[s]*o*(r+1)+o*g+h,E=i[a],S=E/O.factorial(g),e[p+y+m]=S,m++;else{let v=Math.floor((g-1)*(2-g)/2)+u*(g-1);E=e[p+v+s+1]-e[p+v+s],S=E/(A-x),e[p+y+m]=S,m++}b=b||E!==0}b&&(l=Math.max(l,g))}}return l}var L3=M3;var fq={type:"Lagrange"};fq.getRequiredDataPoints=function(e){return Math.max(e+1,2)};fq.interpolateOrderZero=function(e,t,n,i,o){c(o)||(o=new Array(i));let r,s,a=t.length;for(r=0;r<i;r++)o[r]=0;for(r=0;r<a;r++){let l=1;for(s=0;s<a;s++)if(s!==r){let u=t[r]-t[s];l*=(e-t[s])/u}for(s=0;s<i;s++)o[s]+=l*n[r*i+s]}return o};var N3=fq;var dq={type:"Linear"};dq.getRequiredDataPoints=function(e){return 2};dq.interpolateOrderZero=function(e,t,n,i,o){if(t.length!==2)throw new C("The xTable provided to the linear interpolator must have exactly two elements.");if(i<=0)throw new C("There must be at least 1 dependent variable for each independent variable.");c(o)||(o=new Array(i));let r,s,a,l=t[0],u=t[1];if(l===u)throw new C("Divide by zero error: xTable[0] and xTable[1] are equal");for(r=0;r<i;r++)s=n[r],a=n[r+i],o[r]=((a-s)*e+u*s-l*a)/(u-l);return o};var jb=dq;function lc(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}lc.fromCartesian3=function(e,t){T.typeOf.object("cartesian3",e);let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return c(t)||(t=new lc),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};lc.clone=function(e,t){if(c(e))return c(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new lc(e.clock,e.cone,e.magnitude)};lc.normalize=function(e,t){return T.typeOf.object("spherical",e),c(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new lc(e.clock,e.cone,1)};lc.equals=function(e,t){return e===t||c(e)&&c(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};lc.equalsEpsilon=function(e,t,n){return n=n??0,e===t||c(e)&&c(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};lc.prototype.equals=function(e){return lc.equals(this,e)};lc.prototype.clone=function(e){return lc.clone(this,e)};lc.prototype.equalsEpsilon=function(e,t){return lc.equalsEpsilon(this,e,t)};lc.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var F3=lc;var WD=jr(ql(),1);var hq;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?hq=function(){return performance.now()}:hq=function(){return Date.now()};var Ei=hq;function mq(e){e=e??W.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;if(c(t)?t=Q.clone(t):c(n)?t=Q.clone(n):c(i)?t=Q.addDays(i,-1,new Q):t=Q.now(),c(n)?n=Q.clone(n):n=Q.clone(t),c(i)?i=Q.clone(i):i=Q.addDays(n,1,new Q),Q.greaterThan(n,i))throw new C("startTime must come before stopTime.");this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??$r.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new pe,this.onStop=new pe,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Ei(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??_o.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(mq.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){Q.equals(this._currentTime,e)||(this._clockStep===_o.SYSTEM_CLOCK&&(this._clockStep=_o.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===_o.SYSTEM_CLOCK&&(this._clockStep=_o.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===_o.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=Q.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===_o.SYSTEM_CLOCK&&(this._clockStep=_o.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});mq.prototype.tick=function(){let e=Ei(),t=Q.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===_o.SYSTEM_CLOCK)t=Q.now(t);else{let i=this._multiplier;if(n===_o.TICK_DEPENDENT)t=Q.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=Q.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===$r.CLAMPED)Q.lessThan(t,r)?t=Q.clone(r,t):Q.greaterThan(t,s)&&(t=Q.clone(s,t),this.onStop.raiseEvent(this));else if(o===$r.LOOP_STOP)for(Q.lessThan(t,r)&&(t=Q.clone(r,t));Q.greaterThan(t,s);)t=Q.addSeconds(r,Q.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var mm=mq;function Wb(){this._definitionChanged=new pe,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(Wb.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:yl("startTime"),stopTime:yl("stopTime"),currentTime:yl("currentTime"),clockRange:yl("clockRange"),clockStep:yl("clockStep"),multiplier:yl("multiplier")});Wb.prototype.clone=function(e){return c(e)||(e=new Wb),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};Wb.prototype.equals=function(e){return this===e||c(e)&&Q.equals(this.startTime,e.startTime)&&Q.equals(this.stopTime,e.stopTime)&&Q.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};Wb.prototype.merge=function(e){if(!c(e))throw new C("source is required.");this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};Wb.prototype.getValue=function(e){return c(e)||(e=new mm),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var pm=Wb;var T$e=G.WHITE,A$e=.1,C$e=new z(8,8),E$e=new z(0,0),S$e=new z(1,1);function OC(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(OC.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._cellAlpha)&&Y.isConstant(this._lineCount)&&Y.isConstant(this._lineThickness)&&Y.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),cellAlpha:fe("cellAlpha"),lineCount:fe("lineCount"),lineThickness:fe("lineThickness"),lineOffset:fe("lineOffset")});OC.prototype.getType=function(e){return"Grid"};var w$e=new Q;OC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(w$e)),c(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,T$e,t.color),t.cellAlpha=Y.getValueOrDefault(this._cellAlpha,e,A$e),t.lineCount=Y.getValueOrClonedDefault(this._lineCount,e,C$e,t.lineCount),t.lineThickness=Y.getValueOrClonedDefault(this._lineThickness,e,S$e,t.lineThickness),t.lineOffset=Y.getValueOrClonedDefault(this._lineOffset,e,E$e,t.lineOffset),t};OC.prototype.equals=function(e){return this===e||e instanceof OC&&Y.equals(this._color,e._color)&&Y.equals(this._cellAlpha,e._cellAlpha)&&Y.equals(this._lineCount,e._lineCount)&&Y.equals(this._lineThickness,e._lineThickness)&&Y.equals(this._lineOffset,e._lineOffset)};var ND=OC;function RC(e){this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(RC.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color")});RC.prototype.getType=function(e){return"PolylineArrow"};var v$e=new Q;RC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(v$e)),c(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,G.WHITE,t.color),t};RC.prototype.equals=function(e){return this===e||e instanceof RC&&Y.equals(this._color,e._color)};var FD=RC;var D$e=G.WHITE,P$e=G.TRANSPARENT,I$e=16,O$e=255;function MC(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(MC.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._gapColor)&&Y.isConstant(this._dashLength)&&Y.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),gapColor:fe("gapColor"),dashLength:fe("dashLength"),dashPattern:fe("dashPattern")});MC.prototype.getType=function(e){return"PolylineDash"};var R$e=new Q;MC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(R$e)),c(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,D$e,t.color),t.gapColor=Y.getValueOrClonedDefault(this._gapColor,e,P$e,t.gapColor),t.dashLength=Y.getValueOrDefault(this._dashLength,e,I$e,t.dashLength),t.dashPattern=Y.getValueOrDefault(this._dashPattern,e,O$e,t.dashPattern),t};MC.prototype.equals=function(e){return this===e||e instanceof MC&&Y.equals(this._color,e._color)&&Y.equals(this._gapColor,e._gapColor)&&Y.equals(this._dashLength,e._dashLength)&&Y.equals(this._dashPattern,e._dashPattern)};var BD=MC;var M$e=G.WHITE,L$e=.25,N$e=1;function LC(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(LC.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),glowPower:fe("glowPower"),taperPower:fe("taperPower")});LC.prototype.getType=function(e){return"PolylineGlow"};var F$e=new Q;LC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(F$e)),c(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,M$e,t.color),t.glowPower=Y.getValueOrDefault(this._glowPower,e,L$e,t.glowPower),t.taperPower=Y.getValueOrDefault(this._taperPower,e,N$e,t.taperPower),t};LC.prototype.equals=function(e){return this===e||e instanceof LC&&Y.equals(this._color,e._color)&&Y.equals(this._glowPower,e._glowPower)&&Y.equals(this._taperPower,e._taperPower)};var kD=LC;var B$e=G.WHITE,k$e=G.BLACK,U$e=1;function NC(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(NC.prototype,{isConstant:{get:function(){return Y.isConstant(this._color)&&Y.isConstant(this._outlineColor)&&Y.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:fe("color"),outlineColor:fe("outlineColor"),outlineWidth:fe("outlineWidth")});NC.prototype.getType=function(e){return"PolylineOutline"};var V$e=new Q;NC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(V$e)),c(t)||(t={}),t.color=Y.getValueOrClonedDefault(this._color,e,B$e,t.color),t.outlineColor=Y.getValueOrClonedDefault(this._outlineColor,e,k$e,t.outlineColor),t.outlineWidth=Y.getValueOrDefault(this._outlineWidth,e,U$e),t};NC.prototype.equals=function(e){return this===e||e instanceof NC&&Y.equals(this._color,e._color)&&Y.equals(this._outlineColor,e._outlineColor)&&Y.equals(this._outlineWidth,e._outlineWidth)};var qb=NC;function r_(e,t){this._value=void 0,this._definitionChanged=new pe,this._eventHelper=new Ar,this._referenceFrame=t??zi.FIXED,this.setValue(e)}Object.defineProperties(r_.prototype,{isConstant:{get:function(){let e=this._value;if(!c(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!Y.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var z$e=new Q;r_.prototype.getValue=function(e,t){return c(e)||(e=Q.now(z$e)),this.getValueInReferenceFrame(e,zi.FIXED,t)};r_.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new C("time is required.");if(!c(t))throw new C("referenceFrame is required.");let i=this._value;if(!c(i))return;let o=i.length;c(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let l=i[r].getValueInReferenceFrame(e,t,n[r]);c(l)&&(n[s]=l,s++),r++}return n.length=s,n};r_.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),c(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];c(o)&&t.add(o.definitionChanged,r_.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};r_.prototype.equals=function(e){return this===e||e instanceof r_&&this._referenceFrame===e._referenceFrame&&Y.arrayEquals(this._value,e._value)};r_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var uy=r_;function fy(e){this._value=void 0,this._definitionChanged=new pe,this._eventHelper=new Ar,this.setValue(e)}Object.defineProperties(fy.prototype,{isConstant:{get:function(){let e=this._value;if(!c(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!Y.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var H$e=new Q;fy.prototype.getValue=function(e,t){c(e)||(e=Q.now(H$e));let n=this._value;if(!c(n))return;let i=n.length;c(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);c(a)&&(t[r]=a,r++),o++}return t.length=r,t};fy.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),c(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];c(o)&&t.add(o.definitionChanged,fy.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};fy.prototype.equals=function(e){return this===e||e instanceof fy&&Y.arrayEquals(this._value,e._value)};fy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var UD=fy;function Yb(e){let t=e._targetProperty;if(!c(t)){let n=e._targetEntity;if(!c(n)){if(n=e._targetCollection.getById(e._targetId),!c(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(mu.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&c(t);++o)t=t[i[o]];e._targetProperty=t}return t}function mu(e,t,n){if(!c(e))throw new C("targetCollection is required.");if(!c(t)||t==="")throw new C("targetId is required.");if(!c(n)||n.length===0)throw new C("targetPropertyNames is required.");for(let i=0;i<n.length;i++){let o=n[i];if(!c(o)||o==="")throw new C("reference contains invalid properties.")}this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new pe,e.collectionChanged.addEventListener(mu.prototype._onCollectionChanged,this)}Object.defineProperties(mu.prototype,{isConstant:{get:function(){return Y.isConstant(Yb(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=Yb(this);return c(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return Yb(this)}}});mu.fromString=function(e,t){if(!c(e))throw new C("targetCollection is required.");if(!c(t))throw new C("referenceString is required.");let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let l=t.charAt(a);r?(s+=l,r=!1):l==="\\"?r=!0:o&&l==="#"?(n=s,o=!1,s=""):!o&&l==="."?(i.push(s),s=""):s+=l}return i.push(s),new mu(e,n,i)};var G$e=new Q;mu.prototype.getValue=function(e,t){let n=Yb(this);return c(e)||(e=Q.now(G$e)),c(n)?n.getValue(e,t):void 0};mu.prototype.getValueInReferenceFrame=function(e,t,n){let i=Yb(this);return c(i)?i.getValueInReferenceFrame(e,t,n):void 0};mu.prototype.getType=function(e){let t=Yb(this);return c(t)?t.getType(e):void 0};mu.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let o=0;o<i;o++)if(t[o]!==n[o])return!1;return!0};mu.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){c(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};mu.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;c(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(mu.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):c(i)||(i=Yb(this),c(i)&&this._definitionChanged.raiseEvent(this))};var dy=mu;var j$e={packedLength:1,pack:function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,t[n]=e,t},unpack:function(e,t,n){if(!c(e))throw new C("array is required");return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){if(!c(e))throw new C("packedArray is required");c(i)||(i=[]),t=t??0,n=n??e.length;let o;for(let r=0,s=n-t+1;r<s;r++){let a=e[t+r];r===0||Math.abs(o-a)<Math.PI?i[r]=a:i[r]=a-O.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){if(!c(e))throw new C("array is required");if(!c(t))throw new C("sourceArray is required");return o=e[0],o<0?o+O.TWO_PI:o}},Vd=j$e;var zue={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function Hue(e,t,n){let i,o=e.length,r=n.length,s=o+r;if(e.length=s,o!==t){let a=o-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<r;i++)e[t++]=n[i]}function Gue(e,t){return e instanceof Q?e:typeof e=="string"?Q.fromIso8601(e):Q.addSeconds(t,e,new Q)}var pq=[],_q=[];function B3(e,t,n,i,o){let r=0,s,a,l,u,f,h;for(;r<i.length;){f=Gue(i[r],e),l=Mo(t,f,Q.compare);let p=0,g=0;if(l<0){for(l=~l,u=l*o,a=void 0,h=t[l];r<i.length&&(f=Gue(i[r],e),!(c(a)&&Q.compare(a,f)>=0||c(h)&&Q.compare(f,h)>=0));){for(pq[p++]=f,r=r+1,s=0;s<o;s++)_q[g++]=i[r],r=r+1;a=f}p>0&&(_q.length=g,Hue(n,u,_q),pq.length=p,Hue(t,l,pq))}else{for(s=0;s<o;s++)r++,n[l*o+s]=i[r];r++}}}function Nf(e,t){T.defined("type",e);let n=e;n===Number&&(n=zue);let i=n.packedLength,o=n.packedInterpolationLength??i,r=0,s;if(c(t)){let a=t.length;s=new Array(a);for(let l=0;l<a;l++){let u=t[l];u===Number&&(u=zue);let f=u.packedLength;i+=f,o+=u.packedInterpolationLength??f,s[l]=u}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=jb,this._lastInterpolationAlgorithm=jb,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new pe,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=Il.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Il.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Nf.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});var W$e=new Q;Nf.prototype.getValue=function(e,t){c(e)||(e=Q.now(W$e));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Mo(n,e,Q.compare);var l=!1;if(a<0){if(a=~a,a===0){let P=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===Il.NONE||o!==0&&Q.secondsDifference(P,e)>o)return;if(this._backwardExtrapolationType===Il.HOLD)return r.unpack(s,0,t);l=this._backwardExtrapolationType===Il.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let P=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Il.NONE||o!==0&&Q.secondsDifference(e,P)>o)return;if(this._forwardExtrapolationType===Il.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t);l=this._forwardExtrapolationType===Il.LINEAR_EXTRAPOLATE}let h=this._xTable,p=this._yTable;var u,f;l?(u=Cesium.LinearApproximation,f=1):(u=this._interpolationAlgorithm,f=this._interpolationDegree),this._lastInterpolationAlgorithm!=u&&(this._lastInterpolationAlgorithm=u,this._updateTableLength=!0);let g=this._packedInterpolationLength,m=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let P=Math.min(u.getRequiredDataPoints(f,m),i);P!==this._numberOfPoints&&(this._numberOfPoints=P,h.length=P,p.length=P*g)}let y=this._numberOfPoints-1;if(y<1)return;let b=0,x=i-1;if(x-b+1>=y+1){let P=a-(y/2|0)-1;P<b&&(P=b);let M=P+y;M>x&&(M=x,P=M-y,P<b&&(P=b)),b=P,x=M}let E=x-b+1;for(let P=0;P<E;++P)h[P]=Q.secondsDifference(n[b+P],n[x]);if(c(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,b,x,p);else{let P=0,M=this._packedLength,R=b*M,L=(x+1)*M;for(;R<L;)p[P]=s[R],R++,P++}let S=Q.secondsDifference(e,n[x]),v;if(m===0||!c(u.interpolate))v=u.interpolateOrderZero(S,h,p,g,this._interpolationResult);else{let P=Math.floor(g/(m+1));v=u.interpolate(S,h,p,P,m,m,this._interpolationResult)}return c(r.unpackInterpolationResult)?r.unpackInterpolationResult(v,s,b,x,t):r.unpack(v,0,t)}return r.unpack(s,a*this._packedLength,t)};Nf.prototype.setInterpolationOptions=function(e){if(!c(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;c(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),c(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};Nf.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=c(i);T.defined("time",e),T.defined("value",t),o&&T.defined("derivatives",n);let r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let l=0;l<a;l++)i[l].pack(n[l],s,s.length)}B3(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Nf.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=c(i);if(T.defined("times",e),T.defined("values",t),e.length!==t.length)throw new C("times and values must be the same length.");if(o&&(!c(n)||n.length!==e.length))throw new C("times and derivativeValues must be the same length.");let r=this._innerType,s=e.length,a=[];for(let l=0;l<s;l++)if(a.push(e[l]),r.pack(t[l],a,a.length),o){let u=n[l],f=i.length;for(let h=0;h<f;h++)i[h].pack(u[h],a,a.length)}B3(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Nf.prototype.getSample=function(e){T.typeOf.number("index",e);let t=this._times,n=t.length;if(c(n))return e<0&&(e+=n),t[e]};Nf.prototype.addSamplesPackedArray=function(e,t){T.defined("packedSamples",e),B3(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Nf.prototype.removeSample=function(e){T.defined("time",e);let t=Mo(this._times,e,Q.compare);return t<0?!1:(jue(this,t,1),!0)};function jue(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}Nf.prototype.removeSamples=function(e){T.defined("timeInterval",e);let t=this._times,n=Mo(t,e.start,Q.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Mo(t,e.stop,Q.compare);i<0?i=~i:e.isStopIncluded&&++i,jue(this,n,i-n)};Nf.prototype.equals=function(e){if(this===e)return!0;if(!c(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=c(t),i=e._derivativeTypes,o=c(i);if(n!==o)return!1;let r,s;if(n){if(s=t.length,s!==i.length)return!1;for(r=0;r<s;r++)if(t[r]!==i[r])return!1}let a=this._times,l=e._times;if(s=a.length,s!==l.length)return!1;for(r=0;r<s;r++)if(!Q.equals(a[r],l[r]))return!1;let u=this._values,f=e._values;for(s=u.length,r=0;r<s;r++)if(u[r]!==f[r])return!1;return!0};Nf._mergeNewSamples=B3;var Ff=Nf;function Bf(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=d}this._numberOfDerivatives=t,this._property=new Ff(d,n),this._definitionChanged=new pe,this._referenceFrame=e??zi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Bf.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});var q$e=new Q;Bf.prototype.getValue=function(e,t){return c(e)||(e=Q.now(q$e)),this.getValueInReferenceFrame(e,zi.FIXED,t)};Bf.prototype.getValueInReferenceFrame=function(e,t,n){if(T.defined("time",e),T.defined("referenceFrame",t),n=this._property.getValue(e,n),c(n))return Fh.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Bf.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Bf.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;if(i>0&&(!c(n)||n.length!==i))throw new C("derivatives length must be equal to the number of derivatives.");this._property.addSample(e,t,n)};Bf.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Bf.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Bf.prototype.removeSample=function(e){return this._property.removeSample(e)};Bf.prototype.removeSamples=function(e){this._property.removeSamples(e)};Bf.prototype.equals=function(e){return this===e||e instanceof Bf&&Y.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var Ia=Bf;var Y$e={HORIZONTAL:0,VERTICAL:1},_m=Object.freeze(Y$e);var X$e=_m.HORIZONTAL,K$e=G.WHITE,$$e=G.BLACK,Z$e=0,Q$e=1;function FC(e){e=e??W.EMPTY_OBJECT,this._definitionChanged=new pe,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(FC.prototype,{isConstant:{get:function(){return Y.isConstant(this._orientation)&&Y.isConstant(this._evenColor)&&Y.isConstant(this._oddColor)&&Y.isConstant(this._offset)&&Y.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:fe("orientation"),evenColor:fe("evenColor"),oddColor:fe("oddColor"),offset:fe("offset"),repeat:fe("repeat")});FC.prototype.getType=function(e){return"Stripe"};var J$e=new Q;FC.prototype.getValue=function(e,t){return c(e)||(e=Q.now(J$e)),c(t)||(t={}),t.horizontal=Y.getValueOrDefault(this._orientation,e,X$e)===_m.HORIZONTAL,t.evenColor=Y.getValueOrClonedDefault(this._evenColor,e,K$e,t.evenColor),t.oddColor=Y.getValueOrClonedDefault(this._oddColor,e,$$e,t.oddColor),t.offset=Y.getValueOrDefault(this._offset,e,Z$e),t.repeat=Y.getValueOrDefault(this._repeat,e,Q$e),t};FC.prototype.equals=function(e){return this===e||e instanceof FC&&Y.equals(this._orientation,e._orientation)&&Y.equals(this._evenColor,e._evenColor)&&Y.equals(this._oddColor,e._oddColor)&&Y.equals(this._offset,e._offset)&&Y.equals(this._repeat,e._repeat)};var VD=FC;function hy(e){this._definitionChanged=new pe,this._intervals=new Xr,this._intervals.changedEvent.addEventListener(hy.prototype._intervalsChanged,this),this._referenceFrame=e??zi.FIXED}Object.defineProperties(hy.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});var eZe=new Q;hy.prototype.getValue=function(e,t){return c(e)||(e=Q.now(eZe)),this.getValueInReferenceFrame(e,zi.FIXED,t)};hy.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new C("time is required.");if(!c(t))throw new C("referenceFrame is required.");let i=this._intervals.findDataForIntervalContainingDate(e);if(c(i))return Fh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};hy.prototype.equals=function(e){return this===e||e instanceof hy&&this._intervals.equals(e._intervals,Y.equals)&&this._referenceFrame===e._referenceFrame};hy.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var my=hy;function Xb(){this._definitionChanged=new pe,this._intervals=new Xr,this._intervals.changedEvent.addEventListener(Xb.prototype._intervalsChanged,this)}Object.defineProperties(Xb.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var tZe=new Q;Xb.prototype.getValue=function(e,t){c(e)||(e=Q.now(tZe));let n=this._intervals.findDataForIntervalContainingDate(e);return c(n)&&typeof n.clone=="function"?n.clone(t):n};Xb.prototype.equals=function(e){return this===e||e instanceof Xb&&this._intervals.equals(e._intervals,Y.equals)};Xb.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var py=Xb;function BC(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new pe,this._normalize=t??!0,this.position=e}Object.defineProperties(BC.prototype,{isConstant:{get:function(){return Y.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(c(t)&&this._subscription(),this._position=e,c(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var nZe=new d,Wue=new d,que=new Q,iZe=new Q,gq=1/60;BC.prototype.getValue=function(e,t){return this._getValue(e,t)};BC.prototype._getValue=function(e,t,n){c(e)||(e=Q.now(iZe)),c(t)||(t=new d);let i=this._position;if(Y.isConstant(i))return this._normalize?void 0:d.clone(d.ZERO,t);let o=i.getValue(e,nZe),r=i.getValue(Q.addSeconds(e,gq,que),Wue);if(!c(o)||!c(r)&&(r=o,o=i.getValue(Q.addSeconds(e,-gq,que),Wue),!c(o)))return;if(d.equals(o,r))return this._normalize?void 0:d.clone(d.ZERO,t);c(n)&&o.clone(n);let s=d.subtract(r,o,t);return this._normalize?d.normalize(s,t):d.divideByScalar(s,gq,t)};BC.prototype.equals=function(e){return this===e||e instanceof BC&&Y.equals(this._position,e._position)};var _y=BC;function zD(e,t){this._velocityVectorProperty=new _y(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new pe,this.ellipsoid=t??ie.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(zD.prototype,{isConstant:{get:function(){return Y.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var Yue=new d,oZe=new d,Xue=new J,rZe=new Q;zD.prototype.getValue=function(e,t){c(e)||(e=Q.now(rZe));let n=this._velocityVectorProperty._getValue(e,oZe,Yue);if(c(n))return Ot.rotationMatrixFromPositionVelocity(Yue,n,this._ellipsoid,Xue),Le.fromRotationMatrix(Xue,t)};zD.prototype.equals=function(e){return this===e||e instanceof zD&&Y.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var k3=zD;var s_={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};s_.validate=function(e){return e===s_.COMPLETE||e===s_.BELOW_ELLIPSOID_HORIZON||e===s_.ABOVE_ELLIPSOID_HORIZON};s_.toString=function(e){switch(e){case s_.COMPLETE:return"COMPLETE";case s_.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case s_.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new C("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var HD=s_;function gy(){}gy.packedLength=d.packedLength;gy.unpack=d.unpack;gy.pack=d.pack;var yq;function GD(e,t){return t[0]==="#"&&(t=yq+t),dy.fromString(e,t)}function Kue(e,t,n){if(c(n.reference))return GD(t,n.reference);if(c(n.velocityReference)){let i=GD(t,n.velocityReference);switch(e){case d:case gy:return new _y(i,e===gy);case Le:return new k3(i)}}throw new ae(`${JSON.stringify(n)} is not valid CZML.`)}function sZe(e,t){return new Vh(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var Ui=new d,qc=new F3,uc=new he,Kb=new Sn,U3=new Le;function aZe(e){let t=e.rgbaf;if(c(t))return t;let n=e.rgba;if(!c(n))return;let i=n.length;if(i===G.packedLength)return[G.byteToFloat(n[0]),G.byteToFloat(n[1]),G.byteToFloat(n[2]),G.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=G.byteToFloat(n[o+1]),t[o+2]=G.byteToFloat(n[o+2]),t[o+3]=G.byteToFloat(n[o+3]),t[o+4]=G.byteToFloat(n[o+4]);return t}function $ue(e,t){let n=e.uri??e;return c(t)?t.getDerivedResource({url:n}):we.createIfNeeded(n)}function cZe(e){let t=e.wsen;if(c(t))return t;let n=e.wsenDegrees;if(!c(n))return;let i=n.length;if(i===ce.packedLength)return[O.toRadians(n[0]),O.toRadians(n[1]),O.toRadians(n[2]),O.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=O.toRadians(n[o+1]),t[o+2]=O.toRadians(n[o+2]),t[o+3]=O.toRadians(n[o+3]),t[o+4]=O.toRadians(n[o+4]);return t}function lZe(e){let t=e.length;if(qc.magnitude=1,t===2)return qc.clock=e[0],qc.cone=e[1],d.fromSpherical(qc,Ui),[Ui.x,Ui.y,Ui.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],qc.clock=e[i+1],qc.cone=e[i+2],d.fromSpherical(qc,Ui),n[o+1]=Ui.x,n[o+2]=Ui.y,n[o+3]=Ui.z;return n}function uZe(e){let t=e.length;if(t===3)return qc.clock=e[0],qc.cone=e[1],qc.magnitude=e[2],d.fromSpherical(qc,Ui),[Ui.x,Ui.y,Ui.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],qc.clock=e[i+1],qc.cone=e[i+2],qc.magnitude=e[i+3],d.fromSpherical(qc,Ui),n[i+1]=Ui.x,n[i+2]=Ui.y,n[i+3]=Ui.z;return n}function fZe(e){let t=e.length;if(t===3)return uc.longitude=e[0],uc.latitude=e[1],uc.height=e[2],ie.default.cartographicToCartesian(uc,Ui),[Ui.x,Ui.y,Ui.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],uc.longitude=e[i+1],uc.latitude=e[i+2],uc.height=e[i+3],ie.default.cartographicToCartesian(uc,Ui),n[i+1]=Ui.x,n[i+2]=Ui.y,n[i+3]=Ui.z;return n}function dZe(e){let t=e.length;if(t===3)return uc.longitude=O.toRadians(e[0]),uc.latitude=O.toRadians(e[1]),uc.height=e[2],ie.default.cartographicToCartesian(uc,Ui),[Ui.x,Ui.y,Ui.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],uc.longitude=O.toRadians(e[i+1]),uc.latitude=O.toRadians(e[i+2]),uc.height=e[i+3],ie.default.cartographicToCartesian(uc,Ui),n[i+1]=Ui.x,n[i+2]=Ui.y,n[i+3]=Ui.z;return n}function bq(e){let t=e.cartesian;if(c(t))return t;let n=e.cartesianVelocity;if(c(n))return n;let i=e.unitCartesian;if(c(i))return i;let o=e.unitSpherical;if(c(o))return lZe(o);let r=e.spherical;if(c(r))return uZe(r);let s=e.cartographicRadians;if(c(s))return fZe(s);let a=e.cartographicDegrees;if(c(a))return dZe(a);throw new ae(`${JSON.stringify(e)} is not a valid CZML interval.`)}function Zue(e,t){d.unpack(e,t,Ui),d.normalize(Ui,Ui),d.pack(Ui,e,t)}function hZe(e){let t=bq(e);if(t.length===3)return Zue(t,0),t;for(let n=1;n<t.length;n+=4)Zue(t,n);return t}function Que(e,t){Le.unpack(e,t,U3),Le.normalize(U3,U3),Le.pack(U3,e,t)}function mZe(e){let t=e.unitQuaternion;if(c(t)){if(t.length===4)return Que(t,0),t;for(let n=1;n<t.length;n+=5)Que(t,n)}return t}function Jue(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?Ke:e.hasOwnProperty("cartesian2")?z:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?d:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?gy:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?G:e.hasOwnProperty("arcType")?qt:e.hasOwnProperty("classificationType")?Un:e.hasOwnProperty("colorBlendMode")?kc:e.hasOwnProperty("cornerType")?ki:e.hasOwnProperty("heightReference")?qe:e.hasOwnProperty("horizontalOrigin")?xi:e.hasOwnProperty("date")?Q:e.hasOwnProperty("labelStyle")?Ko:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Bt:e.hasOwnProperty("distanceDisplayCondition")?Lt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Le:e.hasOwnProperty("shadowMode")?Tn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?_m:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ce:e.hasOwnProperty("uri")?WD.default:e.hasOwnProperty("verticalOrigin")?Fn:Object}function pZe(e,t,n){switch(e){case qt:return qt[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case Ke:return t.boundingRectangle;case z:return t.cartesian2;case d:return bq(t);case gy:return hZe(t);case G:return aZe(t);case Un:return Un[t.classificationType??t];case kc:return kc[t.colorBlendMode??t];case ki:return ki[t.cornerType??t];case qe:return qe[t.heightReference??t];case xi:return xi[t.horizontalOrigin??t];case Image:return $ue(t,n);case Q:return Q.fromIso8601(t.date??t);case Ko:return Ko[t.labelStyle??t];case Number:return t.number??t;case Bt:return t.nearFarScalar;case Lt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Le:return mZe(t);case Vd:return t.number??t;case HD:return HD[t.portionToDisplay??t];case Tn:return Tn[t.shadowMode??t.shadows??t];case String:return t.string??t;case _m:return _m[t.stripeOrientation??t];case ce:return cZe(t);case WD.default:return $ue(t,n);case Fn:return Fn[t.verticalOrigin??t];default:throw new ae(`Unknown CzmlDataSource interval type: ${e}`)}}var _Ze={HERMITE:L3,LAGRANGE:N3,LINEAR:jb};function V3(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(c(n)||c(i))&&t.setInterpolationOptions({interpolationAlgorithm:_Ze[n],interpolationDegree:i});let o=e.forwardExtrapolationType;c(o)&&(t.forwardExtrapolationType=Il[o]);let r=e.forwardExtrapolationDuration;c(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;c(s)&&(t.backwardExtrapolationType=Il[s]);let a=e.backwardExtrapolationDuration;c(a)&&(t.backwardExtrapolationDuration=a)}var efe={iso8601:void 0};function ur(e){if(c(e))return efe.iso8601=e,Sn.fromIso8601(efe)}function xq(e){let t=Ge.MAXIMUM_INTERVAL.clone();return t.data=e,t}function tfe(e){let t=new Gc;return t.intervals.addInterval(xq(e)),t}function nfe(e){let t=new Pa(e.referenceFrame);return t.intervals.addInterval(xq(e)),t}function z3(e,t,n,i,o,r,s){let a=ur(i.interval);c(o)&&(c(a)?a=Sn.intersect(a,o,Kb):a=o);let l,u,f,h=!c(i.reference)&&!c(i.velocityReference),p=c(a)&&!a.equals(Ge.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return hfe(t[n],a)}let g=!1;if(h){if(u=pZe(e,i,r),!c(u))return;l=e.packedLength??1,f=u.length??1,g=!c(i.array)&&typeof u!="string"&&f>l&&e!==Object}let m=typeof e.unpack=="function"&&e!==Vd;if(!g&&!p){h?t[n]=new Xn(m?e.unpack(u,0):u):t[n]=Kue(e,s,i);return}let y=t[n],b,x=i.epoch;if(c(x)&&(b=Q.fromIso8601(x)),g&&!p){y instanceof Ff||(t[n]=y=new Ff(e)),y.addSamplesPackedArray(u,b),V3(i,y);return}let A;if(!g&&p){a=a.clone(),h?a.data=m?e.unpack(u,0):u:a.data=Kue(e,s,i),c(y)||(t[n]=y=h?new py:new Gc),h&&y instanceof py?y.intervals.addInterval(a):y instanceof Gc?(h&&(a.data=new Xn(a.data)),y.intervals.addInterval(a)):(t[n]=y=tfe(y),h&&(a.data=new Xn(a.data)),y.intervals.addInterval(a));return}c(y)||(t[n]=y=new Gc),y instanceof Gc||(t[n]=y=tfe(y));let E=y.intervals;A=E.findInterval(a),(!c(A)||!(A.data instanceof Ff))&&(A=a.clone(),A.data=new Ff(e),E.addInterval(A)),A.data.addSamplesPackedArray(u,b),V3(i,A.data)}function hfe(e,t){if(e instanceof Ff){e.removeSamples(t);return}else if(e instanceof py){e.intervals.removeInterval(t);return}else if(e instanceof Gc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Sn.intersect(n.get(i),t,Kb);o.isEmpty||hfe(o.data,t)}n.removeInterval(t);return}}function be(e,t,n,i,o,r,s){if(c(i))if(Array.isArray(i))for(let a=0,l=i.length;a<l;++a)z3(e,t,n,i[a],o,r,s);else z3(e,t,n,i,o,r,s)}function ife(e,t,n,i,o,r){let s=ur(n.interval);c(i)&&(c(s)?s=Sn.intersect(s,i,Kb):s=i);let a=c(n.cartesianVelocity)?1:0,l=d.packedLength*(a+1),u,f,h=!c(n.reference),p=c(s)&&!s.equals(Ge.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return mfe(e[t],s)}let g,m=!1;if(h&&(c(n.referenceFrame)&&(g=zi[n.referenceFrame]),g=g??zi.FIXED,u=bq(n),f=u.length??1,m=f>l),!m&&!p){h?e[t]=new gl(d.unpack(u),g):e[t]=GD(r,n.reference);return}let y=e[t],b,x=n.epoch;if(c(x)&&(b=Q.fromIso8601(x)),m&&!p){(!(y instanceof Ia)||c(g)&&y.referenceFrame!==g)&&(e[t]=y=new Ia(g,a)),y.addSamplesPackedArray(u,b),V3(n,y);return}let A;if(!m&&p){s=s.clone(),h?s.data=d.unpack(u):s.data=GD(r,n.reference),c(y)||(h?y=new my(g):y=new Pa(g),e[t]=y),h&&y instanceof my&&c(g)&&y.referenceFrame===g?y.intervals.addInterval(s):y instanceof Pa?(h&&(s.data=new gl(s.data,g)),y.intervals.addInterval(s)):(e[t]=y=nfe(y),h&&(s.data=new gl(s.data,g)),y.intervals.addInterval(s));return}c(y)?y instanceof Pa||(e[t]=y=nfe(y)):e[t]=y=new Pa(g);let E=y.intervals;A=E.findInterval(s),(!c(A)||!(A.data instanceof Ia)||c(g)&&A.data.referenceFrame!==g)&&(A=s.clone(),A.data=new Ia(g,a),E.addInterval(A)),A.data.addSamplesPackedArray(u,b),V3(n,A.data)}function mfe(e,t){if(e instanceof Ia){e.removeSamples(t);return}else if(e instanceof my){e.intervals.removeInterval(t);return}else if(e instanceof Pa){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Sn.intersect(n.get(i),t,Kb);o.isEmpty||mfe(o.data,t)}n.removeInterval(t);return}}function pfe(e,t,n,i,o,r){if(c(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)ife(e,t,n[s],i,o,r);else ife(e,t,n,i,o,r)}function ofe(e,t,n,i){c(n.references)?H3(e,t,n.references,n.interval,i,UD,Gc):(c(n.cartesian2)?n.array=z.unpackArray(n.cartesian2):c(n.cartesian)&&(n.array=z.unpackArray(n.cartesian)),c(n.array)&&be(Array,e,t,n,void 0,void 0,i))}function rfe(e,t,n,i,o,r){let s=ur(n.interval);c(i)&&(c(s)?s=Sn.intersect(s,i,Kb):s=i);let a=e[t],l,u;if(c(s)){a instanceof SD||(a=new SD,e[t]=a);let h=a.intervals;u=h.findInterval({start:s.start,stop:s.stop}),c(u)?l=u.data:(u=s.clone(),h.addInterval(u))}else l=a;let f;c(n.solidColor)?(l instanceof Ut||(l=new Ut),f=n.solidColor,be(G,l,"color",f.color,void 0,void 0,r)):c(n.grid)?(l instanceof ND||(l=new ND),f=n.grid,be(G,l,"color",f.color,void 0,o,r),be(Number,l,"cellAlpha",f.cellAlpha,void 0,o,r),be(z,l,"lineCount",f.lineCount,void 0,o,r),be(z,l,"lineThickness",f.lineThickness,void 0,o,r),be(z,l,"lineOffset",f.lineOffset,void 0,o,r)):c(n.image)?(l instanceof Q0||(l=new Q0),f=n.image,be(Image,l,"image",f.image,void 0,o,r),be(z,l,"repeat",f.repeat,void 0,o,r),be(G,l,"color",f.color,void 0,o,r),be(Boolean,l,"transparent",f.transparent,void 0,o,r)):c(n.stripe)?(l instanceof VD||(l=new VD),f=n.stripe,be(_m,l,"orientation",f.orientation,void 0,o,r),be(G,l,"evenColor",f.evenColor,void 0,o,r),be(G,l,"oddColor",f.oddColor,void 0,o,r),be(Number,l,"offset",f.offset,void 0,o,r),be(Number,l,"repeat",f.repeat,void 0,o,r)):c(n.polylineOutline)?(l instanceof qb||(l=new qb),f=n.polylineOutline,be(G,l,"color",f.color,void 0,o,r),be(G,l,"outlineColor",f.outlineColor,void 0,o,r),be(Number,l,"outlineWidth",f.outlineWidth,void 0,o,r)):c(n.polylineGlow)?(l instanceof kD||(l=new kD),f=n.polylineGlow,be(G,l,"color",f.color,void 0,o,r),be(Number,l,"glowPower",f.glowPower,void 0,o,r),be(Number,l,"taperPower",f.taperPower,void 0,o,r)):c(n.polylineArrow)?(l instanceof FD||(l=new FD),f=n.polylineArrow,be(G,l,"color",f.color,void 0,void 0,r)):c(n.polylineDash)?(l instanceof BD||(l=new BD),f=n.polylineDash,be(G,l,"color",f.color,void 0,void 0,r),be(G,l,"gapColor",f.gapColor,void 0,void 0,r),be(Number,l,"dashLength",f.dashLength,void 0,o,r),be(Number,l,"dashPattern",f.dashPattern,void 0,o,r)):c(n.checkerboard)&&(l instanceof TD||(l=new TD),f=n.checkerboard,be(G,l,"evenColor",f.evenColor,void 0,o,r),be(G,l,"oddColor",f.oddColor,void 0,o,r),be(z,l,"repeat",f.repeat,void 0,o,r)),c(u)?u.data=l:e[t]=l}function pu(e,t,n,i,o,r){if(c(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)rfe(e,t,n[s],i,o,r);else rfe(e,t,n,i,o,r)}function gZe(e,t,n,i){let o=t.name;c(o)&&(e.name=t.name)}function yZe(e,t,n,i){let o=t.description;c(o)&&be(String,e,"description",o,void 0,i,n)}function bZe(e,t,n,i){let o=t.position;c(o)&&pfe(e,"position",o,void 0,i,n)}function xZe(e,t,n,i){let o=t.viewFrom;c(o)&&be(d,e,"viewFrom",o,void 0,i,n)}function TZe(e,t,n,i){let o=t.orientation;c(o)&&be(Le,e,"orientation",o,void 0,i,n)}function AZe(e,t,n,i){let o=t.properties;if(c(o)){c(e.properties)||(e.properties=new bl);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let s=o[r];if(Array.isArray(s))for(let a=0,l=s.length;a<l;++a)z3(Jue(s[a]),e.properties,r,s[a],void 0,i,n);else z3(Jue(s),e.properties,r,s,void 0,i,n)}}}function H3(e,t,n,i,o,r,s){let a=n.map(function(l){return GD(o,l)});if(c(i)){i=ur(i);let l=e[t];if(!(l instanceof s)){let u=new s;u.intervals.addInterval(xq(l)),e[t]=l=u}i.data=new r(a),l.intervals.addInterval(i)}else e[t]=new r(a)}function sfe(e,t,n,i){let o=n.references;c(o)?H3(e,t,o,n.interval,i,UD,Gc):be(Array,e,t,n,void 0,void 0,i)}function afe(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)sfe(e,t,n[o],i);else sfe(e,t,n,i)}function cfe(e,t,n,i){let o=n.references;c(o)?H3(e,t,o,n.interval,i,uy,Pa):(c(n.cartesian)?n.array=d.unpackArray(n.cartesian):c(n.cartographicRadians)?n.array=d.fromRadiansArrayHeights(n.cartographicRadians,ie.default):c(n.cartographicDegrees)&&(n.array=d.fromDegreesArrayHeights(n.cartographicDegrees,ie.default)),c(n.array)&&be(Array,e,t,n,void 0,void 0,i))}function qD(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)cfe(e,t,n[o],i);else cfe(e,t,n,i)}function CZe(e){return d.unpackArray(e)}function EZe(e){return d.fromRadiansArrayHeights(e,ie.default)}function SZe(e){return d.fromDegreesArrayHeights(e,ie.default)}function lfe(e,t,n,i){let o=n.references;if(c(o)){let r=o.map(function(s){let a={};return H3(a,"positions",s,n.interval,i,uy,Pa),a.positions});e[t]=new uy(r)}else c(n.cartesian)?n.array=n.cartesian.map(CZe):c(n.cartographicRadians)?n.array=n.cartographicRadians.map(EZe):c(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(SZe)),c(n.array)&&be(Array,e,t,n,void 0,void 0,i)}function wZe(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)lfe(e,t,n[o],i);else lfe(e,t,n,i)}function vZe(e,t,n,i){if(c(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)ofe(e,t,n[o],i);else ofe(e,t,n,i)}function DZe(e,t,n,i){let o=t.availability;if(!c(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)c(r)||(r=new Xr),r.addInterval(ur(o[s]));else r=new Xr,r.addInterval(ur(o));e.availability=r}function PZe(e,t,n,i,o){c(t)&&be(gy,e,"alignedAxis",t,n,i,o)}function IZe(e,t,n,i){let o=t.billboard;if(!c(o))return;let r=ur(o.interval),s=e.billboard;c(s)||(e.billboard=s=new wc),be(Boolean,s,"show",o.show,r,i,n),be(Image,s,"image",o.image,r,i,n),be(Number,s,"scale",o.scale,r,i,n),be(z,s,"pixelOffset",o.pixelOffset,r,i,n),be(d,s,"eyeOffset",o.eyeOffset,r,i,n),be(xi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),be(Fn,s,"verticalOrigin",o.verticalOrigin,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(G,s,"color",o.color,r,i,n),be(Vd,s,"rotation",o.rotation,r,i,n),PZe(s,o.alignedAxis,r,i,n),be(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),be(Number,s,"width",o.width,r,i,n),be(Number,s,"height",o.height,r,i,n),be(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),be(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),be(Bt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),be(Ke,s,"imageSubRegion",o.imageSubRegion,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function OZe(e,t,n,i){let o=t.box;if(!c(o))return;let r=ur(o.interval),s=e.box;c(s)||(e.box=s=new KT),be(Boolean,s,"show",o.show,r,i,n),be(d,s,"dimensions",o.dimensions,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function RZe(e,t,n,i){let o=t.corridor;if(!c(o))return;let r=ur(o.interval),s=e.corridor;c(s)||(e.corridor=s=new ZT),be(Boolean,s,"show",o.show,r,i,n),qD(s,"positions",o.positions,n),be(Number,s,"width",o.width,r,i,n),be(Number,s,"height",o.height,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),be(qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),be(ki,s,"cornerType",o.cornerType,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n)}function MZe(e,t,n,i){let o=t.cylinder;if(!c(o))return;let r=ur(o.interval),s=e.cylinder;c(s)||(e.cylinder=s=new QT),be(Boolean,s,"show",o.show,r,i,n),be(Number,s,"length",o.length,r,i,n),be(Number,s,"topRadius",o.topRadius,r,i,n),be(Number,s,"bottomRadius",o.bottomRadius,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),be(Number,s,"slices",o.slices,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function LZe(e,t){let n=e.version;if(c(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new ae("Cesium only supports CZML version 1.");t._version=n}}if(!c(t._version))throw new ae("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;c(e.name)&&(i.name=e.name);let o=e.clock;if(c(o)){let r=i.clock;c(r)?(r.interval=o.interval??r.interval,r.currentTime=o.currentTime??r.currentTime,r.range=o.range??r.range,r.step=o.step??r.step,r.multiplier=o.multiplier??r.multiplier):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function NZe(e,t,n,i){let o=t.ellipse;if(!c(o))return;let r=ur(o.interval),s=e.ellipse;c(s)||(e.ellipse=s=new JT),be(Boolean,s,"show",o.show,r,i,n),be(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),be(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),be(Number,s,"height",o.height,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),be(qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),be(Vd,s,"rotation",o.rotation,r,i,n),be(Vd,s,"stRotation",o.stRotation,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n)}function FZe(e,t,n,i){let o=t.ellipsoid;if(!c(o))return;let r=ur(o.interval),s=e.ellipsoid;c(s)||(e.ellipsoid=s=new eA),be(Boolean,s,"show",o.show,r,i,n),be(d,s,"radii",o.radii,r,i,n),be(d,s,"innerRadii",o.innerRadii,r,i,n),be(Number,s,"minimumClock",o.minimumClock,r,i,n),be(Number,s,"maximumClock",o.maximumClock,r,i,n),be(Number,s,"minimumCone",o.minimumCone,r,i,n),be(Number,s,"maximumCone",o.maximumCone,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Number,s,"stackPartitions",o.stackPartitions,r,i,n),be(Number,s,"slicePartitions",o.slicePartitions,r,i,n),be(Number,s,"subdivisions",o.subdivisions,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function BZe(e,t,n,i){let o=t.label;if(!c(o))return;let r=ur(o.interval),s=e.label;c(s)||(e.label=s=new Bh),be(Boolean,s,"show",o.show,r,i,n),be(String,s,"text",o.text,r,i,n),be(String,s,"font",o.font,r,i,n),be(Ko,s,"style",o.style,r,i,n),be(Number,s,"scale",o.scale,r,i,n),be(Boolean,s,"showBackground",o.showBackground,r,i,n),be(G,s,"backgroundColor",o.backgroundColor,r,i,n),be(z,s,"backgroundPadding",o.backgroundPadding,r,i,n),be(z,s,"pixelOffset",o.pixelOffset,r,i,n),be(d,s,"eyeOffset",o.eyeOffset,r,i,n),be(xi,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),be(Fn,s,"verticalOrigin",o.verticalOrigin,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(G,s,"fillColor",o.fillColor,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),be(Bt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),be(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function kZe(e,t,n,i){let o=t.model;if(!c(o))return;let r=ur(o.interval),s=e.model;c(s)||(e.model=s=new ng),be(Boolean,s,"show",o.show,r,i,n),be(WD.default,s,"uri",o.gltf,r,i,n),be(Number,s,"scale",o.scale,r,i,n),be(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),be(Number,s,"maximumScale",o.maximumScale,r,i,n),be(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),be(Boolean,s,"runAnimations",o.runAnimations,r,i,n),be(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(G,s,"silhouetteColor",o.silhouetteColor,r,i,n),be(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),be(G,s,"color",o.color,r,i,n),be(kc,s,"colorBlendMode",o.colorBlendMode,r,i,n),be(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,l,u=o.nodeTransformations;if(c(u))if(Array.isArray(u))for(a=0,l=u.length;a<l;++a)ufe(s,u[a],r,i,n);else ufe(s,u,r,i,n);let f=o.articulations;if(c(f))if(Array.isArray(f))for(a=0,l=f.length;a<l;++a)ffe(s,f[a],r,i,n);else ffe(s,f,r,i,n)}function ufe(e,t,n,i,o){let r=ur(t.interval);c(n)&&(c(r)?r=Sn.intersect(r,n,Kb):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let l=0,u=a.length;l<u;++l){let f=a[l];if(f==="interval")continue;let h=t[f];if(!c(h))continue;c(s)||(e.nodeTransformations=s=new bl),s.hasProperty(f)||s.addProperty(f);let p=s[f];c(p)||(s[f]=p=new tA),be(d,p,"translation",h.translation,r,i,o),be(Le,p,"rotation",h.rotation,r,i,o),be(d,p,"scale",h.scale,r,i,o)}}function ffe(e,t,n,i,o){let r=ur(t.interval);c(n)&&(c(r)?r=Sn.intersect(r,n,Kb):r=n);let s=e.articulations,a=Object.keys(t);for(let l=0,u=a.length;l<u;++l){let f=a[l];if(f==="interval")continue;let h=t[f];c(h)&&(c(s)||(e.articulations=s=new bl),s.hasProperty(f)||s.addProperty(f),be(Number,s,f,h,r,i,o))}}function UZe(e,t,n,i){let o=t.path;if(!c(o))return;let r=ur(o.interval),s=e.path;c(s)||(e.path=s=new ig),be(Boolean,s,"show",o.show,r,i,n),be(Number,s,"leadTime",o.leadTime,r,i,n),be(Number,s,"trailTime",o.trailTime,r,i,n),be(Number,s,"width",o.width,r,i,n),be(Number,s,"resolution",o.resolution,r,i,n),pu(s,"material",o.material,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function VZe(e,t,n,i){let o=t.point;if(!c(o))return;let r=ur(o.interval),s=e.point;c(s)||(e.point=s=new iA),be(Boolean,s,"show",o.show,r,i,n),be(Number,s,"pixelSize",o.pixelSize,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(G,s,"color",o.color,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Bt,s,"scaleByDistance",o.scaleByDistance,r,i,n),be(Bt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function jD(e){this.polygon=e,this._definitionChanged=new pe}Object.defineProperties(jD.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!c(e)||e.isConstant)&&(!c(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});jD.prototype.getValue=function(e,t){let n;c(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return c(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),c(i)&&(i=i.map(function(o){return new ec(o)}))),c(t)?(t.positions=n,t.holes=i,t):new ec(n,i)};jD.prototype.equals=function(e){return this===e||e instanceof jD&&Y.equals(this.polygon._positions,e.polygon._positions)&&Y.equals(this.polygon._holes,e.polygon._holes)};function zZe(e,t,n,i){let o=t.polygon;if(!c(o))return;let r=ur(o.interval),s=e.polygon;c(s)||(e.polygon=s=new kh),be(Boolean,s,"show",o.show,r,i,n),qD(s,"_positions",o.positions,n),wZe(s,"_holes",o.holes,n),(c(s._positions)||c(s._holes))&&(s.hierarchy=new jD(s)),be(Number,s,"height",o.height,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),be(qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),be(Vd,s,"stRotation",o.stRotation,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),be(Boolean,s,"closeTop",o.closeTop,r,i,n),be(Boolean,s,"closeBottom",o.closeBottom,r,i,n),be(qt,s,"arcType",o.arcType,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n)}function HZe(e){return e?qt.GEODESIC:qt.NONE}function GZe(e,t,n,i){let o=t.polyline;if(!c(o))return;let r=ur(o.interval),s=e.polyline;if(c(s)||(e.polyline=s=new Oc),be(Boolean,s,"show",o.show,r,i,n),qD(s,"positions",o.positions,n),be(Number,s,"width",o.width,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),pu(s,"material",o.material,r,i,n),pu(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),be(qt,s,"arcType",o.arcType,r,i,n),be(Boolean,s,"clampToGround",o.clampToGround,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n),c(o.followSurface)&&!c(o.arcType)){let a={};be(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=sZe(a.followSurface,HZe)}}function jZe(e,t,n,i){let o=t.polylineVolume;if(!c(o))return;let r=ur(o.interval),s=e.polylineVolume;c(s)||(e.polylineVolume=s=new oA),qD(s,"positions",o.positions,n),vZe(s,"shape",o.shape,n),be(Boolean,s,"show",o.show,r,i,n),be(ki,s,"cornerType",o.cornerType,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function WZe(e,t,n,i){let o=t.rectangle;if(!c(o))return;let r=ur(o.interval),s=e.rectangle;c(s)||(e.rectangle=s=new Uh),be(Boolean,s,"show",o.show,r,i,n),be(ce,s,"coordinates",o.coordinates,r,i,n),be(Number,s,"height",o.height,r,i,n),be(qe,s,"heightReference",o.heightReference,r,i,n),be(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),be(qe,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),be(Vd,s,"rotation",o.rotation,r,i,n),be(Vd,s,"stRotation",o.stRotation,r,i,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),be(Un,s,"classificationType",o.classificationType,r,i,n),be(Number,s,"zIndex",o.zIndex,r,i,n)}function qZe(e,t,n,i){let o=t.tileset;if(!c(o))return;let r=ur(o.interval),s=e.tileset;c(s)||(e.tileset=s=new nA),be(Boolean,s,"show",o.show,r,i,n),be(WD.default,s,"uri",o.uri,r,i,n),be(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function YZe(e,t,n,i){let o=t.wall;if(!c(o))return;let r=ur(o.interval),s=e.wall;c(s)||(e.wall=s=new og),be(Boolean,s,"show",o.show,r,i,n),qD(s,"positions",o.positions,n),afe(s,"minimumHeights",o.minimumHeights,n),afe(s,"maximumHeights",o.maximumHeights,n),be(Number,s,"granularity",o.granularity,r,i,n),be(Boolean,s,"fill",o.fill,r,i,n),pu(s,"material",o.material,r,i,n),be(Boolean,s,"outline",o.outline,r,i,n),be(G,s,"outlineColor",o.outlineColor,r,i,n),be(Number,s,"outlineWidth",o.outlineWidth,r,i,n),be(Tn,s,"shadows",o.shadows,r,i,n),be(Lt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function dfe(e,t,n,i,o){let r=e.id;if(c(r)||(r=jn()),yq=r,!c(o._version)&&r!=="document")throw new ae("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")LZe(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;c(a)&&(s.parent=t.getOrCreateEntity(a));for(let l=n.length-1;l>-1;l--)n[l](s,e,t,i)}yq=void 0}function XZe(e){let t,n=e._documentPacket.clock;if(!c(n)){if(!c(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(Ge.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=Q.secondsDifference(s,r),l=Math.round(a/120);return t=new pm,t.startTime=Q.clone(r),t.stopTime=Q.clone(s),t.clockRange=$r.LOOP_STOP,t.multiplier=l,t.currentTime=Q.clone(r),t.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}c(e._clock)?t=e._clock.clone():(t=new pm,t.startTime=Ge.MINIMUM_VALUE.clone(),t.stopTime=Ge.MAXIMUM_VALUE.clone(),t.currentTime=Ge.MINIMUM_VALUE.clone(),t.clockRange=$r.LOOP_STOP,t.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=ur(n.interval);return c(i)&&(t.startTime=i.start,t.stopTime=i.stop),c(n.currentTime)&&(t.currentTime=Q.fromIso8601(n.currentTime)),c(n.range)&&(t.clockRange=$r[n.range]??$r.LOOP_STOP),c(n.step)&&(t.clockStep=_o[n.step]??_o.SYSTEM_CLOCK_MULTIPLIER),c(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function _fe(e,t,n,i){if(!c(t))throw new C("czml is required.");n=n??W.EMPTY_OBJECT;let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new At(s)),e._credit=s,typeof t=="string"||t instanceof we){t=we.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let a=e._resourceCredits,l=t.credits;if(c(l)){let u=l.length;for(let f=0;f<u;f++)a.push(l[f])}}return r=we.createIfNeeded(r),Kr.setLoading(e,!0),Promise.resolve(o).then(function(a){return KZe(e,a,r,i)}).catch(function(a){return Kr.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function KZe(e,t,n,i){Kr.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new gfe,o.removeAll()),cs._processCzml(t,o,n,void 0,e);let r=XZe(e),s=e._documentPacket;return c(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!c(e._name)&&c(n)&&(e._name=ly(n.getUrlComponent()),r=!0),Kr.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function gfe(){this.name=void 0,this.clock=void 0}function cs(e){this._name=e,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._clock=void 0,this._documentPacket=new gfe,this._version=void 0,this._entityCollection=new la(this),this._entityCluster=new Lf,this._credit=void 0,this._resourceCredits=[]}cs.load=function(e,t){return new cs().load(e,t)};Object.defineProperties(cs.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!c(e))throw new C("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}}});cs.updaters=[IZe,OZe,RZe,MZe,NZe,FZe,BZe,kZe,gZe,yZe,UZe,VZe,zZe,GZe,jZe,AZe,WZe,bZe,qZe,xZe,YZe,TZe,DZe];cs.registerUpdater=function(e){cs.updaters.includes(e)||cs.updaters.push(e)};cs.unregisterUpdater=function(e){if(cs.updaters.includes(e)){let t=cs.updaters.indexOf(e);cs.updaters.splice(t,1)}};cs.prototype.process=function(e,t){return _fe(this,e,t,!1)};cs.prototype.load=function(e,t){return _fe(this,e,t,!0)};cs.prototype.update=function(e){return!0};cs.processPacketData=be;cs.processPositionPacketData=pfe;cs.processMaterialPacketData=pu;cs._processCzml=function(e,t,n,i,o){if(i=i??cs.updaters,Array.isArray(e))for(let r=0,s=e.length;r<s;++r)dfe(e[r],t,i,n,o);else dfe(e,t,i,n,o)};var G3=cs;function Yc(){this._dataSources=[],this._dataSourceAdded=new pe,this._dataSourceRemoved=new pe,this._dataSourceMoved=new pe}Object.defineProperties(Yc.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});Yc.prototype.add=function(e){if(!c(e))throw new C("dataSource is required.");let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};Yc.prototype.remove=function(e,t){t=t??!1;let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};Yc.prototype.removeAll=function(e){e=e??!1;let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let o=t[n];this._dataSourceRemoved.raiseEvent(this,o),e&&typeof o.destroy=="function"&&o.destroy()}this._dataSources=[]};Yc.prototype.contains=function(e){return this.indexOf(e)!==-1};Yc.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Yc.prototype.get=function(e){if(!c(e))throw new C("index is required.");return this._dataSources[e]};Yc.prototype.getByName=function(e){if(!c(e))throw new C("name is required.");return this._dataSources.filter(function(t){return t.name===e})};function j3(e,t){if(!c(t))throw new C("dataSource is required.");let n=e.indexOf(t);if(n===-1)throw new C("dataSource is not in this collection.");return n}function yfe(e,t,n){let i=e._dataSources,o=i.length-1;if(t=O.clamp(t,0,o),n=O.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}Yc.prototype.raise=function(e){let t=j3(this._dataSources,e);yfe(this,t,t+1)};Yc.prototype.lower=function(e){let t=j3(this._dataSources,e);yfe(this,t,t-1)};Yc.prototype.raiseToTop=function(e){let t=j3(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};Yc.prototype.lowerToBottom=function(e){let t=j3(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Yc.prototype.isDestroyed=function(){return!1};Yc.prototype.destroy=function(){return this.removeAll(!0),de(this)};var W3=Yc;function fa(e){e=e??W.EMPTY_OBJECT,this._primitives=[],this._guid=jn(),this._primitiveAdded=new pe,this._primitiveRemoved=new pe,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0}Object.defineProperties(fa.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});fa.prototype.add=function(e,t){let n=c(t);if(!c(e))throw new C("primitive is required.");if(n){if(t<0)throw new C("index must be greater than or equal to zero.");if(t>this._primitives.length)throw new C("index must be less than or equal to the number of primitives.")}let i=e._external=e._external||{},o=i._composites=i._composites||{};return o[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._primitiveAdded.raiseEvent(e),e};fa.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this.destroyPrimitives&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};fa.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};fa.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n)delete e[n]._external._composites[this._guid],this.destroyPrimitives&&e[n].destroy(),this._primitiveRemoved.raiseEvent(e[n]);this._primitives=[]};fa.prototype.contains=function(e){return!!(c(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function q3(e,t){if(!e.contains(t))throw new C("primitive is not in this collection.");return e._primitives.indexOf(t)}fa.prototype.raise=function(e){if(c(e)){let t=q3(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};fa.prototype.raiseToTop=function(e){if(c(e)){let t=q3(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};fa.prototype.lower=function(e){if(c(e)){let t=q3(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};fa.prototype.lowerToBottom=function(e){if(c(e)){let t=q3(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};fa.prototype.get=function(e){if(!c(e))throw new C("index is required.");return this._primitives[e]};fa.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};fa.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];c(i.prePassesUpdate)&&i.prePassesUpdate(e)}};fa.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];c(o.updateForPass)&&o.updateForPass(e,t)}};fa.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];c(i.postPassesUpdate)&&i.postPassesUpdate(e)}};fa.prototype.isDestroyed=function(){return!1};fa.prototype.destroy=function(){return this.removeAll(),de(this)};var Ol=fa;function gm(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(gm.prototype,{length:{get:function(){return this._length}}});gm.prototype.add=function(e,t){T.defined("primitive",e),c(t)&&T.typeOf.number("zIndex",t),t=t??0;let n=this._collections[t];if(!c(n)){n=new Ol({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,o=0;for(;o<i.length&&i[o]._zIndex<t;)o++;i.splice(o,0,n)}return n.add(e),this._length++,e._zIndex=t,e};gm.prototype.set=function(e,t){return T.defined("primitive",e),T.typeOf.number("zIndex",t),t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};gm.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],o;return t?o=i.remove(e):o=i.removeAndDestroy(e),o&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),o}return!1};gm.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};gm.prototype.contains=function(e){if(!c(e))return!1;let t=this._collections[e._zIndex];return c(t)&&t.contains(e)};gm.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};gm.prototype.isDestroyed=function(){return!1};gm.prototype.destroy=function(){return this.removeAll(),de(this)};var Y3=gm;function kC(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Et}kC.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};kC.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);c(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};kC.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};kC.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};kC.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),c(e)&&c(e.getBoundingSphere)?e.getBoundingSphere(t):lt.FAILED};var UC=kC;var Aq={},X3=new d,bfe=new d,xfe=new Le,Tfe=new J;function VC(e,t,n,i,o,r,s,a,l,u){let f=e+t;d.multiplyByScalar(i,Math.cos(f),X3),d.multiplyByScalar(n,Math.sin(f),bfe),d.add(X3,bfe,X3);let h=Math.cos(e);h=h*h;let p=Math.sin(e);p=p*p;let m=r/Math.sqrt(s*h+o*p)/a;return Le.fromAxisAngle(X3,m,xfe),J.fromQuaternion(xfe,Tfe),J.multiplyByVector(Tfe,l,u),d.normalize(u,u),d.multiplyByScalar(u,a,u),u}var Afe=new d,Cfe=new d,Tq=new d,$Ze=new d;Aq.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),l=e.length,u=n?l:0;for(let f=0;f<l;f+=3){let h=f+1,p=f+2,g=d.fromArray(e,f,Afe);i.scaleToGeodeticSurface(g,g);let m=d.clone(g,Cfe),y=i.geodeticSurfaceNormal(g,$Ze),b=d.multiplyByScalar(y,o,Tq);d.add(g,b,g),n&&(d.multiplyByScalar(y,r,b),d.add(m,b,m),a[f+u]=m.x,a[h+u]=m.y,a[p+u]=m.z),a[f]=g.x,a[h]=g.y,a[p]=g.z}return a};var ZZe=new d,QZe=new d,JZe=new d;Aq.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,l=i*i,u=o*o,f=o*i,h=d.magnitude(s),p=d.normalize(s,ZZe),g=d.cross(d.UNIT_Z,s,QZe);g=d.normalize(g,g);let m=d.cross(p,g,JZe),y=1+Math.ceil(O.PI_OVER_TWO/a),b=O.PI_OVER_TWO/(y-1),x=O.PI_OVER_TWO-y*b;x<0&&(y-=Math.ceil(Math.abs(x)/b));let A=2*(y*(y+2)),E=t?new Array(A*3):void 0,S=0,v=Afe,P=Cfe,M=y*4*3,R=M-1,L=0,B=n?new Array(M):void 0,_,w,D,I,N;for(x=O.PI_OVER_TWO,v=VC(x,r,m,g,l,f,u,h,p,v),t&&(E[S++]=v.x,E[S++]=v.y,E[S++]=v.z),n&&(B[R--]=v.z,B[R--]=v.y,B[R--]=v.x),x=O.PI_OVER_TWO-b,_=1;_<y+1;++_){if(v=VC(x,r,m,g,l,f,u,h,p,v),P=VC(Math.PI-x,r,m,g,l,f,u,h,p,P),t){for(E[S++]=v.x,E[S++]=v.y,E[S++]=v.z,D=2*_+2,w=1;w<D-1;++w)I=w/(D-1),N=d.lerp(v,P,I,Tq),E[S++]=N.x,E[S++]=N.y,E[S++]=N.z;E[S++]=P.x,E[S++]=P.y,E[S++]=P.z}n&&(B[R--]=v.z,B[R--]=v.y,B[R--]=v.x,B[L++]=P.x,B[L++]=P.y,B[L++]=P.z),x=O.PI_OVER_TWO-(_+1)*b}for(_=y;_>1;--_){if(x=O.PI_OVER_TWO-(_-1)*b,v=VC(-x,r,m,g,l,f,u,h,p,v),P=VC(x+Math.PI,r,m,g,l,f,u,h,p,P),t){for(E[S++]=v.x,E[S++]=v.y,E[S++]=v.z,D=2*(_-1)+2,w=1;w<D-1;++w)I=w/(D-1),N=d.lerp(v,P,I,Tq),E[S++]=N.x,E[S++]=N.y,E[S++]=N.z;E[S++]=P.x,E[S++]=P.y,E[S++]=P.z}n&&(B[R--]=v.z,B[R--]=v.y,B[R--]=v.x,B[L++]=P.x,B[L++]=P.y,B[L++]=P.z)}x=O.PI_OVER_TWO,v=VC(-x,r,m,g,l,f,u,h,p,v);let k={};return t&&(E[S++]=v.x,E[S++]=v.y,E[S++]=v.z,k.positions=E,k.numPts=y),n&&(B[R--]=v.z,B[R--]=v.y,B[R--]=v.x,k.outerPositions=B),k};var _u=Aq;var zC=new d,Cq=new d,Eq=new d,Efe=new d,Cs=new z,Sfe=new J,eQe=new J,Sq=new Le,wfe=new d,vfe=new d,Dfe=new d,Z3=new he,Pfe=new d,Ife=new z,Ofe=new z;function Rfe(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,l=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,h=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,y=f?new Float32Array(u*3):void 0,b=0,x=wfe,A=vfe,E=Dfe,S=new Oi(a),v=S.project(a.cartesianToCartographic(o,Z3),Pfe),P=a.scaleToGeodeticSurface(o,zC);a.geodeticSurfaceNormal(P,P);let M=Sfe,R=eQe;if(l!==0){let N=Le.fromAxisAngle(P,l,Sq);M=J.fromQuaternion(N,M),N=Le.fromAxisAngle(P,-l,Sq),R=J.fromQuaternion(N,R)}else M=J.clone(J.IDENTITY,M),R=J.clone(J.IDENTITY,R);let L=z.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ife),B=z.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Ofe),_=e.length,w=n?_:0,D=w/3*2;for(let N=0;N<_;N+=3){let k=N+1,H=N+2,V=d.fromArray(e,N,zC);if(i.st){let j=J.multiplyByVector(M,V,Cq),U=S.project(a.cartesianToCartographic(j,Z3),Eq);d.subtract(U,v,U),Cs.x=(U.x+r)/(2*r),Cs.y=(U.y+s)/(2*s),L.x=Math.min(Cs.x,L.x),L.y=Math.min(Cs.y,L.y),B.x=Math.max(Cs.x,B.x),B.y=Math.max(Cs.y,B.y),n&&(h[b+D]=Cs.x,h[b+1+D]=Cs.y),h[b++]=Cs.x,h[b++]=Cs.y}(i.normal||i.tangent||i.bitangent||f)&&(x=a.geodeticSurfaceNormal(V,x),f&&(y[N+w]=-x.x,y[k+w]=-x.y,y[H+w]=-x.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(A=d.normalize(d.cross(d.UNIT_Z,x,A),A),J.multiplyByVector(R,A,A)),i.normal&&(p[N]=x.x,p[k]=x.y,p[H]=x.z,n&&(p[N+w]=-x.x,p[k+w]=-x.y,p[H+w]=-x.z)),i.tangent&&(g[N]=A.x,g[k]=A.y,g[H]=A.z,n&&(g[N+w]=-A.x,g[k+w]=-A.y,g[H+w]=-A.z)),i.bitangent&&(E=d.normalize(d.cross(x,A,E),E),m[N]=E.x,m[k]=E.y,m[H]=E.z,n&&(m[N+w]=E.x,m[k+w]=E.y,m[H+w]=E.z))))}if(i.st){_=h.length;for(let N=0;N<_;N+=2)h[N]=(h[N]-L.x)/(B.x-L.x),h[N+1]=(h[N+1]-L.y)/(B.y-L.y)}let I=new hn;if(i.position){let N=_u.raisePositionsToHeight(e,t,n);I.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:N})}if(i.st&&(I.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:h})),i.normal&&(I.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(I.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(I.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m})),f&&(I.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:y})),n&&c(t.offsetAttribute)){let N=new Uint8Array(u);if(t.offsetAttribute===Zt.TOP)N=N.fill(1,0,u/2);else{let k=t.offsetAttribute===Zt.NONE?0:1;N=N.fill(k)}I.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return I}function Mfe(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,s,a;for(i=0,r=1,s=0;s<3;s++)t[n++]=r++,t[n++]=i,t[n++]=r;for(s=2;s<e+1;++s){for(r=s*(s+1)-1,i=(s-1)*s-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=r++,t[n++]=i,t[n++]=r}for(o=e*2,++r,++i,s=0;s<o-1;++s)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;for(t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=i++,t[n++]=i++,t[n++]=r++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var $b=new d;function tQe(e){let t=e.center;$b=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,$b),e.height,$b),$b=d.add(t,$b,$b);let n=new le($b,e.semiMajorAxis),i=_u.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=Rfe(o,e,!1),a=Mfe(r);return a=Fe.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function nQe(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,l=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,h=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,y=n.bitangent?new Float32Array(f*3):void 0,b=t.shadowVolume,x=b?new Float32Array(f*3):void 0,A=0,E=wfe,S=vfe,v=Dfe,P=new Oi(s),M=P.project(s.cartesianToCartographic(i,Z3),Pfe),R=s.scaleToGeodeticSurface(i,zC);s.geodeticSurfaceNormal(R,R);let L=Le.fromAxisAngle(R,u,Sq),B=J.fromQuaternion(L,Sfe),_=z.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Ife),w=z.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Ofe),D=e.length,I=D/3*2;for(let k=0;k<D;k+=3){let H=k+1,V=k+2,j=d.fromArray(e,k,zC),U;if(n.st){let X=J.multiplyByVector(B,j,Cq),te=P.project(s.cartesianToCartographic(X,Z3),Eq);d.subtract(te,M,te),Cs.x=(te.x+o)/(2*o),Cs.y=(te.y+r)/(2*r),_.x=Math.min(Cs.x,_.x),_.y=Math.min(Cs.y,_.y),w.x=Math.max(Cs.x,w.x),w.y=Math.max(Cs.y,w.y),p[A+I]=Cs.x,p[A+1+I]=Cs.y,p[A++]=Cs.x,p[A++]=Cs.y}j=s.scaleToGeodeticSurface(j,j),U=d.clone(j,Cq),E=s.geodeticSurfaceNormal(j,E),b&&(x[k+D]=-E.x,x[H+D]=-E.y,x[V+D]=-E.z);let q=d.multiplyByScalar(E,a,Efe);if(j=d.add(j,q,j),q=d.multiplyByScalar(E,l,q),U=d.add(U,q,U),n.position&&(h[k+D]=U.x,h[H+D]=U.y,h[V+D]=U.z,h[k]=j.x,h[H]=j.y,h[V]=j.z),n.normal||n.tangent||n.bitangent){v=d.clone(E,v);let X=d.fromArray(e,(k+3)%D,Efe);d.subtract(X,j,X);let te=d.subtract(U,j,Eq);E=d.normalize(d.cross(te,X,E),E),n.normal&&(g[k]=E.x,g[H]=E.y,g[V]=E.z,g[k+D]=E.x,g[H+D]=E.y,g[V+D]=E.z),n.tangent&&(S=d.normalize(d.cross(v,E,S),S),m[k]=S.x,m[H]=S.y,m[V]=S.z,m[k+D]=S.x,m[k+1+D]=S.y,m[k+2+D]=S.z),n.bitangent&&(y[k]=v.x,y[H]=v.y,y[V]=v.z,y[k+D]=v.x,y[H+D]=v.y,y[V+D]=v.z)}}if(n.st){D=p.length;for(let k=0;k<D;k+=2)p[k]=(p[k]-_.x)/(w.x-_.x),p[k+1]=(p[k+1]-_.y)/(w.y-_.y)}let N=new hn;if(n.position&&(N.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:h})),n.st&&(N.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(N.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(N.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(N.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:y})),b&&(N.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:x})),c(t.offsetAttribute)){let k=new Uint8Array(f);if(t.offsetAttribute===Zt.TOP)k=k.fill(1,0,f/2);else{let H=t.offsetAttribute===Zt.NONE?0:1;k=k.fill(H)}N.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:k})}return N}function iQe(e){let t=e.length/3,n=Fe.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,l=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=l}return n}var K3=new le,$3=new le;function oQe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,zC),e.height,zC);K3.center=d.add(t,o,K3.center),K3.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),$3.center=d.add(t,o,$3.center),$3.radius=i;let r=_u.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,l=r.outerPositions,u=le.union(K3,$3),f=Rfe(s,e,!0),h=Mfe(a),p=h.length;h.length=p*2;let g=s.length/3;for(let S=0;S<p;S+=3)h[S+p]=h[S+2]+g,h[S+1+p]=h[S+1]+g,h[S+2+p]=h[S]+g;let m=Fe.createTypedArray(g*2/3,h),y=new ct({attributes:f,indices:m,primitiveType:Me.TRIANGLES}),b=nQe(l,e);h=iQe(l);let x=Fe.createTypedArray(l.length*2/3,h),A=new ct({attributes:b,indices:x,primitiveType:Me.TRIANGLES}),E=Nn.combineInstances([new St({geometry:y}),new St({geometry:A})]);return{boundingSphere:u,attributes:E[0].attributes,indices:E[0].indices}}function Lfe(e,t,n,i,o,r,s){let l=_u.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,u=l.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=d.fromArray(l,p*3);let h=ce.fromCartesianArray(f,r,s);return h.width>O.PI&&(h.north=h.north>0?O.PI_OVER_TWO-O.EPSILON7:h.north,h.south=h.south<0?O.EPSILON7-O.PI_OVER_TWO:h.south,h.east=O.PI,h.west=-O.PI),h}function bm(e){e=e??W.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ie.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??O.RADIANS_PER_DEGREE,s=e.vertexFormat??Ie.DEFAULT;if(T.defined("options.center",t),T.typeOf.number("options.semiMajorAxis",i),T.typeOf.number("options.semiMinorAxis",o),i<o)throw new C("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new C("granularity must be greater than zero.");let a=e.height??0,l=e.extrudedHeight??a;this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ie.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(l,a),this._granularity=r,this._vertexFormat=Ie.clone(s),this._extrudedHeight=Math.min(l,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}bm.packedLength=d.packedLength+ie.packedLength+Ie.packedLength+9;bm.pack=function(e,t,n){return T.defined("value",e),T.defined("array",t),n=n??0,d.pack(e._center,t,n),n+=d.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var Nfe=new d,Ffe=new ie,Bfe=new Ie,ym={center:Nfe,ellipsoid:Ffe,vertexFormat:Bfe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};bm.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=d.unpack(e,t,Nfe);t+=d.packedLength;let o=ie.unpack(e,t,Ffe);t+=ie.packedLength;let r=Ie.unpack(e,t,Bfe);t+=Ie.packedLength;let s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t++],g=e[t++]===1,m=e[t];return c(n)?(n._center=d.clone(i,n._center),n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=l,n._stRotation=u,n._height=f,n._granularity=h,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=m===-1?void 0:m,n):(ym.height=f,ym.extrudedHeight=p,ym.granularity=h,ym.stRotation=u,ym.rotation=l,ym.semiMajorAxis=s,ym.semiMinorAxis=a,ym.shadowVolume=g,ym.offsetAttribute=m===-1?void 0:m,new bm(ym))};bm.computeRectangle=function(e,t){e=e??W.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??ie.default,o=e.semiMajorAxis,r=e.semiMinorAxis,s=e.granularity??O.RADIANS_PER_DEGREE,a=e.rotation??0;if(T.defined("options.center",n),T.typeOf.number("options.semiMajorAxis",o),T.typeOf.number("options.semiMinorAxis",r),o<r)throw new C("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(s<=0)throw new C("granularity must be greater than zero.");return Lfe(n,o,r,a,s,i,t)};bm.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!O.equalsEpsilon(t,n,0,O.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=oQe(o);else if(r=tQe(o),c(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===Zt.NONE?0:1,l=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:l})}return new ct({attributes:r.attributes,indices:r.indices,primitiveType:Me.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};bm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new bm({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};function rQe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=_u.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let l=0;l<o;++l)r[l]=d.fromArray(i,l*3);let s=e._ellipsoid,a=e.rectangle;return ct._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(bm.prototype,{rectangle:{get:function(){return c(this._rectangle)||(this._rectangle=Lfe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return c(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=rQe(this)),this._textureCoordinateRotationPoints}}});var Rl=bm;var kfe=new d,Zb=new d;function sQe(e){let t=e.center;Zb=d.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Zb),e.height,Zb),Zb=d.add(t,Zb,Zb);let n=new le(Zb,e.semiMajorAxis),i=_u.computeEllipsePositions(e,!1,!0).outerPositions,o=new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:_u.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Fe.createTypedArray(r,r*2),a=0;for(let l=0;l<r;++l)s[a++]=l,s[a++]=(l+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var Q3=new le,J3=new le;function aQe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,kfe),e.height,kfe);Q3.center=d.add(t,o,Q3.center),Q3.radius=i,o=d.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),J3.center=d.add(t,o,J3.center),J3.radius=i;let r=_u.computeEllipsePositions(e,!1,!0).outerPositions,s=new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:_u.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=le.union(Q3,J3),l=r.length/3;if(c(e.offsetAttribute)){let m=new Uint8Array(l);if(e.offsetAttribute===Zt.TOP)m=m.fill(1,0,l/2);else{let y=e.offsetAttribute===Zt.NONE?0:1;m=m.fill(y)}s.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=e.numberOfVerticalLines??16;u=O.clamp(u,0,l/2);let f=Fe.createTypedArray(l,l*2+u*2);l/=2;let h=0,p;for(p=0;p<l;++p)f[h++]=p,f[h++]=(p+1)%l,f[h++]=p+l,f[h++]=(p+1)%l+l;let g;if(u>0){let m=Math.min(u,l);g=Math.round(l/m);let y=Math.min(g*u,l);for(p=0;p<y;p+=g)f[h++]=p,f[h++]=p+l}return{boundingSphere:a,attributes:s,indices:f}}function HC(e){e=e??W.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ie.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??O.RADIANS_PER_DEGREE;if(!c(t))throw new C("center is required.");if(!c(i))throw new C("semiMajorAxis is required.");if(!c(o))throw new C("semiMinorAxis is required.");if(i<o)throw new C("semiMajorAxis must be greater than or equal to the semiMinorAxis.");if(r<=0)throw new C("granularity must be greater than zero.");let s=e.height??0,a=e.extrudedHeight??s;this._center=d.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ie.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}HC.packedLength=d.packedLength+ie.packedLength+8;HC.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,d.pack(e._center,t,n),n+=d.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var Ufe=new d,Vfe=new ie,a_={center:Ufe,ellipsoid:Vfe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};HC.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i=d.unpack(e,t,Ufe);t+=d.packedLength;let o=ie.unpack(e,t,Vfe);t+=ie.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return c(n)?(n._center=d.clone(i,n._center),n._ellipsoid=ie.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=l,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=h,n._offsetAttribute=p===-1?void 0:p,n):(a_.height=l,a_.extrudedHeight=f,a_.granularity=u,a_.rotation=a,a_.semiMajorAxis=r,a_.semiMinorAxis=s,a_.numberOfVerticalLines=h,a_.offsetAttribute=p===-1?void 0:p,new HC(a_))};HC.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!O.equalsEpsilon(t,n,0,O.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(i)o.extrudedHeight=n,o.offsetAttribute=e._offsetAttribute,r=aQe(o);else if(r=sQe(o),c(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===Zt.NONE?0:1,l=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:l})}return new ct({attributes:r.attributes,indices:r.indices,primitiveType:Me.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var kf=HC;var zfe=new G,Hfe=d.ZERO,Gfe=new d,jfe=new ce;function cQe(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function zd(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new cQe(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}c(Object.create)&&(zd.prototype=Object.create(Gn.prototype),zd.prototype.constructor=zd);zd.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,zfe)),c(o)||(o=G.WHITE),i.color=jt.fromColor(o)}return c(this._options.offsetAttribute)&&(i.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Hfe,Gfe))),new St({id:t,geometry:new Rl(this._options),attributes:i})};zd.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,zfe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Hfe,Gfe))),new St({id:t,geometry:new kf(this._options),attributes:r})};zd.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};zd.prototype._isHidden=function(e,t){let n=e.position;return!c(n)||!c(t.semiMajorAxis)||!c(t.semiMinorAxis)||oi.prototype._isHidden.call(this,e,t)};zd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!Y.isConstant(t.rotation)||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.stRotation)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.numberOfVerticalLines)||!Y.isConstant(t.zIndex)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};zd.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),i=Y.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),o=Y.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),r=Y.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE);c(o)&&!c(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(Ge.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(Ge.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(Ge.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=Y.getValueOrUndefined(t.rotation,Ge.MINIMUM_VALUE),s.granularity=Y.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),s.stRotation=Y.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),s.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,Ge.MINIMUM_VALUE),s.offsetAttribute=Gn.computeGeometryOffsetAttribute(n,i,o,r),s.height=Gn.getGeometryHeight(n,i),o=Gn.getGeometryExtrudedHeight(o,r),o===Gn.CLAMP_TO_GROUND&&(o=fi.getMinimumMaximumHeights(Rl.computeRectangle(s,jfe)).minimumTerrainHeight),s.extrudedHeight=o};zd.DynamicGeometryUpdater=GC;function GC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(GC.prototype=Object.create(ii.prototype),GC.prototype.constructor=GC);GC.prototype._isHidden=function(e,t,n){let i=this._options;return!c(i.center)||!c(i.semiMajorAxis)||!c(i.semiMinorAxis)||ii.prototype._isHidden.call(this,e,t,n)};GC.prototype._setOptions=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,qe.NONE),s=Y.getValueOrUndefined(t.extrudedHeight,n),a=Y.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE);c(s)&&!c(o)&&(o=0),i.center=Y.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=Y.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=Y.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=Y.getValueOrUndefined(t.rotation,n),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.stRotation=Y.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=Y.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=fi.getMinimumMaximumHeights(Rl.computeRectangle(i,jfe)).minimumTerrainHeight),i.extrudedHeight=s};var ek=zd;var lQe=new d,uQe=new d,fQe=new d,dQe=new d,hQe=new d,mQe=new d(1,1,1),Wfe=Math.cos,qfe=Math.sin;function c_(e){e=e??W.EMPTY_OBJECT;let t=e.radii??mQe,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??O.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??O.PI,a=Math.round(e.stackPartitions??64),l=Math.round(e.slicePartitions??64),u=e.vertexFormat??Ie.DEFAULT;if(l<3)throw new C("options.slicePartitions cannot be less than three.");if(a<3)throw new C("options.stackPartitions cannot be less than three.");this._radii=d.clone(t),this._innerRadii=d.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=l,this._vertexFormat=Ie.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}c_.packedLength=2*d.packedLength+Ie.packedLength+7;c_.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");return n=n??0,d.pack(e._radii,t,n),n+=d.packedLength,d.pack(e._innerRadii,t,n),n+=d.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=e._offsetAttribute??-1,t};var Yfe=new d,Xfe=new d,Kfe=new Ie,yy={radii:Yfe,innerRadii:Xfe,vertexFormat:Kfe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};c_.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i=d.unpack(e,t,Yfe);t+=d.packedLength;let o=d.unpack(e,t,Xfe);t+=d.packedLength;let r=Ie.unpack(e,t,Kfe);t+=Ie.packedLength;let s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++],p=e[t];return c(n)?(n._radii=d.clone(i,n._radii),n._innerRadii=d.clone(o,n._innerRadii),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=l,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=h,n._offsetAttribute=p===-1?void 0:p,n):(yy.minimumClock=s,yy.maximumClock=a,yy.minimumCone=l,yy.maximumCone=u,yy.stackPartitions=f,yy.slicePartitions=h,yy.offsetAttribute=p===-1?void 0:p,new c_(yy))};c_.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,l=e._slicePartitions+1,u=e._stackPartitions+1;l=Math.round(l*Math.abs(o-i)/O.TWO_PI),u=Math.round(u*Math.abs(s-r)/O.PI),l<2&&(l=2),u<2&&(u=2);let f,h,p=0,g=[r],m=[i];for(f=0;f<u;f++)g.push(r+f*(s-r)/(u-1));for(g.push(s),h=0;h<l;h++)m.push(i+h*(o-i)/(l-1));m.push(o);let y=g.length,b=m.length,x=0,A=1,E=n.x!==t.x||n.y!==t.y||n.z!==t.z,S=!1,v=!1,P=!1;E&&(A=2,r>0&&(S=!0,x+=l-1),s<Math.PI&&(v=!0,x+=l-1),(o-i)%O.TWO_PI?(P=!0,x+=(u-1)*2+1):x+=1);let M=b*y*A,R=new Float64Array(M*3),L=new Array(M).fill(!1),B=new Array(M).fill(!1),_=l*u*A,w=6*(_+x+1-(l+u)*A),D=Fe.createTypedArray(_,w),I=a.normal?new Float32Array(M*3):void 0,N=a.tangent?new Float32Array(M*3):void 0,k=a.bitangent?new Float32Array(M*3):void 0,H=a.st?new Float32Array(M*2):void 0,V=new Array(y),j=new Array(y);for(f=0;f<y;f++)V[f]=qfe(g[f]),j[f]=Wfe(g[f]);let U=new Array(b),q=new Array(b);for(h=0;h<b;h++)q[h]=Wfe(m[h]),U[h]=qfe(m[h]);for(f=0;f<y;f++)for(h=0;h<b;h++)R[p++]=t.x*V[f]*q[h],R[p++]=t.y*V[f]*U[h],R[p++]=t.z*j[f];let X=M/2;if(E)for(f=0;f<y;f++)for(h=0;h<b;h++)R[p++]=n.x*V[f]*q[h],R[p++]=n.y*V[f]*U[h],R[p++]=n.z*j[f],L[X]=!0,f>0&&f!==y-1&&h!==0&&h!==b-1&&(B[X]=!0),X++;p=0;let te,K;for(f=1;f<y-2;f++)for(te=f*b,K=(f+1)*b,h=1;h<b-2;h++)D[p++]=K+h,D[p++]=K+h+1,D[p++]=te+h+1,D[p++]=K+h,D[p++]=te+h+1,D[p++]=te+h;if(E){let it=y*b;for(f=1;f<y-2;f++)for(te=it+f*b,K=it+(f+1)*b,h=1;h<b-2;h++)D[p++]=K+h,D[p++]=te+h,D[p++]=te+h+1,D[p++]=K+h,D[p++]=te+h+1,D[p++]=K+h+1}let Z,ee;if(E){if(S)for(ee=y*b,f=1;f<b-2;f++)D[p++]=f,D[p++]=f+1,D[p++]=ee+f+1,D[p++]=f,D[p++]=ee+f+1,D[p++]=ee+f;if(v)for(Z=y*b-b,ee=y*b*A-b,f=1;f<b-2;f++)D[p++]=Z+f+1,D[p++]=Z+f,D[p++]=ee+f,D[p++]=Z+f+1,D[p++]=ee+f,D[p++]=ee+f+1}if(P){for(f=1;f<y-2;f++)ee=b*y+b*f,Z=b*f,D[p++]=ee,D[p++]=Z+b,D[p++]=Z,D[p++]=ee,D[p++]=ee+b,D[p++]=Z+b;for(f=1;f<y-2;f++)ee=b*y+b*(f+1)-1,Z=b*(f+1)-1,D[p++]=Z+b,D[p++]=ee,D[p++]=Z,D[p++]=Z+b,D[p++]=ee+b,D[p++]=ee}let me=new hn;a.position&&(me.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:R}));let xe=0,ue=0,ye=0,Ae=0,Pe=M/2,Ee,Ve=ie.fromCartesian3(t),je=ie.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<M;f++){Ee=L[f]?je:Ve;let it=d.fromArray(R,f*3,lQe),Dt=Ee.geodeticSurfaceNormal(it,uQe);if(B[f]&&d.negate(Dt,Dt),a.st){let Gt=z.negate(Dt,hQe);H[xe++]=Math.atan2(Gt.y,Gt.x)/O.TWO_PI+.5,H[xe++]=Math.asin(Dt.z)/Math.PI+.5}if(a.normal&&(I[ue++]=Dt.x,I[ue++]=Dt.y,I[ue++]=Dt.z),a.tangent||a.bitangent){let Gt=fQe,$e=0,ln;if(L[f]&&($e=Pe),!S&&f>=$e&&f<$e+b*2?ln=d.UNIT_X:ln=d.UNIT_Z,d.cross(ln,Dt,Gt),d.normalize(Gt,Gt),a.tangent&&(N[ye++]=Gt.x,N[ye++]=Gt.y,N[ye++]=Gt.z),a.bitangent){let Vt=d.cross(Dt,Gt,dQe);d.normalize(Vt,Vt),k[Ae++]=Vt.x,k[Ae++]=Vt.y,k[Ae++]=Vt.z}}}a.st&&(me.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:H})),a.normal&&(me.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:I})),a.tangent&&(me.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:N})),a.bitangent&&(me.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:k}))}if(c(e._offsetAttribute)){let it=R.length,Dt=e._offsetAttribute===Zt.NONE?0:1,Gt=new Uint8Array(it/3).fill(Dt);me.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:Gt})}return new ct({attributes:me,indices:D,primitiveType:Me.TRIANGLES,boundingSphere:le.fromEllipsoid(Ve),offsetAttribute:e._offsetAttribute})};var wq;c_.getUnitEllipsoid=function(){return c(wq)||(wq=c_.createGeometry(new c_({radii:new d(1,1,1),vertexFormat:Ie.POSITION_ONLY}))),wq};var da=c_;var pQe=new Ut(G.WHITE),vq=d.ZERO,Dq=new d,_Qe=new d,gQe=new d,Pq=new G,yQe=new d(1,1,1);function bQe(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function gu(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new bQe(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}c(Object.create)&&(gu.prototype=Object.create(oi.prototype),gu.prototype.constructor=gu);Object.defineProperties(gu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});gu.prototype.createFillGeometryInstance=function(e,t,n){T.defined("time",e);let i=this._entity,o=i.isAvailable(e),r,s=new xn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),l=kn.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:l,color:void 0,offset:void 0};if(this._materialProperty instanceof Ut){let f;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(f=this._materialProperty.color.getValue(e,Pq)),c(f)||(f=G.WHITE),r=jt.fromColor(f),u.color=r}return c(this._options.offsetAttribute)&&(u.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,vq,Dq))),new St({id:i,geometry:new da(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};gu.prototype.createOutlineGeometryInstance=function(e,t,n){T.defined("time",e);let i=this._entity,o=i.isAvailable(e),r=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Pq),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new xn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(r),distanceDisplayCondition:kn.fromDistanceDisplayCondition(s),offset:void 0};return c(this._options.offsetAttribute)&&(a.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,vq,Dq))),new St({id:i,geometry:new If(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};gu.prototype._computeCenter=function(e,t){return Y.getValueOrUndefined(this._entity.position,e,t)};gu.prototype._isHidden=function(e,t){return!c(e.position)||!c(t.radii)||oi.prototype._isHidden.call(this,e,t)};gu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.radii.isConstant||!Y.isConstant(t.innerRadii)||!Y.isConstant(t.stackPartitions)||!Y.isConstant(t.slicePartitions)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.minimumClock)||!Y.isConstant(t.maximumClock)||!Y.isConstant(t.minimumCone)||!Y.isConstant(t.maximumCone)||!Y.isConstant(t.subdivisions)};gu.prototype._setStaticOptions=function(e,t){let n=Y.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Ut?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(Ge.MINIMUM_VALUE,i.radii),i.innerRadii=Y.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=Y.getValueOrUndefined(t.minimumClock,Ge.MINIMUM_VALUE),i.maximumClock=Y.getValueOrUndefined(t.maximumClock,Ge.MINIMUM_VALUE),i.minimumCone=Y.getValueOrUndefined(t.minimumCone,Ge.MINIMUM_VALUE),i.maximumCone=Y.getValueOrUndefined(t.maximumCone,Ge.MINIMUM_VALUE),i.stackPartitions=Y.getValueOrUndefined(t.stackPartitions,Ge.MINIMUM_VALUE),i.slicePartitions=Y.getValueOrUndefined(t.slicePartitions,Ge.MINIMUM_VALUE),i.subdivisions=Y.getValueOrUndefined(t.subdivisions,Ge.MINIMUM_VALUE),i.offsetAttribute=n!==qe.NONE?Zt.ALL:void 0};gu.prototype._onEntityPropertyChanged=rg;gu.DynamicGeometryUpdater=YD;function YD(e,t,n){ii.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new F,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new d,this._material={}}c(Object.create)&&(YD.prototype=Object.create(ii.prototype),YD.prototype.constructor=YD);YD.prototype.update=function(e){T.defined("time",e);let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!Y.getValueOrDefault(n.show,e,!0)){c(this._primitive)&&(this._primitive.show=!1),c(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=Y.getValueOrUndefined(n.radii,e,_Qe),o=c(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!c(o)||!c(i)){c(this._primitive)&&(this._primitive.show=!1),c(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=Y.getValueOrDefault(n.fill,e,!0),s=Y.getValueOrDefault(n.outline,e,!1),a=Y.getValueOrClonedDefault(n.outlineColor,e,G.BLACK,Pq),l=or.getValue(e,n.material??pQe,this._material),u=Y.getValueOrUndefined(n.innerRadii,e,gQe),f=Y.getValueOrUndefined(n.minimumClock,e),h=Y.getValueOrUndefined(n.maximumClock,e),p=Y.getValueOrUndefined(n.minimumCone,e),g=Y.getValueOrUndefined(n.maximumCone,e),m=Y.getValueOrUndefined(n.stackPartitions,e),y=Y.getValueOrUndefined(n.slicePartitions,e),b=Y.getValueOrUndefined(n.subdivisions,e),x=Y.getValueOrDefault(n.outlineWidth,e,1),A=Y.getValueOrDefault(n.heightReference,e,qe.NONE),E=A!==qe.NONE?Zt.ALL:void 0,S=this._scene.mode,v=S===oe.SCENE3D&&A===qe.NONE,P=this._options,M=this._geometryUpdater.shadowsProperty.getValue(e),L=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),B=Y.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,vq,Dq);if(!v||this._lastSceneMode!==S||!c(this._primitive)||P.stackPartitions!==m||P.slicePartitions!==y||c(u)&&!d.equals(P.innerRadii!==u)||P.minimumClock!==f||P.maximumClock!==h||P.minimumCone!==p||P.maximumCone!==g||P.subdivisions!==b||this._lastOutlineWidth!==x||P.offsetAttribute!==E){let w=this._primitives;w.removeAndDestroy(this._primitive),w.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=S,this._lastOutlineWidth=x,P.stackPartitions=m,P.slicePartitions=y,P.subdivisions=b,P.offsetAttribute=E,P.radii=d.clone(v?yQe:i,P.radii),c(u)?v?P.innerRadii=d.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,P.innerRadii):P.innerRadii=d.clone(u,P.innerRadii):P.innerRadii=void 0,P.minimumClock=f,P.maximumClock=h,P.minimumCone=p,P.maximumCone=g;let D=new so({material:l,translucent:l.isTranslucent(),closed:!0});P.vertexFormat=D.vertexFormat;let I=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=w.add(new In({geometryInstances:I,appearance:D,asynchronous:!1,shadows:M}));let N=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=w.add(new In({geometryInstances:N,appearance:new rn({flat:!0,translucent:N.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(x)}}),asynchronous:!1,shadows:M})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=G.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=L,this._lastOffset=d.clone(B,this._lastOffset)}else if(this._primitive.ready){let w=this._primitive,D=this._outlinePrimitive;w.show=!0,D.show=!0,w.appearance.material=l;let I=this._attributes;c(I)||(I=w.getGeometryInstanceAttributes(t),this._attributes=I),r!==this._lastShow&&(I.show=xn.toValue(r,I.show),this._lastShow=r);let N=this._outlineAttributes;c(N)||(N=D.getGeometryInstanceAttributes(t),this._outlineAttributes=N),s!==this._lastOutlineShow&&(N.show=xn.toValue(s,N.show),this._lastOutlineShow=s),G.equals(a,this._lastOutlineColor)||(N.color=jt.toValue(a,N.color),G.clone(a,this._lastOutlineColor)),Lt.equals(L,this._lastDistanceDisplayCondition)||(I.distanceDisplayCondition=kn.toValue(L,I.distanceDisplayCondition),N.distanceDisplayCondition=kn.toValue(L,N.distanceDisplayCondition),Lt.clone(L,this._lastDistanceDisplayCondition)),d.equals(B,this._lastOffset)||(I.offset=Ji.toValue(B,I.offset),N.offset=Ji.toValue(B,I.offset),d.clone(B,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=F.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var tk=gu;function jC(e){e=e??W.EMPTY_OBJECT;let t=e.vertexFormat??Ie.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}jC.packedLength=Ie.packedLength;jC.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,Ie.pack(e._vertexFormat,t,n),t};var $fe=new Ie,xQe={vertexFormat:$fe};jC.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=Ie.unpack(e,t,$fe);return c(n)?(n._vertexFormat=Ie.clone(i,n._vertexFormat),n):new jC(xQe)};var nk=new d(-.5,-.5,0),ik=new d(.5,.5,0);jC.createGeometry=function(e){let t=e._vertexFormat,n=new hn,i,o;if(t.position){if(o=new Float64Array(4*3),o[0]=nk.x,o[1]=nk.y,o[2]=0,o[3]=ik.x,o[4]=nk.y,o[5]=0,o[6]=ik.x,o[7]=ik.y,o[8]=0,o[9]=nk.x,o[10]=ik.y,o[11]=0,n.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(2*3),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new ct({attributes:n,indices:i,primitiveType:Me.TRIANGLES,boundingSphere:new le(d.ZERO,Math.sqrt(2))})};var ok=jC;function WC(){this._workerName="createPlaneOutlineGeometry"}WC.packedLength=0;WC.pack=function(e,t){return T.defined("value",e),T.defined("array",t),t};WC.unpack=function(e,t,n){return T.defined("array",e),c(n)?n:new WC};var by=new d(-.5,-.5,0),rk=new d(.5,.5,0);WC.createGeometry=function(){let e=new hn,t=new Uint16Array(4*2),n=new Float64Array(4*3);return n[0]=by.x,n[1]=by.y,n[2]=by.z,n[3]=rk.x,n[4]=by.y,n[5]=by.z,n[6]=rk.x,n[7]=rk.y,n[8]=by.z,n[9]=by.x,n[10]=rk.y,n[11]=by.z,e.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new ct({attributes:e,indices:t,primitiveType:Me.LINES,boundingSphere:new le(d.ZERO,Math.sqrt(2))})};var sk=WC;var TQe=new d,Zfe=new G;function AQe(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Uf(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new AQe(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}c(Object.create)&&(Uf.prototype=Object.create(oi.prototype),Uf.prototype.constructor=Uf);Uf.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let g;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,Zfe)),c(g)||(g=G.WHITE),o=jt.fromColor(g),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let l=t.plane,u=this._options,f=t.computeModelMatrix(e),h=Y.getValueOrDefault(l.plane,e,u.plane),p=Y.getValueOrUndefined(l.dimensions,e,u.dimensions);return u.plane=h,u.dimensions=p,f=Iq(h,p,f,f),new St({id:t,geometry:new ok(this._options),modelMatrix:f,attributes:i})};Uf.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Zfe),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),l=Y.getValueOrDefault(r.plane,e,s.plane),u=Y.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=l,s.dimensions=u,a=Iq(l,u,a,a),new St({id:t,geometry:new sk,modelMatrix:a,attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};Uf.prototype._isHidden=function(e,t){return!c(t.plane)||!c(t.dimensions)||!c(e.position)||oi.prototype._isHidden.call(this,e,t)};Uf.prototype._getIsClosed=function(e){return!1};Uf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!Y.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!Y.isConstant(t.outlineWidth)};Uf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(Ge.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(Ge.MINIMUM_VALUE,i.dimensions)};Uf.DynamicGeometryUpdater=qC;function qC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(qC.prototype=Object.create(ii.prototype),qC.prototype.constructor=qC);qC.prototype._isHidden=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(e.position,n,TQe);return!c(o)||!c(i.plane)||!c(i.dimensions)||ii.prototype._isHidden.call(this,e,t,n)};qC.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=Y.getValueOrDefault(t.plane,n,i.plane),i.dimensions=Y.getValueOrUndefined(t.dimensions,n,i.dimensions)};var CQe=new d,EQe=new d,SQe=new d,wQe=new d,vQe=new J,DQe=new J,PQe=new F;function Iq(e,t,n,i){let o=e.normal,r=e.distance,s=d.multiplyByScalar(o,-r,SQe),a=d.clone(d.UNIT_Z,EQe);O.equalsEpsilon(Math.abs(d.dot(a,o)),1,O.EPSILON8)&&(a=d.clone(d.UNIT_Y,a));let l=d.cross(a,o,CQe);a=d.cross(o,l,a),d.normalize(l,l),d.normalize(a,a);let u=vQe;J.setColumn(u,0,l,u),J.setColumn(u,1,a,u),J.setColumn(u,2,o,u);let f=d.fromElements(t.x,t.y,1,wQe),h=J.multiplyByScale(u,f,DQe),p=F.fromRotationTranslation(h,s,PQe);return F.multiplyTransformation(n,p,i)}Uf.createPrimitiveMatrix=Iq;var ak=Uf;var IQe=new d,OQe=new Ke,RQe=new z,MQe=new z,LQe=new d,NQe=new d,FQe=new d,XD=new d,BQe=new d,kQe=new d,Qfe=new Le,UQe=new J,VQe=new J,zQe=new d;function HQe(e,t,n,i,o,r,s,a,l){let u=e.positions,f=si.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let h=Fe.createTypedArray(u.length,f.length);h.set(f);let p=UQe;if(i!==0){let _=Le.fromAxisAngle(s,i,Qfe);if(p=J.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(s,-i,Qfe);let w=J.fromQuaternion(_,VQe);a=d.normalize(J.multiplyByVector(w,a,a),a),t.bitangent&&(l=d.normalize(d.cross(s,a,l),l))}}else p=J.clone(J.IDENTITY,p);let g=MQe;t.st&&(g.x=n.x,g.y=n.y);let m=u.length,y=m*3,b=new Float64Array(y),x=t.normal?new Float32Array(y):void 0,A=t.tangent?new Float32Array(y):void 0,E=t.bitangent?new Float32Array(y):void 0,S=t.st?new Float32Array(m*2):void 0,v=0,P=0,M=0,R=0,L=0;for(let _=0;_<m;_++){let w=u[_];if(b[v++]=w.x,b[v++]=w.y,b[v++]=w.z,t.st)if(c(o)&&o.positions.length===m)S[L++]=o.positions[_].x,S[L++]=o.positions[_].y;else{let D=J.multiplyByVector(p,w,IQe),I=r(D,RQe);z.subtract(I,g,I);let N=O.clamp(I.x/n.width,0,1),k=O.clamp(I.y/n.height,0,1);S[L++]=N,S[L++]=k}t.normal&&(x[P++]=s.x,x[P++]=s.y,x[P++]=s.z),t.tangent&&(A[R++]=a.x,A[R++]=a.y,A[R++]=a.z),t.bitangent&&(E[M++]=l.x,E[M++]=l.y,E[M++]=l.z)}let B=new hn;return t.position&&(B.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:b})),t.normal&&(B.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:x})),t.tangent&&(B.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:A})),t.bitangent&&(B.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:E})),t.st&&(B.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:S})),new ct({attributes:B,indices:h,primitiveType:Me.TRIANGLES})}function Qb(e){e=e??W.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates;T.defined("options.polygonHierarchy",t);let i=e.vertexFormat??Ie.DEFAULT;this._vertexFormat=Ie.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=zn.computeHierarchyPackedLength(t,d)+Ie.packedLength+ie.packedLength+(c(n)?zn.computeHierarchyPackedLength(n,z):1)+2}Qb.fromPositions=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new Qb(t)};Qb.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._stRotation,c(e._textureCoordinates)?n=zn.packPolygonHierarchy(e._textureCoordinates,t,n,z):t[n++]=-1,t[n++]=e.packedLength,t};var GQe=ie.clone(ie.UNIT_SPHERE),jQe=new Ie,WQe={polygonHierarchy:{}};Qb.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=ie.unpack(e,t,GQe);t+=ie.packedLength;let r=Ie.unpack(e,t,jQe);t+=Ie.packedLength;let s=e[t++],a=e[t]===-1?void 0:zn.unpackPolygonHierarchy(e,t,z);c(a)?(t=a.startingIndex,delete a.startingIndex):t++;let l=e[t++];return c(n)||(n=new Qb(WQe)),n._polygonHierarchy=i,n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=l,n};Qb.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=c(o),s=n.positions;if(s=xo(s,d.equalsEpsilon,!0),s.length<3)return;let a=LQe,l=NQe,u=FQe,f=BQe,h=kQe;if(!Zg.computeProjectTo2DArguments(s,XD,f,h))return;if(a=d.cross(f,h,a),a=d.normalize(a,a),!d.equalsEpsilon(XD,d.ZERO,O.EPSILON6)){let L=e._ellipsoid.geodeticSurfaceNormal(XD,zQe);d.dot(a,L)<0&&(a=d.negate(a,a),f=d.negate(f,f))}let g=Zg.createProjectPointsTo2DFunction(XD,f,h),m=Zg.createProjectPointTo2DFunction(XD,f,h);t.tangent&&(l=d.clone(f,l)),t.bitangent&&(u=d.clone(h,u));let y=zn.polygonsFromHierarchy(n,r,g,!1),b=y.hierarchy,x=y.polygons,A=function(L){return L},E=r?zn.polygonsFromHierarchy(o,!0,A,!1).polygons:void 0;if(b.length===0)return;s=b[0].outerRing;let S=le.fromPoints(s),v=zn.computeBoundingRectangle(a,m,s,i,OQe),P=[];for(let L=0;L<x.length;L++){let B=new St({geometry:HQe(x[L],t,v,i,r?E[L]:void 0,m,a,l,u)});P.push(B)}let M=Nn.combineInstances(P)[0];M.attributes.position.values=new Float64Array(M.attributes.position.values),M.indices=Fe.createTypedArray(M.attributes.position.values.length/3,M.indices);let R=M.attributes;return t.position||delete R.position,new ct({attributes:R,indices:M.indices,primitiveType:M.primitiveType,boundingSphere:S})};var ck=Qb;var Jfe=[],lk=[];function qQe(e,t,n,i,o){let s=is.fromPoints(t,e).projectPointsOntoPlane(t,Jfe);si.computeWindingOrder2D(s)===ts.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let l,u,f=t.length,h=0;if(i)for(l=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],y=t[(u+1)%f];l[h++]=m.x,l[h++]=m.y,l[h++]=m.z,l[h++]=y.x,l[h++]=y.y,l[h++]=y.z}else{let m=0;if(o===qt.GEODESIC)for(u=0;u<f;u++)m+=zn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===qt.RHUMB)for(u=0;u<f;u++)m+=zn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(l=new Float64Array(m*3),u=0;u<f;u++){let y;o===qt.GEODESIC?y=zn.subdivideLine(t[u],t[(u+1)%f],n,lk):o===qt.RHUMB&&(y=zn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,lk));let b=y.length;for(let x=0;x<b;++x)l[h++]=y[x]}}f=l.length/3;let p=f*2,g=Fe.createTypedArray(f,p);for(h=0,u=0;u<f-1;u++)g[h++]=u,g[h++]=u+1;return g[h++]=f-1,g[h++]=0,new St({geometry:new ct({attributes:new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:l})}),indices:g,primitiveType:Me.LINES})})}function YQe(e,t,n,i,o){let s=is.fromPoints(t,e).projectPointsOntoPlane(t,Jfe);si.computeWindingOrder2D(s)===ts.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let l,u,f=t.length,h=new Array(f),p=0;if(i)for(l=new Float64Array(f*2*3*2),u=0;u<f;++u){h[u]=p/3;let b=t[u],x=t[(u+1)%f];l[p++]=b.x,l[p++]=b.y,l[p++]=b.z,l[p++]=x.x,l[p++]=x.y,l[p++]=x.z}else{let b=0;if(o===qt.GEODESIC)for(u=0;u<f;u++)b+=zn.subdivideLineCount(t[u],t[(u+1)%f],n);else if(o===qt.RHUMB)for(u=0;u<f;u++)b+=zn.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(l=new Float64Array(b*3*2),u=0;u<f;++u){h[u]=p/3;let x;o===qt.GEODESIC?x=zn.subdivideLine(t[u],t[(u+1)%f],n,lk):o===qt.RHUMB&&(x=zn.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,lk));let A=x.length;for(let E=0;E<A;++E)l[p++]=x[E]}}f=l.length/(3*2);let g=h.length,m=(f*2+g)*2,y=Fe.createTypedArray(f+g,m);for(p=0,u=0;u<f;++u)y[p++]=u,y[p++]=(u+1)%f,y[p++]=u+f,y[p++]=(u+1)%f+f;for(u=0;u<g;u++){let b=h[u];y[p++]=b,y[p++]=b+f}return new St({geometry:new ct({attributes:new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:l})}),indices:y,primitiveType:Me.LINES})})}function Jb(e){if(T.typeOf.object("options",e),T.typeOf.object("options.polygonHierarchy",e.polygonHierarchy),e.perPositionHeight&&c(e.height))throw new C("Cannot use both options.perPositionHeight and options.height");if(c(e.arcType)&&e.arcType!==qt.GEODESIC&&e.arcType!==qt.RHUMB)throw new C("Invalid arcType. Valid options are ArcType.GEODESIC and ArcType.RHUMB.");let t=e.polygonHierarchy,n=e.ellipsoid??ie.default,i=e.granularity??O.RADIANS_PER_DEGREE,o=e.perPositionHeight??!1,r=o&&c(e.extrudedHeight),s=e.arcType??qt.GEODESIC,a=e.height??0,l=e.extrudedHeight??a;if(!r){let u=Math.max(a,l);l=Math.min(a,l),a=u}this._ellipsoid=ie.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=l,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=zn.computeHierarchyPackedLength(t,d)+ie.packedLength+8}Jb.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,n=zn.packPolygonHierarchy(e._polygonHierarchy,t,n,d),ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var XQe=ie.clone(ie.UNIT_SPHERE),KQe={polygonHierarchy:{}};Jb.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=zn.unpackPolygonHierarchy(e,t,d);t=i.startingIndex,delete i.startingIndex;let o=ie.unpack(e,t,XQe);t+=ie.packedLength;let r=e[t++],s=e[t++],a=e[t++],l=e[t++]===1,u=e[t++]===1,f=e[t++],h=e[t++],p=e[t];return c(n)||(n=new Jb(KQe)),n._polygonHierarchy=i,n._ellipsoid=ie.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=l,n._arcType=f,n._offsetAttribute=h===-1?void 0:h,n.packedLength=p,n};Jb.fromPositions=function(e){e=e??W.EMPTY_OBJECT,T.defined("options.positions",e.positions);let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new Jb(t)};Jb.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=zn.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,l=[],u=O.chordLength(n,t.maximumRadius),f=e._height,h=e._extrudedHeight,p=e._perPositionHeightExtrude||!O.equalsEpsilon(f,h,0,O.EPSILON2),g,m;if(p)for(m=0;m<s.length;m++){if(a=YQe(t,s[m],u,o,r),a.geometry=zn.scaleToGeodeticHeightExtruded(a.geometry,f,h,t,o),c(e._offsetAttribute)){let x=a.geometry.attributes.position.values.length/3,A=new Uint8Array(x);e._offsetAttribute===Zt.TOP?A=A.fill(1,0,x/2):(g=e._offsetAttribute===Zt.NONE?0:1,A=A.fill(g)),a.geometry.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}l.push(a)}else for(m=0;m<s.length;m++){if(a=qQe(t,s[m],u,o,r),a.geometry.attributes.position.values=si.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!o),c(e._offsetAttribute)){let x=a.geometry.attributes.position.values.length;g=e._offsetAttribute===Zt.NONE?0:1;let A=new Uint8Array(x/3).fill(g);a.geometry.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}l.push(a)}let y=Nn.combineInstances(l)[0],b=le.fromVertices(y.attributes.position.values);return new ct({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:b,offsetAttribute:e._offsetAttribute})};var uk=Jb;var ede="Entity polygons cannot have both height and perPositionHeight. height will be ignored",tde="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",nde=new G,ide=d.ZERO,ode=new d,rde=new ce,$Qe=[],ZQe=new z;function QQe(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function yu(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new QQe(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}c(Object.create)&&(yu.prototype=Object.create(Gn.prototype),yu.prototype.constructor=yu);yu.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let s;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,nde)),c(s)||(s=G.WHITE),o.color=jt.fromColor(s)}c(i.offsetAttribute)&&(o.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,ide,ode)));let r;return i.perPositionHeight&&!c(i.extrudedHeight)?r=new ck(i):r=new Pg(i),new St({id:t,geometry:r,attributes:o})};yu.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=this._options,o=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,nde),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(o),distanceDisplayCondition:kn.fromDistanceDisplayCondition(r),offset:void 0};c(i.offsetAttribute)&&(s.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,ide,ode)));let a;return i.perPositionHeight&&!c(i.extrudedHeight)?a=new Nd(i):a=new uk(i),new St({id:t,geometry:a,attributes:s})};yu.prototype._computeCenter=function(e,t){let n=Y.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!c(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=is.fromPoints(i,o),s=r.projectPointsOntoPlane(i,$Qe),a=s.length,l=0,u=a-1,f=new z;for(let p=0;p<a;u=p++){let g=s[p],m=s[u],y=g.x*m.y-m.x*g.y,b=z.add(g,m,ZQe);b=z.multiplyByScalar(b,y,b),f=z.add(f,b,f),l+=y}let h=1/(l*3);return f=z.multiplyByScalar(f,h,f),r.projectPointOntoEllipsoid(f,t)};yu.prototype._isHidden=function(e,t){return!c(t.hierarchy)||oi.prototype._isHidden.call(this,e,t)};yu.prototype._isOnTerrain=function(e,t){let n=Gn.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=c(i)&&(i.isConstant?i.getValue(Ge.MINIMUM_VALUE):!0);return n&&!o};yu.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.stRotation)||!Y.isConstant(t.textureCoordinates)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.perPositionHeight)||!Y.isConstant(t.closeTop)||!Y.isConstant(t.closeBottom)||!Y.isConstant(t.zIndex)||!Y.isConstant(t.arcType)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};yu.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=this._options;i.vertexFormat=n?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(Ge.MINIMUM_VALUE),r=Y.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),s=Y.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),a=Y.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),l=Y.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE),u=Y.getValueOrDefault(t.perPositionHeight,Ge.MINIMUM_VALUE,!1);r=Gn.getGeometryHeight(r,s);let f;if(u?(c(r)&&(r=void 0,dt(ede)),s!==qe.NONE&&u&&(r=void 0,dt(tde))):(c(a)&&!c(r)&&(r=0),f=Gn.computeGeometryOffsetAttribute(r,s,a,l)),i.polygonHierarchy=o,i.granularity=Y.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),i.stRotation=Y.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=Y.getValueOrDefault(t.closeTop,Ge.MINIMUM_VALUE,!0),i.closeBottom=Y.getValueOrDefault(t.closeBottom,Ge.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=r,i.arcType=Y.getValueOrDefault(t.arcType,Ge.MINIMUM_VALUE,qt.GEODESIC),i.textureCoordinates=Y.getValueOrUndefined(t.textureCoordinates,Ge.MINIMUM_VALUE),a=Gn.getGeometryExtrudedHeight(a,l),a===Gn.CLAMP_TO_GROUND){let h=Pg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,rde);a=fi.getMinimumMaximumHeights(h).minimumTerrainHeight}i.extrudedHeight=a};yu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=c(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};yu.DynamicGeometryUpdater=YC;function YC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(YC.prototype=Object.create(ii.prototype),YC.prototype.constructor=YC);YC.prototype._isHidden=function(e,t,n){return!c(this._options.polygonHierarchy)||ii.prototype._isHidden.call(this,e,t,n)};YC.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=Y.getValueOrUndefined(t.hierarchy,n);let o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,qe.NONE),s=Y.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE),a=Y.getValueOrUndefined(t.extrudedHeight,n),l=Y.getValueOrUndefined(t.perPositionHeight,n);o=Gn.getGeometryHeight(o,s);let u;if(l?(c(o)&&(o=void 0,dt(ede)),r!==qe.NONE&&l&&(o=void 0,dt(tde))):(c(a)&&!c(o)&&(o=0),u=Gn.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.stRotation=Y.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=Y.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=Y.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=Y.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=Y.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=o,i.arcType=Y.getValueOrDefault(t.arcType,n,qt.GEODESIC),a=Gn.getGeometryExtrudedHeight(a,s),a===Gn.CLAMP_TO_GROUND){let f=Pg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,rde);a=fi.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var fk=yu;function JQe(e,t,n,i){let o=new hn;i.position&&(o.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),l=si.triangulate(t),u=(a-1)*r*6+l.length*2,f=Fe.createTypedArray(s,u),h,p,g,m,y,b,x=r*2,A=0;for(h=0;h<a-1;h++){for(p=0;p<r-1;p++)g=p*2+h*r*2,b=g+x,m=g+1,y=m+x,f[A++]=m,f[A++]=g,f[A++]=y,f[A++]=y,f[A++]=g,f[A++]=b;g=r*2-2+h*r*2,m=g+1,y=m+x,b=g+x,f[A++]=m,f[A++]=g,f[A++]=y,f[A++]=y,f[A++]=g,f[A++]=b}if(i.st||i.tangent||i.bitangent){let v=new Float32Array(s*2),P=1/(a-1),M=1/n.height,R=n.height/2,L,B,_=0;for(h=0;h<a;h++){for(L=h*P,B=M*(t[0].y+R),v[_++]=L,v[_++]=B,p=1;p<r;p++)B=M*(t[p].y+R),v[_++]=L,v[_++]=B,v[_++]=L,v[_++]=B;B=M*(t[0].y+R),v[_++]=L,v[_++]=B}for(p=0;p<r;p++)L=0,B=M*(t[p].y+R),v[_++]=L,v[_++]=B;for(p=0;p<r;p++)L=(a-1)*P,B=M*(t[p].y+R),v[_++]=L,v[_++]=B;o.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}let E=s-r*2;for(h=0;h<l.length;h+=3){let v=l[h]+E,P=l[h+1]+E,M=l[h+2]+E;f[A++]=v,f[A++]=P,f[A++]=M,f[A++]=M+r,f[A++]=P+r,f[A++]=v+r}let S=new ct({attributes:o,indices:f,boundingSphere:le.fromVertices(e),primitiveType:Me.TRIANGLES});if(i.normal&&(S=Nn.computeNormal(S)),i.tangent||i.bitangent){try{S=Nn.computeTangentAndBitangent(S)}catch{dt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(S.attributes.tangent=void 0),i.bitangent||(S.attributes.bitangent=void 0),i.st||(S.attributes.st=void 0)}return S}function $D(e){e=e??W.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;if(!c(t))throw new C("options.polylinePositions is required.");if(!c(n))throw new C("options.shapePositions is required.");this._positions=t,this._shape=n,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._cornerType=e.cornerType??ki.ROUNDED,this._vertexFormat=Ie.clone(e.vertexFormat??Ie.DEFAULT),this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*z.packedLength,this.packedLength=i+ie.packedLength+Ie.packedLength+2}$D.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var sde=ie.clone(ie.UNIT_SPHERE),ade=new Ie,KD={polylinePositions:void 0,shapePositions:void 0,ellipsoid:sde,vertexFormat:ade,cornerType:void 0,granularity:void 0};$D.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ie.unpack(e,t,sde);t+=ie.packedLength;let l=Ie.unpack(e,t,ade);t+=Ie.packedLength;let u=e[t++],f=e[t];return c(n)?(n._positions=r,n._shape=s,n._ellipsoid=ie.clone(a,n._ellipsoid),n._vertexFormat=Ie.clone(l,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(KD.polylinePositions=r,KD.shapePositions=s,KD.cornerType=u,KD.granularity=f,new $D(KD))};var eJe=new Ke;$D.createGeometry=function(e){let t=e._positions,n=xo(t,d.equalsEpsilon),i=e._shape;if(i=dm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;si.computeWindingOrder2D(i)===ts.CLOCKWISE&&i.reverse();let o=Ke.fromPoints(i,eJe),r=dm.computePositions(n,i,o,e,!0);return JQe(r,i,o,e._vertexFormat)};var dk=$D;function tJe(e,t){let n=new hn;n.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Fe.createTypedArray(o,2*i*(s+1)),l,u,f=0;l=0;let h=l*i;for(u=0;u<i-1;u++)a[f++]=u+h,a[f++]=u+h+1;for(a[f++]=i-1+h,a[f++]=h,l=s-1,h=l*i,u=0;u<i-1;u++)a[f++]=u+h,a[f++]=u+h+1;for(a[f++]=i-1+h,a[f++]=h,l=0;l<s-1;l++){let g=i*l,m=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+m}return new ct({attributes:n,indices:Fe.createTypedArray(o,a),boundingSphere:le.fromVertices(e),primitiveType:Me.LINES})}function QD(e){e=e??W.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;if(!c(t))throw new C("options.polylinePositions is required.");if(!c(n))throw new C("options.shapePositions is required.");this._positions=t,this._shape=n,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._cornerType=e.cornerType??ki.ROUNDED,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*d.packedLength;i+=1+n.length*z.packedLength,this.packedLength=i+ie.packedLength+2}QD.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=z.packedLength)z.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var cde=ie.clone(ie.UNIT_SPHERE),ZD={polylinePositions:void 0,shapePositions:void 0,ellipsoid:cde,height:void 0,cornerType:void 0,granularity:void 0};QD.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ie.unpack(e,t,cde);t+=ie.packedLength;let l=e[t++],u=e[t];return c(n)?(n._positions=r,n._shape=s,n._ellipsoid=ie.clone(a,n._ellipsoid),n._cornerType=l,n._granularity=u,n):(ZD.polylinePositions=r,ZD.shapePositions=s,ZD.cornerType=l,ZD.granularity=u,new QD(ZD))};var nJe=new Ke;QD.createGeometry=function(e){let t=e._positions,n=xo(t,d.equalsEpsilon),i=e._shape;if(i=dm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;si.computeWindingOrder2D(i)===ts.CLOCKWISE&&i.reverse();let o=Ke.fromPoints(i,nJe),r=dm.computePositions(n,i,o,e,!1);return tJe(r,i)};var hk=QD;var lde=new G;function iJe(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function xm(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new iJe(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}c(Object.create)&&(xm.prototype=Object.create(oi.prototype),xm.prototype.constructor=xm);xm.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let l;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(l=this._materialProperty.color.getValue(e,lde)),c(l)||(l=G.WHITE),o=jt.fromColor(l),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new St({id:t,geometry:new dk(this._options),attributes:i})};xm.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,lde),o=this._distanceDisplayConditionProperty.getValue(e);return new St({id:t,geometry:new hk(this._options),attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};xm.prototype._isHidden=function(e,t){return!c(t.positions)||!c(t.shape)||oi.prototype._isHidden.call(this,e,t)};xm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!Y.isConstant(t.granularity)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.cornerType)};xm.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Ut;o.vertexFormat=r?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(Ge.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(Ge.MINIMUM_VALUE,o.shape),o.granularity=c(n)?n.getValue(Ge.MINIMUM_VALUE):void 0,o.cornerType=c(i)?i.getValue(Ge.MINIMUM_VALUE):void 0};xm.DynamicGeometryUpdater=XC;function XC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(XC.prototype=Object.create(ii.prototype),XC.prototype.constructor=XC);XC.prototype._isHidden=function(e,t,n){let i=this._options;return!c(i.polylinePositions)||!c(i.shapePositions)||ii.prototype._isHidden.call(this,e,t,n)};XC.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=Y.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=Y.getValueOrUndefined(t.shape,n),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.cornerType=Y.getValueOrUndefined(t.cornerType,n)};var mk=xm;var Oq=new d,dde=new d,hde=new d,mde=new d,pde=new ce,oJe=new z,rJe=new le,sJe=new le;function _de(e,t){let n=new ct({attributes:new hn,primitiveType:Me.TRIANGLES});return n.attributes.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function aJe(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,a=t.bitangent?new Float32Array(o):void 0,l=0,u=mde,f=hde,h=dde;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let g=d.fromArray(e,p,Oq),m=l+1,y=l+2;h=n.geodeticSurfaceNormal(g,h),(t.tangent||t.bitangent)&&(d.cross(d.UNIT_Z,h,f),J.multiplyByVector(i,f,f),d.normalize(f,f),t.bitangent&&d.normalize(d.cross(h,f,u),u)),t.normal&&(r[l]=h.x,r[m]=h.y,r[y]=h.z),t.tangent&&(s[l]=f.x,s[m]=f.y,s[y]=f.z),t.bitangent&&(a[l]=u.x,a[m]=u.y,a[y]=u.z),l+=3}return _de(t,{positions:e,normals:r,tangents:s,bitangents:a})}var Rq=new d,gde=new d;function cJe(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,l=0,u=0,f=!0,h=mde,p=hde,g=dde;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=d.fromArray(e,m,Oq),b=d.fromArray(e,(m+6)%i,Rq);if(f){let x=d.fromArray(e,(m+3)%i,gde);d.subtract(b,y,b),d.subtract(x,y,x),g=d.normalize(d.cross(x,b,g),g),f=!1}d.equalsEpsilon(b,y,O.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(h=n.geodeticSurfaceNormal(y,h),t.tangent&&(p=d.normalize(d.cross(h,g,p),p))),t.normal&&(o[a++]=g.x,o[a++]=g.y,o[a++]=g.z,o[a++]=g.x,o[a++]=g.y,o[a++]=g.z),t.tangent&&(r[l++]=p.x,r[l++]=p.y,r[l++]=p.z,r[l++]=p.x,r[l++]=p.y,r[l++]=p.z),t.bitangent&&(s[u++]=h.x,s[u++]=h.y,s[u++]=h.z,s[u++]=h.x,s[u++]=h.y,s[u++]=h.z)}return _de(t,{positions:e,normals:o,tangents:r,bitangents:s})}function yde(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,l=0,u=o,f=o,h=0;s&&(l=1,f-=1,h+=1),a&&(u-=1,f-=1,h+=1),h+=r*f;let p=n.position?new Float64Array(h*3):void 0,g=n.st?new Float32Array(h*2):void 0,m=0,y=0,b=Oq,x=oJe,A=Number.MAX_VALUE,E=Number.MAX_VALUE,S=-Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let w=l;w<u;++w)for(let D=0;D<r;++D)zs.computePosition(t,i,n.st,w,D,b,x),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(g[y++]=x.x,g[y++]=x.y,A=Math.min(A,x.x),E=Math.min(E,x.y),S=Math.max(S,x.x),v=Math.max(v,x.y));if(s&&(zs.computePosition(t,i,n.st,0,0,b,x),p[m++]=b.x,p[m++]=b.y,p[m++]=b.z,n.st&&(g[y++]=x.x,g[y++]=x.y,A=x.x,E=x.y,S=x.x,v=x.y)),a&&(zs.computePosition(t,i,n.st,o-1,0,b,x),p[m++]=b.x,p[m++]=b.y,p[m]=b.z,n.st&&(g[y++]=x.x,g[y]=x.y,A=Math.min(A,x.x),E=Math.min(E,x.y),S=Math.max(S,x.x),v=Math.max(v,x.y))),n.st&&(A<0||E<0||S>1||v>1))for(let w=0;w<g.length;w+=2)g[w]=(g[w]-A)/(S-A),g[w+1]=(g[w+1]-E)/(v-E);let P=aJe(p,n,i,t.tangentRotationMatrix),M=6*(r-1)*(f-1);s&&(M+=3*(r-1)),a&&(M+=3*(r-1));let R=Fe.createTypedArray(h,M),L=0,B=0,_;for(_=0;_<f-1;++_){for(let w=0;w<r-1;++w){let D=L,I=D+r,N=I+1,k=D+1;R[B++]=D,R[B++]=I,R[B++]=k,R[B++]=k,R[B++]=I,R[B++]=N,++L}++L}if(s||a){let w=h-1,D=h-1;s&&a&&(w=h-2);let I,N;if(L=0,s)for(_=0;_<r-1;_++)I=L,N=I+1,R[B++]=w,R[B++]=I,R[B++]=N,++L;if(a)for(L=(f-1)*r,_=0;_<r-1;_++)I=L,N=I+1,R[B++]=I,R[B++]=D,R[B++]=N,++L}return P.indices=R,n.st&&(P.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:g})),P}function KC(e,t,n,i,o){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=o[n],e[t++]=o[n+1],e[t]=o[n+2],e}function $C(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var Mq=new Ie;function lJe(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,l=t.height,u=t.width,f;if(n){let $e=Ie.clone(o,Mq);$e.normal=!0,e._vertexFormat=$e}let h=yde(e,t);n&&(e._vertexFormat=o);let p=si.scaleToGeodeticHeight(h.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,m=g*2,y=new Float64Array(m);y.set(p);let b=si.scaleToGeodeticHeight(h.attributes.position.values,r,a);y.set(b,g),h.attributes.position.values=y;let x=o.normal?new Float32Array(m):void 0,A=o.tangent?new Float32Array(m):void 0,E=o.bitangent?new Float32Array(m):void 0,S=o.st?new Float32Array(m/3*2):void 0,v,P;if(o.normal){for(P=h.attributes.normal.values,x.set(P),f=0;f<g;f++)P[f]=-P[f];x.set(P,g),h.attributes.normal.values=x}if(n){P=h.attributes.normal.values,o.normal||(h.attributes.normal=void 0);let $e=new Float32Array(m);for(f=0;f<g;f++)P[f]=-P[f];$e.set(P,g),h.attributes.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:$e})}let M,R=c(i);if(R){let $e=g/3*2,ln=new Uint8Array($e);i===Zt.TOP?ln=ln.fill(1,0,$e/2):(M=i===Zt.NONE?0:1,ln=ln.fill(M)),h.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:ln})}if(o.tangent){let $e=h.attributes.tangent.values;for(A.set($e),f=0;f<g;f++)$e[f]=-$e[f];A.set($e,g),h.attributes.tangent.values=A}if(o.bitangent){let $e=h.attributes.bitangent.values;E.set($e),E.set($e,g),h.attributes.bitangent.values=E}o.st&&(v=h.attributes.st.values,S.set(v),S.set(v,g/3*2),h.attributes.st.values=S);let L=h.indices,B=L.length,_=g/3,w=Fe.createTypedArray(m/3,B*2);for(w.set(L),f=0;f<B;f+=3)w[f+B]=L[f+2]+_,w[f+1+B]=L[f+1]+_,w[f+2+B]=L[f]+_;h.indices=w;let D=t.northCap,I=t.southCap,N=l,k=2,H=0,V=4,j=4;D&&(k-=1,N-=1,H+=1,V-=2,j-=1),I&&(k-=1,N-=1,H+=1,V-=2,j-=1),H+=k*u+2*N-V;let U=(H+j)*2,q=new Float64Array(U*3),X=n?new Float32Array(U*3):void 0,te=R?new Uint8Array(U):void 0,K=o.st?new Float32Array(U*2):void 0,Z=i===Zt.TOP;R&&!Z&&(M=i===Zt.ALL?1:0,te=te.fill(M));let ee=0,me=0,xe=0,ue=0,ye=u*N,Ae;for(f=0;f<ye;f+=u)Ae=f*3,q=KC(q,ee,Ae,p,b),ee+=6,o.st&&(K=$C(K,me,f*2,v),me+=4),n&&(xe+=3,X[xe++]=P[Ae],X[xe++]=P[Ae+1],X[xe++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1);if(I){let $e=D?ye+1:ye;for(Ae=$e*3,f=0;f<2;f++)q=KC(q,ee,Ae,p,b),ee+=6,o.st&&(K=$C(K,me,$e*2,v),me+=4),n&&(xe+=3,X[xe++]=P[Ae],X[xe++]=P[Ae+1],X[xe++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1)}else for(f=ye-u;f<ye;f++)Ae=f*3,q=KC(q,ee,Ae,p,b),ee+=6,o.st&&(K=$C(K,me,f*2,v),me+=4),n&&(xe+=3,X[xe++]=P[Ae],X[xe++]=P[Ae+1],X[xe++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1);for(f=ye-1;f>0;f-=u)Ae=f*3,q=KC(q,ee,Ae,p,b),ee+=6,o.st&&(K=$C(K,me,f*2,v),me+=4),n&&(xe+=3,X[xe++]=P[Ae],X[xe++]=P[Ae+1],X[xe++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1);if(D){let $e=ye;for(Ae=$e*3,f=0;f<2;f++)q=KC(q,ee,Ae,p,b),ee+=6,o.st&&(K=$C(K,me,$e*2,v),me+=4),n&&(xe+=3,X[xe++]=P[Ae],X[xe++]=P[Ae+1],X[xe++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1)}else for(f=u-1;f>=0;f--)Ae=f*3,q=KC(q,ee,Ae,p,b),ee+=6,o.st&&(K=$C(K,me,f*2,v),me+=4),n&&(xe+=3,X[xe++]=P[Ae],X[xe++]=P[Ae+1],X[xe++]=P[Ae+2]),Z&&(te[ue++]=1,ue+=1);let Pe=cJe(q,o,a);o.st&&(Pe.attributes.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:K})),n&&(Pe.attributes.extrudeDirection=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:X})),R&&(Pe.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:te}));let Ee=Fe.createTypedArray(U,H*6),Ve,je,it,Dt;g=q.length/3;let Gt=0;for(f=0;f<g-1;f+=2){Ve=f,Dt=(Ve+2)%g;let $e=d.fromArray(q,Ve*3,Rq),ln=d.fromArray(q,Dt*3,gde);d.equalsEpsilon($e,ln,O.EPSILON10)||(je=(Ve+1)%g,it=(je+2)%g,Ee[Gt++]=Ve,Ee[Gt++]=je,Ee[Gt++]=Dt,Ee[Gt++]=Dt,Ee[Gt++]=je,Ee[Gt++]=it)}return Pe.indices=Ee,Pe=Nn.combineInstances([new St({geometry:h}),new St({geometry:Pe})]),Pe[0]}var uJe=[new d,new d,new d,new d],bde=new he,fJe=new he;function Lq(e,t,n,i,o){if(n===0)return ce.clone(e,o);let r=zs.computeOptions(e,t,n,0,pde,bde),s=r.height,a=r.width,l=uJe;return zs.computePosition(r,i,!1,0,0,l[0]),zs.computePosition(r,i,!1,0,a-1,l[1]),zs.computePosition(r,i,!1,s-1,0,l[2]),zs.computePosition(r,i,!1,s-1,a-1,l[3]),ce.fromCartesianArray(l,i,o)}function Tm(e){e=e??W.EMPTY_OBJECT;let t=e.rectangle;if(T.typeOf.object("rectangle",t),ce._validate(t),t.north<t.south)throw new C("options.rectangle.north must be greater than or equal to options.rectangle.south");let n=e.height??0,i=e.extrudedHeight??n;this._rectangle=ce.clone(t),this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=Ie.clone(e.vertexFormat??Ie.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Tm.packedLength=ce.packedLength+ie.packedLength+Ie.packedLength+7;Tm.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,ce.pack(e._rectangle,t,n),n+=ce.packedLength,ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var xde=new ce,Tde=ie.clone(ie.UNIT_SPHERE),xy={rectangle:xde,ellipsoid:Tde,vertexFormat:Mq,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Tm.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=ce.unpack(e,t,xde);t+=ce.packedLength;let o=ie.unpack(e,t,Tde);t+=ie.packedLength;let r=Ie.unpack(e,t,Mq);t+=Ie.packedLength;let s=e[t++],a=e[t++],l=e[t++],u=e[t++],f=e[t++],h=e[t++]===1,p=e[t];return c(n)?(n._rectangle=ce.clone(i,n._rectangle),n._ellipsoid=ie.clone(o,n._ellipsoid),n._vertexFormat=Ie.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=l,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=h,n._offsetAttribute=p===-1?void 0:p,n):(xy.granularity=s,xy.height=a,xy.rotation=l,xy.stRotation=u,xy.extrudedHeight=f,xy.shadowVolume=h,xy.offsetAttribute=p===-1?void 0:p,new Tm(xy))};Tm.computeRectangle=function(e,t){e=e??W.EMPTY_OBJECT;let n=e.rectangle;if(T.typeOf.object("rectangle",n),ce._validate(n),n.north<n.south)throw new C("options.rectangle.north must be greater than or equal to options.rectangle.south");let i=e.granularity??O.RADIANS_PER_DEGREE,o=e.ellipsoid??ie.default,r=e.rotation??0;return Lq(n,i,r,o,t)};var dJe=new J,ude=new Le,hJe=new he;Tm.createGeometry=function(e){if(O.equalsEpsilon(e._rectangle.north,e._rectangle.south,O.EPSILON10)||O.equalsEpsilon(e._rectangle.east,e._rectangle.west,O.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=zs.computeOptions(t,e._granularity,i,o,pde,bde,fJe),a=dJe;if(o!==0||i!==0){let g=ce.center(t,hJe),m=n.geodeticSurfaceNormalCartographic(g,Rq);Le.fromAxisAngle(m,-o,ude),J.fromQuaternion(ude,a)}else J.clone(J.IDENTITY,a);let l=e._surfaceHeight,u=e._extrudedHeight,f=!O.equalsEpsilon(l,u,0,O.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let h,p;if(t=e._rectangle,f){h=lJe(e,s);let g=le.fromRectangle3D(t,n,l,sJe),m=le.fromRectangle3D(t,n,u,rJe);p=le.union(g,m)}else{if(h=yde(e,s),h.attributes.position.values=si.scaleToGeodeticHeight(h.attributes.position.values,l,n,!1),c(e._offsetAttribute)){let g=h.attributes.position.values.length,m=e._offsetAttribute===Zt.NONE?0:1,y=new Uint8Array(g/3).fill(m);h.attributes.applyOffset=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=le.fromRectangle3D(t,n,l)}return r.position||delete h.attributes.position,new ct({attributes:h.attributes,indices:h.indices,primitiveType:h.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Tm.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Tm({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};var fde=new ce,mJe=[new z,new z,new z],pJe=new Ri,_Je=new he;function gJe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ce.clone(e._rectangle,fde),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=Lq(t,n,o,i,fde),s=mJe;s[0].x=r.west,s[0].y=r.south,s[1].x=r.west,s[1].y=r.north,s[2].x=r.east,s[2].y=r.south;let a=e.rectangle,l=Ri.fromRotation(e._stRotation,pJe),u=ce.center(a,_Je);for(let m=0;m<3;++m){let y=s[m];y.x-=u.longitude,y.y-=u.latitude,Ri.multiplyByVector(l,y,y),y.x+=u.longitude,y.y+=u.latitude,y.x=(y.x-a.west)/a.width,y.y=(y.y-a.south)/a.height}let f=s[0],h=s[1],p=s[2],g=new Array(6);return z.pack(f,g),z.pack(h,g,2),z.pack(p,g,4),g}Object.defineProperties(Tm.prototype,{rectangle:{get:function(){return c(this._rotatedRectangle)||(this._rotatedRectangle=Lq(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return c(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=gJe(this)),this._textureCoordinateRotationPoints}}});var ZC=Tm;var Ade=new G,Cde=d.ZERO,Ede=new d,Sde=new ce,yJe=new ce,bJe=new he;function xJe(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function Hd(e,t){Gn.call(this,{entity:e,scene:t,geometryOptions:new xJe(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}c(Object.create)&&(Hd.prototype=Object.create(Gn.prototype),Hd.prototype.constructor=Hd);Hd.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:kn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Ut){let o;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Ade)),c(o)||(o=G.WHITE),i.color=jt.fromColor(o)}return c(this._options.offsetAttribute)&&(i.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Cde,Ede))),new St({id:t,geometry:new ZC(this._options),attributes:i})};Hd.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Ade),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o),offset:void 0};return c(this._options.offsetAttribute)&&(r.offset=Ji.fromCartesian3(Y.getValueOrDefault(this._terrainOffsetProperty,e,Cde,Ede))),new St({id:t,geometry:new cC(this._options),attributes:r})};Hd.prototype._computeCenter=function(e,t){let n=Y.getValueOrUndefined(this._entity.rectangle.coordinates,e,yJe);if(!c(n))return;let i=ce.center(n,bJe);return he.toCartesian(i,ie.default,t)};Hd.prototype._isHidden=function(e,t){return!c(t.coordinates)||oi.prototype._isHidden.call(this,e,t)};Hd.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!Y.isConstant(t.height)||!Y.isConstant(t.extrudedHeight)||!Y.isConstant(t.granularity)||!Y.isConstant(t.stRotation)||!Y.isConstant(t.rotation)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.zIndex)||this._onTerrain&&!Y.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Ut)};Hd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Ut,i=Y.getValueOrUndefined(t.height,Ge.MINIMUM_VALUE),o=Y.getValueOrDefault(t.heightReference,Ge.MINIMUM_VALUE,qe.NONE),r=Y.getValueOrUndefined(t.extrudedHeight,Ge.MINIMUM_VALUE),s=Y.getValueOrDefault(t.extrudedHeightReference,Ge.MINIMUM_VALUE,qe.NONE);c(r)&&!c(i)&&(i=0);let a=this._options;a.vertexFormat=n?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(Ge.MINIMUM_VALUE,a.rectangle),a.granularity=Y.getValueOrUndefined(t.granularity,Ge.MINIMUM_VALUE),a.stRotation=Y.getValueOrUndefined(t.stRotation,Ge.MINIMUM_VALUE),a.rotation=Y.getValueOrUndefined(t.rotation,Ge.MINIMUM_VALUE),a.offsetAttribute=Gn.computeGeometryOffsetAttribute(i,o,r,s),a.height=Gn.getGeometryHeight(i,o),r=Gn.getGeometryExtrudedHeight(r,s),r===Gn.CLAMP_TO_GROUND&&(r=fi.getMinimumMaximumHeights(ZC.computeRectangle(a,Sde)).minimumTerrainHeight),a.extrudedHeight=r};Hd.DynamicGeometryUpdater=QC;function QC(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(QC.prototype=Object.create(ii.prototype),QC.prototype.constructor=QC);QC.prototype._isHidden=function(e,t,n){return!c(this._options.rectangle)||ii.prototype._isHidden.call(this,e,t,n)};QC.prototype._setOptions=function(e,t,n){let i=this._options,o=Y.getValueOrUndefined(t.height,n),r=Y.getValueOrDefault(t.heightReference,n,qe.NONE),s=Y.getValueOrUndefined(t.extrudedHeight,n),a=Y.getValueOrDefault(t.extrudedHeightReference,n,qe.NONE);c(s)&&!c(o)&&(o=0),i.rectangle=Y.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=Y.getValueOrUndefined(t.granularity,n),i.stRotation=Y.getValueOrUndefined(t.stRotation,n),i.rotation=Y.getValueOrUndefined(t.rotation,n),i.offsetAttribute=Gn.computeGeometryOffsetAttribute(o,r,s,a),i.height=Gn.getGeometryHeight(o,r),s=Gn.getGeometryExtrudedHeight(s,a),s===Gn.CLAMP_TO_GROUND&&(s=fi.getMinimumMaximumHeights(ZC.computeRectangle(i,Sde)).minimumTerrainHeight),i.extrudedHeight=s};var pk=Hd;var wde={};function TJe(e,t){return O.equalsEpsilon(e.latitude,t.latitude,O.EPSILON10)&&O.equalsEpsilon(e.longitude,t.longitude,O.EPSILON10)}var AJe=new he,CJe=new he;function EJe(e,t,n,i){t=xo(t,d.equalsEpsilon);let o=t.length;if(o<2)return;let r=c(i),s=c(n),a=new Array(o),l=new Array(o),u=new Array(o),f=t[0];a[0]=f;let h=e.cartesianToCartographic(f,AJe);s&&(h.height=n[0]),l[0]=h.height,r?u[0]=i[0]:u[0]=0;let p=l[0],g=u[0],m=p===g,y=1;for(let b=1;b<o;++b){let x=t[b],A=e.cartesianToCartographic(x,CJe);s&&(A.height=n[b]),m=m&&A.height===0,TJe(h,A)?h.height<A.height&&(l[y-1]=A.height):(a[y]=x,l[y]=A.height,r?u[y]=i[b]:u[y]=0,m=m&&l[y]===u[y],he.clone(A,h),++y)}if(!(m||y<2))return a.length=y,l.length=y,u.length=y,{positions:a,topHeights:l,bottomHeights:u}}var SJe=new Array(2),wJe=new Array(2),vJe={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};wde.computePositions=function(e,t,n,i,o,r){let s=EJe(e,t,n,i);if(!c(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,l=a-2,u,f,h=O.chordLength(o,e.maximumRadius),p=vJe;if(p.minDistance=h,p.ellipsoid=e,r){let g=0,m;for(m=0;m<a-1;m++)g+=Bi.numberOfPoints(t[m],t[m+1],h)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let y=SJe,b=wJe;p.positions=y,p.height=b;let x=0;for(m=0;m<a-1;m++){y[0]=t[m],y[1]=t[m+1],b[0]=n[m],b[1]=n[m+1];let A=Bi.generateArc(p);u.set(A,x),b[0]=i[m],b[1]=i[m+1],f.set(Bi.generateArc(p),x),x+=A.length}}else p.positions=t,p.height=n,u=new Float64Array(Bi.generateArc(p)),p.height=i,f=new Float64Array(Bi.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:l}};var JC=wde;var Nq=new d,_k=new d,DJe=new d,vde=new d,PJe=new d,IJe=new d,OJe=new d;function ex(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights;if(!c(t))throw new C("options.positions is required.");if(c(n)&&n.length!==t.length)throw new C("options.positions and options.maximumHeights must have the same length.");if(c(i)&&i.length!==t.length)throw new C("options.positions and options.minimumHeights must have the same length.");let o=e.vertexFormat??Ie.DEFAULT,r=e.granularity??O.RADIANS_PER_DEGREE,s=e.ellipsoid??ie.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Ie.clone(o),this._granularity=r,this._ellipsoid=ie.clone(s),this._workerName="createWallGeometry";let a=1+t.length*d.packedLength+2;c(i)&&(a+=i.length),c(n)&&(a+=n.length),this.packedLength=a+ie.packedLength+Ie.packedLength+1}ex.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._minimumHeights;if(r=c(s)?s.length:0,t[n++]=r,c(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=c(a)?a.length:0,t[n++]=r,c(a))for(i=0;i<r;++i)t[n++]=a[i];return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n]=e._granularity,t};var Dde=ie.clone(ie.UNIT_SPHERE),Pde=new Ie,JD={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Dde,vertexFormat:Pde,granularity:void 0};ex.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let l=ie.unpack(e,t,Dde);t+=ie.packedLength;let u=Ie.unpack(e,t,Pde);t+=Ie.packedLength;let f=e[t];return c(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ie.clone(l,n._ellipsoid),n._vertexFormat=Ie.clone(u,n._vertexFormat),n._granularity=f,n):(JD.positions=r,JD.minimumHeights=s,JD.maximumHeights=a,JD.granularity=f,new ex(JD))};ex.fromConstantHeights=function(e){e=e??W.EMPTY_OBJECT;let t=e.positions;if(!c(t))throw new C("options.positions is required.");let n,i,o=e.minimumHeight,r=e.maximumHeight,s=c(o),a=c(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let l={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new ex(l)};ex.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=JC.computePositions(s,t,i,n,r,!0);if(!c(a))return;let l=a.bottomPositions,u=a.topPositions,f=a.numCorners,h=u.length,p=h*2,g=o.position?new Float64Array(p):void 0,m=o.normal?new Float32Array(p):void 0,y=o.tangent?new Float32Array(p):void 0,b=o.bitangent?new Float32Array(p):void 0,x=o.st?new Float32Array(p/3*2):void 0,A=0,E=0,S=0,v=0,P=0,M=OJe,R=IJe,L=PJe,B=!0;h/=3;let _,w=0,D=1/(h-f-1);for(_=0;_<h;++_){let V=_*3,j=d.fromArray(u,V,Nq),U=d.fromArray(l,V,_k);if(o.position&&(g[A++]=U.x,g[A++]=U.y,g[A++]=U.z,g[A++]=j.x,g[A++]=j.y,g[A++]=j.z),o.st&&(x[P++]=w,x[P++]=0,x[P++]=w,x[P++]=1),o.normal||o.tangent||o.bitangent){let q=d.clone(d.ZERO,vde),X=d.subtract(j,s.geodeticSurfaceNormal(j,_k),_k);if(_+1<h&&(q=d.fromArray(u,V+3,vde)),B){let te=d.subtract(q,j,DJe),K=d.subtract(X,j,Nq);M=d.normalize(d.cross(K,te,M),M),B=!1}d.equalsEpsilon(j,q,O.EPSILON10)?B=!0:(w+=D,o.tangent&&(R=d.normalize(d.subtract(q,j,R),R)),o.bitangent&&(L=d.normalize(d.cross(M,R,L),L))),o.normal&&(m[E++]=M.x,m[E++]=M.y,m[E++]=M.z,m[E++]=M.x,m[E++]=M.y,m[E++]=M.z),o.tangent&&(y[v++]=R.x,y[v++]=R.y,y[v++]=R.z,y[v++]=R.x,y[v++]=R.y,y[v++]=R.z),o.bitangent&&(b[S++]=L.x,b[S++]=L.y,b[S++]=L.z,b[S++]=L.x,b[S++]=L.y,b[S++]=L.z)}}let I=new hn;o.position&&(I.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:g})),o.normal&&(I.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(I.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:y})),o.bitangent&&(I.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:b})),o.st&&(I.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:x}));let N=p/3;p-=6*(f+1);let k=Fe.createTypedArray(N,p),H=0;for(_=0;_<N-2;_+=2){let V=_,j=_+2,U=d.fromArray(g,V*3,Nq),q=d.fromArray(g,j*3,_k);if(d.equalsEpsilon(U,q,O.EPSILON10))continue;let X=_+1,te=_+3;k[H++]=X,k[H++]=V,k[H++]=te,k[H++]=te,k[H++]=V,k[H++]=j}return new ct({attributes:I,indices:k,primitiveType:Me.TRIANGLES,boundingSphere:new le.fromVertices(g)})};var gk=ex;var Ide=new d,Ode=new d;function tx(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights;if(!c(t))throw new C("options.positions is required.");if(c(n)&&n.length!==t.length)throw new C("options.positions and options.maximumHeights must have the same length.");if(c(i)&&i.length!==t.length)throw new C("options.positions and options.minimumHeights must have the same length.");let o=e.granularity??O.RADIANS_PER_DEGREE,r=e.ellipsoid??ie.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=ie.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*d.packedLength+2;c(i)&&(s+=i.length),c(n)&&(s+=n.length),this.packedLength=s+ie.packedLength+1}tx.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._minimumHeights;if(r=c(s)?s.length:0,t[n++]=r,c(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=c(a)?a.length:0,t[n++]=r,c(a))for(i=0;i<r;++i)t[n++]=a[i];return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n]=e._granularity,t};var Rde=ie.clone(ie.UNIT_SPHERE),eP={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:Rde,granularity:void 0};tx.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let l=ie.unpack(e,t,Rde);t+=ie.packedLength;let u=e[t];return c(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ie.clone(l,n._ellipsoid),n._granularity=u,n):(eP.positions=r,eP.minimumHeights=s,eP.maximumHeights=a,eP.granularity=u,new tx(eP))};tx.fromConstantHeights=function(e){e=e??W.EMPTY_OBJECT;let t=e.positions;if(!c(t))throw new C("options.positions is required.");let n,i,o=e.minimumHeight,r=e.maximumHeight,s=c(o),a=c(r);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=o),a&&(i[f]=r)}let l={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new tx(l)};tx.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=JC.computePositions(r,t,i,n,o,!1);if(!c(s))return;let a=s.bottomPositions,l=s.topPositions,u=l.length,f=u*2,h=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let A=g*3,E=d.fromArray(l,A,Ide),S=d.fromArray(a,A,Ode);h[p++]=S.x,h[p++]=S.y,h[p++]=S.z,h[p++]=E.x,h[p++]=E.y,h[p++]=E.z}let m=new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:h})}),y=f/3;f=2*y-4+y;let b=Fe.createTypedArray(y,f),x=0;for(g=0;g<y-2;g+=2){let A=g,E=g+2,S=d.fromArray(h,A*3,Ide),v=d.fromArray(h,E*3,Ode);if(d.equalsEpsilon(S,v,O.EPSILON10))continue;let P=g+1,M=g+3;b[x++]=P,b[x++]=A,b[x++]=P,b[x++]=M,b[x++]=A,b[x++]=E}return b[x++]=y-2,b[x++]=y-1,new ct({attributes:m,indices:b,primitiveType:Me.LINES,boundingSphere:new le.fromVertices(h)})};var yk=tx;var Mde=new G;function RJe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function Gd(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new RJe(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}c(Object.create)&&(Gd.prototype=Object.create(oi.prototype),Gd.prototype.constructor=Gd);Gd.prototype.createFillGeometryInstance=function(e){if(T.defined("time",e),!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i,o,r=new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=kn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Ut){let l;c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(l=this._materialProperty.color.getValue(e,Mde)),c(l)||(l=G.WHITE),o=jt.fromColor(l),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new St({id:t,geometry:new gk(this._options),attributes:i})};Gd.prototype.createOutlineGeometryInstance=function(e){if(T.defined("time",e),!this._outlineEnabled)throw new C("This instance does not represent an outlined geometry.");let t=this._entity,n=t.isAvailable(e),i=Y.getValueOrDefault(this._outlineColorProperty,e,G.BLACK,Mde),o=this._distanceDisplayConditionProperty.getValue(e);return new St({id:t,geometry:new yk(this._options),attributes:{show:new xn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:jt.fromColor(i),distanceDisplayCondition:kn.fromDistanceDisplayCondition(o)}})};Gd.prototype._isHidden=function(e,t){return!c(t.positions)||oi.prototype._isHidden.call(this,e,t)};Gd.prototype._getIsClosed=function(e){return!1};Gd.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!Y.isConstant(t.minimumHeights)||!Y.isConstant(t.maximumHeights)||!Y.isConstant(t.outlineWidth)||!Y.isConstant(t.granularity)};Gd.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Ut,s=this._options;s.vertexFormat=r?rn.VERTEX_FORMAT:so.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(Ge.MINIMUM_VALUE,s.positions),s.minimumHeights=c(n)?n.getValue(Ge.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=c(i)?i.getValue(Ge.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=c(o)?o.getValue(Ge.MINIMUM_VALUE):void 0};Gd.DynamicGeometryUpdater=eE;function eE(e,t,n){ii.call(this,e,t,n)}c(Object.create)&&(eE.prototype=Object.create(ii.prototype),eE.prototype.constructor=eE);eE.prototype._isHidden=function(e,t,n){return!c(this._options.positions)||ii.prototype._isHidden.call(this,e,t,n)};eE.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=Y.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=Y.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=Y.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=Y.getValueOrUndefined(t.granularity,n)};var bk=Gd;var nx=[cN,R3,E3,ek,tk,ak,fk,mk,pk,bk];function ix(e,t){this.entity=e,this.scene=t;let n=new Array(nx.length),i=new pe,o=new Ar;for(let r=0;r<n.length;r++){let s=new nx[r](e,t);o.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(ix.prototype._onEntityPropertyChanged,this)}ix.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r<o.length;r++)o[r]._onEntityPropertyChanged(e,t,n,i)};ix.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};ix.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),de(this)};ix.registerUpdater=function(e){nx.includes(e)||nx.push(e)};ix.unregisterUpdater=function(e){if(nx.includes(e)){let t=nx.indexOf(e);nx.splice(t,1)}};var tE=ix;var Lde=new G,MJe=new Lt,LJe=new Lt,NJe=d.ZERO,FJe=new d;function jd(e,t,n,i,o,r,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.updaters=new Et,this.updatersWithAttributes=new Et,this.attributes=new Et,this.subscriptions=new Et,this.showsUpdated=new Et,this.itemsToRemove=[],this.invalidated=!1;let a;c(o)&&(a=o.definitionChanged.addEventListener(jd.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}jd.prototype.onMaterialChanged=function(){this.invalidated=!0};jd.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:c(t)?t.equals(n):!1};jd.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!Y.isConstant(e.distanceDisplayConditionProperty)||!Y.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};jd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return c(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};jd.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let l;c(this.depthFailAppearanceType)&&(c(this.depthFailMaterialProperty)&&(this.depthFailMaterial=or.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial)),l=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new this.appearanceType({translucent:this.translucent,closed:this.closed}),depthFailAppearance:l,shadows:this.shadows}),o.add(i),t=!1}else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),c(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=or.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(c(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||l){let b=u.fillMaterialProperty.color,x=Y.getValueOrDefault(b,e,G.WHITE,Lde);G.equals(h._lastColor,x)||(h._lastColor=G.clone(x,h._lastColor),h.color=jt.toValue(x,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(c(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Ut&&(!u.depthFailMaterialProperty.isConstant||l)){let b=u.depthFailMaterialProperty.color,x=Y.getValueOrDefault(b,e,G.WHITE,Lde);G.equals(h._lastDepthFailColor,x)||(h._lastDepthFailColor=G.clone(x,h._lastDepthFailColor),h.depthFailColor=jt.toValue(x,h.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=xn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let b=Y.getValueOrDefault(m,e,LJe,MJe);Lt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(b,h.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!Y.isConstant(y)){let b=Y.getValueOrDefault(y,e,NJe,FJe);d.equals(b,h._lastOffset)||(h._lastOffset=d.clone(b,h._lastOffset),h.offset=Ji.toValue(b,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else c(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};jd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);c(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,l=s.show[0]===1;a!==l&&(s.show=xn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};jd.prototype.contains=function(e){return this.updaters.contains(e.id)};jd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};jd.prototype.destroy=function(){let e=this.primitive,t=this.primitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),c(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function nE(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}nE.prototype.add=function(e,t){let n,i,o=t.createFillGeometryInstance(e);o.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let r=n.length;for(let a=0;a<r;a++){let l=n[a];if(l.isMaterial(t)){l.add(t,o);return}}let s=new jd(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function Nde(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}nE.prototype.remove=function(e){Nde(this._solidItems,e)||Nde(this._translucentItems,e)};function Fde(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,l=a.length;if(l>0)for(r=0;r<l;r++){let u=a[r];s.remove(u),e.add(n,u),i=!0}}return i}function xk(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,l=a.length;for(let u=0;u<l;u++)e.add(n,a[u]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}nE.prototype.update=function(e){let t=xk(this,this._solidItems,e,!0);t=xk(this,this._translucentItems,e,t)&&t;let n=Fde(this,this._solidItems,e),i=Fde(this,this._translucentItems,e);return(n||i)&&(t=xk(this,this._solidItems,e,t)&&t,t=xk(this,this._translucentItems,e,t)&&t),t};function Bde(e,t,n){let i=e.length;for(let o=0;o<i;o++){let r=e[o];if(r.contains(t))return r.getBoundingSphere(t,n)}return lt.FAILED}nE.prototype.getBoundingSphere=function(e,t){let n=Bde(this._solidItems,e,t);return n===lt.FAILED?Bde(this._translucentItems,e,t):n};function kde(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}nE.prototype.removeAllPrimitives=function(){kde(this._solidItems),kde(this._translucentItems)};var Wd=nE;var BJe=new Lt,kJe=new Lt,UJe=d.ZERO,VJe=new d;function qd(e,t,n,i,o,r,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=s,this.updaters=new Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(qd.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et}qd.prototype.onMaterialChanged=function(){this.invalidated=!0};qd.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(n===t&&o===i)return!0;let r=c(t)&&t.equals(n);return r=(!c(i)&&!c(o)||c(i)&&i.equals(o))&&r,r};qd.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!Y.isConstant(t.distanceDisplayConditionProperty)||!Y.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};qd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return c(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var zJe=new G;qd.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=or.getValue(e,this.materialProperty,this.material);let a;c(this.depthFailMaterialProperty)&&(this.depthFailMaterial=or.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),a=new this.depthFailAppearanceType({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})),n=new In({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=or.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,c(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Ut)&&(this.depthFailMaterial=or.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let l=s[r],u=l.entity,f=this.geometry.get(l.id),h=this.attributes.get(f.id.id);if(c(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),c(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Ut&&!l.depthFailMaterialProperty.isConstant){let b=l.depthFailMaterialProperty.color,x=Y.getValueOrDefault(b,e,G.WHITE,zJe);G.equals(h._lastDepthFailColor,x)||(h._lastDepthFailColor=G.clone(x,h._lastDepthFailColor),h.depthFailColor=jt.toValue(x,h.depthFailColor))}let p=u.isShowing&&(l.hasConstantFill||l.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=xn.toValue(p,h.show));let m=l.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let b=Y.getValueOrDefault(m,e,kJe,BJe);Lt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(b,h.distanceDisplayCondition))}let y=l.terrainOffsetProperty;if(!Y.isConstant(y)){let b=Y.getValueOrDefault(y,e,UJe,VJe);d.equals(b,h._lastOffset)||(h._lastOffset=d.clone(b,h._lastOffset),h.offset=Ji.toValue(b,h.offset))}}this.updateShows(n)}else c(n)&&!n.ready&&(t=!1);return t};qd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);c(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let l=r.isShowing,u=a.show[0]===1;l!==u&&(a.show=xn.toValue(l,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};qd.prototype.contains=function(e){return this.updaters.contains(e.id)};qd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};qd.prototype.destroy=function(){let e=this.primitive,t=this.primitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),this.removeMaterialSubscription()};function iE(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}iE.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let s=n[r];if(s.isMaterial(t)){s.add(e,t);return}}let o=new qd(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};iE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};iE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let l=0;l<a;l++)this.add(e,s[l]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};iE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return lt.FAILED};iE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Yd=iE;var Vde=jr(Ude(),1);function Tk(){this._tree=new Vde.default}function ox(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}ox.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};Tk.prototype.insert=function(e,t){T.typeOf.string("id",e),T.typeOf.object("rectangle",t);let n=ox.fromRectangleAndId(e,t,new ox);this._tree.insert(n)};function HJe(e,t){return e.id===t.id}var GJe=new ox;Tk.prototype.remove=function(e,t){T.typeOf.string("id",e),T.typeOf.object("rectangle",t);let n=ox.fromRectangleAndId(e,t,GJe);this._tree.remove(n,HJe)};var jJe=new ox;Tk.prototype.collides=function(e){T.typeOf.object("rectangle",e);let t=ox.fromRectangleAndId("",e,jJe);return this._tree.collides(t)};var oE=Tk;var WJe=new G,qJe=new Lt,YJe=new Lt;function l_(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.updaters=new Et,this.updatersWithAttributes=new Et,this.attributes=new Et,this.subscriptions=new Et,this.showsUpdated=new Et,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new oE}l_.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};l_.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!Y.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};l_.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return c(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};l_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new _l({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(c(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.fillMaterialProperty.isConstant||l){let y=u.fillMaterialProperty.color,b=Y.getValueOrDefault(y,e,G.WHITE,WJe);G.equals(h._lastColor,b)||(h._lastColor=G.clone(b,h._lastColor),h.color=jt.toValue(b,h.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=xn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let y=Y.getValueOrDefault(m,e,YJe,qJe);Lt.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(y,h.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else c(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};l_.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);c(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,l=s.show[0]===1;a!==l&&(s.show=xn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};l_.prototype.contains=function(e){return this.updaters.contains(e.id)};l_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getBoundingSphere(e.entity);return c(i)?(i.clone(t),lt.DONE):lt.FAILED};l_.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;c(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;c(n)&&(e.remove(n),this.oldPrimitive=void 0)};function rE(e,t){this._batches=[],this._primitives=e,this._classificationType=t}rE.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=Y.getValueOrDefault(t.zIndex,0),r,s=i.length;for(let a=0;a<s;++a){let l=i[a];if(l.zIndex===o&&!l.overlapping(n.geometry.rectangle)){r=l;break}}return c(r)||(r=new l_(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};rE.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};rE.prototype.update=function(e){let t,n,i=!0,o=this._batches,r=o.length;for(t=0;t<r;++t)i=o[t].update(e)&&i;for(t=0;t<r;++t){let s=o[t],a=s.itemsToRemove,l=a.length;for(let u=0;u<l;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};rE.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return lt.FAILED};rE.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var tP=rE;var XJe=new Lt,KJe=new Lt;function Vf(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=i.definitionChanged.addEventListener(Vf.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new oE}Vf.prototype.onMaterialChanged=function(){this.invalidated=!0};Vf.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Vf.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:c(t)&&t.equals(n)};Vf.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!Y.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,l){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Vf.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return c(i)&&(i(),this.subscriptions.remove(t)),!0}return!1};Vf.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=or.getValue(e,this.materialProperty,this.material),n=new _l({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new this.appearanceType({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1;else{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=or.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let l=s[r],u=l.entity,f=this.geometry.get(l.id),h=this.attributes.get(f.id.id);c(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h));let p=u.isShowing&&(l.hasConstantFill||l.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=xn.toValue(p,h.show));let m=l.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let y=Y.getValueOrDefault(m,e,KJe,XJe);Lt.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(y,h.distanceDisplayCondition))}}this.updateShows(n)}else c(n)&&!n.ready&&(t=!1);return t};Vf.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);c(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let l=r.isShowing,u=a.show[0]===1;l!==u&&(a.show=xn.toValue(l,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Vf.prototype.contains=function(e){return this.updaters.contains(e.id)};Vf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};Vf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),this.removeMaterialSubscription()};function sE(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}sE.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=sf.shouldUseSphericalCoordinates(o.geometry.rectangle),s=Y.getValueOrDefault(t.zIndex,0);for(let l=0;l<i;++l){let u=n[l];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===r&&u.zIndex===s&&!u.overlapping(o.geometry.rectangle)){u.add(e,t,o);return}}let a=new Vf(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};sE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};sE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let l=0;l<a;l++)this.add(e,s[l]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};sE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return lt.FAILED};sE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Ak=sE;var $Je=new G,ZJe=new Lt,QJe=new Lt,JJe=d.ZERO,eet=new d;function u_(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.updaters=new Et,this.updatersWithAttributes=new Et,this.attributes=new Et,this.itemsToRemove=[],this.subscriptions=new Et,this.showsUpdated=new Et}u_.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!Y.isConstant(e.distanceDisplayConditionProperty)||!Y.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};u_.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return c(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};u_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)c(i)&&(c(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new rn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{c(i)&&(o.remove(i),i=void 0);let l=this.oldPrimitive;c(l)&&(o.remove(l),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(c(i)&&i.ready){i.show=!0,c(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,l=this.waitingOnCreate;for(r=0;r<a;r++){let u=s[r],f=this.geometry.get(u.id),h=this.attributes.get(f.id.id);if(c(h)||(h=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!u.outlineColorProperty.isConstant||l){let b=u.outlineColorProperty,x=Y.getValueOrDefault(b,e,G.WHITE,$Je);G.equals(h._lastColor,x)||(h._lastColor=G.clone(x,h._lastColor),h.color=jt.toValue(x,h.color),(this.translucent&&h.color[3]===255||!this.translucent&&h.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=h.show[0]===1;p!==g&&(h.show=xn.toValue(p,h.show));let m=u.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let b=Y.getValueOrDefault(m,e,QJe,ZJe);Lt.equals(b,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(b,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(b,h.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!Y.isConstant(y)){let b=Y.getValueOrDefault(y,e,JJe,eet);d.equals(b,h._lastOffset)||(h._lastOffset=d.clone(b,h._lastOffset),h.offset=Ji.toValue(b,h.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else c(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};u_.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);c(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,l=s.show[0]===1;a!==l&&(s.show=xn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};u_.prototype.contains=function(e){return this.updaters.contains(e.id)};u_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};u_.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;c(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;c(n)&&(e.remove(n),this.oldPrimitive=void 0)};function aE(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Et,this._translucentBatches=new Et}aE.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),o,r;n.attributes.color.value[3]===255?(o=this._solidBatches,r=o.get(i),c(r)||(r=new u_(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),c(r)||(r=new u_(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};aE.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let o=this._translucentBatches.values,r=o.length;for(t=0;t<r;t++)if(o[t].remove(e))return};aE.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,l=a.length,u,f=!0,h=!1;do{for(h=!1,n=0;n<s;n++){o=r[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(h=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}for(n=0;n<l;n++){o=a[n],f=o.update(e),u=o.itemsToRemove;let p=u.length;if(p>0)for(h=!0,t=0;t<p;t++)i=u[t],o.remove(i),this.add(e,i)}}while(h);return f};aE.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let r=this._translucentBatches.values,s=r.length;for(n=0;n<s;n++){let a=r[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return lt.FAILED};aE.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,o=i.length;for(e=0;e<o;e++)i[e].removeAllPrimitives()};var nP=aE;var tet=[];function Ml(e,t,n,i){T.defined("scene",e),T.defined("entityCollection",t),n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Et,this._removedObjects=new Et,this._changedObjects=new Et;let o=Tn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(o*2),this._closedColorBatches=new Array(o*2),this._closedMaterialBatches=new Array(o*2),this._openColorBatches=new Array(o*2),this._openMaterialBatches=new Array(o*2);let r=rr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new nP(n,e,s,!1),this._outlineBatches[o+s]=new nP(n,e,s,!0),this._closedColorBatches[s]=new Wd(n,rn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new Wd(n,rn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Yd(n,so,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new Yd(n,so,void 0,!0,s,!1),this._openColorBatches[s]=new Wd(n,rn,void 0,!1,s,!0),this._openColorBatches[o+s]=new Wd(n,rn,void 0,!1,s,!1),this._openMaterialBatches[s]=new Yd(n,so,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new Yd(n,so,void 0,!1,s,!1);let a=Un.NUMBER_OF_CLASSIFICATION_TYPES,l=new Array(a),u=[];if(r)for(s=0;s<a;++s)u.push(new Ak(i,s,so)),l[s]=new tP(i,s);else for(s=0;s<a;++s)l[s]=new tP(i,s);this._groundColorBatches=l,this._groundMaterialBatches=u,this._dynamicBatch=new UC(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Et,this._updaterSets=new Et,this._entityCollection=t,t.collectionChanged.addEventListener(Ml.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,tet)}Ml.registerUpdater=function(e){tE.registerUpdater(e)};Ml.unregisterUpdater=function(e){tE.unregisterUpdater(e)};Ml.prototype.update=function(e){T.defined("time",e);let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,l,u,f,h=this;for(a=s.length-1;a>-1;a--)l=s[a],u=l.id,f=this._updaterSets.get(u),f.entity===l?f.forEach(function(y){h._removeUpdater(y),h._insertUpdaterIntoBatch(e,y)}):(o.push(l),n.push(l));for(a=o.length-1;a>-1;a--)l=o[a],u=l.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)l=n[a],u=l.id,f=new tE(l,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){h._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Ml._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,g=this._batches,m=g.length;for(a=0;a<m;a++)p=g[a].update(e)&&p;return p};var net=[],iet=new le;Ml.prototype.getBoundingSphere=function(e,t){T.defined("entity",e),T.defined("result",t);let n=net,i=iet,o=0,r=lt.DONE,s=this._batches,a=s.length,l=e.id,u=this._updaterSets.get(l).updaters;for(let f=0;f<u.length;f++){let h=u[f];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(h,i),r===lt.PENDING)return lt.PENDING;r===lt.DONE&&(n[o]=le.clone(i,n[o]),o++)}}return o===0?lt.FAILED:(n.length=o,le.fromBoundingSpheres(n,t),lt.DONE)};Ml.prototype.isDestroyed=function(){return!1};Ml.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ml.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let o=this._updaterSets.values;for(n=o.length,e=0;e<n;e++)o[e].destroy();return this._updaterSets.removeAll(),de(this)};Ml.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Ml.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=Tn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(c(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let o=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Ut?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Ut?c(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):c(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Ut?c(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):c(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Ml._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!c(t.get(o))&&!c(n.get(o))&&n.set(o,i)};Ml.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,l;for(s=n.length-1;s>-1;s--)l=n[s],a=l.id,i.remove(a)||(o.set(a,l),r.remove(a));for(s=t.length-1;s>-1;s--)l=t[s],a=l.id,o.remove(a)?r.set(a,l):i.set(a,l)};var Ck=Ml;var oet=1,ret="30px sans-serif",set=Ko.FILL,aet=G.WHITE,cet=G.BLACK,uet=1,fet=!1,det=new G(.165,.165,.165,.8),het=new z(7,5),met=z.ZERO,pet=d.ZERO,_et=qe.NONE,get=xi.CENTER,yet=Fn.CENTER,bet=new d,xet=new G,Tet=new G,Aet=new G,Cet=new z,Eet=new d,wet=new z,vet=new Bt,Det=new Bt,Pet=new Bt,Iet=new Lt;function zde(e){this.entity=e,this.label=void 0,this.index=void 0}function Ty(e,t){if(!c(e))throw new C("entityCluster is required.");if(!c(t))throw new C("entityCollection is required.");t.collectionChanged.addEventListener(Ty.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}Ty.prototype.update=function(e){if(!c(e))throw new C("time is required.");let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._label,l,u=r.label,f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),h;if(f&&(h=Y.getValueOrUndefined(s._position,e,bet),l=Y.getValueOrUndefined(a._text,e),f=c(h)&&c(l)),!f){kq(r,s,n);continue}Y.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=Y.getValueOrDefault(a._heightReference,e,_et);c(u)||(u=n.getLabel(s),u.id=s,r.label=u,p=d.equals(u.position,h)&&u.heightReference===g),u.show=!0,u.position=h,u.text=l,u.scale=Y.getValueOrDefault(a._scale,e,oet),u.font=Y.getValueOrDefault(a._font,e,ret),u.style=Y.getValueOrDefault(a._style,e,set),u.fillColor=Y.getValueOrDefault(a._fillColor,e,aet,xet),u.outlineColor=Y.getValueOrDefault(a._outlineColor,e,cet,Tet),u.outlineWidth=Y.getValueOrDefault(a._outlineWidth,e,uet),u.showBackground=Y.getValueOrDefault(a._showBackground,e,fet),u.backgroundColor=Y.getValueOrDefault(a._backgroundColor,e,det,Aet),u.backgroundPadding=Y.getValueOrDefault(a._backgroundPadding,e,het,Cet),u.pixelOffset=Y.getValueOrDefault(a._pixelOffset,e,met,wet),u.eyeOffset=Y.getValueOrDefault(a._eyeOffset,e,pet,Eet),u.heightReference=g,u.horizontalOrigin=Y.getValueOrDefault(a._horizontalOrigin,e,get),u.verticalOrigin=Y.getValueOrDefault(a._verticalOrigin,e,yet),u.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,vet),u.pixelOffsetScaleByDistance=Y.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,Det),u.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,Pet),u.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,Iet),u.disableDepthTestDistance=Y.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};Ty.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new C("entity is required.");if(!c(t))throw new C("result is required.");let n=this._items.get(e.id);if(!c(n)||!c(n.label))return lt.FAILED;let i=n.label;return t.center=d.clone(i._clampedPosition??i.position,t.center),t.radius=0,lt.DONE};Ty.prototype.isDestroyed=function(){return!1};Ty.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ty.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return de(this)};Ty.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],c(r._label)&&c(r._position)&&s.set(r.id,new zde(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._label)&&c(r._position)?s.contains(r.id)||s.set(r.id,new zde(r)):(kq(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],kq(s.get(r.id),r,a),s.remove(r.id)};function kq(e,t,n){c(e)&&(e.label=void 0,n.removeLabel(t))}var Ek=Ty;var Oet=1,Ret=!0,Met=0,Let=!0,Net=!0,Fet=Tn.ENABLED,Bet=qe.NONE,ket=G.RED,Uet=0,Vet=G.WHITE,zet=kc.HIGHLIGHT,Het=.5,Get=new z(1,1),Hde={maximumPositionEpsilon:Number.POSITIVE_INFINITY},jet=new F,Wet=new F,Gde=new G,jde=new Array(4),qet=new d;function Ay(e,t){T.typeOf.object("scene",e),T.typeOf.object("entityCollection",t),t.collectionChanged.addEventListener(Ay.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Et,this._onCollectionChanged(t,t.values,[],[])}async function Yet(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await om.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!c(s[t.id]))return;a.id=t,r.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(l=>{c(s[t.id])&&(console.log(l),l.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!c(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}Ay.prototype.update=function(e){if(!c(e))throw new C("time is required.");let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,l,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),h;if(f&&(h=s.computeModelMatrix(e,jet),l=we.createIfNeeded(Y.getValueOrUndefined(a._uri,e)),f=c(h)&&c(l)),!f){c(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if(!c(u)||l.url!==u.url){c(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:l.url,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...Hde}},n[s.id]=u;let m=Y.getValueOrDefault(a._incrementallyLoadTextures,e,Let),y=Y.getValueOrDefault(a._environmentMapOptions,e,Hde,u.environmentMapOptionsScratch);Yet(this,s,l,m,y)}let p=u.modelPrimitive;if(!c(p))continue;p.show=!0,p.scale=Y.getValueOrDefault(a._scale,e,Oet),p.enableVerticalExaggeration=Y.getValueOrDefault(a._enableVerticalExaggeration,e,Ret),p.minimumPixelSize=Y.getValueOrDefault(a._minimumPixelSize,e,Met),p.maximumScale=Y.getValueOrUndefined(a._maximumScale,e),p.modelMatrix=F.clone(h,p.modelMatrix),p.shadows=Y.getValueOrDefault(a._shadows,e,Fet),p.heightReference=Y.getValueOrDefault(a._heightReference,e,Bet),p.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e),p.silhouetteColor=Y.getValueOrDefault(a._silhouetteColor,e,ket,Gde),p.silhouetteSize=Y.getValueOrDefault(a._silhouetteSize,e,Uet),p.color=Y.getValueOrDefault(a._color,e,Vet,Gde),p.colorBlendMode=Y.getValueOrDefault(a._colorBlendMode,e,zet),p.colorBlendAmount=Y.getValueOrDefault(a._colorBlendAmount,e,Het),p.clippingPlanes=Y.getValueOrUndefined(a._clippingPlanes,e),p.clampAnimations=Y.getValueOrDefault(a._clampAnimations,e,Net),p.imageBasedLighting.imageBasedLightingFactor=Y.getValueOrDefault(a._imageBasedLightingFactor,e,Get);let g=Y.getValueOrUndefined(a._lightColor,e);if(c(g)&&(G.pack(g,jde,0),g=d.unpack(jde,0,qet)),p.lightColor=g,p.customShader=Y.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,p.ready){let m=Y.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==m&&(m?p.activeAnimations.addAll({loop:au.REPEAT}):p.activeAnimations.removeAll(),u.animationsRunning=m);let y=Y.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(c(y)){let A=Object.keys(y);for(let E=0,S=A.length;E<S;++E){let v=A[E],P=y[v];if(!c(P))continue;let M=p.getNode(v);if(!c(M))continue;let R=F.fromTranslationRotationScale(P,Wet);M.matrix=F.multiply(M.originalMatrix,R,R)}}let b=!1,x=Y.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(c(x)){let A=Object.keys(x);for(let E=0,S=A.length;E<S;++E){let v=A[E],P=x[v];c(P)&&(b=!0,p.setArticulationStage(v,P))}}b&&p.applyArticulations()}}return!0};Ay.prototype.isDestroyed=function(){return!1};Ay.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ay.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Uq(this,e[i],t,n);return de(this)};var Sk=new d,Xet=new he;Ay.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new C("entity is required.");if(!c(t))throw new C("result is required.");let n=this._modelHash[e.id];if(!c(n))return lt.FAILED;if(n.loadFailed)return lt.FAILED;let i=n.modelPrimitive;if(!c(i)||!i.show)return lt.PENDING;if(!i.ready||!n.modelUpdated)return lt.PENDING;let o=this._scene,r=o.ellipsoid??ie.default;if(i.heightReference!==qe.NONE){let a=i.modelMatrix;Sk.x=a[12],Sk.y=a[13],Sk.z=a[14];let l=r.cartesianToCartographic(Sk,Xet),u=o.getHeight(l,i.heightReference);return c(u)&&(of(i.heightReference)?l.height=u:l.height+=u),le.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(l),lt.DONE}return le.clone(i.boundingSphere,t),lt.DONE};Ay.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,l=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],c(r._model)&&c(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],c(r._model)&&c(r._position)?(Ket(r,a),s.set(r.id,r)):(Uq(this,r,a,l),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Uq(this,r,a,l),s.remove(r.id)};function Uq(e,t,n,i){let o=n[t.id];c(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function Ket(e,t){let n=t[e.id];c(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var wk=Ay;function Cy(e){this._definitionChanged=new pe,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(Cy.prototype,{isConstant:{get:function(){return Y.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return c(this._value)?this._value.referenceFrame:zi.FIXED}}});var $et=new Q;Cy.prototype.getValue=function(e,t){return c(e)||(e=Q.now($et)),this.getValueInReferenceFrame(e,zi.FIXED,t)};Cy.prototype.setValue=function(e){this._value!==e&&(this._value=e,c(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),c(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};Cy.prototype.getValueInReferenceFrame=function(e,t,n){if(!c(e))throw new C("time is required.");if(!c(t))throw new C("referenceFrame is required.");if(c(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),c(n)?ie.default.scaleToGeodeticSurface(n,n):void 0};Cy.prototype.equals=function(e){return this===e||e instanceof Cy&&this._value===e._value};Cy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var f_=Cy;var Zet=60,Qet=1,qde=new Sn,Vq=new Sn,zq=new Sn;function Wde(e){this.entity=e,this.polyline=void 0,this.index=void 0,this.updater=void 0}function Jet(e,t,n,i,o,r,s,a,l){let u=a,f;f=e.getValueInReferenceFrame(t,r,l[u]),c(f)&&(l[u++]=f);let h=!c(o)||Q.lessThanOrEquals(o,t)||Q.greaterThanOrEquals(o,n),p=0,g=i.length,m=i[p],y=n,b=!1,x,A,E;for(;p<g;){if(!h&&Q.greaterThanOrEquals(m,o)&&(f=e.getValueInReferenceFrame(o,r,l[u]),c(f)&&(l[u++]=f),h=!0),Q.greaterThan(m,t)&&Q.lessThan(m,y)&&!m.equals(o)&&(f=e.getValueInReferenceFrame(m,r,l[u]),c(f)&&(l[u++]=f)),p<g-1){if(s>0&&!b){let S=i[p+1],v=Q.secondsDifference(S,m);b=v>s,b&&(x=Math.ceil(v/s),A=0,E=v/Math.max(x,2),x=Math.max(x-1,1))}if(b&&A<x){m=Q.addSeconds(m,E,new Q),A++;continue}}b=!1,p++,m=i[p]}return f=e.getValueInReferenceFrame(n,r,l[u]),c(f)&&(l[u++]=f),u}function ett(e,t,n,i,o,r,s,a){let l,u=0,f=s,h=t,p=!c(i)||Q.lessThanOrEquals(i,t)||Q.greaterThanOrEquals(i,n);for(;Q.lessThan(h,n);)!p&&Q.greaterThanOrEquals(h,i)&&(p=!0,l=e.getValueInReferenceFrame(i,o,a[f]),c(l)&&(a[f]=l,f++)),l=e.getValueInReferenceFrame(h,o,a[f]),c(l)&&(a[f]=l,f++),u++,h=Q.addSeconds(t,r*u,new Q);return l=e.getValueInReferenceFrame(n,o,a[f]),c(l)&&(a[f]=l,f++),f}function ttt(e,t,n,i,o,r,s,a){let l,u=0,f=s,h=t,p=Math.max(r,60),g=!c(i)||Q.lessThanOrEquals(i,t)||Q.greaterThanOrEquals(i,n);for(;Q.lessThan(h,n);)!g&&Q.greaterThanOrEquals(h,i)&&(g=!0,l=e.getValueInReferenceFrame(i,o,a[f]),c(l)&&(a[f]=l,f++)),l=e.getValueInReferenceFrame(h,o,a[f]),c(l)&&(a[f]=l,f++),u++,h=Q.addSeconds(t,p*u,new Q);return l=e.getValueInReferenceFrame(n,o,a[f]),c(l)&&(a[f]=l,f++),f}function ntt(e,t,n,i,o,r,s,a){zq.start=t,zq.stop=n;let l=s,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!Sn.intersect(h,zq,qde).isEmpty){let p=h.start;h.isStartIncluded||(h.isStopIncluded?p=h.stop:p=Q.addSeconds(h.start,Q.secondsDifference(h.stop,h.start)/2,new Q));let g=e.getValueInReferenceFrame(p,o,a[l]);c(g)&&(a[l]=g,l++)}}return l}function itt(e,t,n,i,o,r,s,a){let l=e.getValueInReferenceFrame(t,o,a[s]);return c(l)&&(a[s++]=l),s}function ott(e,t,n,i,o,r,s,a){Vq.start=t,Vq.stop=n;let l=s,u=e.intervals;for(let f=0;f<u.length;f++){let h=u.get(f);if(!Sn.intersect(h,Vq,qde).isEmpty){let p=h.start,g=h.stop,m=t;Q.greaterThan(p,m)&&(m=p);let y=n;Q.lessThan(g,y)&&(y=g),l=Yde(h.data,m,y,i,o,r,l,a)}}return l}function Yde(e,t,n,i,o,r,s,a){for(;e instanceof dy;)e=e.resolvedProperty;if(e instanceof Ia){let l=e._property._times;s=Jet(e,t,n,l,i,o,r,s,a)}else e instanceof lN?s=ett(e,t,n,i,o,r,s,a):e instanceof Pa?s=ott(e,t,n,i,o,r,s,a):e instanceof my?s=ntt(e,t,n,i,o,r,s,a):e instanceof gl||e instanceof f_&&Y.isConstant(e)?s=itt(e,t,n,i,o,r,s,a):s=ttt(e,t,n,i,o,r,s,a);return s}function Xde(e,t,n,i,o,r,s){c(s)||(s=[]);let a=Yde(e,t,n,i,o,r,0,s);return s.length=a,s}var rtt=new J;function iP(e,t){this._unusedIndexes=[],this._polylineCollection=new cm,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}iP.prototype.update=function(e){if(this._referenceFrame===zi.INERTIAL){let t=Ot.computeIcrfToCentralBodyFixedMatrix(e,rtt);F.fromRotationTranslation(t,d.ZERO,this._polylineCollection.modelMatrix)}};iP.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,l=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!c(a)||a.getValue(e));if(u){let h=Y.getValueOrUndefined(i._leadTime,e),p=Y.getValueOrUndefined(i._trailTime,e),g=n._availability,m=c(g),y=c(h),b=c(p);if(u=m||y&&b,u){if(b&&(r=Q.addSeconds(e,-p,new Q)),y&&(s=Q.addSeconds(e,h,new Q)),m){let x=g.start,A=g.stop;(!b||Q.greaterThan(x,r))&&(r=x),(!y||Q.lessThan(A,s))&&(s=A)}u=Q.lessThan(r,s)}}if(!u){c(l)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,l.show=!1,t.index=void 0);return}if(!c(l)){let h=this._unusedIndexes;if(h.length>0){let g=h.pop();l=this._polylineCollection.get(g),t.index=g}else t.index=this._polylineCollection.length,l=this._polylineCollection.add();l.id=n,t.polyline=l}let f=Y.getValueOrDefault(i._resolution,e,Zet);l.show=!0,l.positions=Xde(o,r,s,e,this._referenceFrame,f,l.positions.slice()),l.material=or.getValue(e,i._material,l.material),l.width=Y.getValueOrDefault(i._width,e,Qet),l.distanceDisplayCondition=Y.getValueOrUndefined(i._distanceDisplayCondition,e,l.distanceDisplayCondition)};iP.prototype.removeObject=function(e){let t=e.polyline;c(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0)};iP.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),de(this)};function Ey(e,t){if(!c(e))throw new C("scene is required.");if(!c(t))throw new C("entityCollection is required.");t.collectionChanged.addEventListener(Ey.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}Ey.prototype.update=function(e){if(!c(e))throw new C("time is required.");let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&c(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],a=r.entity._position,l=r.updater,u=zi.FIXED;this._scene.mode===oe.SCENE3D&&(u=a.referenceFrame);let f=this._updaters[u];if(l===f&&c(f)){f.updateObject(e,r);continue}c(l)&&l.removeObject(r),c(f)||(f=new iP(this._scene,u),f.update(e),this._updaters[u]=f),r.updater=f,c(f)&&f.updateObject(e,r)}return!0};Ey.prototype.isDestroyed=function(){return!1};Ey.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ey.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return de(this)};Ey.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s,a=this._items;for(o=t.length-1;o>-1;o--)r=t[o],c(r._path)&&c(r._position)&&a.set(r.id,new Wde(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._path)&&c(r._position)?a.contains(r.id)||a.set(r.id,new Wde(r)):(s=a.get(r.id),c(s)&&(c(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),c(s)&&(c(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};Ey._subSample=Xde;var vk=Ey;var Kde=G.WHITE,$de=G.BLACK,Zde=0,Qde=1,Jde=0,ehe=qr.NONE,the=new G,stt=new d,nhe=new G,ihe=new Bt,ohe=new Bt,rhe=new Lt;function she(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function Sy(e,t){if(!c(e))throw new C("entityCluster is required.");if(!c(t))throw new C("entityCollection is required.");t.collectionChanged.addEventListener(Sy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Et,this._onCollectionChanged(t,t.values,[],[])}Sy.prototype.update=function(e){if(!c(e))throw new C("time is required.");let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,l=r.pointPrimitive,u=r.billboard,f=Y.getValueOrDefault(a._heightReference,e,qe.NONE),h=s.isShowing&&s.isAvailable(e)&&Y.getValueOrDefault(a._show,e,!0),p;if(h&&(p=Y.getValueOrUndefined(s._position,e,stt),h=c(p)),!h){oP(r,s,n);continue}Y.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==qe.NONE&&!c(u)?(c(l)&&(oP(r,s,n),l=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,r.billboard=u,g=!0,m=d.equals(u.position,p)&&u.heightReference===f):f===qe.NONE&&!c(l)&&(c(u)&&(oP(r,s,n),u=void 0),l=n.getPoint(s),l.id=s,r.pointPrimitive=l),c(l))l.show=!0,l.position=p,l.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,ihe),l.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,ohe),l.color=Y.getValueOrDefault(a._color,e,Kde,the),l.outlineColor=Y.getValueOrDefault(a._outlineColor,e,$de,nhe),l.outlineWidth=Y.getValueOrDefault(a._outlineWidth,e,Zde),l.pixelSize=Y.getValueOrDefault(a._pixelSize,e,Qde),l.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,rhe),l.disableDepthTestDistance=Y.getValueOrDefault(a._disableDepthTestDistance,e,Jde),l.splitDirection=Y.getValueOrDefault(a._splitDirection,e,ehe);else if(c(u)){u.show=!0,u.position=p,u.scaleByDistance=Y.getValueOrUndefined(a._scaleByDistance,e,ihe),u.translucencyByDistance=Y.getValueOrUndefined(a._translucencyByDistance,e,ohe),u.distanceDisplayCondition=Y.getValueOrUndefined(a._distanceDisplayCondition,e,rhe),u.disableDepthTestDistance=Y.getValueOrDefault(a._disableDepthTestDistance,e,Jde),u.splitDirection=Y.getValueOrDefault(a._splitDirection,e,ehe),u.heightReference=f;let y=Y.getValueOrDefault(a._color,e,Kde,the),b=Y.getValueOrDefault(a._outlineColor,e,$de,nhe),x=Math.round(Y.getValueOrDefault(a._outlineWidth,e,Zde)),A=Math.max(1,Math.round(Y.getValueOrDefault(a._pixelSize,e,Qde)));if(x>0?(u.scale=1,g=g||x!==r.outlineWidth||A!==r.pixelSize||!G.equals(y,r.color)||!G.equals(b,r.outlineColor)):(u.scale=A/50,A=50,g=g||x!==r.outlineWidth||!G.equals(y,r.color)||!G.equals(b,r.outlineColor)),g){r.color=G.clone(y,r.color),r.outlineColor=G.clone(b,r.outlineColor),r.pixelSize=A,r.outlineWidth=x;let E=y.alpha,S=y.toCssColorString(),v=b.toCssColorString(),P=JSON.stringify([S,A,v,x]);u.setImage(P,ZA(E,S,v,x,A))}m&&u._updateClamping()}}return!0};Sy.prototype.getBoundingSphere=function(e,t){if(!c(e))throw new C("entity is required.");if(!c(t))throw new C("result is required.");let n=this._items.get(e.id);if(!c(n)||!(c(n.pointPrimitive)||c(n.billboard)))return lt.FAILED;if(c(n.pointPrimitive))t.center=d.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(!c(i._clampedPosition))return lt.PENDING;t.center=d.clone(i._clampedPosition,t.center)}return t.radius=0,lt.DONE};Sy.prototype.isDestroyed=function(){return!1};Sy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Sy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return de(this)};Sy.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],c(r._point)&&c(r._position)&&s.set(r.id,new she(r));for(o=i.length-1;o>-1;o--)r=i[o],c(r._point)&&c(r._position)?s.contains(r.id)||s.set(r.id,new she(r)):(oP(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],oP(s.get(r.id),r,a),s.remove(r.id)};function oP(e,t,n){if(c(e)){let i=e.pointPrimitive;if(c(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;c(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var Dk=Sy;var fhe=[];function att(e,t,n,i,o){let r=fhe;r.length=o;let s,a=n.red,l=n.green,u=n.blue,f=n.alpha,h=i.red,p=i.green,g=i.blue,m=i.alpha;if(G.equals(n,i)){for(s=0;s<o;s++)r[s]=G.clone(n);return r}let y=(h-a)/o,b=(p-l)/o,x=(g-u)/o,A=(m-f)/o;for(s=0;s<o;s++)r[s]=new G(a+s*y,l+s*b,u+s*x,f+s*A);return r}function rP(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,o=e.colorsPerVertex??!1;if(!c(t)||t.length<2)throw new C("At least two positions are required.");if(typeof i!="number")throw new C("width must be a number");if(c(n)&&(o&&n.length<t.length||!o&&n.length<t.length-1))throw new C("colors has an invalid length.");this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=Ie.clone(e.vertexFormat??Ie.DEFAULT),this._arcType=e.arcType??qt.GEODESIC,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._ellipsoid=ie.clone(e.ellipsoid??ie.default),this._workerName="createPolylineGeometry";let r=1+t.length*d.packedLength;r+=c(n)?1+n.length*G.packedLength:1,this.packedLength=r+ie.packedLength+Ie.packedLength+4}rP.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._colors;for(r=c(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=G.packedLength)G.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var dhe=ie.clone(ie.UNIT_SPHERE),hhe=new Ie,rx={positions:void 0,colors:void 0,ellipsoid:dhe,vertexFormat:hhe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};rP.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=G.packedLength)s[i]=G.unpack(e,t);let a=ie.unpack(e,t,dhe);t+=ie.packedLength;let l=Ie.unpack(e,t,hhe);t+=Ie.packedLength;let u=e[t++],f=e[t++]===1,h=e[t++],p=e[t];return c(n)?(n._positions=r,n._colors=s,n._ellipsoid=ie.clone(a,n._ellipsoid),n._vertexFormat=Ie.clone(l,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=h,n._granularity=p,n):(rx.positions=r,rx.colors=s,rx.width=u,rx.colorsPerVertex=f,rx.arcType=h,rx.granularity=p,new rP(rx))};var ahe=new d,che=new d,lhe=new d,uhe=new d;rP.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,l,u,f,h=[],p=xo(e._positions,d.equalsEpsilon,!1,h);if(c(i)&&h.length>0){let N=0,k=h[0];i=i.filter(function(H,V){let j=!1;return o?j=V===k||V===0&&k===1:j=V+1===k,j?(N++,k=h[N],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(r===qt.GEODESIC||r===qt.RHUMB){let N,k;r===qt.GEODESIC?(N=O.chordLength(s,a.maximumRadius),k=Bi.numberOfPoints):(N=s,k=Bi.numberOfPointsRhumbLine);let H=Bi.extractHeights(p,a);if(c(i)){let V=1;for(l=0;l<g-1;++l)V+=k(p[l],p[l+1],N);let j=new Array(V),U=0;for(l=0;l<g-1;++l){let q=p[l],X=p[l+1],te=i[l],K=k(q,X,N);if(o&&l<V){let Z=i[l+1],ee=att(q,X,te,Z,K),me=ee.length;for(u=0;u<me;++u)j[U++]=ee[u]}else for(u=0;u<K;++u)j[U++]=G.clone(te)}j[U]=G.clone(i[i.length-1]),i=j,fhe.length=0}r===qt.GEODESIC?p=Bi.generateCartesianArc({positions:p,minDistance:N,ellipsoid:a,height:H}):p=Bi.generateCartesianRhumbArc({positions:p,granularity:N,ellipsoid:a,height:H})}g=p.length;let m=g*4-4,y=new Float64Array(m*3),b=new Float64Array(m*3),x=new Float64Array(m*3),A=new Float32Array(m*2),E=n.st?new Float32Array(m*2):void 0,S=c(i)?new Uint8Array(m*4):void 0,v=0,P=0,M=0,R=0,L;for(u=0;u<g;++u){u===0?(L=ahe,d.subtract(p[0],p[1],L),d.add(p[0],L,L)):L=p[u-1],d.clone(L,lhe),d.clone(p[u],che),u===g-1?(L=ahe,d.subtract(p[g-1],p[g-2],L),d.add(p[g-1],L,L)):L=p[u+1],d.clone(L,uhe);let N,k;c(S)&&(u!==0&&!o?N=i[u-1]:N=i[u],u!==g-1&&(k=i[u]));let H=u===0?2:0,V=u===g-1?2:4;for(f=H;f<V;++f){d.pack(che,y,v),d.pack(lhe,b,v),d.pack(uhe,x,v),v+=3;let j=f-2<0?-1:1;if(A[P++]=2*(f%2)-1,A[P++]=j*t,n.st&&(E[M++]=u/(g-1),E[M++]=Math.max(A[P-2],0)),c(S)){let U=f<2?N:k;S[R++]=G.floatToByte(U.red),S[R++]=G.floatToByte(U.green),S[R++]=G.floatToByte(U.blue),S[R++]=G.floatToByte(U.alpha)}}}let B=new hn;B.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:y}),B.prevPosition=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:b}),B.nextPosition=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:x}),B.expandAndWidth=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:A}),n.st&&(B.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:E})),c(S)&&(B.color=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:4,values:S,normalize:!0}));let _=Fe.createTypedArray(m,g*6-6),w=0,D=0,I=g-1;for(u=0;u<I;++u)_[D++]=w,_[D++]=w+2,_[D++]=w+1,_[D++]=w+1,_[D++]=w+2,_[D++]=w+3,w+=4;return new ct({attributes:B,indices:_,primitiveType:Me.TRIANGLES,boundingSphere:le.fromPoints(p),geometryType:ld.POLYLINES})};var wy=rP;var ctt=new Xn(0),Pk={},mhe=new G,ltt=new Ut(G.WHITE),utt=new Xn(!0),ftt=new Xn(Tn.DISABLED),dtt=new Xn(new Lt),htt=new Xn(Un.BOTH);function mtt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function ptt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Xd(e,t){if(!c(e))throw new C("entity is required");if(!c(t))throw new C("scene is required");this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Xd.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new pe,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new mtt,this._groundGeometryOptions=new ptt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=rr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Xd.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!c(this._entity.availability)&&Y.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});Xd.prototype.isOutlineVisible=function(e){return!1};Xd.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};Xd.prototype.createFillGeometryInstance=function(e){if(!c(e))throw new C("time is required.");if(!this._fillEnabled)throw new C("This instance does not represent a filled geometry.");let t=this._entity,n=t.isAvailable(e),i=new xn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=kn.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Ut&&(c(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,mhe)),c(a)||(a=G.WHITE),s.color=jt.fromColor(a)),this.clampToGround?new St({id:t,geometry:new qT(this._groundGeometryOptions),attributes:s}):(c(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Ut&&(c(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,mhe)),c(a)||(a=G.WHITE),s.depthFailColor=jt.fromColor(a)),new St({id:t,geometry:new wy(this._geometryOptions),attributes:s}))};Xd.prototype.createOutlineGeometryInstance=function(e){throw new C("This instance does not represent an outlined geometry.")};Xd.prototype.isDestroyed=function(){return!1};Xd.prototype.destroy=function(){this._entitySubscription(),de(this)};Xd.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!c(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(c(s)&&s.isConstant&&!s.getValue(Ge.MINIMUM_VALUE)||!c(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,l=o.material??ltt,u=l instanceof Ut;this._materialProperty=l,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=s??utt,this._shadowsProperty=o.shadows??ftt,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??dtt,this._classificationTypeProperty=o.classificationType??htt,this._fillEnabled=!0,this._zIndex=a??ctt;let f=o.width,h=o.arcType,p=o.clampToGround,g=o.granularity;if(!r.isConstant||!Y.isConstant(f)||!Y.isConstant(h)||!Y.isConstant(g)||!Y.isConstant(p)||!Y.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,y=r.getValue(Ge.MINIMUM_VALUE,m.positions);if(!c(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let b;u&&(!c(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Ut)?b=os.VERTEX_FORMAT:b=Ea.VERTEX_FORMAT,m.vertexFormat=b,m.positions=y,m.width=c(f)?f.getValue(Ge.MINIMUM_VALUE):void 0,m.arcType=c(h)?h.getValue(Ge.MINIMUM_VALUE):void 0,m.granularity=c(g)?g.getValue(Ge.MINIMUM_VALUE):void 0;let x=this._groundGeometryOptions;x.positions=y,x.width=m.width,x.arcType=m.arcType,x.granularity=m.granularity,this._clampToGround=c(p)?p.getValue(Ge.MINIMUM_VALUE):!1,!this._clampToGround&&c(a)&&dt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Xd.prototype.createDynamicUpdater=function(e,t){if(T.defined("primitives",e),T.defined("groundPrimitives",t),!this._dynamic)throw new C("This instance does not represent dynamic geometry.");return new sP(e,t,this)};var cE={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function sP(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function phe(e){if(c(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=Pk[n];!c(i)||i.isDestroyed()?(i=new cm,Pk[n]=i,t.add(i)):t.contains(i)||t.add(i);let o=i.add();return o.id=e._geometryUpdater._entity,e._line=o,o}sP.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=Y.getValueOrUndefined(o,e,this._positions);t._clampToGround=Y.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=Y.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=Y.getValueOrDefault(i._arcType,e,qt.GEODESIC),t._groundGeometryOptions.granularity=Y.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(c(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!Y.getValueOrDefault(i._show,e,!0)||!c(r)||r.length<2)return;let h=t.fillMaterialProperty,p;if(h instanceof Ut)p=new os;else{let g=or.getValue(e,h,this._material);p=new Ea({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new Nh({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),Y.getValueOrUndefined(t.zIndex,e)),c(this._line)&&(this._line.show=!1);return}let a=phe(this);if(!n.isShowing||!n.isAvailable(e)||!Y.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!c(r)||r.length<2){a.show=!1;return}let l=qt.GEODESIC;l=Y.getValueOrDefault(i._arcType,e,l);let u=t._scene.globe,f=t._scene.ellipsoid;l!==qt.NONE&&c(u)&&(cE.ellipsoid=f,cE.positions=r,cE.granularity=Y.getValueOrUndefined(i._granularity,e),cE.height=Bi.extractHeights(r,f),l===qt.GEODESIC?r=Bi.generateCartesianArc(cE):r=Bi.generateCartesianRhumbArc(cE)),a.show=!0,a.positions=r.slice(),a.material=or.getValue(e,t.fillMaterialProperty,a.material),a.width=Y.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=Y.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};sP.prototype.getBoundingSphere=function(e){if(T.defined("result",e),this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(c(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(c(n)&&c(n.boundingSphere))return le.clone(n.boundingSphere,e),lt.DONE}return c(t)&&!t.ready?lt.PENDING:lt.DONE}else{let t=phe(this);if(t.show&&t.positions.length>0)return le.fromPoints(t.positions,e),lt.DONE}return lt.FAILED};sP.prototype.isDestroyed=function(){return!1};sP.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=Pk[t];c(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete Pk[t])),c(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),de(this)};var Ik=Xd;var _tt=new G,gtt=new Lt,ytt=new Lt;function Kd(e,t,n,i,o){let r;n instanceof Ut?r=os:r=Ea,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new Et,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Et,this.material=void 0,this.updatersWithAttributes=new Et,this.attributes=new Et,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Kd.prototype.onMaterialChanged,this),this.subscriptions=new Et,this.showsUpdated=new Et,this.zIndex=i,this._asynchronous=o}Kd.prototype.onMaterialChanged=function(){this.invalidated=!0};Kd.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Ut&&t instanceof Ut?!0:c(t)&&t.equals(n)};Kd.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!Y.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,l){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Kd.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return c(n)&&(n(),this.subscriptions.remove(t)),!0}return!1};Kd.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0)c(n)&&(c(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),n=new Nh({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new this.appearanceType,classificationType:this.classificationType}),this.appearanceType===Ea&&(this.material=or.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1;else{c(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;c(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(c(n)&&n.ready){n.show=!0,c(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===Ea&&(this.material=or.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let l=s[r],u=l.entity,f=this.geometry.get(l.id),h=this.attributes.get(f.id.id);if(c(h)||(h=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,h)),!l.fillMaterialProperty.isConstant){let y=l.fillMaterialProperty.color,b=Y.getValueOrDefault(y,e,G.WHITE,_tt);G.equals(h._lastColor,b)||(h._lastColor=G.clone(b,h._lastColor),h.color=jt.toValue(b,h.color))}let p=u.isShowing&&(l.hasConstantFill||l.isFilled(e)),g=h.show[0]===1;p!==g&&(h.show=xn.toValue(p,h.show));let m=l.distanceDisplayConditionProperty;if(!Y.isConstant(m)){let y=Y.getValueOrDefault(m,e,ytt,gtt);Lt.equals(y,h._lastDistanceDisplayCondition)||(h._lastDistanceDisplayCondition=Lt.clone(y,h._lastDistanceDisplayCondition),h.distanceDisplayCondition=kn.toValue(y,h.distanceDisplayCondition))}}this.updateShows(n)}else c(n)&&!n.ready&&(t=!1);return t};Kd.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);c(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let l=r.isShowing,u=a.show[0]===1;l!==u&&(a.show=xn.toValue(l,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Kd.prototype.contains=function(e){return this.updaters.contains(e.id)};Kd.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return lt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!c(i)||!c(i.boundingSphere)||c(i.show)&&i.show[0]===0?lt.FAILED:(i.boundingSphere.clone(t),lt.DONE)};Kd.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;c(e)&&t.remove(e);let n=this.oldPrimitive;c(n)&&t.remove(n),this.removeMaterialSubscription()};function lE(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}lE.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=Y.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let l=n[a];if(l.isMaterial(t)&&l.zIndex===r){l.add(e,t,o);return}}let s=new Kd(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};lE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};lE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let l=0;l<a;l++)this.add(e,s[l]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};lE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return lt.FAILED};lE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Ok=lE;var btt=[];function _he(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function ghe(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;c(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Ut?1:2);let r;c(i)&&(r=i+o*Tn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Ut?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function Am(e,t,n,i){T.defined("scene",e),T.defined("entityCollection",t),i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Et,this._removedObjects=new Et,this._changedObjects=new Et;let o,r=Tn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(r*3),this._materialBatches=new Array(r*3),o=0;o<r;++o)this._colorBatches[o]=new Wd(n,os,void 0,!1,o),this._materialBatches[o]=new Yd(n,Ea,void 0,!1,o),this._colorBatches[o+r]=new Wd(n,os,os,!1,o),this._materialBatches[o+r]=new Yd(n,Ea,os,!1,o),this._colorBatches[o+r*2]=new Wd(n,os,Ea,!1,o),this._materialBatches[o+r*2]=new Yd(n,Ea,Ea,!1,o);this._dynamicBatch=new UC(n,i);let s=Un.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new Ok(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Et,this._updaters=new Et,this._entityCollection=t,t.collectionChanged.addEventListener(Am.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,btt)}Am.prototype.update=function(e){T.defined("time",e);let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,l,u,f;for(a=s.length-1;a>-1;a--)l=s[a],u=l.id,f=this._updaters.get(u),f.entity===l?(_he(this,f),ghe(this,e,f)):(o.push(l),n.push(l));for(a=o.length-1;a>-1;a--)l=o[a],u=l.id,f=this._updaters.get(u),_he(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)l=n[a],u=l.id,f=new Ik(l,this._scene),this._updaters.set(u,f),ghe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(Am._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let h=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)h=p[a].update(e)&&h;return h};var xtt=[],Ttt=new le;Am.prototype.getBoundingSphere=function(e,t){T.defined("entity",e),T.defined("result",t);let n=xtt,i=Ttt,o=0,r=lt.DONE,s=this._batches,a=s.length,l=this._updaters.get(e.id);for(let u=0;u<a;u++){if(r=s[u].getBoundingSphere(l,i),r===lt.PENDING)return lt.PENDING;r===lt.DONE&&(n[o]=le.clone(i,n[o]),o++)}return o===0?lt.FAILED:(n.length=o,le.fromBoundingSpheres(n,t),lt.DONE)};Am.prototype.isDestroyed=function(){return!1};Am.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Am.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),de(this)};Am._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!c(t.get(o))&&!c(n.get(o))&&n.set(o,i)};Am.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,l;for(s=n.length-1;s>-1;s--)l=n[s],a=l.id,i.remove(a)||(o.set(a,l),r.remove(a));for(s=t.length-1;s>-1;s--)l=t[s],a=l.id,o.remove(a)?r.set(a,l):i.set(a,l)};var Rk=Am;function Ll(e){T.typeOf.object("options",e),T.typeOf.object("options.scene",e.scene),T.typeOf.object("options.dataSourceCollection",e.dataSourceCollection),_l.initializeTerrainHeights(),Nh.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Ar,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=e.visualizersCallback??Ll.defaultVisualizersCallback;let i=!1,o=new Ol,r=new Ol;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new P3;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,l;if(!i){let u=this,f=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),l(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),l=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=l,this._ready=!1}var uE=[];Ll.registerVisualizer=function(e){uE.includes(e)||uE.push(e)};Ll.unregisterVisualizer=function(e){if(uE.includes(e)){let t=uE.indexOf(e);uE.splice(t,1)}};Ll.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new dL(t,i),new Ck(e,i,n._primitives,n._groundPrimitives),new Ek(t,i),new wk(e,i),new m3(e,i),new Dk(t,i),new vk(e,i),new Rk(e,i,n._primitives,n._groundPrimitives),...uE.map(o=>new o(e,i))]};Object.defineProperties(Ll.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});Ll.prototype.isDestroyed=function(){return!1};Ll.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),c(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),de(this)};Ll.prototype.update=function(e){if(T.defined("time",e),!fi.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let l=s.get(n);for(c(l.update)&&(t=l.update(e)&&t),o=l._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t}for(o=this._defaultDataSource._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=this._ready||t,t};Ll.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let o=t.get(i),r=o.credit;c(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(c(s)){let a=s.length;for(let l=0;l<a;l++)e.creditDisplay.addCreditToNextFrame(s[l])}}};var Att=[],Ctt=new le;Ll.prototype.getBoundingSphere=function(e,t,n){if(T.defined("entity",e),T.typeOf.bool("allowPartial",t),T.defined("result",n),!this._ready)return lt.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let p=this._dataSourceCollection;for(o=p.length,i=0;i<o;i++){let g=p.get(i);if(g.entities.contains(e)){r=g;break}}}if(!c(r))return lt.FAILED;let s=Att,a=Ctt,l=0,u=lt.DONE,f=r._visualizers,h=f.length;for(i=0;i<h;i++){let p=f[i];if(c(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===lt.PENDING)return lt.PENDING;u===lt.DONE&&(s[l]=le.clone(a,s[l]),l++)}}return l===0?lt.FAILED:(s.length=l,le.fromBoundingSpheres(s,n),lt.DONE)};Ll.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new Ol),s=o.add(new Y3);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};Ll.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,l=a.length;for(let u=0;u<l;u++)a[u].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};Ll.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(s)):t===n-1?(i.lower(r),o.lower(s)):t===0?(i.lowerToBottom(r),o.lowerToBottom(s),i.raise(r),o.raise(s)):(i.raiseToTop(r),o.raiseToTop(s))};var Mk=Ll;function Hq(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}Hq.clone=function(e,t){if(c(e))return c(t)||(t=new Hq),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var $d=Hq;var yhe=new J,bhe=new J,xhe=new J,Ett=new F,Lk=new d,The=new d,Gq=new d,jq=new d,Ahe=new d,Che=new d,Stt=new Le,wtt=new d,vtt=new J,fE=new Q,Dtt=1.25;function Ptt(e,t,n,i,o,r,s,a,l,u){let f=e.scene.mode,h=o.getValue(l,e._lastCartesian);if(c(h)){let p=!1,g=!1,m,y,b;if(f===oe.SCENE3D){Q.addSeconds(l,.001,fE);let M=o.getValue(fE,Lk);if(c(M)||(Q.addSeconds(l,-.001,fE),M=o.getValue(fE,Lk),g=!0),c(M)){let R=Ot.computeFixedToIcrfMatrix(l,yhe),L=Ot.computeFixedToIcrfMatrix(fE,bhe),B;!c(R)||!c(L)?(B=Ot.computeTemeToPseudoFixedMatrix(l,xhe),R=J.transpose(B,yhe),L=Ot.computeTemeToPseudoFixedMatrix(fE,bhe),J.transpose(L,L)):B=J.transpose(R,xhe);let _=J.multiplyByVector(R,h,Ahe),w=J.multiplyByVector(L,M,Che);d.subtract(_,w,jq);let D=d.magnitude(jq)*1e3,I=O.GRAVITATIONALPARAMETER,N=-I/(D*D-2*I/d.magnitude(_));N<0||N>Dtt*u.maximumRadius?(m=The,d.normalize(h,m),d.negate(m,m),b=d.clone(d.UNIT_Z,Gq),y=d.cross(b,m,Lk),d.magnitude(y)>O.EPSILON7&&(d.normalize(m,m),d.normalize(y,y),b=d.cross(m,y,Gq),d.normalize(b,b),p=!0)):d.equalsEpsilon(h,M,O.EPSILON7)||(b=The,d.normalize(_,b),d.normalize(w,w),y=d.cross(b,w,Gq),g&&(y=d.multiplyByScalar(y,-1,y)),d.equalsEpsilon(y,d.ZERO,O.EPSILON7)||(m=d.cross(y,b,Lk),J.multiplyByVector(B,m,m),J.multiplyByVector(B,y,y),J.multiplyByVector(B,b,b),d.normalize(m,m),d.normalize(y,y),d.normalize(b,b),p=!0))}}c(e.boundingSphere)&&(h=e.boundingSphere.center);let x,A,E;i&&(x=d.clone(t.position,jq),A=d.clone(t.direction,Ahe),E=d.clone(t.up,Che));let S=Ett,v;c(s)&&(v=s.getValue(l,Stt));let P=r.getValue(l,wtt);if(a===Q_.INERTIAL&&c(v))F.fromTranslationQuaternionRotationScale(h,v,d.ONE,S);else if(a===Q_.VELOCITY&&c(P)){let M=Ot.rotationMatrixFromPositionVelocity(h,P,u,vtt);F.fromRotationTranslation(M,h,S)}else a===Q_.ENU||!p?Ot.eastNorthUpToFixedFrame(h,u,S):(S[0]=m.x,S[1]=m.y,S[2]=m.z,S[3]=0,S[4]=y.x,S[5]=y.y,S[6]=y.z,S[7]=0,S[8]=b.x,S[9]=b.y,S[10]=b.z,S[11]=0,S[12]=h.x,S[13]=h.y,S[14]=h.z,S[15]=0);t._setTransform(S),i&&(d.clone(x,t.position),d.clone(A,t.direction),d.clone(E,t.up),d.cross(A,E,t.right))}if(n){let p=f===oe.SCENE2D||d.equals(e._offset3D,d.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function aP(e,t,n){T.defined("entity",e),T.defined("scene",t),this.entity=e,this.scene=t,this.ellipsoid=n??ie.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new d,this._defaultOffset3D=void 0,this._velocityProperty=new _y(e.position,!0),this._offset3D=new d}Object.defineProperties(aP,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=d.clone(e,new d)}}});aP.defaultOffset3D=new d(-14e3,3500,3500);var Nk=new $d,Itt=new d;aP.prototype.update=function(e,t){T.defined("time",e);let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===oe.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!c(a))return;let l=this._velocityProperty,u=r.orientation,f=r!==this._lastEntity,h=o!==this._mode,p=n.camera,g=f||h,m=!0;if(f){let y=r.viewFrom,b=c(y);if(!b&&c(t)){Nk.pitch=-O.PI_OVER_FOUR,Nk.range=0;let x=a.getValue(e,Itt);if(c(x)){let A=2-1/Math.max(1,d.magnitude(x)/i.maximumRadius);Nk.pitch*=A}p.viewBoundingSphere(t,Nk),this.boundingSphere=t,g=!1,m=!1}else(!b||!c(y.getValue(e,this._offset3D)))&&d.clone(aP._defaultOffset3D,this._offset3D)}else!h&&this._mode!==oe.SCENE2D&&d.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,Ptt(this,p,g,m,a,l,u,s,e,i)};var Fk=aP;function Gk(e){return jk(e.map(([t,n])=>new Array(t).fill(n,0,t)))}function jk(e){return e.reduce((t,n)=>t.concat(Array.isArray(n)?jk(n):n),[])}var Ehe=[0,1,2,3].concat(...Gk([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function fr(){let e=this;function t(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,u=e.stat_desc.max_length,f,h,p,g,m,y,b=0;for(g=0;g<=15;g++)o.bl_count[g]=0;for(r[o.heap[o.heap_max]*2+1]=0,f=o.heap_max+1;f<573;f++)h=o.heap[f],g=r[r[h*2+1]*2+1]+1,g>u&&(g=u,b++),r[h*2+1]=g,!(h>e.max_code)&&(o.bl_count[g]++,m=0,h>=l&&(m=a[h-l]),y=r[h*2],o.opt_len+=y*(g+m),s&&(o.static_len+=y*(s[h*2+1]+m)));if(b!==0){do{for(g=u-1;o.bl_count[g]===0;)g--;o.bl_count[g]--,o.bl_count[g+1]+=2,o.bl_count[u]--,b-=2}while(b>0);for(g=u;g!==0;g--)for(h=o.bl_count[g];h!==0;)p=o.heap[--f],!(p>e.max_code)&&(r[p*2+1]!=g&&(o.opt_len+=(g-r[p*2+1])*r[p*2],r[p*2+1]=g),h--)}}function n(o,r){let s=0;do s|=o&1,o>>>=1,s<<=1;while(--r>0);return s>>>1}function i(o,r,s){let a=[],l=0,u,f,h;for(u=1;u<=15;u++)a[u]=l=l+s[u-1]<<1;for(f=0;f<=r;f++)h=o[f*2+1],h!==0&&(o[f*2]=n(a[h]++,h))}e.build_tree=function(o){let r=e.dyn_tree,s=e.stat_desc.static_tree,a=e.stat_desc.elems,l,u,f=-1,h;for(o.heap_len=0,o.heap_max=573,l=0;l<a;l++)r[l*2]!==0?(o.heap[++o.heap_len]=f=l,o.depth[l]=0):r[l*2+1]=0;for(;o.heap_len<2;)h=o.heap[++o.heap_len]=f<2?++f:0,r[h*2]=1,o.depth[h]=0,o.opt_len--,s&&(o.static_len-=s[h*2+1]);for(e.max_code=f,l=Math.floor(o.heap_len/2);l>=1;l--)o.pqdownheap(r,l);h=a;do l=o.heap[1],o.heap[1]=o.heap[o.heap_len--],o.pqdownheap(r,1),u=o.heap[1],o.heap[--o.heap_max]=l,o.heap[--o.heap_max]=u,r[h*2]=r[l*2]+r[u*2],o.depth[h]=Math.max(o.depth[l],o.depth[u])+1,r[l*2+1]=r[u*2+1]=h,o.heap[1]=h++,o.pqdownheap(r,1);while(o.heap_len>=2);o.heap[--o.heap_max]=o.heap[1],t(o),i(r,e.max_code,o.bl_count)}}fr._length_code=[0,1,2,3,4,5,6,7].concat(...Gk([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]]));fr.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0];fr.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576];fr.d_code=function(e){return e<256?Ehe[e]:Ehe[256+(e>>>7)]};fr.extra_lbits=[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];fr.extra_dbits=[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];fr.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];fr.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Oa(e,t,n,i,o){let r=this;r.static_tree=e,r.extra_bits=t,r.extra_base=n,r.elems=i,r.max_length=o}var Ott=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],Rtt=Gk([[144,8],[112,9],[24,7],[8,8]]);Oa.static_ltree=jk(Ott.map((e,t)=>[e,Rtt[t]]));var Mtt=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],Ltt=Gk([[30,5]]);Oa.static_dtree=jk(Mtt.map((e,t)=>[e,Ltt[t]]));Oa.static_l_desc=new Oa(Oa.static_ltree,fr.extra_lbits,257,286,15);Oa.static_d_desc=new Oa(Oa.static_dtree,fr.extra_dbits,0,30,15);Oa.static_bl_desc=new Oa(null,fr.extra_blbits,0,19,7);var Ntt=9,Ftt=8;function Cm(e,t,n,i,o){let r=this;r.good_length=e,r.max_lazy=t,r.nice_length=n,r.max_chain=i,r.func=o}var whe=0,zk=1,sx=2,Zd=[new Cm(0,0,0,0,whe),new Cm(4,4,8,4,zk),new Cm(4,5,16,8,zk),new Cm(4,6,32,32,zk),new Cm(4,4,16,16,sx),new Cm(8,16,32,32,sx),new Cm(8,16,128,128,sx),new Cm(8,32,128,256,sx),new Cm(32,128,258,1024,sx),new Cm(32,258,258,4096,sx)],Bk=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],zf=0,kk=1,cP=2,Uk=3,Btt=32,Wq=42,Vk=113,lP=666,qq=8,ktt=0,Yq=1,Utt=2,Er=3,Hk=258,bu=Hk+Er+1;function She(e,t,n,i){let o=e[t*2],r=e[n*2];return o<r||o==r&&i[t]<=i[n]}function Vtt(){let e=this,t,n,i,o,r,s,a,l,u,f,h,p,g,m,y,b,x,A,E,S,v,P,M,R,L,B,_,w,D,I,N,k,H,V=new fr,j=new fr,U=new fr;e.depth=[];let q,X,te,K,Z,ee;e.bl_count=[],e.heap=[],N=[],k=[],H=[];function me(){u=2*r,h[g-1]=0;for(let Ne=0;Ne<g-1;Ne++)h[Ne]=0;B=Zd[_].max_lazy,D=Zd[_].good_length,I=Zd[_].nice_length,L=Zd[_].max_chain,v=0,x=0,M=0,A=R=Er-1,S=0,p=0}function xe(){let Ne;for(Ne=0;Ne<286;Ne++)N[Ne*2]=0;for(Ne=0;Ne<30;Ne++)k[Ne*2]=0;for(Ne=0;Ne<19;Ne++)H[Ne*2]=0;N[256*2]=1,e.opt_len=e.static_len=0,X=te=0}function ue(){V.dyn_tree=N,V.stat_desc=Oa.static_l_desc,j.dyn_tree=k,j.stat_desc=Oa.static_d_desc,U.dyn_tree=H,U.stat_desc=Oa.static_bl_desc,Z=0,ee=0,K=8,xe()}e.pqdownheap=function(Ne,ot){let Xe=e.heap,Ze=Xe[ot],pt=ot<<1;for(;pt<=e.heap_len&&(pt<e.heap_len&&She(Ne,Xe[pt+1],Xe[pt],e.depth)&&pt++,!She(Ne,Ze,Xe[pt],e.depth));)Xe[ot]=Xe[pt],ot=pt,pt<<=1;Xe[ot]=Ze};function ye(Ne,ot){let Xe=-1,Ze,pt=Ne[0*2+1],Ht=0,bn=7,wo=4;pt===0&&(bn=138,wo=3),Ne[(ot+1)*2+1]=65535;for(let yo=0;yo<=ot;yo++)Ze=pt,pt=Ne[(yo+1)*2+1],!(++Ht<bn&&Ze==pt)&&(Ht<wo?H[Ze*2]+=Ht:Ze!==0?(Ze!=Xe&&H[Ze*2]++,H[16*2]++):Ht<=10?H[17*2]++:H[18*2]++,Ht=0,Xe=Ze,pt===0?(bn=138,wo=3):Ze==pt?(bn=6,wo=3):(bn=7,wo=4))}function Ae(){let Ne;for(ye(N,V.max_code),ye(k,j.max_code),U.build_tree(e),Ne=18;Ne>=3&&H[fr.bl_order[Ne]*2+1]===0;Ne--);return e.opt_len+=3*(Ne+1)+5+5+4,Ne}function Pe(Ne){e.pending_buf[e.pending++]=Ne}function Ee(Ne){Pe(Ne&255),Pe(Ne>>>8&255)}function Ve(Ne){Pe(Ne>>8&255),Pe(Ne&255&255)}function je(Ne,ot){let Xe,Ze=ot;ee>16-Ze?(Xe=Ne,Z|=Xe<<ee&65535,Ee(Z),Z=Xe>>>16-ee,ee+=Ze-16):(Z|=Ne<<ee&65535,ee+=Ze)}function it(Ne,ot){let Xe=Ne*2;je(ot[Xe]&65535,ot[Xe+1]&65535)}function Dt(Ne,ot){let Xe,Ze=-1,pt,Ht=Ne[0*2+1],bn=0,wo=7,yo=4;for(Ht===0&&(wo=138,yo=3),Xe=0;Xe<=ot;Xe++)if(pt=Ht,Ht=Ne[(Xe+1)*2+1],!(++bn<wo&&pt==Ht)){if(bn<yo)do it(pt,H);while(--bn!==0);else pt!==0?(pt!=Ze&&(it(pt,H),bn--),it(16,H),je(bn-3,2)):bn<=10?(it(17,H),je(bn-3,3)):(it(18,H),je(bn-11,7));bn=0,Ze=pt,Ht===0?(wo=138,yo=3):pt==Ht?(wo=6,yo=3):(wo=7,yo=4)}}function Gt(Ne,ot,Xe){let Ze;for(je(Ne-257,5),je(ot-1,5),je(Xe-4,4),Ze=0;Ze<Xe;Ze++)je(H[fr.bl_order[Ze]*2+1],3);Dt(N,Ne-1),Dt(k,ot-1)}function $e(){ee==16?(Ee(Z),Z=0,ee=0):ee>=8&&(Pe(Z&255),Z>>>=8,ee-=8)}function ln(){je(Yq<<1,3),it(256,Oa.static_ltree),$e(),1+K+10-ee<9&&(je(Yq<<1,3),it(256,Oa.static_ltree),$e()),K=7}function Vt(Ne,ot){let Xe,Ze,pt;if(e.dist_buf[X]=Ne,e.lc_buf[X]=ot&255,X++,Ne===0?N[ot*2]++:(te++,Ne--,N[(fr._length_code[ot]+256+1)*2]++,k[fr.d_code(Ne)*2]++),!(X&8191)&&_>2){for(Xe=X*8,Ze=v-x,pt=0;pt<30;pt++)Xe+=k[pt*2]*(5+fr.extra_dbits[pt]);if(Xe>>>=3,te<Math.floor(X/2)&&Xe<Math.floor(Ze/2))return!0}return X==q-1}function Ct(Ne,ot){let Xe,Ze,pt=0,Ht,bn;if(X!==0)do Xe=e.dist_buf[pt],Ze=e.lc_buf[pt],pt++,Xe===0?it(Ze,Ne):(Ht=fr._length_code[Ze],it(Ht+256+1,Ne),bn=fr.extra_lbits[Ht],bn!==0&&(Ze-=fr.base_length[Ht],je(Ze,bn)),Xe--,Ht=fr.d_code(Xe),it(Ht,ot),bn=fr.extra_dbits[Ht],bn!==0&&(Xe-=fr.base_dist[Ht],je(Xe,bn)));while(pt<X);it(256,Ne),K=Ne[256*2+1]}function gi(){ee>8?Ee(Z):ee>0&&Pe(Z&255),Z=0,ee=0}function an(Ne,ot,Xe){gi(),K=8,Xe&&(Ee(ot),Ee(~ot)),e.pending_buf.set(l.subarray(Ne,Ne+ot),e.pending),e.pending+=ot}function _e(Ne,ot,Xe){je((ktt<<1)+(Xe?1:0),3),an(Ne,ot,!0)}function Ce(Ne,ot,Xe){let Ze,pt,Ht=0;_>0?(V.build_tree(e),j.build_tree(e),Ht=Ae(),Ze=e.opt_len+3+7>>>3,pt=e.static_len+3+7>>>3,pt<=Ze&&(Ze=pt)):Ze=pt=ot+5,ot+4<=Ze&&Ne!=-1?_e(Ne,ot,Xe):pt==Ze?(je((Yq<<1)+(Xe?1:0),3),Ct(Oa.static_ltree,Oa.static_dtree)):(je((Utt<<1)+(Xe?1:0),3),Gt(V.max_code+1,j.max_code+1,Ht+1),Ct(N,k)),xe(),Xe&&gi()}function mn(Ne){Ce(x>=0?x:-1,v-x,Ne),x=v,t.flush_pending()}function mt(){let Ne,ot,Xe,Ze;do{if(Ze=u-M-v,Ze===0&&v===0&&M===0)Ze=r;else if(Ze==-1)Ze--;else if(v>=r+r-bu){l.set(l.subarray(r,r+r),0),P-=r,v-=r,x-=r,Ne=g,Xe=Ne;do ot=h[--Xe]&65535,h[Xe]=ot>=r?ot-r:0;while(--Ne!==0);Ne=r,Xe=Ne;do ot=f[--Xe]&65535,f[Xe]=ot>=r?ot-r:0;while(--Ne!==0);Ze+=r}if(t.avail_in===0)return;Ne=t.read_buf(l,v+M,Ze),M+=Ne,M>=Er&&(p=l[v]&255,p=(p<<b^l[v+1]&255)&y)}while(M<bu&&t.avail_in!==0)}function to(Ne){let ot=65535,Xe;for(ot>i-5&&(ot=i-5);;){if(M<=1){if(mt(),M===0&&Ne==0)return zf;if(M===0)break}if(v+=M,M=0,Xe=x+ot,(v===0||v>=Xe)&&(M=v-Xe,v=Xe,mn(!1),t.avail_out===0)||v-x>=r-bu&&(mn(!1),t.avail_out===0))return zf}return mn(Ne==4),t.avail_out===0?Ne==4?cP:zf:Ne==4?Uk:kk}function So(Ne){let ot=L,Xe=v,Ze,pt,Ht=R,bn=v>r-bu?v-(r-bu):0,wo=I,yo=a,ka=v+Hk,Ua=l[Xe+Ht-1],yi=l[Xe+Ht];R>=D&&(ot>>=2),wo>M&&(wo=M);do if(Ze=Ne,!(l[Ze+Ht]!=yi||l[Ze+Ht-1]!=Ua||l[Ze]!=l[Xe]||l[++Ze]!=l[Xe+1])){Xe+=2,Ze++;do;while(l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&l[++Xe]==l[++Ze]&&Xe<ka);if(pt=Hk-(ka-Xe),Xe=ka-Hk,pt>Ht){if(P=Ne,Ht=pt,pt>=wo)break;Ua=l[Xe+Ht-1],yi=l[Xe+Ht]}}while((Ne=f[Ne&yo]&65535)>bn&&--ot!==0);return Ht<=M?Ht:M}function Ks(Ne){let ot=0,Xe;for(;;){if(M<bu){if(mt(),M<bu&&Ne==0)return zf;if(M===0)break}if(M>=Er&&(p=(p<<b^l[v+(Er-1)]&255)&y,ot=h[p]&65535,f[v&a]=h[p],h[p]=v),ot!==0&&(v-ot&65535)<=r-bu&&w!=2&&(A=So(ot)),A>=Er)if(Xe=Vt(v-P,A-Er),M-=A,A<=B&&M>=Er){A--;do v++,p=(p<<b^l[v+(Er-1)]&255)&y,ot=h[p]&65535,f[v&a]=h[p],h[p]=v;while(--A!==0);v++}else v+=A,A=0,p=l[v]&255,p=(p<<b^l[v+1]&255)&y;else Xe=Vt(0,l[v]&255),M--,v++;if(Xe&&(mn(!1),t.avail_out===0))return zf}return mn(Ne==4),t.avail_out===0?Ne==4?cP:zf:Ne==4?Uk:kk}function vr(Ne){let ot=0,Xe,Ze;for(;;){if(M<bu){if(mt(),M<bu&&Ne==0)return zf;if(M===0)break}if(M>=Er&&(p=(p<<b^l[v+(Er-1)]&255)&y,ot=h[p]&65535,f[v&a]=h[p],h[p]=v),R=A,E=P,A=Er-1,ot!==0&&R<B&&(v-ot&65535)<=r-bu&&(w!=2&&(A=So(ot)),A<=5&&(w==1||A==Er&&v-P>4096)&&(A=Er-1)),R>=Er&&A<=R){Ze=v+M-Er,Xe=Vt(v-1-E,R-Er),M-=R-1,R-=2;do++v<=Ze&&(p=(p<<b^l[v+(Er-1)]&255)&y,ot=h[p]&65535,f[v&a]=h[p],h[p]=v);while(--R!==0);if(S=0,A=Er-1,v++,Xe&&(mn(!1),t.avail_out===0))return zf}else if(S!==0){if(Xe=Vt(0,l[v-1]&255),Xe&&mn(!1),v++,M--,t.avail_out===0)return zf}else S=1,v++,M--}return S!==0&&(Xe=Vt(0,l[v-1]&255),S=0),mn(Ne==4),t.avail_out===0?Ne==4?cP:zf:Ne==4?Uk:kk}function ps(Ne){return Ne.total_in=Ne.total_out=0,Ne.msg=null,e.pending=0,e.pending_out=0,n=Vk,o=0,ue(),me(),0}e.deflateInit=function(Ne,ot,Xe,Ze,pt,Ht){return Ze||(Ze=qq),pt||(pt=Ftt),Ht||(Ht=0),Ne.msg=null,ot==-1&&(ot=6),pt<1||pt>Ntt||Ze!=qq||Xe<9||Xe>15||ot<0||ot>9||Ht<0||Ht>2?-2:(Ne.dstate=e,s=Xe,r=1<<s,a=r-1,m=pt+7,g=1<<m,y=g-1,b=Math.floor((m+Er-1)/Er),l=new Uint8Array(r*2),f=[],h=[],q=1<<pt+6,e.pending_buf=new Uint8Array(q*4),i=q*4,e.dist_buf=new Uint16Array(q),e.lc_buf=new Uint8Array(q),_=ot,w=Ht,ps(Ne))},e.deflateEnd=function(){return n!=Wq&&n!=Vk&&n!=lP?-2:(e.lc_buf=null,e.dist_buf=null,e.pending_buf=null,h=null,f=null,l=null,e.dstate=null,n==Vk?-3:0)},e.deflateParams=function(Ne,ot,Xe){let Ze=0;return ot==-1&&(ot=6),ot<0||ot>9||Xe<0||Xe>2?-2:(Zd[_].func!=Zd[ot].func&&Ne.total_in!==0&&(Ze=Ne.deflate(1)),_!=ot&&(_=ot,B=Zd[_].max_lazy,D=Zd[_].good_length,I=Zd[_].nice_length,L=Zd[_].max_chain),w=Xe,Ze)},e.deflateSetDictionary=function(Ne,ot,Xe){let Ze=Xe,pt,Ht=0;if(!ot||n!=Wq)return-2;if(Ze<Er)return 0;for(Ze>r-bu&&(Ze=r-bu,Ht=Xe-Ze),l.set(ot.subarray(Ht,Ht+Ze),0),v=Ze,x=Ze,p=l[0]&255,p=(p<<b^l[1]&255)&y,pt=0;pt<=Ze-Er;pt++)p=(p<<b^l[pt+(Er-1)]&255)&y,f[pt&a]=h[p],h[p]=pt;return 0},e.deflate=function(Ne,ot){let Xe,Ze,pt,Ht,bn;if(ot>4||ot<0)return-2;if(!Ne.next_out||!Ne.next_in&&Ne.avail_in!==0||n==lP&&ot!=4)return Ne.msg=Bk[4],-2;if(Ne.avail_out===0)return Ne.msg=Bk[7],-5;if(t=Ne,Ht=o,o=ot,n==Wq&&(Ze=qq+(s-8<<4)<<8,pt=(_-1&255)>>1,pt>3&&(pt=3),Ze|=pt<<6,v!==0&&(Ze|=Btt),Ze+=31-Ze%31,n=Vk,Ve(Ze)),e.pending!==0){if(t.flush_pending(),t.avail_out===0)return o=-1,0}else if(t.avail_in===0&&ot<=Ht&&ot!=4)return t.msg=Bk[7],-5;if(n==lP&&t.avail_in!==0)return Ne.msg=Bk[7],-5;if(t.avail_in!==0||M!==0||ot!=0&&n!=lP){switch(bn=-1,Zd[_].func){case whe:bn=to(ot);break;case zk:bn=Ks(ot);break;case sx:bn=vr(ot);break;default:}if((bn==cP||bn==Uk)&&(n=lP),bn==zf||bn==cP)return t.avail_out===0&&(o=-1),0;if(bn==kk){if(ot==1)ln();else if(_e(0,0,!1),ot==3)for(Xe=0;Xe<g;Xe++)h[Xe]=0;if(t.flush_pending(),t.avail_out===0)return o=-1,0}}return ot!=4?0:1}}function vhe(){let e=this;e.next_in_index=0,e.next_out_index=0,e.avail_in=0,e.total_in=0,e.avail_out=0,e.total_out=0}vhe.prototype={deflateInit(e,t){let n=this;return n.dstate=new Vtt,t||(t=15),n.dstate.deflateInit(n,e,t)},deflate(e){let t=this;return t.dstate?t.dstate.deflate(t,e):-2},deflateEnd(){let e=this;if(!e.dstate)return-2;let t=e.dstate.deflateEnd();return e.dstate=null,t},deflateParams(e,t){let n=this;return n.dstate?n.dstate.deflateParams(n,e,t):-2},deflateSetDictionary(e,t){let n=this;return n.dstate?n.dstate.deflateSetDictionary(n,e,t):-2},read_buf(e,t,n){let i=this,o=i.avail_in;return o>n&&(o=n),o===0?0:(i.avail_in-=o,e.set(i.next_in.subarray(i.next_in_index,i.next_in_index+o),t),i.next_in_index+=o,i.total_in+=o,o)},flush_pending(){let e=this,t=e.dstate.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.next_out.set(e.dstate.pending_buf.subarray(e.dstate.pending_out,e.dstate.pending_out+t),e.next_out_index),e.next_out_index+=t,e.dstate.pending_out+=t,e.total_out+=t,e.avail_out-=t,e.dstate.pending-=t,e.dstate.pending===0&&(e.dstate.pending_out=0))}};function Dhe(e){let t=this,n=new vhe,i=ztt(e&&e.chunkSize?e.chunkSize:64*1024),o=0,r=new Uint8Array(i),s=e?e.level:-1;typeof s>"u"&&(s=-1),n.deflateInit(s),n.next_out=r,t.append=function(a,l){let u,f,h=0,p=0,g=0,m=[];if(a.length){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,u=n.deflate(o),u!=0)throw new Error("deflating: "+n.msg);n.next_out_index&&(n.next_out_index==i?m.push(new Uint8Array(r)):m.push(r.subarray(0,n.next_out_index))),g+=n.next_out_index,l&&n.next_in_index>0&&n.next_in_index!=h&&(l(n.next_in_index),h=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return m.length>1?(f=new Uint8Array(g),m.forEach(function(y){f.set(y,p),p+=y.length})):f=m[0]?new Uint8Array(m[0]):new Uint8Array,f}},t.flush=function(){let a,l,u=0,f=0,h=[];do{if(n.next_out_index=0,n.avail_out=i,a=n.deflate(4),a!=1&&a!=0)throw new Error("deflating: "+n.msg);i-n.avail_out>0&&h.push(r.slice(0,n.next_out_index)),f+=n.next_out_index}while(n.avail_in>0||n.avail_out===0);return n.deflateEnd(),l=new Uint8Array(f),h.forEach(function(p){l.set(p,u),u+=p.length}),l}}function ztt(e){return e+5*(Math.floor(e/16383)+1)}var xu=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],Xhe=1440,Htt=0,Gtt=4,jtt=9,Wtt=5,qtt=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],Ytt=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],Xtt=[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],Ktt=[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,112,112],$tt=[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],Ztt=[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],vy=15;function Zq(){let e=this,t,n,i,o,r,s;function a(u,f,h,p,g,m,y,b,x,A,E){let S,v,P,M,R,L,B,_,w,D,I,N,k,H,V;D=0,R=h;do i[u[f+D]]++,D++,R--;while(R!==0);if(i[0]==h)return y[0]=-1,b[0]=0,0;for(_=b[0],L=1;L<=vy&&i[L]===0;L++);for(B=L,_<L&&(_=L),R=vy;R!==0&&i[R]===0;R--);for(P=R,_>R&&(_=R),b[0]=_,H=1<<L;L<R;L++,H<<=1)if((H-=i[L])<0)return-3;if((H-=i[R])<0)return-3;for(i[R]+=H,s[1]=L=0,D=1,k=2;--R!==0;)s[k]=L+=i[D],k++,D++;R=0,D=0;do(L=u[f+D])!==0&&(E[s[L]++]=R),D++;while(++R<h);for(h=s[P],s[0]=R=0,D=0,M=-1,N=-_,r[0]=0,I=0,V=0;B<=P;B++)for(S=i[B];S--!==0;){for(;B>N+_;){if(M++,N+=_,V=P-N,V=V>_?_:V,(v=1<<(L=B-N))>S+1&&(v-=S+1,k=B,L<V))for(;++L<V&&!((v<<=1)<=i[++k]);)v-=i[k];if(V=1<<L,A[0]+V>Xhe)return-3;r[M]=I=A[0],A[0]+=V,M!==0?(s[M]=R,o[0]=L,o[1]=_,L=R>>>N-_,o[2]=I-r[M-1]-L,x.set(o,(r[M-1]+L)*3)):y[0]=I}for(o[1]=B-N,D>=h?o[0]=192:E[D]<p?(o[0]=E[D]<256?0:96,o[2]=E[D++]):(o[0]=m[E[D]-p]+16+64,o[2]=g[E[D++]-p]),v=1<<B-N,L=R>>>N;L<V;L+=v)x.set(o,(I+L)*3);for(L=1<<B-1;R&L;L>>>=1)R^=L;for(R^=L,w=(1<<N)-1;(R&w)!=s[M];)M--,N-=_,w=(1<<N)-1}return H!==0&&P!=1?-5:0}function l(u){let f;for(t||(t=[],n=[],i=new Int32Array(vy+1),o=[],r=new Int32Array(vy),s=new Int32Array(vy+1)),n.length<u&&(n=[]),f=0;f<u;f++)n[f]=0;for(f=0;f<vy+1;f++)i[f]=0;for(f=0;f<3;f++)o[f]=0;r.set(i.subarray(0,vy),0),s.set(i.subarray(0,vy+1),0)}e.inflate_trees_bits=function(u,f,h,p,g){let m;return l(19),t[0]=0,m=a(u,0,19,19,null,null,h,f,p,t,n),m==-3?g.msg="oversubscribed dynamic bit lengths tree":(m==-5||f[0]===0)&&(g.msg="incomplete dynamic bit lengths tree",m=-3),m},e.inflate_trees_dynamic=function(u,f,h,p,g,m,y,b,x){let A;return l(288),t[0]=0,A=a(h,0,u,257,Xtt,Ktt,m,p,b,t,n),A!=0||p[0]===0?(A==-3?x.msg="oversubscribed literal/length tree":A!=-4&&(x.msg="incomplete literal/length tree",A=-3),A):(l(288),A=a(h,u,f,0,$tt,Ztt,y,g,b,t,n),A!=0||g[0]===0&&u>257?(A==-3?x.msg="oversubscribed distance tree":A==-5?(x.msg="incomplete distance tree",A=-3):A!=-4&&(x.msg="empty distance tree with lengths",A=-3),A):0)}}Zq.inflate_trees_fixed=function(e,t,n,i){return e[0]=jtt,t[0]=Wtt,n[0]=qtt,i[0]=Ytt,0};var Wk=0,Phe=1,Ihe=2,Ohe=3,Rhe=4,Mhe=5,Lhe=6,Xq=7,Nhe=8,qk=9;function Qtt(){let e=this,t,n=0,i,o=0,r=0,s=0,a=0,l=0,u=0,f=0,h,p=0,g,m=0;function y(b,x,A,E,S,v,P,M){let R,L,B,_,w,D,I,N,k,H,V,j,U,q,X,te;I=M.next_in_index,N=M.avail_in,w=P.bitb,D=P.bitk,k=P.write,H=k<P.read?P.read-k-1:P.end-k,V=xu[b],j=xu[x];do{for(;D<20;)N--,w|=(M.read_byte(I++)&255)<<D,D+=8;if(R=w&V,L=A,B=E,te=(B+R)*3,(_=L[te])===0){w>>=L[te+1],D-=L[te+1],P.win[k++]=L[te+2],H--;continue}do{if(w>>=L[te+1],D-=L[te+1],_&16){for(_&=15,U=L[te+2]+(w&xu[_]),w>>=_,D-=_;D<15;)N--,w|=(M.read_byte(I++)&255)<<D,D+=8;R=w&j,L=S,B=v,te=(B+R)*3,_=L[te];do if(w>>=L[te+1],D-=L[te+1],_&16){for(_&=15;D<_;)N--,w|=(M.read_byte(I++)&255)<<D,D+=8;if(q=L[te+2]+(w&xu[_]),w>>=_,D-=_,H-=U,k>=q)X=k-q,k-X>0&&2>k-X?(P.win[k++]=P.win[X++],P.win[k++]=P.win[X++],U-=2):(P.win.set(P.win.subarray(X,X+2),k),k+=2,X+=2,U-=2);else{X=k-q;do X+=P.end;while(X<0);if(_=P.end-X,U>_){if(U-=_,k-X>0&&_>k-X)do P.win[k++]=P.win[X++];while(--_!==0);else P.win.set(P.win.subarray(X,X+_),k),k+=_,X+=_,_=0;X=0}}if(k-X>0&&U>k-X)do P.win[k++]=P.win[X++];while(--U!==0);else P.win.set(P.win.subarray(X,X+U),k),k+=U,X+=U,U=0;break}else if(!(_&64))R+=L[te+2],R+=w&xu[_],te=(B+R)*3,_=L[te];else return M.msg="invalid distance code",U=M.avail_in-N,U=D>>3<U?D>>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,-3;while(!0);break}if(_&64)return _&32?(U=M.avail_in-N,U=D>>3<U?D>>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,1):(M.msg="invalid literal/length code",U=M.avail_in-N,U=D>>3<U?D>>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,-3);if(R+=L[te+2],R+=w&xu[_],te=(B+R)*3,(_=L[te])===0){w>>=L[te+1],D-=L[te+1],P.win[k++]=L[te+2],H--;break}}while(!0)}while(H>=258&&N>=10);return U=M.avail_in-N,U=D>>3<U?D>>3:U,N+=U,I-=U,D-=U<<3,P.bitb=w,P.bitk=D,M.avail_in=N,M.total_in+=I-M.next_in_index,M.next_in_index=I,P.write=k,0}e.init=function(b,x,A,E,S,v){t=Wk,u=b,f=x,h=A,p=E,g=S,m=v,i=null},e.proc=function(b,x,A){let E,S,v,P=0,M=0,R=0,L,B,_,w;for(R=x.next_in_index,L=x.avail_in,P=b.bitb,M=b.bitk,B=b.write,_=B<b.read?b.read-B-1:b.end-B;;)switch(t){case Wk:if(_>=258&&L>=10&&(b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,A=y(u,f,h,p,g,m,b,x),R=x.next_in_index,L=x.avail_in,P=b.bitb,M=b.bitk,B=b.write,_=B<b.read?b.read-B-1:b.end-B,A!=0)){t=A==1?Xq:qk;break}r=u,i=h,o=p,t=Phe;case Phe:for(E=r;M<E;){if(L!==0)A=0;else return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);L--,P|=(x.read_byte(R++)&255)<<M,M+=8}if(S=(o+(P&xu[E]))*3,P>>>=i[S+1],M-=i[S+1],v=i[S],v===0){s=i[S+2],t=Lhe;break}if(v&16){a=v&15,n=i[S+2],t=Ihe;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}if(v&32){t=Xq;break}return t=qk,x.msg="invalid literal/length code",A=-3,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);case Ihe:for(E=a;M<E;){if(L!==0)A=0;else return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);L--,P|=(x.read_byte(R++)&255)<<M,M+=8}n+=P&xu[E],P>>=E,M-=E,r=f,i=g,o=m,t=Ohe;case Ohe:for(E=r;M<E;){if(L!==0)A=0;else return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);L--,P|=(x.read_byte(R++)&255)<<M,M+=8}if(S=(o+(P&xu[E]))*3,P>>=i[S+1],M-=i[S+1],v=i[S],v&16){a=v&15,l=i[S+2],t=Rhe;break}if(!(v&64)){r=v,o=S/3+i[S+2];break}return t=qk,x.msg="invalid distance code",A=-3,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);case Rhe:for(E=a;M<E;){if(L!==0)A=0;else return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);L--,P|=(x.read_byte(R++)&255)<<M,M+=8}l+=P&xu[E],P>>=E,M-=E,t=Mhe;case Mhe:for(w=B-l;w<0;)w+=b.end;for(;n!==0;){if(_===0&&(B==b.end&&b.read!==0&&(B=0,_=B<b.read?b.read-B-1:b.end-B),_===0&&(b.write=B,A=b.inflate_flush(x,A),B=b.write,_=B<b.read?b.read-B-1:b.end-B,B==b.end&&b.read!==0&&(B=0,_=B<b.read?b.read-B-1:b.end-B),_===0)))return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);b.win[B++]=b.win[w++],_--,w==b.end&&(w=0),n--}t=Wk;break;case Lhe:if(_===0&&(B==b.end&&b.read!==0&&(B=0,_=B<b.read?b.read-B-1:b.end-B),_===0&&(b.write=B,A=b.inflate_flush(x,A),B=b.write,_=B<b.read?b.read-B-1:b.end-B,B==b.end&&b.read!==0&&(B=0,_=B<b.read?b.read-B-1:b.end-B),_===0)))return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);A=0,b.win[B++]=s,_--,t=Wk;break;case Xq:if(M>7&&(M-=8,L++,R--),b.write=B,A=b.inflate_flush(x,A),B=b.write,_=B<b.read?b.read-B-1:b.end-B,b.read!=b.write)return b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);t=Nhe;case Nhe:return A=1,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);case qk:return A=-3,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A);default:return A=-2,b.bitb=P,b.bitk=M,x.avail_in=L,x.total_in+=R-x.next_in_index,x.next_in_index=R,b.write=B,b.inflate_flush(x,A)}},e.free=function(){}}var Fhe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],dE=0,Kq=1,Bhe=2,khe=3,Uhe=4,Vhe=5,Yk=6,Xk=7,zhe=8,ax=9;function Jtt(e,t){let n=this,i=dE,o=0,r=0,s=0,a,l=[0],u=[0],f=new Qtt,h=0,p=new Int32Array(Xhe*3),g=0,m=new Zq;n.bitk=0,n.bitb=0,n.win=new Uint8Array(t),n.end=t,n.read=0,n.write=0,n.reset=function(y,b){b&&(b[0]=g),i==Yk&&f.free(y),i=dE,n.bitk=0,n.bitb=0,n.read=n.write=0},n.reset(e,null),n.inflate_flush=function(y,b){let x,A,E;return A=y.next_out_index,E=n.read,x=(E<=n.write?n.write:n.end)-E,x>y.avail_out&&(x=y.avail_out),x!==0&&b==-5&&(b=0),y.avail_out-=x,y.total_out+=x,y.next_out.set(n.win.subarray(E,E+x),A),A+=x,E+=x,E==n.end&&(E=0,n.write==n.end&&(n.write=0),x=n.write-E,x>y.avail_out&&(x=y.avail_out),x!==0&&b==-5&&(b=0),y.avail_out-=x,y.total_out+=x,y.next_out.set(n.win.subarray(E,E+x),A),A+=x,E+=x),y.next_out_index=A,n.read=E,b},n.proc=function(y,b){let x,A,E,S,v,P,M,R;for(S=y.next_in_index,v=y.avail_in,A=n.bitb,E=n.bitk,P=n.write,M=P<n.read?n.read-P-1:n.end-P;;){let L,B,_,w,D,I,N,k;switch(i){case dE:for(;E<3;){if(v!==0)b=0;else return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<E,E+=8}switch(x=A&7,h=x&1,x>>>1){case 0:A>>>=3,E-=3,x=E&7,A>>>=x,E-=x,i=Kq;break;case 1:L=[],B=[],_=[[]],w=[[]],Zq.inflate_trees_fixed(L,B,_,w),f.init(L[0],B[0],_[0],0,w[0],0),A>>>=3,E-=3,i=Yk;break;case 2:A>>>=3,E-=3,i=khe;break;case 3:return A>>>=3,E-=3,i=ax,y.msg="invalid block type",b=-3,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b)}break;case Kq:for(;E<32;){if(v!==0)b=0;else return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<E,E+=8}if((~A>>>16&65535)!=(A&65535))return i=ax,y.msg="invalid stored block lengths",b=-3,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);o=A&65535,A=E=0,i=o!==0?Bhe:h!==0?Xk:dE;break;case Bhe:if(v===0||M===0&&(P==n.end&&n.read!==0&&(P=0,M=P<n.read?n.read-P-1:n.end-P),M===0&&(n.write=P,b=n.inflate_flush(y,b),P=n.write,M=P<n.read?n.read-P-1:n.end-P,P==n.end&&n.read!==0&&(P=0,M=P<n.read?n.read-P-1:n.end-P),M===0)))return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);if(b=0,x=o,x>v&&(x=v),x>M&&(x=M),n.win.set(y.read_buf(S,x),P),S+=x,v-=x,P+=x,M-=x,(o-=x)!==0)break;i=h!==0?Xk:dE;break;case khe:for(;E<14;){if(v!==0)b=0;else return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<E,E+=8}if(r=x=A&16383,(x&31)>29||(x>>5&31)>29)return i=ax,y.msg="too many length or distance symbols",b=-3,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);if(x=258+(x&31)+(x>>5&31),!a||a.length<x)a=[];else for(R=0;R<x;R++)a[R]=0;A>>>=14,E-=14,s=0,i=Uhe;case Uhe:for(;s<4+(r>>>10);){for(;E<3;){if(v!==0)b=0;else return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<E,E+=8}a[Fhe[s++]]=A&7,A>>>=3,E-=3}for(;s<19;)a[Fhe[s++]]=0;if(l[0]=7,x=m.inflate_trees_bits(a,l,u,p,y),x!=0)return b=x,b==-3&&(a=null,i=ax),n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);s=0,i=Vhe;case Vhe:for(;x=r,!(s>=258+(x&31)+(x>>5&31));){let H,V;for(x=l[0];E<x;){if(v!==0)b=0;else return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<E,E+=8}if(x=p[(u[0]+(A&xu[x]))*3+1],V=p[(u[0]+(A&xu[x]))*3+2],V<16)A>>>=x,E-=x,a[s++]=V;else{for(R=V==18?7:V-14,H=V==18?11:3;E<x+R;){if(v!==0)b=0;else return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);v--,A|=(y.read_byte(S++)&255)<<E,E+=8}if(A>>>=x,E-=x,H+=A&xu[R],A>>>=R,E-=R,R=s,x=r,R+H>258+(x&31)+(x>>5&31)||V==16&&R<1)return a=null,i=ax,y.msg="invalid bit length repeat",b=-3,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);V=V==16?a[R-1]:0;do a[R++]=V;while(--H!==0);s=R}}if(u[0]=-1,D=[],I=[],N=[],k=[],D[0]=9,I[0]=6,x=r,x=m.inflate_trees_dynamic(257+(x&31),1+(x>>5&31),a,D,I,N,k,p,y),x!=0)return x==-3&&(a=null,i=ax),b=x,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);f.init(D[0],I[0],p,N[0],p,k[0]),i=Yk;case Yk:if(n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,(b=f.proc(n,y,b))!=1)return n.inflate_flush(y,b);if(b=0,f.free(y),S=y.next_in_index,v=y.avail_in,A=n.bitb,E=n.bitk,P=n.write,M=P<n.read?n.read-P-1:n.end-P,h===0){i=dE;break}i=Xk;case Xk:if(n.write=P,b=n.inflate_flush(y,b),P=n.write,M=P<n.read?n.read-P-1:n.end-P,n.read!=n.write)return n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);i=zhe;case zhe:return b=1,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);case ax:return b=-3,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b);default:return b=-2,n.bitb=A,n.bitk=E,y.avail_in=v,y.total_in+=S-y.next_in_index,y.next_in_index=S,n.write=P,n.inflate_flush(y,b)}}},n.free=function(y){n.reset(y,null),n.win=null,p=null},n.set_dictionary=function(y,b,x){n.win.set(y.subarray(b,b+x),0),n.read=n.write=x},n.sync_point=function(){return i==Kq?1:0}}var ent=32,tnt=8,nnt=0,Hhe=1,Ghe=2,jhe=3,Whe=4,qhe=5,$q=6,uP=7,Yhe=12,Dy=13,int=[0,0,255,255];function ont(){let e=this;e.mode=0,e.method=0,e.was=[0],e.need=0,e.marker=0,e.wbits=0;function t(n){return!n||!n.istate?-2:(n.total_in=n.total_out=0,n.msg=null,n.istate.mode=uP,n.istate.blocks.reset(n,null),0)}e.inflateEnd=function(n){return e.blocks&&e.blocks.free(n),e.blocks=null,0},e.inflateInit=function(n,i){return n.msg=null,e.blocks=null,i<8||i>15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new Jtt(n,1<<i),t(n),0)},e.inflate=function(n,i){let o,r;if(!n||!n.istate||!n.next_in)return-2;let s=n.istate;for(i=i==Gtt?-5:0,o=-5;;)switch(s.mode){case nnt:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,((s.method=n.read_byte(n.next_in_index++))&15)!=tnt){s.mode=Dy,n.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=Dy,n.msg="invalid win size",s.marker=5;break}s.mode=Hhe;case Hhe:if(n.avail_in===0)return o;if(o=i,n.avail_in--,n.total_in++,r=n.read_byte(n.next_in_index++)&255,((s.method<<8)+r)%31!==0){s.mode=Dy,n.msg="incorrect header check",s.marker=5;break}if(!(r&ent)){s.mode=uP;break}s.mode=Ghe;case Ghe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need=(n.read_byte(n.next_in_index++)&255)<<24&4278190080,s.mode=jhe;case jhe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<16&16711680,s.mode=Whe;case Whe:if(n.avail_in===0)return o;o=i,n.avail_in--,n.total_in++,s.need+=(n.read_byte(n.next_in_index++)&255)<<8&65280,s.mode=qhe;case qhe:return n.avail_in===0?o:(o=i,n.avail_in--,n.total_in++,s.need+=n.read_byte(n.next_in_index++)&255,s.mode=$q,2);case $q:return s.mode=Dy,n.msg="need dictionary",s.marker=0,-2;case uP:if(o=s.blocks.proc(n,o),o==-3){s.mode=Dy,s.marker=0;break}if(o==0&&(o=i),o!=1)return o;o=i,s.blocks.reset(n,s.was),s.mode=Yhe;case Yhe:return n.avail_in=0,1;case Dy:return-3;default:return-2}},e.inflateSetDictionary=function(n,i,o){let r=0,s=o;if(!n||!n.istate||n.istate.mode!=$q)return-2;let a=n.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,r=o-s),a.blocks.set_dictionary(i,r,s),a.mode=uP,0},e.inflateSync=function(n){let i,o,r,s,a;if(!n||!n.istate)return-2;let l=n.istate;if(l.mode!=Dy&&(l.mode=Dy,l.marker=0),(i=n.avail_in)===0)return-5;for(o=n.next_in_index,r=l.marker;i!==0&&r<4;)n.read_byte(o)==int[r]?r++:n.read_byte(o)!==0?r=0:r=4-r,o++,i--;return n.total_in+=o-n.next_in_index,n.next_in_index=o,n.avail_in=i,l.marker=r,r!=4?-3:(s=n.total_in,a=n.total_out,t(n),n.total_in=s,n.total_out=a,l.mode=uP,0)},e.inflateSyncPoint=function(n){return!n||!n.istate||!n.istate.blocks?-2:n.istate.blocks.sync_point()}}function Khe(){}Khe.prototype={inflateInit(e){let t=this;return t.istate=new ont,e||(e=15),t.istate.inflateInit(t,e)},inflate(e){let t=this;return t.istate?t.istate.inflate(t,e):-2},inflateEnd(){let e=this;if(!e.istate)return-2;let t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync(){let e=this;return e.istate?e.istate.inflateSync(e):-2},inflateSetDictionary(e,t){let n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):-2},read_byte(e){return this.next_in[e]},read_buf(e,t){return this.next_in.subarray(e,e+t)}};function $he(e){let t=this,n=new Khe,i=e&&e.chunkSize?Math.floor(e.chunkSize*2):128*1024,o=Htt,r=new Uint8Array(i),s=!1;n.inflateInit(),n.next_out=r,t.append=function(a,l){let u=[],f,h,p=0,g=0,m=0;if(a.length!==0){n.next_in_index=0,n.next_in=a,n.avail_in=a.length;do{if(n.next_out_index=0,n.avail_out=i,n.avail_in===0&&!s&&(n.next_in_index=0,s=!0),f=n.inflate(o),s&&f===-5){if(n.avail_in!==0)throw new Error("inflating: bad input")}else if(f!==0&&f!==1)throw new Error("inflating: "+n.msg);if((s||f===1)&&n.avail_in===a.length)throw new Error("inflating: bad input");n.next_out_index&&(n.next_out_index===i?u.push(new Uint8Array(r)):u.push(r.subarray(0,n.next_out_index))),m+=n.next_out_index,l&&n.next_in_index>0&&n.next_in_index!=p&&(l(n.next_in_index),p=n.next_in_index)}while(n.avail_in>0||n.avail_out===0);return u.length>1?(h=new Uint8Array(m),u.forEach(function(y){h.set(y,g),g+=y.length})):h=u[0]?new Uint8Array(u[0]):new Uint8Array,h}},t.flush=function(){n.inflateEnd()}}var hE="/",Qq=new Date(2107,11,31),Jq=new Date(1980,0,1),Si=void 0,Tu="undefined",d_="function";var fP=class{constructor(t){return class extends TransformStream{constructor(n,i){let o=new t(i);super({transform(r,s){s.enqueue(o.append(r))},flush(r){let s=o.flush();s&&r.enqueue(s)}})}}}};var rnt=64,Zhe=2;try{typeof navigator!=Tu&&navigator.hardwareConcurrency&&(Zhe=navigator.hardwareConcurrency)}catch{}var snt={chunkSize:512*1024,maxWorkers:Zhe,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:Si,CompressionStreamNative:typeof CompressionStream!=Tu&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Tu&&DecompressionStream},Iy=Object.assign({},snt);function dP(){return Iy}function Kk(e){return Math.max(e.chunkSize,rnt)}function mE(e){let{baseURL:t,chunkSize:n,maxWorkers:i,terminateWorkerTimeout:o,useCompressionStream:r,useWebWorkers:s,Deflate:a,Inflate:l,CompressionStream:u,DecompressionStream:f,workerScripts:h}=e;if(Py("baseURL",t),Py("chunkSize",n),Py("maxWorkers",i),Py("terminateWorkerTimeout",o),Py("useCompressionStream",r),Py("useWebWorkers",s),a&&(Iy.CompressionStream=new fP(a)),l&&(Iy.DecompressionStream=new fP(l)),Py("CompressionStream",u),Py("DecompressionStream",f),h!==Si){let{deflate:p,inflate:g}=h;if((p||g)&&(Iy.workerScripts||(Iy.workerScripts={})),p){if(!Array.isArray(p))throw new Error("workerScripts.deflate must be an array");Iy.workerScripts.deflate=p}if(g){if(!Array.isArray(g))throw new Error("workerScripts.inflate must be an array");Iy.workerScripts.inflate=g}}}function Py(e,t){t!==Si&&(Iy[e]=t)}var Qhe=[];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t&1?t=t>>>1^3988292384:t=t>>>1;Qhe[e]=t}var h_=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0;for(let i=0,o=t.length|0;i<o;i++)n=n>>>8^Qhe[(n^t[i])&255];this.crc=n}get(){return~this.crc}};var hP=class extends TransformStream{constructor(){let t,n=new h_;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}};function pE(e){if(typeof TextEncoder==Tu){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var Xc={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=Xc.getPartial(n);return i===32?e.concat(t):Xc._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+Xc.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=Xc.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=Xc.getPartial(o);return i.push(Xc.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},mP={bytes:{fromBits(e){let n=Xc.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r<n;r++)r&3||(o=e[r/4]),i[r]=o>>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(Xc.partial(8*(n&3),i)),t}}},Jhe={};Jhe.sha1=class{constructor(e){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){let e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){let t=this;typeof e=="string"&&(e=mP.utf8String.toBits(e));let n=t._buffer=Xc.concat(t._buffer,e),i=t._length,o=t._length=i+Xc.bitLength(e);if(o>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=Xc.concat(t,[Xc.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let o=n[0],r=n[1],s=n[2],a=n[3],l=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,o)+t._f(u,r,s,a)+l+i[u]+t._key[Math.floor(u/20)]|0;l=a,a=s,s=t._S(30,r),r=o,o=f}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+l|0}};var e7={};e7.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,l=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let u=s[r-1];(r%o===0||o===8&&r%o===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],r%o===0&&(u=u<<8^u>>>24^l<<24,l=l<<1^(l>>7)*283)),s[r]=s[r-o]^u}for(let u=0;r;u++,r--){let f=s[u&3?r:r-4];r<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,l,u;for(let f=0;f<256;f++)r[(o[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=r[s]||1){let h=s^s<<1^s<<2^s<<3^s<<4;h=h>>8^h&255^99,n[f]=h,i[h]=f,u=o[l=o[a=o[f]]];let p=u*16843009^l*65537^a*257^f*16843008,g=o[h]*257^h*16843008;for(let m=0;m<4;m++)e[m][f]=g=g<<24^g>>>8,t[m][h]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],l=r[2],u=r[3],f=r[4],h=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],m=e[t?1:3]^n[3],y=4,b,x,A;for(let E=0;E<i;E++)b=s[h>>>24]^a[p>>16&255]^l[g>>8&255]^u[m&255]^n[y],x=s[p>>>24]^a[g>>16&255]^l[m>>8&255]^u[h&255]^n[y+1],A=s[g>>>24]^a[m>>16&255]^l[h>>8&255]^u[p&255]^n[y+2],m=s[m>>>24]^a[h>>16&255]^l[p>>8&255]^u[g&255]^n[y+3],y+=4,h=b,p=x,g=A;for(let E=0;E<4;E++)o[t?3&-E:E]=f[h>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[m&255]^n[y++],b=h,h=p,p=g,g=m,m=b;return o}};var eme={getRandomValues(e){let t=new Uint32Array(e.buffer),n=i=>{let o=987654321,r=4294967295;return function(){return o=36969*(o&65535)+(o>>16)&r,i=18e3*(i&65535)+(i>>16)&r,(((o<<16)+i&r)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let i=0,o;i<e.length;i+=4){let r=n((o||Math.random())*4294967296);o=r()*987654071,t[i/4]=r()*4294967296|0}return e}},t7={};t7.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=Xc.bitLength(t);for(let r=0;r<i;r+=4){this.incCounter(n);let s=e.encrypt(n);t[r]^=s[0],t[r+1]^=s[1],t[r+2]^=s[2],t[r+3]^=s[3]}return Xc.clamp(t,o)}};var Oy={importKey(e){return new Oy.hmacSha1(mP.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let o=(i>>5)+1<<2,r,s,a,l,u,f=new ArrayBuffer(o),h=new DataView(f),p=0,g=Xc;for(t=mP.bytes.toBits(t),u=1;p<(o||1);u++){for(r=s=e.encrypt(g.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),l=0;l<s.length;l++)r[l]^=s[l];for(a=0;p<(o||1)&&a<r.length;a++)h.setInt32(p,r[a]),p+=4}return f.slice(0,i/8)}};Oy.hmacSha1=class{constructor(e){let t=this,n=t._hash=Jhe.sha1,i=[[],[]];t._baseHash=[new n,new n];let o=t._baseHash[0].blockSize/32;e.length>o&&(e=new n().update(e).finalize());for(let r=0;r<o;r++)i[0][r]=e[r]^909522486,i[1][r]=e[r]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}};var ant=typeof crypto!=Tu&&typeof crypto.getRandomValues==d_,Ry="Invalid password",cx="Invalid signature",m_="zipjs-abort-check-password";function $k(e){return ant?crypto.getRandomValues(e):eme.getRandomValues(e)}var _E=16,cnt="raw",ime={name:"PBKDF2"},lnt={name:"HMAC"},unt="SHA-1",fnt=Object.assign({hash:lnt},ime),n7=Object.assign({iterations:1e3,hash:{name:unt}},ime),dnt=["deriveBits"],_P=[8,12,16],pP=[16,24,32],My=10,hnt=[0,0,0,0],Jk=typeof crypto!=Tu,bP=Jk&&crypto.subtle,ome=Jk&&typeof bP!=Tu,Em=mP.bytes,mnt=e7.aes,pnt=t7.ctrGladman,_nt=Oy.hmacSha1,tme=Jk&&ome&&typeof bP.importKey==d_,nme=Jk&&ome&&typeof bP.deriveBits==d_,Zk=class extends TransformStream{constructor({password:t,rawPassword:n,signed:i,encryptionStrength:o,checkPasswordOnly:r}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:ame(t,n),signed:i,strength:o-1,pending:new Uint8Array})},async transform(s,a){let l=this,{password:u,strength:f,resolveReady:h,ready:p}=l;u?(await gnt(l,f,u,Hf(s,0,_P[f]+2)),s=Hf(s,_P[f]+2),r?a.error(new Error(m_)):h()):await p;let g=new Uint8Array(s.length-My-(s.length-My)%_E);a.enqueue(rme(l,s,g,0,My,!0))},async flush(s){let{signed:a,ctr:l,hmac:u,pending:f,ready:h}=this;if(u&&l){await h;let p=Hf(f,0,f.length-My),g=Hf(f,f.length-My),m=new Uint8Array;if(p.length){let y=yP(Em,p);u.update(y);let b=l.update(y);m=gP(Em,b)}if(a){let y=Hf(gP(Em,u.digest()),0,My);for(let b=0;b<My;b++)if(y[b]!=g[b])throw new Error(cx)}s.enqueue(m)}}})}},Qk=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i}){let o;super({start(){Object.assign(this,{ready:new Promise(r=>this.resolveReady=r),password:ame(t,n),strength:i-1,pending:new Uint8Array})},async transform(r,s){let a=this,{password:l,strength:u,resolveReady:f,ready:h}=a,p=new Uint8Array;l?(p=await ynt(a,u,l),f()):await h;let g=new Uint8Array(p.length+r.length-r.length%_E);g.set(p,0),s.enqueue(rme(a,r,g,p.length,0))},async flush(r){let{ctr:s,hmac:a,pending:l,ready:u}=this;if(a&&s){await u;let f=new Uint8Array;if(l.length){let h=s.update(yP(Em,l));a.update(h),f=gP(Em,h)}o.signature=gP(Em,a.digest()).slice(0,My),r.enqueue(i7(f,o.signature))}}}),o=this}};function rme(e,t,n,i,o,r){let{ctr:s,hmac:a,pending:l}=e,u=t.length-o;l.length&&(t=i7(l,t),n=Tnt(n,u-u%_E));let f;for(f=0;f<=u-_E;f+=_E){let h=yP(Em,Hf(t,f,f+_E));r&&a.update(h);let p=s.update(h);r||a.update(p),n.set(gP(Em,p),f+i)}return e.pending=Hf(t,f),n}async function gnt(e,t,n,i){let o=await sme(e,t,n,Hf(i,0,_P[t])),r=Hf(i,_P[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(Ry)}async function ynt(e,t,n){let i=$k(new Uint8Array(_P[t])),o=await sme(e,t,n,i);return i7(i,o)}async function sme(e,t,n,i){e.password=null;let o=await bnt(cnt,n,fnt,!1,dnt),r=await xnt(Object.assign({salt:i},n7),o,8*(pP[t]*2+2)),s=new Uint8Array(r),a=yP(Em,Hf(s,0,pP[t])),l=yP(Em,Hf(s,pP[t],pP[t]*2)),u=Hf(s,pP[t]*2);return Object.assign(e,{keys:{key:a,authentication:l,passwordVerification:u},ctr:new pnt(new mnt(a),Array.from(hnt)),hmac:new _nt(l)}),u}async function bnt(e,t,n,i,o){if(tme)try{return await bP.importKey(e,t,n,i,o)}catch{return tme=!1,Oy.importKey(t)}else return Oy.importKey(t)}async function xnt(e,t,n){if(nme)try{return await bP.deriveBits(e,t,n)}catch{return nme=!1,Oy.pbkdf2(t,e.salt,n7.iterations,n)}else return Oy.pbkdf2(t,e.salt,n7.iterations,n)}function ame(e,t){return t===Si?pE(e):t}function i7(e,t){let n=e;return e.length+t.length&&(n=new Uint8Array(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function Tnt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Hf(e,t,n){return e.subarray(t,n)}function gP(e,t){return e.fromBits(t)}function yP(e,t){return e.toBits(t)}var gE=12,eU=class extends TransformStream{constructor({password:t,passwordVerification:n,checkPasswordOnly:i}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),fme(this,t)},transform(o,r){let s=this;if(s.password){let a=cme(s,o.subarray(0,gE));if(s.password=null,a[gE-1]!=s.passwordVerification)throw new Error(Ry);o=o.subarray(gE)}i?r.error(new Error(m_)):r.enqueue(cme(s,o))}})}},tU=class extends TransformStream{constructor({password:t,passwordVerification:n}){super({start(){Object.assign(this,{password:t,passwordVerification:n}),fme(this,t)},transform(i,o){let r=this,s,a;if(r.password){r.password=null;let l=$k(new Uint8Array(gE));l[gE-1]=r.passwordVerification,s=new Uint8Array(i.length+l.length),s.set(lme(r,l),0),a=gE}else s=new Uint8Array(i.length),a=0;s.set(lme(r,i),a),o.enqueue(s)}})}};function cme(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=dme(e)^t[i],o7(e,n[i]);return n}function lme(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=dme(e)^t[i],o7(e,t[i]);return n}function fme(e,t){let n=[305419896,591751049,878082192];Object.assign(e,{keys:n,crcKey0:new h_(n[0]),crcKey2:new h_(n[2])});for(let i=0;i<t.length;i++)o7(e,t.charCodeAt(i))}function o7(e,t){let[n,i,o]=e.keys;e.crcKey0.append([t]),n=~e.crcKey0.get(),i=ume(Math.imul(ume(i+hme(n)),134775813)+1),e.crcKey2.append([i>>>24]),o=~e.crcKey2.get(),e.keys=[n,i,o]}function dme(e){let t=e.keys[2]|2;return hme(Math.imul(t,t^1)>>>8)}function hme(e){return e&255}function ume(e){return e&4294967295}var mme="deflate-raw",nU=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStream:i,CompressionStreamNative:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:l,signed:u,level:f}=t,h=this,p,g,m=pme(super.readable);(!s||l)&&u&&(p=new hP,m=Sm(m,p)),r&&(m=gme(m,a,{level:f,chunkSize:n},o,i)),s&&(l?m=Sm(m,new tU(t)):(g=new Qk(t),m=Sm(m,g))),_me(h,m,()=>{let y;s&&!l&&(y=g.signature),(!s||l)&&u&&(y=new DataView(p.value.buffer).getUint32(0)),h.signature=y})}},iU=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStream:i,DecompressionStreamNative:o}){super({});let{zipCrypto:r,encrypted:s,signed:a,signature:l,compressed:u,useCompressionStream:f}=t,h,p,g=pme(super.readable);s&&(r?g=Sm(g,new eU(t)):(p=new Zk(t),g=Sm(g,p))),u&&(g=gme(g,f,{chunkSize:n},o,i)),(!s||r)&&a&&(h=new hP,g=Sm(g,h)),_me(this,g,()=>{if((!s||r)&&a){let m=new DataView(h.value.buffer);if(l!=m.getUint32(0,!1))throw new Error(cx)}})}};function pme(e){return Sm(e,new TransformStream({transform(t,n){t&&t.length&&n.enqueue(t)}}))}function _me(e,t,n){t=Sm(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function gme(e,t,n,i,o){try{let r=t&&i?i:o;e=Sm(e,new r(mme,n))}catch{if(t)try{e=Sm(e,new o(mme,n))}catch{return e}else return e}return e}function Sm(e,t){return e.pipeThrough(t)}var yme="message",bme="start",xme="pull",r7="data",Tme="ack",s7="close",sU="deflate",aU="inflate";var oU=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(sU)?r=nU:o.startsWith(aU)&&(r=iU);let s=0,a=0,l=new r(t,n),u=super.readable,f=new TransformStream({transform(p,g){p&&p.length&&(a+=p.length,g.enqueue(p))},flush(){Object.assign(i,{inputSize:a})}}),h=new TransformStream({transform(p,g){p&&p.length&&(s+=p.length,g.enqueue(p))},flush(){let{signature:p}=l;Object.assign(i,{signature:p,outputSize:s,inputSize:a})}});Object.defineProperty(i,"readable",{get(){return u.pipeThrough(f).pipeThrough(l).pipeThrough(h)}})}},rU=class extends TransformStream{constructor(t){let n;super({transform:i,flush(o){n&&n.length&&o.enqueue(n)}});function i(o,r){if(n){let s=new Uint8Array(n.length+o.length);s.set(n),s.set(o,n.length),o=s,n=null}o.length>t?(r.enqueue(o.slice(0,t)),i(o.slice(t),r)):n=o}}};var Eme=typeof Worker!=Tu;var yE=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:l,scripts:u},f){let{signal:h}=s;return Object.assign(t,{busy:!0,readable:n.pipeThrough(new rU(r.chunkSize)).pipeThrough(new c7(n,s),{signal:h}),writable:i,options:Object.assign({},o),scripts:u,transferStreams:l,terminate(){return new Promise(p=>{let{worker:g,busy:m}=t;g?(m?t.resolveTerminated=p:(g.terminate(),p()),t.interface=null):p()})},onTaskFinished(){let{resolveTerminated:p}=t;p&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),p()),t.busy=!1,f(t)}}),(a&&Eme?Ant:Sme)(t,r)}},c7=class extends TransformStream{constructor(t,{onstart:n,onprogress:i,size:o,onend:r}){let s=0;super({async start(){n&&await a7(n,o)},async transform(a,l){s+=a.length,i&&await a7(i,s,o),l.enqueue(a)},async flush(){t.size=s,r&&await a7(r,s)}})}};async function a7(e,...t){try{await e(...t)}catch{}}function Sme(e,t){return{run:()=>Cnt(e,t)}}function Ant(e,t){let{baseURL:n,chunkSize:i}=t;if(!e.interface){let o;try{o=wnt(e.scripts[0],n,e)}catch{return Eme=!1,Sme(e,t)}Object.assign(e,{worker:o,interface:{run:()=>Ent(e,{chunkSize:i})}})}return e.interface}async function Cnt({options:e,readable:t,writable:n,onTaskFinished:i},o){try{let r=new oU(e,o);await t.pipeThrough(r).pipeTo(n,{preventClose:!0,preventAbort:!0});let{signature:s,inputSize:a,outputSize:l}=r;return{signature:s,inputSize:a,outputSize:l}}finally{i()}}async function Ent(e,t){let n,i,o=new Promise((p,g)=>{n=p,i=g});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s,scripts:a}=e,{writable:l,closed:u}=Snt(e.writable),f=cU({type:bme,scripts:a.slice(1),options:s,config:t,readable:r,writable:l},e);f||Object.assign(e,{reader:r.getReader(),writer:l.getWriter()});let h=await o;return f||await l.getWriter().close(),await u,h}function Snt(e){let t,n=new Promise(o=>t=o);return{writable:new WritableStream({async write(o){let r=e.getWriter();await r.ready,await r.write(o),r.releaseLock()},close(){t()},abort(o){return e.getWriter().abort(o)}}),closed:n}}var Ame=!0,Cme=!0;function wnt(e,t,n){let i={type:"module"},o,r;typeof e==d_&&(e=e());try{o=new URL(e,t)}catch{o=e}if(Ame)try{r=new Worker(o)}catch{Ame=!1,r=new Worker(o,i)}else r=new Worker(o,i);return r.addEventListener(yme,s=>vnt(s,n)),r}function cU(e,{worker:t,writer:n,onTaskFinished:i,transferStreams:o}){try{let{value:r,readable:s,writable:a}=e,l=[];if(r&&(r.byteLength<r.buffer.byteLength?e.value=r.buffer.slice(0,r.byteLength):e.value=r.buffer,l.push(e.value)),o&&Cme?(s&&l.push(s),a&&l.push(a)):e.readable=e.writable=null,l.length)try{return t.postMessage(e,l),!0}catch{Cme=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),i(),r}}async function vnt({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:l,resolveResult:u,rejectResult:f,onTaskFinished:h}=t;try{if(s){let{message:g,stack:m,code:y,name:b}=s,x=new Error(g);Object.assign(x,{stack:m,code:y,name:b}),p(x)}else{if(n==xme){let{value:g,done:m}=await a.read();cU({type:r7,value:g,done:m,messageId:o},t)}n==r7&&(await l.ready,await l.write(new Uint8Array(i)),cU({type:Tme,messageId:o},t)),n==s7&&p(null,r)}}catch(g){cU({type:s7,messageId:o},t),p(g)}function p(g,m){g?f(g):u(m),l&&l.releaseLock(),h()}}var lx=[],l7=[];var wme=0;async function lU(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,codecType:a,compressed:l,signed:u,encrypted:f}=n,{workerScripts:h,maxWorkers:p}=i;t.transferStreams=o||o===Si;let g=!l&&!u&&!f&&!t.transferStreams;return t.useWebWorkers=!g&&(r||r===Si&&i.useWebWorkers),t.scripts=t.useWebWorkers&&h?h[a]:[],n.useCompressionStream=s||s===Si&&i.useCompressionStream,(await m()).run();async function m(){let b=lx.find(x=>!x.busy);if(b)return vme(b),new yE(b,e,t,y);if(lx.length<p){let x={indexWorker:wme};return wme++,lx.push(x),new yE(x,e,t,y)}else return new Promise(x=>l7.push({resolve:x,stream:e,workerOptions:t}))}function y(b){if(l7.length){let[{resolve:x,stream:A,workerOptions:E}]=l7.splice(0,1);x(new yE(b,A,E,y))}else b.worker?(vme(b),Dnt(b,t)):lx=lx.filter(x=>x!=b)}}function Dnt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{lx=lx.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function vme(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var Pnt="Writer iterator completed too soon",Int="text/plain";var Ont="Content-Type";var Rnt=64*1024,d7="writable",bE=class{constructor(){this.size=0}init(){this.initialized=!0}},uU=class extends bE{get readable(){let t=this,{chunkSize:n=Rnt}=t,i=new ReadableStream({start(){this.chunkOffset=0},async pull(o){let{offset:r=0,size:s,diskNumberStart:a}=i,{chunkOffset:l}=this;o.enqueue(await Ra(t,r+l,Math.min(n,s-l),a)),l+n>s?o.close():this.chunkOffset+=n}});return i}},u7=class extends bE{constructor(){super();let t=this,n=new WritableStream({write(i){return t.writeUint8Array(i)}});Object.defineProperty(t,d7,{get(){return n}})}writeUint8Array(){}};var fU=class extends u7{constructor(t){super(),Object.assign(this,{data:"data:"+(t||"")+";base64,",pending:[]})}writeUint8Array(t){let n=this,i=0,o=n.pending,r=n.pending.length;for(n.pending="",i=0;i<Math.floor((r+t.length)/3)*3-r;i++)o+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pending+=String.fromCharCode(t[i]);o.length>2?n.data+=btoa(o):n.pending=o}getData(){return this.data+btoa(this.pending)}},p_=class extends uU{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,n){let i=this,o=t+n,s=await(t||o<i.size?i.blob.slice(t,o):i.blob).arrayBuffer();return s.byteLength>n&&(s=s.slice(t,o)),new Uint8Array(s)}},xP=class extends bE{constructor(t){super();let n=this,i=new TransformStream,o=[];t&&o.push([Ont,t]),Object.defineProperty(n,d7,{get(){return i.writable}}),n.blob=new Response(i.readable,{headers:o}).blob()}getData(){return this.blob}},dU=class extends p_{constructor(t){super(new Blob([t],{type:Int}))}},hU=class extends xP{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();if(i.text&&n)return i.text();{let o=new FileReader;return new Promise((r,s)=>{Object.assign(o,{onload:({target:a})=>r(a.result),onerror:()=>s(o.error)}),o.readAsText(i,t)})}}};var f7=class extends uU{constructor(t){super(),this.readers=t}async init(){let t=this,{readers:n}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(n.map(async(i,o)=>{await i.init(),o!=n.length-1&&(t.lastDiskOffset+=i.size),t.size+=i.size})),super.init()}async readUint8Array(t,n,i=0){let o=this,{readers:r}=this,s,a=i;a==-1&&(a=r.length-1);let l=t;for(;l>=r[a].size;)l-=r[a].size,a++;let u=r[a],f=u.size;if(l+n<=f)s=await Ra(u,l,n);else{let h=f-l;s=new Uint8Array(n),s.set(await Ra(u,l,h)),s.set(await o.readUint8Array(t+h,n-h,i),h)}return o.lastDiskNumber=Math.max(a,o.lastDiskNumber),s}},mU=class extends bE{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(f){let{availableSize:h}=i;if(s)f.length>=h?(await l(f.slice(0,h)),await u(),i.diskOffset+=o.size,i.diskNumber++,s=null,await this.write(f.slice(h))):await l(f);else{let{value:p,done:g}=await t.next();if(g&&!p)throw new Error(Pnt);o=p,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await vm(o),r=p.writable,s=r.getWriter(),await this.write(f)}},async close(){await s.ready,await u()}});Object.defineProperty(i,d7,{get(){return a}});async function l(f){let h=f.length;h&&(await s.ready,await s.write(f),o.size+=h,i.size+=h,i.availableSize-=h)}async function u(){r.size=o.size,await s.close()}}};async function vm(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}function pU(e){return Array.isArray(e)&&(e=new f7(e)),e instanceof ReadableStream&&(e={readable:e}),e}function _U(e){e.writable===Si&&typeof e.next==d_&&(e=new mU(e)),e instanceof WritableStream&&(e={writable:e});let{writable:t}=e;return t.size===Si&&(t.size=0),e instanceof mU||Object.assign(e,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),e}function Ra(e,t,n,i){return e.readUint8Array(t,n,i)}var Dme="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),Mnt=Dme.length==256;function Pme(e){if(Mnt){let t="";for(let n=0;n<e.length;n++)t+=Dme[e[n]];return t}else return new TextDecoder().decode(e)}function TP(e,t){return t&&t.trim().toLowerCase()=="cp437"?Pme(e):new TextDecoder(t).decode(e)}var h7="filename",m7="rawFilename",p7="comment",_7="rawComment",g7="uncompressedSize",y7="compressedSize",b7="offset",gU="diskNumberStart",xE="lastModDate",yU="rawLastModDate",AP="lastAccessDate",Ime="rawLastAccessDate",CP="creationDate",Ome="rawCreationDate",x7="internalFileAttribute",T7="externalFileAttribute",A7="msDosCompatible",bU="zip64",C7="encrypted",E7="version",S7="versionMadeBy",w7="zipCrypto",Lnt=[h7,m7,y7,g7,xE,yU,p7,_7,AP,CP,b7,gU,gU,x7,T7,A7,bU,C7,E7,S7,w7,"directory","bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],Ly=class{constructor(t){Lnt.forEach(n=>this[n]=t[n])}};var v7="File format is not recognized",knt="End of central directory not found",Unt="End of Zip64 central directory locator not found",Vnt="Central directory header not found",znt="Local file header not found",Hnt="Zip64 extra field not found",Gnt="File contains encrypted entry",jnt="Encryption method not supported",Rme="Compression method not supported",Mme="Split zip file",Lme="utf-8",Nme="cp437",Wnt=[[g7,4294967295],[y7,4294967295],[b7,4294967295],[gU,65535]],qnt={[65535]:{getValue:ls,bytes:4},[4294967295]:{getValue:xU,bytes:8}},vU=class{constructor(t,n={}){Object.assign(this,{reader:pU(t),options:n,config:dP()})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n,{config:o}=n;if(await vm(i),(i.size===Si||!i.readUint8Array)&&(i=new p_(await new Response(i.readable).blob()),await vm(i)),i.size<22)throw new Error(v7);i.chunkSize=Kk(o);let r=await Znt(i,101010256,i.size,22,65535*16);if(!r){let B=await Ra(i,0,4),_=ma(B);throw ls(_)==134695760?new Error(Mme):new Error(knt)}let s=ma(r),a=ls(s,12),l=ls(s,16),u=r.offset,f=ha(s,20),h=u+22+f,p=ha(s,4),g=i.lastDiskNumber||0,m=ha(s,6),y=ha(s,8),b=0,x=0;if(l==4294967295||a==4294967295||y==65535||m==65535){let B=await Ra(i,r.offset-20,20),_=ma(B);if(ls(_,0)==117853008){l=xU(_,8);let w=await Ra(i,l,56,-1),D=ma(w),I=r.offset-20-56;if(ls(D,0)!=101075792&&l!=I){let N=l;l=I,b=l-N,w=await Ra(i,l,56,-1),D=ma(w)}if(ls(D,0)!=101075792)throw new Error(Unt);p==65535&&(p=ls(D,16)),m==65535&&(m=ls(D,20)),y==65535&&(y=xU(D,32)),a==4294967295&&(a=xU(D,40)),l-=a}}if(l>=i.size&&(b=i.size-l-a-22,l=i.size-a-22),g!=p)throw new Error(Mme);if(l<0)throw new Error(v7);let A=0,E=await Ra(i,l,a,m),S=ma(E);if(a){let B=r.offset-a;if(ls(S,A)!=33639248&&l!=B){let _=l;l=B,b+=l-_,E=await Ra(i,l,a,m),S=ma(E)}}let v=r.offset-l-(i.lastDiskOffset||0);if(a!=v&&v>=0&&(a=v,E=await Ra(i,l,a,m),S=ma(E)),l<0||l>=i.size)throw new Error(v7);let P=Kc(n,t,"filenameEncoding"),M=Kc(n,t,"commentEncoding");for(let B=0;B<y;B++){let _=new P7(i,o,n.options);if(ls(S,A)!=33639248)throw new Error(Vnt);Bme(_,S,A+6);let w=!!_.bitFlag.languageEncodingFlag,D=A+46,I=D+_.filenameLength,N=I+_.extraFieldLength,k=ha(S,A+4),H=(k&0)==0,V=E.subarray(D,I),j=ha(S,A+32),U=N+j,q=E.subarray(N,U),X=w,te=w,K=H&&(TE(S,A+38)&16)==16,Z=ls(S,A+42)+b;Object.assign(_,{versionMadeBy:k,msDosCompatible:H,compressedSize:0,uncompressedSize:0,commentLength:j,directory:K,offset:Z,diskNumberStart:ha(S,A+34),internalFileAttribute:ha(S,A+36),externalFileAttribute:ls(S,A+38),rawFilename:V,filenameUTF8:X,commentUTF8:te,rawExtraField:E.subarray(I,N)});let ee=Kc(n,t,"decodeText")||TP,me=X?Lme:P||Nme,xe=te?Lme:M||Nme,ue=ee(V,me);ue===Si&&(ue=TP(V,me));let ye=ee(q,xe);ye===Si&&(ye=TP(q,xe)),Object.assign(_,{rawComment:q,filename:ue,comment:ye,directory:K||ue.endsWith(hE)}),x=Math.max(Z,x),kme(_,_,S,A+6),_.zipCrypto=_.encrypted&&!_.extraFieldAES;let Ae=new Ly(_);Ae.getData=(Ee,Ve)=>_.getData(Ee,Ae,Ve),A=U;let{onprogress:Pe}=t;if(Pe)try{await Pe(B+1,y,new Ly(_))}catch{}yield Ae}let R=Kc(n,t,"extractPrependedData"),L=Kc(n,t,"extractAppendedData");return R&&(n.prependedData=x>0?await Ra(i,0,x):new Uint8Array),n.comment=f?await Ra(i,u+22,f):new Uint8Array,L&&(n.appendedData=h<i.size?await Ra(i,h,i.size-h):new Uint8Array),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){}};var P7=class{constructor(t,n,i){Object.assign(this,{reader:t,config:n,options:i})}async getData(t,n,i={}){let o=this,{reader:r,offset:s,diskNumberStart:a,extraFieldAES:l,compressionMethod:u,config:f,bitFlag:h,signature:p,rawLastModDate:g,uncompressedSize:m,compressedSize:y}=o,b=n.localDirectory={},x=await Ra(r,s,30,a),A=ma(x),E=Kc(o,i,"password"),S=Kc(o,i,"rawPassword"),v=Kc(o,i,"passThrough");if(E=E&&E.length&&E,S=S&&S.length&&S,l&&l.originalCompressionMethod!=99)throw new Error(Rme);if(u!=0&&u!=8&&!v)throw new Error(Rme);if(ls(A,0)!=67324752)throw new Error(znt);Bme(b,A,4),b.rawExtraField=b.extraFieldLength?await Ra(r,s+30+b.filenameLength,b.extraFieldLength,a):new Uint8Array,kme(o,b,A,4,!0),Object.assign(n,{lastAccessDate:b.lastAccessDate,creationDate:b.creationDate});let P=o.encrypted&&b.encrypted&&!v,M=P&&!l;if(v||(n.zipCrypto=M),P){if(!M&&l.strength===Si)throw new Error(jnt);if(!E&&!S)throw new Error(Gnt)}let R=s+30+b.filenameLength+b.extraFieldLength,L=y,B=r.readable;Object.assign(B,{diskNumberStart:a,offset:R,size:L});let _=Kc(o,i,"signal"),w=Kc(o,i,"checkPasswordOnly");w&&(t=new WritableStream),t=_U(t),await vm(t,v?y:m);let{writable:D}=t,{onstart:I,onprogress:N,onend:k}=i,H={options:{codecType:aU,password:E,rawPassword:S,zipCrypto:M,encryptionStrength:l&&l.strength,signed:Kc(o,i,"checkSignature")&&!v,passwordVerification:M&&(h.dataDescriptor?g>>>8&255:p>>>24&255),signature:p,compressed:u!=0&&!v,encrypted:o.encrypted&&!v,useWebWorkers:Kc(o,i,"useWebWorkers"),useCompressionStream:Kc(o,i,"useCompressionStream"),transferStreams:Kc(o,i,"transferStreams"),checkPasswordOnly:w},config:f,streamOptions:{signal:_,size:L,onstart:I,onprogress:N,onend:k}},V=0;try{({outputSize:V}=await lU({readable:B,writable:D},H))}catch(j){if(!w||j.message!=m_)throw j}finally{let j=Kc(o,i,"preventClose");D.size+=V,!j&&!D.locked&&await D.getWriter().close()}return w?Si:t.getData?t.getData():D}};function Bme(e,t,n){let i=e.rawBitFlag=ha(t,n+2),o=(i&1)==1,r=ls(t,n+6);Object.assign(e,{encrypted:o,version:ha(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:Qnt(r),filenameLength:ha(t,n+22),extraFieldLength:ha(t,n+24)})}function kme(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=ma(new Uint8Array(r)),l=0;try{for(;l<r.length;){let x=ha(a,l),A=ha(a,l+2);s.set(x,{type:x,data:r.slice(l+4,l+4+A)}),l+=4+A}}catch{}let u=ha(n,i+4);Object.assign(t,{signature:ls(n,i+10),uncompressedSize:ls(n,i+18),compressedSize:ls(n,i+14)});let f=s.get(1);f&&(Ynt(f,t),t.extraFieldZip64=f);let h=s.get(28789);h&&(Fme(h,h7,m7,t,e),t.extraFieldUnicodePath=h);let p=s.get(25461);p&&(Fme(p,p7,_7,t,e),t.extraFieldUnicodeComment=p);let g=s.get(39169);g?(Xnt(g,t,u),t.extraFieldAES=g):t.compressionMethod=u;let m=s.get(10);m&&(Knt(m,t),t.extraFieldNTFS=m);let y=s.get(21589);y&&($nt(y,t,o),t.extraFieldExtendedTimestamp=y);let b=s.get(6534);b&&(t.extraFieldUSDZ=b)}function Ynt(e,t){t.zip64=!0;let n=ma(e.data),i=Wnt.filter(([o,r])=>t[o]==r);for(let o=0,r=0;o<i.length;o++){let[s,a]=i[o];if(t[s]==a){let l=qnt[a];t[s]=e[s]=l.getValue(n,r),r+=l.bytes}else if(e[s])throw new Error(Hnt)}}function Fme(e,t,n,i,o){let r=ma(e.data),s=new h_;s.append(o[n]);let a=ma(new Uint8Array(4));a.setUint32(0,s.get(),!0);let l=ls(r,1);Object.assign(e,{version:TE(r,0),[t]:TP(e.data.subarray(5)),valid:!o.bitFlag.languageEncodingFlag&&l==ls(a,0)}),e.valid&&(i[t]=e[t],i[t+"UTF8"]=!0)}function Xnt(e,t,n){let i=ma(e.data),o=TE(i,4);Object.assign(e,{vendorVersion:TE(i,0),vendorId:TE(i,2),strength:o,originalCompressionMethod:n,compressionMethod:ha(i,5)}),t.compressionMethod=e.compressionMethod}function Knt(e,t){let n=ma(e.data),i=4,o;try{for(;i<e.data.length&&!o;){let r=ha(n,i),s=ha(n,i+2);r==1&&(o=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}try{if(o&&o.length==24){let r=ma(o),s=r.getBigUint64(0,!0),a=r.getBigUint64(8,!0),l=r.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:l});let u=D7(s),f=D7(a),h=D7(l),p={lastModDate:u,lastAccessDate:f,creationDate:h};Object.assign(e,p),Object.assign(t,p)}}catch{}}function $nt(e,t,n){let i=ma(e.data),o=TE(i,0),r=[],s=[];n?((o&1)==1&&(r.push(xE),s.push(yU)),(o&2)==2&&(r.push(AP),s.push(Ime)),(o&4)==4&&(r.push(CP),s.push(Ome))):e.data.length>=5&&(r.push(xE),s.push(yU));let a=1;r.forEach((l,u)=>{if(e.data.length>=a+4){let f=ls(i,a);t[l]=e[l]=new Date(f*1e3);let h=s[u];e[h]=f}a+=4})}async function Znt(e,t,n,i,o){let r=new Uint8Array(4),s=ma(r);Jnt(s,0,t);let a=i+o;return await l(i)||await l(Math.min(a,n));async function l(u){let f=n-u,h=await Ra(e,f,u);for(let p=h.length-i;p>=0;p--)if(h[p]==r[0]&&h[p+1]==r[1]&&h[p+2]==r[2]&&h[p+3]==r[3])return{offset:f+p,buffer:h.slice(p,p+i).buffer}}}function Kc(e,t,n){return t[n]===Si?e.options[n]:t[n]}function Qnt(e){let t=(e&4294901760)>>16,n=e&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0)}catch{}}function D7(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function TE(e,t){return e.getUint8(t)}function ha(e,t){return e.getUint16(t,!0)}function ls(e,t){return e.getUint32(t,!0)}function xU(e,t){return Number(e.getBigUint64(t,!0))}function Jnt(e,t,n){e.setUint32(t,n,!0)}function ma(e){return new DataView(e.buffer)}var iit="File already exists",oit="Zip file comment exceeds 64KB",rit="File entry comment exceeds 64KB",sit="File entry name exceeds 64KB",zme="Version exceeds 65535",ait="The strength must equal 1, 2, or 3",cit="Extra field type exceeds 65535",lit="Extra field data exceeds 64KB",G7="Zip64 is not supported (make sure 'keepOrder' is set to 'true')",uit="Undefined uncompressed size",Hme=new Uint8Array([7,0,2,0,65,69,3,0,0]),z7=0,Gme=[],IU=class{constructor(t,n={}){t=_U(t);let i=t.availableSize!==Si&&t.availableSize>0&&t.availableSize!==1/0&&t.maxSize!==Si&&t.maxSize>0&&t.maxSize!==1/0;Object.assign(this,{writer:t,addSplitZipSignature:i,options:n,config:dP(),files:new Map,filenames:new Set,offset:n.offset===Si?t.writable.size:n.offset,pendingEntriesSize:0,pendingAddFileCalls:new Set,bufferedWrites:0})}async add(t="",n,i={}){let o=this,{pendingAddFileCalls:r,config:s}=o;z7<s.maxWorkers?z7++:await new Promise(l=>Gme.push(l));let a;try{if(t=t.trim(),o.filenames.has(t))throw new Error(iit);return o.filenames.add(t),a=fit(o,t,n,i),r.add(a),await a}catch(l){throw o.filenames.delete(t),l}finally{r.delete(a);let l=Gme.shift();l?l():z7--}}async close(t=new Uint8Array,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;for(;o.size;)await Promise.allSettled(Array.from(o));return await xit(this,t,n),co(i,n,"preventClose")||await s.getWriter().close(),r.getData?r.getData():s}};async function fit(e,t,n,i){t=t.trim(),i.directory&&!t.endsWith(hE)?t+=hE:i.directory=t.endsWith(hE);let o=co(e,i,"encodeText",pE),r=o(t);if(r===Si&&(r=pE(t)),Wi(r)>65535)throw new Error(sit);let s=i.comment||"",a=o(s);if(a===Si&&(a=pE(s)),Wi(a)>65535)throw new Error(rit);let l=co(e,i,E7,20);if(l>65535)throw new Error(zme);let u=co(e,i,S7,20);if(u>65535)throw new Error(zme);let f=co(e,i,xE,new Date),h=co(e,i,AP),p=co(e,i,CP),g=co(e,i,A7,!0),m=co(e,i,x7,0),y=co(e,i,T7,0),b=co(e,i,"passThrough"),x,A;b||(x=co(e,i,"password"),A=co(e,i,"rawPassword"));let E=co(e,i,"encryptionStrength",3),S=co(e,i,w7),v=co(e,i,"extendedTimestamp",!0),P=co(e,i,"keepOrder",!0),M=co(e,i,"level"),R=co(e,i,"useWebWorkers"),L=co(e,i,"bufferedWrite"),B=co(e,i,"dataDescriptorSignature",!1),_=co(e,i,"signal"),w=co(e,i,"useUnicodeFileNames",!0),D=co(e,i,"useCompressionStream"),I=co(e,i,"compressionMethod"),N=co(e,i,"dataDescriptor",!0),k=co(e,i,bU);if(!S&&(x!==Si||A!==Si)&&!(E>=1&&E<=3))throw new Error(ait);let H=new Uint8Array,{extraField:V}=i;if(V){let Dt=0,Gt=0;V.forEach($e=>Dt+=4+Wi($e)),H=new Uint8Array(Dt),V.forEach(($e,ln)=>{if(ln>65535)throw new Error(cit);if(Wi($e)>65535)throw new Error(lit);Es(H,new Uint16Array([ln]),Gt),Es(H,new Uint16Array([Wi($e)]),Gt+2),Es(H,$e,Gt+4),Gt+=4+Wi($e)})}let j=0,U=0,q=0;if(b&&({uncompressedSize:q}=i,q===Si))throw new Error(uit);let X=k===!0;n&&(n=pU(n),await vm(n),b?j=jme(q):n.size===Si?(N=!0,(k||k===Si)&&(k=!0,q=j=4294967296)):(q=n.size,j=jme(q)));let{diskOffset:te,diskNumber:K,maxSize:Z}=e.writer,ee=X||q>4294967295,me=X||j>4294967295,xe=X||e.offset+e.pendingEntriesSize-te>4294967295,ye=co(e,i,"supportZip64SplitFile",!0)&&X||K+Math.ceil(e.pendingEntriesSize/Z)>65535;if(xe||ee||me||ye){if(k===!1||!P)throw new Error(G7);k=!0}k=k||!1;let Ae=co(e,i,C7),{signature:Pe}=i;i=Object.assign({},i,{rawFilename:r,rawComment:a,version:l,versionMadeBy:u,lastModDate:f,lastAccessDate:h,creationDate:p,rawExtraField:H,zip64:k,zip64UncompressedSize:ee,zip64CompressedSize:me,zip64Offset:xe,zip64DiskNumberStart:ye,password:x,rawPassword:A,level:!D&&e.config.CompressionStream===Si&&e.config.CompressionStreamNative===Si?0:M,useWebWorkers:R,encryptionStrength:E,extendedTimestamp:v,zipCrypto:S,bufferedWrite:L,keepOrder:P,useUnicodeFileNames:w,dataDescriptor:N,dataDescriptorSignature:B,signal:_,msDosCompatible:g,internalFileAttribute:m,externalFileAttribute:y,useCompressionStream:D,passThrough:b,encrypted:!!(x&&Wi(x)||A&&Wi(A))||b&&Ae,signature:Pe,compressionMethod:I});let Ee=mit(i),Ve=_it(i),je=Wi(Ee.localHeaderArray,Ve.dataDescriptorArray);U=je+j,e.options.usdz&&(U+=U+64),e.pendingEntriesSize+=U;let it;try{it=await dit(e,t,n,{headerInfo:Ee,dataDescriptorInfo:Ve,metadataSize:je},i)}finally{e.pendingEntriesSize-=U}return Object.assign(it,{name:t,comment:s,extraField:V}),new Ly(it)}async function dit(e,t,n,i,o){let{files:r,writer:s}=e,{keepOrder:a,dataDescriptor:l,signal:u}=o,{headerInfo:f}=i,{usdz:h}=e.options,p=Array.from(r.values()).pop(),g={},m,y,b,x,A,E,S;r.set(t,g);try{let R;a&&(R=p&&p.lock,v()),(o.bufferedWrite||e.writerLocked||e.bufferedWrites&&a||!l)&&!h?(E=new TransformStream,S=new Response(E.readable).blob(),E.writable.size=0,m=!0,e.bufferedWrites++,await vm(s)):(E=s,await P()),await vm(E);let{writable:L}=s,{diskOffset:B}=s;if(e.addSplitZipSignature){delete e.addSplitZipSignature;let w=new Uint8Array(4),D=Ma(w);ji(D,0,134695760),await Dm(L,w),e.offset+=4}h&&pit(i,e.offset-B),m||(await R,await M(L));let{diskNumber:_}=s;if(A=!0,g.diskNumberStart=_,g=await hit(n,E,g,i,e.config,o),A=!1,r.set(t,g),g.filename=t,m){await E.writable.getWriter().close();let w=await S;await R,await P(),x=!0,l||(w=await yit(g,w,L,o)),await M(L),g.diskNumberStart=s.diskNumber,B=s.diskOffset,await w.stream().pipeTo(L,{preventClose:!0,preventAbort:!0,signal:u}),L.size+=w.size,x=!1}if(g.offset=e.offset-B,g.zip64)bit(g,o);else if(g.offset>4294967295)throw new Error(G7);return e.offset+=g.size,g}catch(R){if(m&&x||!m&&A){if(e.hasCorruptedEntries=!0,R)try{R.corruptedEntry=!0}catch{}m?e.offset+=E.writable.size:e.offset=E.writable.size}throw r.delete(t),R}finally{m&&e.bufferedWrites--,b&&b(),y&&y()}function v(){g.lock=new Promise(R=>b=R)}async function P(){e.writerLocked=!0;let{lockWriter:R}=e;e.lockWriter=new Promise(L=>y=()=>{e.writerLocked=!1,L()}),await R}async function M(R){Wi(f.localHeaderArray)>s.availableSize&&(s.availableSize=0,await Dm(R,new Uint8Array))}}async function hit(e,t,{diskNumberStart:n,lock:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:l,metadataSize:u}=o,{localHeaderArray:f,headerArray:h,lastModDate:p,rawLastModDate:g,encrypted:m,compressed:y,version:b,compressionMethod:x,rawExtraFieldExtendedTimestamp:A,extraFieldExtendedTimestampFlag:E,rawExtraFieldNTFS:S,rawExtraFieldAES:v}=a,{dataDescriptorArray:P}=l,{rawFilename:M,lastAccessDate:R,creationDate:L,password:B,rawPassword:_,level:w,zip64:D,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:k,zip64DiskNumberStart:H,zipCrypto:V,dataDescriptor:j,directory:U,versionMadeBy:q,rawComment:X,rawExtraField:te,useWebWorkers:K,onstart:Z,onprogress:ee,onend:me,signal:xe,encryptionStrength:ue,extendedTimestamp:ye,msDosCompatible:Ae,internalFileAttribute:Pe,externalFileAttribute:Ee,useCompressionStream:Ve,passThrough:je}=s,it={lock:i,versionMadeBy:q,zip64:D,directory:!!U,filenameUTF8:!0,rawFilename:M,commentUTF8:!0,rawComment:X,rawExtraFieldExtendedTimestamp:A,rawExtraFieldNTFS:S,rawExtraFieldAES:v,rawExtraField:te,extendedTimestamp:ye,msDosCompatible:Ae,internalFileAttribute:Pe,externalFileAttribute:Ee,diskNumberStart:n},{signature:Dt,uncompressedSize:Gt}=s,$e=0;je||(Gt=0);let{writable:ln}=t;if(e){e.chunkSize=Kk(r),await Dm(ln,f);let Ct=e.readable,gi=Ct.size=e.size,an={options:{codecType:sU,level:w,rawPassword:_,password:B,encryptionStrength:ue,zipCrypto:m&&V,passwordVerification:m&&V&&g>>8&255,signed:!je,compressed:y&&!je,encrypted:m&&!je,useWebWorkers:K,useCompressionStream:Ve,transferStreams:!1},config:r,streamOptions:{signal:xe,size:gi,onstart:Z,onprogress:ee,onend:me}},_e=await lU({readable:Ct,writable:ln},an);$e=_e.outputSize,je||(Gt=_e.inputSize,Dt=_e.signature),ln.size+=Gt}else await Dm(ln,f);let Vt;if(D){let Ct=4;I&&(Ct+=8),N&&(Ct+=8),k&&(Ct+=8),H&&(Ct+=4),Vt=new Uint8Array(Ct)}else Vt=new Uint8Array;return git({signature:Dt,rawExtraFieldZip64:Vt,compressedSize:$e,uncompressedSize:Gt,headerInfo:a,dataDescriptorInfo:l},s),j&&await Dm(ln,P),Object.assign(it,{uncompressedSize:Gt,compressedSize:$e,lastModDate:p,rawLastModDate:g,creationDate:L,lastAccessDate:R,encrypted:m,zipCrypto:V,size:u+$e,compressionMethod:x,version:b,headerArray:h,signature:Dt,rawExtraFieldZip64:Vt,extraFieldExtendedTimestampFlag:E,zip64UncompressedSize:I,zip64CompressedSize:N,zip64Offset:k,zip64DiskNumberStart:H}),it}function mit(e){let{rawFilename:t,lastModDate:n,lastAccessDate:i,creationDate:o,level:r,zip64:s,zipCrypto:a,useUnicodeFileNames:l,dataDescriptor:u,directory:f,rawExtraField:h,encryptionStrength:p,extendedTimestamp:g,encrypted:m}=e,{version:y,compressionMethod:b}=e,x=!f&&(r>0||r===Si&&b!==0),A;if(m&&!a){A=new Uint8Array(Wi(Hme)+2);let k=Ma(A);eo(k,0,39169),Es(A,Hme,2),OU(k,8,p)}else A=new Uint8Array;let E,S,v;if(g){S=new Uint8Array(9+(i?4:0)+(o?4:0));let k=Ma(S);eo(k,0,21589),eo(k,2,Wi(S)-4),v=1+(i?2:0)+(o?4:0),OU(k,4,v);let H=5;ji(k,H,Math.floor(n.getTime()/1e3)),H+=4,i&&(ji(k,H,Math.floor(i.getTime()/1e3)),H+=4),o&&ji(k,H,Math.floor(o.getTime()/1e3));try{E=new Uint8Array(36);let V=Ma(E),j=H7(n);eo(V,0,10),eo(V,2,32),eo(V,8,1),eo(V,10,24),Nl(V,12,j),Nl(V,20,H7(i)||j),Nl(V,28,H7(o)||j)}catch{E=new Uint8Array}}else E=S=new Uint8Array;let P=0;l&&(P=P|2048),u&&(P=P|8),b===Si&&(b=x?8:0),b==8&&(r>=1&&r<3&&(P=P|6),r>=3&&r<5&&(P=P|1),r===9&&(P=P|2)),s&&(y=y>45?y:45),m&&(P=P|1,a||(y=y>51?y:51,A[9]=b,b=99));let M=new Uint8Array(26),R=Ma(M);eo(R,0,y),eo(R,2,P),eo(R,4,b);let L=new Uint32Array(1),B=Ma(L),_;n<Jq?_=Jq:n>Qq?_=Qq:_=n,eo(B,0,(_.getHours()<<6|_.getMinutes())<<5|_.getSeconds()/2),eo(B,2,(_.getFullYear()-1980<<4|_.getMonth()+1)<<5|_.getDate());let w=L[0];ji(R,6,w),eo(R,22,Wi(t));let D=Wi(A,S,E,h);eo(R,24,D);let I=new Uint8Array(30+Wi(t)+D),N=Ma(I);return ji(N,0,67324752),Es(I,M,4),Es(I,t,30),Es(I,A,30+Wi(t)),Es(I,S,30+Wi(t,A)),Es(I,E,30+Wi(t,A,S)),Es(I,h,30+Wi(t,A,S,E)),{localHeaderArray:I,headerArray:M,headerView:R,lastModDate:n,rawLastModDate:w,encrypted:m,compressed:x,version:y,compressionMethod:b,extraFieldExtendedTimestampFlag:v,rawExtraFieldExtendedTimestamp:S,rawExtraFieldNTFS:E,rawExtraFieldAES:A,extraFieldLength:D}}function pit(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=Ma(i),s=64-(t+Wi(i))%64;s<4&&(s+=64);let a=new Uint8Array(s),l=Ma(a);eo(l,0,6534),eo(l,2,s-2);let u=i;n.localHeaderArray=i=new Uint8Array(Wi(u)+s),Es(i,u),Es(i,a,Wi(u)),r=Ma(i),eo(r,28,o+s),e.metadataSize+=s}function _it(e){let{zip64:t,dataDescriptor:n,dataDescriptorSignature:i}=e,o=new Uint8Array,r,s=0;return n&&(o=new Uint8Array(t?i?24:20:i?16:12),r=Ma(o),i&&(s=4,ji(r,0,134695760))),{dataDescriptorArray:o,dataDescriptorView:r,dataDescriptorOffset:s}}function git(e,t){let{signature:n,rawExtraFieldZip64:i,compressedSize:o,uncompressedSize:r,headerInfo:s,dataDescriptorInfo:a}=e,{headerView:l,encrypted:u}=s,{dataDescriptorView:f,dataDescriptorOffset:h}=a,{zip64:p,zip64UncompressedSize:g,zip64CompressedSize:m,zipCrypto:y,dataDescriptor:b}=t;if((!u||y)&&n!==Si&&(ji(l,10,n),b&&ji(f,h,n)),p){let x=Ma(i);eo(x,0,1),eo(x,2,Wi(i)-4);let A=4;g&&(ji(l,18,4294967295),Nl(x,A,BigInt(r)),A+=8),m&&(ji(l,14,4294967295),Nl(x,A,BigInt(o))),b&&(Nl(f,h+4,BigInt(o)),Nl(f,h+12,BigInt(r)))}else ji(l,14,o),ji(l,18,r),b&&(ji(f,h+4,o),ji(f,h+8,r))}async function yit(e,t,n,{zipCrypto:i}){let o;o=await t.slice(0,26).arrayBuffer(),o.byteLength!=26&&(o=o.slice(0,26));let r=new DataView(o);return(!e.encrypted||i)&&ji(r,14,e.signature),e.zip64?(ji(r,18,4294967295),ji(r,22,4294967295)):(ji(r,18,e.compressedSize),ji(r,22,e.uncompressedSize)),await Dm(n,new Uint8Array(o)),t.slice(o.byteLength)}function bit(e,t){let{rawExtraFieldZip64:n,offset:i,diskNumberStart:o}=e,{zip64UncompressedSize:r,zip64CompressedSize:s,zip64Offset:a,zip64DiskNumberStart:l}=t,u=Ma(n),f=4;r&&(f+=8),s&&(f+=8),a&&(Nl(u,f,BigInt(i)),f+=8),l&&ji(u,f,o)}async function xit(e,t,n){let{files:i,writer:o}=e,{diskOffset:r,writable:s}=o,{diskNumber:a}=o,l=0,u=0,f=e.offset-r,h=i.size;for(let[,v]of i){let{rawFilename:P,rawExtraFieldZip64:M,rawExtraFieldAES:R,rawComment:L,rawExtraFieldNTFS:B,rawExtraField:_,extendedTimestamp:w,extraFieldExtendedTimestampFlag:D,lastModDate:I}=v,N;if(w){N=new Uint8Array(9);let k=Ma(N);eo(k,0,21589),eo(k,2,5),OU(k,4,D),ji(k,5,Math.floor(I.getTime()/1e3))}else N=new Uint8Array;v.rawExtraFieldCDExtendedTimestamp=N,u+=46+Wi(P,L,M,R,B,N,_)}let p=new Uint8Array(u),g=Ma(p);await vm(o);let m=0;for(let[v,P]of Array.from(i.values()).entries()){let{offset:M,rawFilename:R,rawExtraFieldZip64:L,rawExtraFieldAES:B,rawExtraFieldCDExtendedTimestamp:_,rawExtraFieldNTFS:w,rawExtraField:D,rawComment:I,versionMadeBy:N,headerArray:k,directory:H,zip64:V,zip64UncompressedSize:j,zip64CompressedSize:U,zip64DiskNumberStart:q,zip64Offset:X,msDosCompatible:te,internalFileAttribute:K,externalFileAttribute:Z,diskNumberStart:ee,uncompressedSize:me,compressedSize:xe}=P,ue=Wi(L,B,_,w,D);ji(g,l,33639248),eo(g,l+4,N);let ye=Ma(k);j||ji(ye,18,me),U||ji(ye,14,xe),Es(p,k,l+6),eo(g,l+30,ue),eo(g,l+32,Wi(I)),eo(g,l+34,V&&q?65535:ee),eo(g,l+36,K),Z?ji(g,l+38,Z):H&&te&&OU(g,l+38,16),ji(g,l+42,V&&X?4294967295:M),Es(p,R,l+46),Es(p,L,l+46+Wi(R)),Es(p,B,l+46+Wi(R,L)),Es(p,_,l+46+Wi(R,L,B)),Es(p,w,l+46+Wi(R,L,B,_)),Es(p,D,l+46+Wi(R,L,B,_,w)),Es(p,I,l+46+Wi(R)+ue);let Ae=46+Wi(R,I)+ue;if(l-m>o.availableSize&&(o.availableSize=0,await Dm(s,p.slice(m,l)),m=l),l+=Ae,n.onprogress)try{await n.onprogress(v+1,i.size,new Ly(P))}catch{}}await Dm(s,m?p.slice(m):p);let y=o.diskNumber,{availableSize:b}=o;b<22&&y++;let x=co(e,n,bU);if(f>4294967295||u>4294967295||h>65535||y>65535){if(x===!1)throw new Error(G7);x=!0}let A=new Uint8Array(x?98:22),E=Ma(A);l=0,x&&(ji(E,0,101075792),Nl(E,4,BigInt(44)),eo(E,12,45),eo(E,14,45),ji(E,16,y),ji(E,20,a),Nl(E,24,BigInt(h)),Nl(E,32,BigInt(h)),Nl(E,40,BigInt(u)),Nl(E,48,BigInt(f)),ji(E,56,117853008),Nl(E,64,BigInt(f)+BigInt(u)),ji(E,72,y+1),co(e,n,"supportZip64SplitFile",!0)&&(y=65535,a=65535),h=65535,f=4294967295,u=4294967295,l+=76),ji(E,l,101010256),eo(E,l+4,y),eo(E,l+6,a),eo(E,l+8,h),eo(E,l+10,h),ji(E,l+12,u),ji(E,l+16,f);let S=Wi(t);if(S)if(S<=65535)eo(E,l+20,S);else throw new Error(oit);await Dm(s,A),S&&await Dm(s,t)}async function Dm(e,t){let n=e.getWriter();try{await n.ready,e.size+=Wi(t),await n.write(t)}finally{n.releaseLock()}}function H7(e){if(e)return(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4)}function co(e,t,n,i){let o=t[n]===Si?e.options[n]:t[n];return o===Si?i:o}function jme(e){return e+5*(Math.floor(e/16383)+1)}function OU(e,t,n){e.setUint8(t,n)}function eo(e,t,n){e.setUint16(t,n,!0)}function ji(e,t,n){e.setUint32(t,n,!0)}function Nl(e,t,n){e.setBigUint64(t,n,!0)}function Es(e,t,n){e.set(t,n)}function Ma(e){return new DataView(e.buffer)}function Wi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}mE({Deflate:Dhe,Inflate:$he});var j7=32,Tit="http://www.opengis.net/kml/2.2",Jd="http://www.google.com/kml/ext/2.2",Ait="http://www.w3.org/2000/xmlns/";function RU(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Cit=/^data:image\/([^,;]+)/;RU.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof we){if(e=we.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Cit);n=`texture_${++this._count}`,c(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function Eit(e,t){return function(n){e._files[t]=n}}RU.prototype.model=function(e,t){let n=this._modelCallback;if(!c(n))throw new ae("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(Eit(this,r))}return o};Object.defineProperties(RU.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function MU(e){this._time=e}MU.prototype.get=function(e,t,n){let i;return c(e)&&(i=c(e.getValue)?e.getValue(this._time,n):e),i??t};MU.prototype.getColor=function(e,t){let n=this.get(e,t);if(c(n))return fx(n)};MU.prototype.getMaterialType=function(e){if(c(e))return e.getType(this._time)};function W7(){this._ids={},this._styles={},this._count=0}W7.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(c(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};W7.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function Xme(){this._ids={}}Xme.prototype.get=function(e){if(!c(e))return this.get(jn());let t=this._ids;return c(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function q7(e){e=e??W.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1;if(!c(t))throw new C("entities is required.");let i=q7._createState(e),o=t.values.filter(function(u){return!c(u.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(Ait,"xmlns:gx",Jd);let a=r.createElement("Document");s.appendChild(a),$me(i,a,o),i.styleCache.save(a);let l=i.externalFileHandler;return l.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?Sit(f,l.files):{kml:f,externalFiles:l.files}})}function Sit(e,t){let n=tn("ThirdParty/Workers/z-worker-pako.js");mE({workerScripts:{deflate:[n,"./pako_deflate.min.js"],inflate:[n,"./pako_inflate.min.js"]}});let i=new xP,o=new IU(i);return o.add("doc.kml",new dU(e)).then(function(){let r=Object.keys(t);return Kme(o,r,t,0)}).then(function(){return o.close()}).then(function(r){return{kmz:r}})}function Kme(e,t,n,i){if(t.length===i)return;let o=t[i];return e.add(o,new p_(n[o])).then(function(){return Kme(e,t,n,i+1)})}q7._createState=function(e){let t=e.entities,n=new W7,i=t.computeAvailability(),o=c(e.time)?e.time:i.start,r=e.defaultAvailability??i,s=e.sampleDuration??60;r.start===Ge.MINIMUM_VALUE?r.stop===Ge.MAXIMUM_VALUE?r=new Sn:Q.addSeconds(r.stop,-10*s,r.start):r.stop===Ge.MAXIMUM_VALUE&&Q.addSeconds(r.start,10*s,r.stop);let a=new RU(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Tit,"kml"),ellipsoid:e.ellipsoid??ie.default,idManager:new Xme,styleCache:n,externalFileHandler:a,time:o,valueGetter:new MU(o),sampleDuration:s,defaultAvailability:new Xr([r])}};function $me(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,l,u,f;for(let h=0;h<a;++h){let p=n[h];l=[],u=[],f=[],wit(e,p,u,f),vit(e,p.polyline,u,f),Yme(e,p.rectangle,u,f,l),Yme(e,p.polygon,u,f,l),Oit(e,p,p.model,u,f);let g,m=p.availability;c(m)&&(g=i.createElement("TimeSpan"),Q.equals(m.start,Ge.MINIMUM_VALUE)||g.appendChild(fn(i,"begin",Q.toIso8601(m.start))),Q.equals(m.stop,Ge.MAXIMUM_VALUE)||g.appendChild(fn(i,"end",Q.toIso8601(m.stop))));for(let x=0;x<l.length;++x){let A=l[x];A.setAttribute("id",s.get(p.id)),A.appendChild(fn(i,"name",p.name)),A.appendChild(fn(i,"visibility",p.show)),A.appendChild(fn(i,"description",p.description)),c(g)&&A.appendChild(g),t.appendChild(A)}let y=u.length;if(y>0){let x=i.createElement("Placemark");x.setAttribute("id",s.get(p.id));let A=p.name,E=p.label;if(c(E)){let v=i.createElement("LabelStyle"),P=r.get(E.text);A=c(P)&&P.length>0?P:A;let M=r.getColor(E.fillColor);c(M)&&(v.appendChild(fn(i,"color",M)),v.appendChild(fn(i,"colorMode","normal")));let R=r.get(E.scale);c(R)&&v.appendChild(fn(i,"scale",R)),f.push(v)}x.appendChild(fn(i,"name",A)),x.appendChild(fn(i,"visibility",p.show)),x.appendChild(fn(i,"description",p.description)),c(g)&&x.appendChild(g),t.appendChild(x);let S=f.length;if(S>0){let v=i.createElement("Style");for(let P=0;P<S;++P)v.appendChild(f[P]);x.appendChild(fn(i,"styleUrl",o.get(v)))}if(u.length===1)x.appendChild(u[0]);else if(u.length>1){let v=i.createElement("MultiGeometry");for(let P=0;P<y;++P)v.appendChild(u[P]);x.appendChild(v)}}let b=p._children;if(b.length>0){let x=i.createElement("Folder");x.setAttribute("id",s.get(p.id)),x.appendChild(fn(i,"name",p.name)),x.appendChild(fn(i,"visibility",p.show)),x.appendChild(fn(i,"description",p.description)),t.appendChild(x),$me(e,x,b)}}}var Fl=new d,$c=new he,Qd=new Q;function wit(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!c(a)&&!c(t.path))return;let l=t.position;if(!l.isConstant){Zme(e,t,a,n,i);return}s.get(l,void 0,Fl);let u=fn(o,"coordinates",ux(Fl,r)),f=o.createElement("Point"),h=o.createElement("altitudeMode");h.appendChild(dx(e,a.heightReference)),f.appendChild(h),f.appendChild(u),n.push(f);let p=a instanceof wc?Jme(e,a):Qme(e,a);i.push(p)}function Zme(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,l,u=t.position,f=!0;u instanceof Pa?(l=u.intervals,f=!1):l=t.availability??e.defaultAvailability;let h=n instanceof ng,p,g,m,y=[];for(p=0;p<l.length;++p){let x=l.get(p),A=f?u:x.data,E=r.createElement("altitudeMode");A instanceof f_?(A=A._value,E.appendChild(dx(e,qe.CLAMP_TO_GROUND))):c(n)?E.appendChild(dx(e,n.heightReference)):E.appendChild(dx(e,qe.NONE));let S=[],v=[];if(A.isConstant){a.get(A,void 0,Fl);let M=fn(r,"coordinates",ux(Fl,s));S.push(Q.toIso8601(x.start)),v.push(M),S.push(Q.toIso8601(x.stop)),v.push(M)}else if(A instanceof Ia)for(m=A._property._times,g=0;g<m.length;++g)S.push(Q.toIso8601(m[g])),A.getValueInReferenceFrame(m[g],zi.FIXED,Fl),v.push(ux(Fl,s));else if(A instanceof Ff){m=A._times;let M=A._values;for(g=0;g<m.length;++g)S.push(Q.toIso8601(m[g])),d.fromArray(M,g*3,Fl),v.push(ux(Fl,s))}else{let M=e.sampleDuration;x.start.clone(Qd),x.isStartIncluded||Q.addSeconds(Qd,M,Qd);let R=x.stop;for(;Q.lessThan(Qd,R);)A.getValue(Qd,Fl),S.push(Q.toIso8601(Qd)),v.push(ux(Fl,s)),Q.addSeconds(Qd,M,Qd);x.isStopIncluded&&Q.equals(Qd,R)&&(A.getValue(Qd,Fl),S.push(Q.toIso8601(Qd)),v.push(ux(Fl,s)))}let P=r.createElementNS(Jd,"Track");P.appendChild(E);for(let M=0;M<S.length;++M){let R=fn(r,"when",S[M]),L=fn(r,"coord",v[M],Jd);P.appendChild(R),P.appendChild(L)}h&&P.appendChild(epe(e,n)),y.push(P)}if(y.length===1)i.push(y[0]);else if(y.length>1){let x=r.createElementNS(Jd,"MultiTrack");for(p=0;p<y.length;++p)x.appendChild(y[p]);i.push(x)}if(c(n)&&!h){let x=n instanceof wc?Jme(e,n):Qme(e,n);o.push(x)}let b=t.path;if(c(b)){let x=a.get(b.width),A=b.material;if(c(A)||c(x)){let E=r.createElement("LineStyle");c(x)&&E.appendChild(fn(r,"width",x)),Y7(e,A,E),o.push(E)}}}function Qme(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);c(r)&&(o.appendChild(fn(n,"color",r)),o.appendChild(fn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return c(s)&&o.appendChild(fn(n,"scale",s/j7)),o}function Jme(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(c(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(fn(n,"href",s));let g=i.get(t.imageSubRegion);c(g)&&(p.appendChild(fn(n,"x",g.x,Jd)),p.appendChild(fn(n,"y",g.y,Jd)),p.appendChild(fn(n,"w",g.width,Jd)),p.appendChild(fn(n,"h",g.height,Jd))),r.appendChild(p)}let a=i.getColor(t.color);c(a)&&(r.appendChild(fn(n,"color",a)),r.appendChild(fn(n,"colorMode","normal")));let l=i.get(t.scale);c(l)&&r.appendChild(fn(n,"scale",l));let u=i.get(t.pixelOffset);if(c(u)){l=l??1,z.divideByScalar(u,l,u);let p=i.get(t.width,j7),g=i.get(t.height,j7),m=i.get(t.horizontalOrigin,xi.CENTER);m===xi.CENTER?u.x-=p*.5:m===xi.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,Fn.CENTER);y===Fn.TOP?u.y+=g:y===Fn.CENTER&&(u.y+=g*.5);let b=n.createElement("hotSpot");b.setAttribute("x",-u.x),b.setAttribute("y",u.y),b.setAttribute("xunits","pixels"),b.setAttribute("yunits","pixels"),r.appendChild(b)}let f=i.get(t.rotation),h=i.get(t.alignedAxis);return c(f)&&d.equals(d.UNIT_Z,h)&&(f=O.toDegrees(-f),f===0&&(f=360),r.appendChild(fn(n,"heading",f))),r}function vit(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!c(t))return;let a=o.createElement("LineString"),l=o.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(fn(o,"tessellate",!0)),f=o.createTextNode("clampToGround")):f=o.createTextNode("absolute"),l.appendChild(f),a.appendChild(l);let h=t.positions,p=s.get(h),g=fn(o,"coordinates",ux(p,r));a.appendChild(g);let m=s.get(t.zIndex);u&&c(m)&&a.appendChild(fn(o,"drawOrder",m,Jd)),n.push(a);let y=o.createElement("LineStyle"),b=s.get(t.width);c(b)&&y.appendChild(fn(o,"width",b)),Y7(e,t.material,y),i.push(y)}function Dit(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),l=[],u=[ce.northeast,ce.southeast,ce.southwest,ce.northwest];for(let g=0;g<4;++g)u[g](a,$c),l.push(`${O.toDegrees($c.longitude)},${O.toDegrees($c.latitude)},${r}`);let f=fn(i,"coordinates",l.join(" ")),h=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),h.appendChild(p),[h]}function qme(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)he.fromCartesian(t[f],r,$c),s.push(`${O.toDegrees($c.longitude)},${O.toDegrees($c.latitude)},${i?$c.height:n}`);let l=fn(o,"coordinates",s.join(" ")),u=o.createElement("LinearRing");return u.appendChild(l),u}function Pit(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],l=t.hierarchy,u=o.get(l),f=Array.isArray(u)?u:u.positions,h=i.createElement("outerBoundaryIs");h.appendChild(qme(e,f,r,s)),a.push(h);let p=u.holes;if(c(p)){let g=p.length;for(let m=0;m<g;++m){let y=i.createElement("innerBoundaryIs");y.appendChild(qme(e,p[m].positions,r,s)),a.push(y)}}return a}function Yme(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!c(t))return;let a=t instanceof Uh;if(a&&s.getMaterialType(t.material)==="Image"){Iit(e,t,o);return}let l=r.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&l.appendChild(fn(r,"extrude",!0));let f=a?Dit(e,t,u):Pit(e,t,u),h=f.length;for(let b=0;b<h;++b)l.appendChild(f[b]);let p=r.createElement("altitudeMode");p.appendChild(dx(e,t.heightReference)),l.appendChild(p),n.push(l);let g=r.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&g.appendChild(fn(r,"fill",m)),Y7(e,t.material,g);let y=s.get(t.outline,!1);if(y){g.appendChild(fn(r,"outline",y));let b=r.createElement("LineStyle"),x=s.get(t.outlineWidth,1);b.appendChild(fn(r,"width",x));let A=s.getColor(t.outlineColor,G.BLACK);b.appendChild(fn(r,"color",A)),b.appendChild(fn(r,"colorMode","normal")),i.push(b)}i.push(g)}function Iit(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(dx(e,t.heightReference)),s.appendChild(a);let l=o.get(t.height);c(l)&&s.appendChild(fn(i,"altitude",l));let u=o.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(fn(i,"north",O.toDegrees(u.north))),f.appendChild(fn(i,"south",O.toDegrees(u.south))),f.appendChild(fn(i,"east",O.toDegrees(u.east))),f.appendChild(fn(i,"west",O.toDegrees(u.west))),s.appendChild(f);let h=o.get(t.material),p=r.texture(h.image),g=i.createElement("Icon");g.appendChild(fn(i,"href",p)),s.appendChild(g);let m=h.color;c(m)&&s.appendChild(fn(i,"color",fx(h.color))),n.push(s)}function epe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(c(s)){let u=n.createElement("scale");u.appendChild(fn(n,"x",s)),u.appendChild(fn(n,"y",s)),u.appendChild(fn(n,"z",s)),r.appendChild(u)}let a=n.createElement("Link"),l=o.model(t,e.time);return a.appendChild(fn(n,"href",l)),r.appendChild(a),r}function Oit(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!c(n))return;let l=t.position;if(!l.isConstant){Zme(e,t,n,i,o);return}let u=epe(e,n),f=r.createElement("altitudeMode");f.appendChild(dx(e,n.heightReference)),u.appendChild(f),a.get(l,void 0,Fl),he.fromCartesian(Fl,s,$c);let h=r.createElement("Location");h.appendChild(fn(r,"longitude",O.toDegrees($c.longitude))),h.appendChild(fn(r,"latitude",O.toDegrees($c.latitude))),h.appendChild(fn(r,"altitude",$c.height)),u.appendChild(h),i.push(u)}function Y7(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!c(t))return;let r=o.get(t);if(!c(r))return;let s,a=o.getMaterialType(t),l,u;switch(a){case"Image":s=fx(G.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=fx(r.color);break;case"PolylineOutline":s=fx(r.color),l=fx(r.outlineColor),u=r.outlineWidth,n.appendChild(fn(i,"outerColor",l,Jd)),n.appendChild(fn(i,"outerWidth",u,Jd));break;case"Stripe":s=fx(r.oddColor);break}c(s)&&(n.appendChild(fn(i,"color",s)),n.appendChild(fn(i,"colorMode","normal")))}function dx(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,qe.NONE),r;switch(o){case qe.NONE:r=n.createTextNode("absolute");break;case qe.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case qe.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function ux(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)he.fromCartesian(e[o],t,$c),i.push(`${O.toDegrees($c.longitude)},${O.toDegrees($c.latitude)},${$c.height}`);return i.join(" ")}function fn(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let o=c(i)?e.createElementNS(i,t):e.createElement(t),r=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return o.appendChild(r),o}function fx(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var tpe=q7;function vP(){this._cache={}}vP.prototype.fromColor=function(e,t){if(!c(e))throw new C("color is required");if(!c(t))throw new C("size is required");return LU(void 0,void 0,e,t,this._cache)};vP.prototype.fromUrl=function(e,t,n){if(!c(e))throw new C("url is required");if(!c(t))throw new C("color is required");if(!c(n))throw new C("size is required");return LU(e,void 0,t,n,this._cache)};vP.prototype.fromMakiIconId=function(e,t,n){if(!c(e))throw new C("id is required");if(!c(t))throw new C("color is required");if(!c(n))throw new C("size is required");return LU(tn(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};vP.prototype.fromText=function(e,t,n){if(!c(e))throw new C("text is required");if(!c(t))throw new C("color is required");if(!c(n))throw new C("size is required");return LU(void 0,e,t,n,this._cache)};var Rit=new G;function Mit(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,Rit).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function npe(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=G.BLACK.toCssColorString(),e.fillRect(s-1,a-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=G.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var wP=new Array(4);function LU(e,t,n,i,o){wP[0]=e,wP[1]=t,wP[2]=n,wP[3]=i;let r=JSON.stringify(wP),s=o[r];if(c(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let l=a.getContext("2d");if(Mit(l,n,i),c(e)){let f=we.createIfNeeded(e).fetchImage().then(function(h){return npe(l,h,i),o[r]=a,a});return o[r]=f,f}else if(c(t)){let u=JA(t,{font:`bold ${i}px sans-serif`});npe(l,u,i)}return o[r]=a,a}var Ny=vP;function X7(e){return e}function NU(e){if(e==null)return X7;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],s=e.translate[1];return function(a,l){l||(t=n=0);var u=2,f=a.length,h=new Array(f);for(h[0]=(t+=a[0])*i+r,h[1]=(n+=a[1])*o+s;u<f;)h[u]=a[u],++u;return h}}function ipe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function K7(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return ope(e,n)})}:ope(e,t)}function ope(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=$7(e,t);return n==null&&i==null?{type:"Feature",properties:o,geometry:r}:i==null?{type:"Feature",id:n,properties:o,geometry:r}:{type:"Feature",id:n,bbox:i,properties:o,geometry:r}}function $7(e,t){var n=NU(e.transform),i=e.arcs;function o(f,h){h.length&&h.pop();for(var p=i[f<0?~f:f],g=0,m=p.length;g<m;++g)h.push(n(p[g],g));f<0&&ipe(h,m)}function r(f){return n(f)}function s(f){for(var h=[],p=0,g=f.length;p<g;++p)o(f[p],h);return h.length<2&&h.push(h[0]),h}function a(f){for(var h=s(f);h.length<4;)h.push(h[0]);return h}function l(f){return f.map(a)}function u(f){var h=f.type,p;switch(h){case"GeometryCollection":return{type:h,geometries:f.geometries.map(u)};case"Point":p=r(f.coordinates);break;case"MultiPoint":p=f.coordinates.map(r);break;case"LineString":p=s(f.arcs);break;case"MultiLineString":p=f.arcs.map(s);break;case"Polygon":p=l(f.arcs);break;case"MultiPolygon":p=f.arcs.map(l);break;default:return null}return{type:h,coordinates:p}}return u(t)}function FU(e){return d.fromDegrees(e[0],e[1],e[2])}var Z7={"urn:ogc:def:crs:OGC:1.3:CRS84":FU,"EPSG:4326":FU,"urn:ogc:def:crs:EPSG::4326":FU},rpe={},spe={},Q7=48,J7,eY=G.ROYALBLUE,tY=G.YELLOW,nY=2,iY=G.fromBytes(255,255,0,100),oY=!1,kit={small:24,medium:48,large:64},Uit=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function ape(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||Uit.indexOf(i)!==-1)continue;let o=e[i];c(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${ape(o)}</td></tr>`:n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function Vit(e,t,n){let i;return function(o,r){return c(i)||(i=e(t,n)),i}}function zit(e,t){return new Vh(Vit(ape,e,t),!0)}function BU(e,t,n){let i=e.id;if(!c(i)||e.type!=="Feature")i=jn();else{let s=2,a=i;for(;c(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(c(r)){o.properties=r;let s,a=r.title;if(c(a))o.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in r)if(r.hasOwnProperty(f)&&r[f]){let h=f.toLowerCase();if(u>1&&h==="title"){u=1,s=f;break}else u>2&&h==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}c(s)&&(o.name=r[s])}let l=r.description;l!==null&&(o.description=c(l)?new Xn(l):n(r,s))}return o}function rY(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var cpe={Feature:upe,FeatureCollection:Hit,GeometryCollection:fpe,LineString:_pe,MultiLineString:gpe,MultiPoint:mpe,MultiPolygon:xpe,Point:hpe,Polygon:bpe,Topology:Tpe},lpe={GeometryCollection:fpe,LineString:_pe,MultiLineString:gpe,MultiPoint:mpe,MultiPolygon:xpe,Point:hpe,Polygon:bpe,Topology:Tpe};function upe(e,t,n,i,o){if(t.geometry===null){BU(t,e._entityCollection,o.describe);return}if(!c(t.geometry))throw new ae("feature.geometry is required.");let r=t.geometry.type,s=lpe[r];if(!c(s))throw new ae(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function Hit(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)upe(e,r[s],void 0,i,o)}function fpe(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let l=r[s],u=l.type,f=lpe[u];if(!c(f))throw new ae(`Unknown geometry type: ${u}`);f(e,t,l,i,o)}}function dpe(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,l=t.properties;if(c(l)){let g=l["marker-color"];c(g)&&(s=G.fromCssColorString(g)),a=kit[l["marker-size"]]??a;let m=l["marker-symbol"];c(m)&&(r=m)}let u;c(r)?r.length===1?u=e._pinBuilder.fromText(r.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(r,s,a):u=e._pinBuilder.fromColor(s,a);let f=new wc;f.verticalOrigin=new Xn(Fn.BOTTOM),i.length===2&&o.clampToGround&&(f.heightReference=qe.CLAMP_TO_GROUND);let h=BU(t,e._entityCollection,o.describe);h.billboard=f,h.position=new gl(n(i));let p=Promise.resolve(u).then(function(g){f.image=new Xn(g)}).catch(function(){f.image=new Xn(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function hpe(e,t,n,i,o){dpe(e,t,i,n.coordinates,o)}function mpe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)dpe(e,t,i,r[s],o)}function ppe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(c(a)){let f=a["stroke-width"];c(f)&&(s=new Xn(f));let h,p=a.stroke;c(p)&&(h=G.fromCssColorString(p));let g=a["stroke-opacity"];c(g)&&g!==1&&(c(h)||(h=r.color.getValue().clone()),h.alpha=g),c(h)&&(r=new Ut(h))}let l=BU(t,e._entityCollection,o.describe),u=new Oc;l.polyline=u,u.clampToGround=o.clampToGround,u.material=r,u.width=s,u.positions=new Xn(rY(i,n)),u.arcType=qt.RHUMB}function _pe(e,t,n,i,o){ppe(e,t,i,n.coordinates,o)}function gpe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)ppe(e,t,i,r[s],o)}function ype(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,s=o.fillMaterialProperty,a=o.strokeWidthProperty,l=t.properties;if(c(l)){let g=l["stroke-width"];c(g)&&(a=new Xn(g));let m,y=l.stroke;c(y)&&(m=G.fromCssColorString(y));let b=l["stroke-opacity"];c(b)&&b!==1&&(c(m)||(m=r.getValue().clone()),m.alpha=b),c(m)&&(r=new Xn(m));let x,A=l.fill,E=s.color.getValue();c(A)&&(x=G.fromCssColorString(A),x.alpha=E.alpha),b=l["fill-opacity"],c(b)&&b!==E.alpha&&(c(x)||(x=E.clone()),x.alpha=b),c(x)&&(s=new Ut(x))}let u=new kh;u.outline=new Xn(!0),u.outlineColor=r,u.outlineWidth=a,u.material=s,u.arcType=qt.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new ec(rY(i[g],n)));let h=i[0];u.hierarchy=new Xn(new ec(rY(h,n),f)),h[0].length>2?u.perPositionHeight=new Xn(!0):o.clampToGround||(u.height=0);let p=BU(t,e._entityCollection,o.describe);p.polygon=u}function bpe(e,t,n,i,o){ype(e,t,i,n.coordinates,o)}function xpe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)ype(e,t,i,r[s],o)}function Tpe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=K7(n,n.objects[r]),a=cpe[s.type];a(e,s,s,i,o)}}function Fy(e){this._name=e,this._changed=new pe,this._error=new pe,this._isLoading=!1,this._loading=new pe,this._entityCollection=new la(this),this._promises=[],this._pinBuilder=new Ny,this._entityCluster=new Lf,this._credit=void 0,this._resourceCredits=[]}Fy.load=function(e,t){return new Fy().load(e,t)};Object.defineProperties(Fy,{markerSize:{get:function(){return Q7},set:function(e){Q7=e}},markerSymbol:{get:function(){return J7},set:function(e){J7=e}},markerColor:{get:function(){return eY},set:function(e){eY=e}},stroke:{get:function(){return tY},set:function(e){tY=e}},strokeWidth:{get:function(){return nY},set:function(e){nY=e}},fill:{get:function(){return iY},set:function(e){iY=e}},clampToGround:{get:function(){return oY},set:function(e){oY=e}},crsNames:{get:function(){return Z7}},crsLinkHrefs:{get:function(){return rpe}},crsLinkTypes:{get:function(){return spe}}});Object.defineProperties(Fy.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!c(e))throw new C("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}}});Fy.prototype.load=function(e,t){return Ape(this,e,t,!0)};Fy.prototype.process=function(e,t){return Ape(this,e,t,!1)};function Ape(e,t,n,i){if(!c(t))throw new C("data is required.");Kr.setLoading(e,!0),n=n??W.EMPTY_OBJECT;let o=n.credit;typeof o=="string"&&(o=new At(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof we){t=we.createIfNeeded(t),r=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,l=t.credits;if(c(l)){let u=l.length;for(let f=0;f<u;f++)a.push(l[f])}}return n={describe:n.describe??zit,markerSize:n.markerSize??Q7,markerSymbol:n.markerSymbol??J7,markerColor:n.markerColor??eY,strokeWidthProperty:new Xn(n.strokeWidth??nY),strokeMaterialProperty:new Ut(n.stroke??tY),fillMaterialProperty:new Ut(n.fill??iY),clampToGround:n.clampToGround??oY},Promise.resolve(r).then(function(a){return Git(e,a,n,s,i)}).catch(function(a){throw Kr.setLoading(e,!1),e._error.raiseEvent(e,a),a})}Fy.prototype.update=function(e){return!0};function Git(e,t,n,i,o){let r;c(i)&&(r=ly(i)),c(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=cpe[t.type];if(!c(s))throw new ae(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,l=a!==null?FU:null;if(c(a)){if(!c(a.properties))throw new ae("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(l=Z7[u.name],!c(l))throw new ae(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=rpe[u.href];if(c(f)||(f=spe[u.type]),!c(f))throw new ae(`Unable to resolve crs link: ${JSON.stringify(u)}`);l=f(u)}else if(a.type==="EPSG"){if(l=Z7[`EPSG:${u.code}`],!c(l))throw new ae(`Unknown crs EPSG code: ${u.code}`)}else throw new ae(`Unknown crs type: ${a.type}`)}return Promise.resolve(l).then(function(u){return o&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Kr.setLoading(e,!1),e})})}var hx=Fy;function jit(e){if(typeof e=="string"){let t=document.getElementById(e);if(t===null)throw new C(`Element with id "${e}" does not exist in the document.`);e=t}return e}var Rn=jit;var Cpe="4.1.0";function Wit(e){return e===void 0}function Au(e){return typeof e=="boolean"}function Epe(e,t){for(var n in t)t.hasOwnProperty(n)&&Wit(e[n])&&(e[n]=t[n]);return e}function Spe(e,t,n){var i;return e.length>t&&(n==null?(n="&hellip;",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function zo(e,t){for(var n=e.length-1;n>=0;n--)e[n]===t&&e.splice(n,1)}function By(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Pm(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var ky=/[A-Za-z]/,Gs=/[\d]/;var Cu=/\s/,kU=/['"]/,wpe=/[\x00-\x1F\x7F]/,vpe=/A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,qit=/\u2700-\u27bf\udde6-\uddff\ud800-\udbff\udc00-\udfff\ufe0e\ufe0f\u0300-\u036f\ufe20-\ufe23\u20d0-\u20f0\ud83c\udffb-\udfff\u200d\u3299\u3297\u303d\u3030\u24c2\ud83c\udd70-\udd71\udd7e-\udd7f\udd8e\udd91-\udd9a\udde6-\uddff\ude01-\ude02\ude1a\ude2f\ude32-\ude3a\ude50-\ude51\u203c\u2049\u25aa-\u25ab\u25b6\u25c0\u25fb-\u25fe\u00a9\u00ae\u2122\u2139\udc04\u2600-\u26FF\u2b05\u2b06\u2b07\u2b1b\u2b1c\u2b50\u2b55\u231a\u231b\u2328\u23cf\u23e9-\u23f3\u23f8-\u23fa\udccf\u2935\u2934\u2190-\u21ff/.source,Yit=/\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D4-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D01-\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF8\u1CF9\u1DC0-\u1DF5\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F/.source,Xit=vpe+qit+Yit,Dpe=/0-9\u0660-\u0669\u06F0-\u06F9\u07C0-\u07C9\u0966-\u096F\u09E6-\u09EF\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F\u0CE6-\u0CEF\u0D66-\u0D6F\u0DE6-\u0DEF\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29\u1040-\u1049\u1090-\u1099\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9\u1A80-\u1A89\u1A90-\u1A99\u1B50-\u1B59\u1BB0-\u1BB9\u1C40-\u1C49\u1C50-\u1C59\uA620-\uA629\uA8D0-\uA8D9\uA900-\uA909\uA9D0-\uA9D9\uA9F0-\uA9F9\uAA50-\uAA59\uABF0-\uABF9\uFF10-\uFF19/.source,pai=new RegExp("[".concat(vpe+Dpe,"]")),sY=Xit+Dpe,eh=new RegExp("[".concat(sY,"]"));var UU=function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName||""},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs||(this.attrs={})},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(Cu):[],o=t.split(Cu),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(Cu):[],o=t.split(Cu),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){if(!this.attrs)return"";var t=this.getAttrs(),n=[];for(var i in t)t.hasOwnProperty(i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e}();function Ppe(e,t,n){var i,o;n==null?(n="&hellip;",o=3,i=8):(o=n.length,i=n.length);var r=function(A){var E={},S=A,v=S.match(/^([a-z]+):\/\//i);return v&&(E.scheme=v[1],S=S.substr(v[0].length)),v=S.match(/^(.*?)(?=(\?|#|\/|$))/i),v&&(E.host=v[1],S=S.substr(v[0].length)),v=S.match(/^\/(.*?)(?=(\?|#|$))/i),v&&(E.path=v[1],S=S.substr(v[0].length)),v=S.match(/^\?(.*?)(?=(#|$))/i),v&&(E.query=v[1],S=S.substr(v[0].length)),v=S.match(/^#(.*?)$/i),v&&(E.fragment=v[1]),E},s=function(A){var E="";return A.scheme&&A.host&&(E+=A.scheme+"://"),A.host&&(E+=A.host),A.path&&(E+="/"+A.path),A.query&&(E+="?"+A.query),A.fragment&&(E+="#"+A.fragment),E},a=function(A,E){var S=E/2,v=Math.ceil(S),P=-1*Math.floor(S),M="";return P<0&&(M=A.substr(P)),A.substr(0,v)+n+M};if(e.length<=t)return e;var l=t-o,u=r(e);if(u.query){var f=u.query.match(/^(.*?)(?=(\?|\#))(.*?)$/i);f&&(u.query=u.query.substr(0,f[1].length),e=s(u))}if(e.length<=t||(u.host&&(u.host=u.host.replace(/^www\./,""),e=s(u)),e.length<=t))return e;var h="";if(u.host&&(h+=u.host),h.length>=l)return u.host.length==t?(u.host.substr(0,t-o)+n).substr(0,l+i):a(h,l).substr(0,l+i);var p="";if(u.path&&(p+="/"+u.path),u.query&&(p+="?"+u.query),p)if((h+p).length>=l){if((h+p).length==t)return(h+p).substr(0,t);var g=l-h.length;return(h+a(p,g)).substr(0,l+i)}else h+=p;if(u.fragment){var m="#"+u.fragment;if((h+m).length>=l){if((h+m).length==t)return(h+m).substr(0,t);var y=l-h.length;return(h+a(m,y)).substr(0,l+i)}else h+=m}if(u.scheme&&u.host){var b=u.scheme+"://";if((h+b).length<l)return(b+h).substr(0,t)}if(h.length<=t)return h;var x="";return l>0&&(x=h.substr(-1*Math.floor(l/2))),(h.substr(0,Math.ceil(l/2))+n+x).substr(0,l+i)}function Ipe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="&hellip;",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}function Ope(e,t,n){return Spe(e,t,n)}var Rpe=function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new UU({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate&&this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n||!n.length)return t;var i=n.length,o=n.location;return o==="smart"?Ppe(t,i):o==="middle"?Ipe(t,i):Ope(t,i)},e}();var aY=function(e,t){return aY=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},aY(e,t)};function Im(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");aY(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var js=function(){return js=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},js.apply(this,arguments)};var Om=function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e}();var Kit="(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|verm\xF6gensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|verm\xF6gensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|kerrylogistics|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|lancaster|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|\u0645\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u0627|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|\u0627\u0644\u0633\u0639\u0648\u062F\u064A\u0629|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bentley|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|\u043A\u0430\u0442\u043E\u043B\u0438\u043A|\u0627\u0644\u0628\u062D\u0631\u064A\u0646|\u0627\u0644\u062C\u0632\u0627\u0626\u0631|\u0627\u0644\u0639\u0644\u064A\u0627\u0646|\u067E\u0627\u06A9\u0633\u062A\u0627\u0646|\u0643\u0627\u062B\u0648\u0644\u064A\u0643|\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|\u043C\u043E\u0441\u043A\u0432\u0430|\u043E\u043D\u043B\u0430\u0439\u043D|\u0627\u0628\u0648\u0638\u0628\u064A|\u0627\u0631\u0627\u0645\u0643\u0648|\u0627\u0644\u0627\u0631\u062F\u0646|\u0627\u0644\u0645\u063A\u0631\u0628|\u0627\u0645\u0627\u0631\u0627\u062A|\u0641\u0644\u0633\u0637\u064A\u0646|\u0645\u0644\u064A\u0633\u064A\u0627|\u092D\u093E\u0930\u0924\u092E\u094D|\u0B87\u0BB2\u0B99\u0BCD\u0B95\u0BC8|\u30D5\u30A1\u30C3\u30B7\u30E7\u30F3|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|lipsy|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|\u05D9\u05E9\u05E8\u05D0\u05DC|\u0627\u06CC\u0631\u0627\u0646|\u0628\u0627\u0632\u0627\u0631|\u0628\u06BE\u0627\u0631\u062A|\u0633\u0648\u062F\u0627\u0646|\u0633\u0648\u0631\u064A\u0629|\u0647\u0645\u0631\u0627\u0647|\u092D\u093E\u0930\u094B\u0924|\u0938\u0902\u0917\u0920\u0928|\u09AC\u09BE\u0982\u09B2\u09BE|\u0C2D\u0C3E\u0C30\u0C24\u0C4D|\u0D2D\u0D3E\u0D30\u0D24\u0D02|\u5609\u91CC\u5927\u9152\u5E97|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|\u0434\u0435\u0442\u0438|\u0441\u0430\u0439\u0442|\u0628\u0627\u0631\u062A|\u0628\u064A\u062A\u0643|\u0680\u0627\u0631\u062A|\u062A\u0648\u0646\u0633|\u0634\u0628\u0643\u0629|\u0639\u0631\u0627\u0642|\u0639\u0645\u0627\u0646|\u0645\u0648\u0642\u0639|\u092D\u093E\u0930\u0924|\u09AD\u09BE\u09B0\u09A4|\u09AD\u09BE\u09F0\u09A4|\u0A2D\u0A3E\u0A30\u0A24|\u0AAD\u0ABE\u0AB0\u0AA4|\u0B2D\u0B3E\u0B30\u0B24|\u0CAD\u0CBE\u0CB0\u0CA4|\u0DBD\u0D82\u0D9A\u0DCF|\u30A2\u30DE\u30BE\u30F3|\u30B0\u30FC\u30B0\u30EB|\u30AF\u30E9\u30A6\u30C9|\u30DD\u30A4\u30F3\u30C8|\u7EC4\u7EC7\u673A\u6784|\u96FB\u8A0A\u76C8\u79D1|\u9999\u683C\u91CC\u62C9|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|\u0431\u0435\u043B|\u043A\u043E\u043C|\u049B\u0430\u0437|\u043C\u043A\u0434|\u043C\u043E\u043D|\u043E\u0440\u0433|\u0440\u0443\u0441|\u0441\u0440\u0431|\u0443\u043A\u0440|\u0570\u0561\u0575|\u05E7\u05D5\u05DD|\u0639\u0631\u0628|\u0642\u0637\u0631|\u0643\u0648\u0645|\u0645\u0635\u0631|\u0915\u0949\u092E|\u0928\u0947\u091F|\u0E04\u0E2D\u0E21|\u0E44\u0E17\u0E22|\u0EA5\u0EB2\u0EA7|\u30B9\u30C8\u30A2|\u30BB\u30FC\u30EB|\u307F\u3093\u306A|\u4E2D\u6587\u7F51|\u4E9A\u9A6C\u900A|\u5929\u4E3B\u6559|\u6211\u7231\u4F60|\u65B0\u52A0\u5761|\u6DE1\u9A6C\u9521|\u98DE\u5229\u6D66|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|\u03B5\u03BB|\u03B5\u03C5|\u0431\u0433|\u0435\u044E|\u0440\u0444|\u10D2\u10D4|\uB2F7\uB137|\uB2F7\uCEF4|\uC0BC\uC131|\uD55C\uAD6D|\u30B3\u30E0|\u4E16\u754C|\u4E2D\u4FE1|\u4E2D\u56FD|\u4E2D\u570B|\u4F01\u4E1A|\u4F5B\u5C71|\u4FE1\u606F|\u5065\u5EB7|\u516B\u5366|\u516C\u53F8|\u516C\u76CA|\u53F0\u6E7E|\u53F0\u7063|\u5546\u57CE|\u5546\u5E97|\u5546\u6807|\u5609\u91CC|\u5728\u7EBF|\u5927\u62FF|\u5A31\u4E50|\u5BB6\u96FB|\u5E7F\u4E1C|\u5FAE\u535A|\u6148\u5584|\u624B\u673A|\u62DB\u8058|\u653F\u52A1|\u653F\u5E9C|\u65B0\u95FB|\u65F6\u5C1A|\u66F8\u7C4D|\u673A\u6784|\u6E38\u620F|\u6FB3\u9580|\u70B9\u770B|\u79FB\u52A8|\u7F51\u5740|\u7F51\u5E97|\u7F51\u7AD9|\u7F51\u7EDC|\u8054\u901A|\u8C37\u6B4C|\u8D2D\u7269|\u901A\u8CA9|\u96C6\u56E2|\u98DF\u54C1|\u9910\u5385|\u9999\u6E2F)",Mpe=new RegExp("^"+Kit+"$");var $it=/[\/?#]/,Zit=/[-+&@#/%=~_()|'$*\[\]{}\u2713]/,Lpe=/[?!:,.;^]/,cY=/https?:\/\//i,Npe=new RegExp("^"+cY.source,"i"),Fpe=new RegExp(Lpe.source+"$"),Qit=/^(javascript|vbscript):/i,Jit=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,eot=/^(?:\/\/)?([^/#?:]+)/;function AE(e){return ky.test(e)}function lY(e){return ky.test(e)||Gs.test(e)||e==="+"||e==="-"||e==="."}function __(e){return eh.test(e)}function VU(e){return e==="_"||__(e)}function uY(e){return eh.test(e)||Zit.test(e)||Lpe.test(e)}function zU(e){return $it.test(e)}function fY(e){return Mpe.test(e.toLowerCase())}function Bpe(e){if(Qit.test(e))return!1;var t=e.match(Jit);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!ky.test(i))}function kpe(e){var t=e.match(eot);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!fY(o)}var tot=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,not=/[:/?#]/;function Upe(e){var t=e.split(not,1)[0];return tot.test(t)}var iot=/^(https?:\/\/)?(www\.)?/i,oot=/^\/\//,Vpe=function(e){Im(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&amp;/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=aot(n)),this.stripPrefix.scheme&&(n=rot(n)),this.stripPrefix.www&&(n=sot(n)),this.stripTrailingSlash&&(n=cot(n)),this.decodePercentEncoding&&(n=lot(n)),n},t}(Om);function rot(e){return e.replace(Npe,"")}function sot(e){return e.replace(iot,"$1")}function aot(e){return e.replace(oot,"")}function cot(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function lot(e){var t=e.replace(/%22/gi,"&quot;").replace(/%26/gi,"&amp;").replace(/%27/gi,"&#39;").replace(/%3C/gi,"&lt;").replace(/%3E/gi,"&gt;");try{return decodeURIComponent(t)}catch{return t}}var zpe=/^mailto:/i,uot=new RegExp("[".concat(sY,"!#$%&'*+/=?^_`{|}~-]"));function Hpe(e){return eh.test(e)}function HU(e){return uot.test(e)}function Gpe(e){var t=e.split(".").pop()||"";return fY(t)}var jpe=function(e){Im(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t}(Om);function dY(e){return e==="_"||eh.test(e)}function Wpe(e){return e.length<=140}var qpe=["twitter","facebook","instagram","tiktok","youtube"];var Ype=function(e){Im(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;case"youtube":return"https://youtube.com/hashtag/"+i;default:throw Pm(n),new Error("Invalid hashtag service: ".concat(n))}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Om);var fot={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/},dot=/[-\w.]/;function hY(e){return dot.test(e)}function Xpe(e,t){var n=fot[t];return n.test(e)}var Kpe=["twitter","instagram","soundcloud","tiktok","youtube"];var $pe=function(e){Im(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:throw Pm(this.serviceName),new Error("Unknown service name to point mention to: "+this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t}(Om);var hot=/[-. ]/,mot=/[-. ()]/,pot=/[,;]/,_ot=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,got=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,yot=new RegExp("^".concat(_ot.source,"|").concat(got.source,"$"));function mY(e){return hot.test(e)}function GU(e){return pot.test(e)}function Zpe(e){var t=e.charAt(0)==="+"||mot.test(e);return t&&yot.test(e)}var Qpe=function(e){Im(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t}(Om);function t_e(e,t){for(var n=t.tagBuilder,i=t.stripPrefix,o=t.stripTrailingSlash,r=t.decodePercentEncoding,s=t.hashtagServiceName,a=t.mentionServiceName,l=[],u=e.length,f=[],h=0;h<u;h++){var p=e.charAt(h);if(f.length===0)x(p);else{for(var g=f.length-1;g>=0;g--){var m=f[g];switch(m.state){case 11:M(m,p);break;case 12:R(m,p);break;case 0:A(m,p);break;case 1:E(m,p);break;case 2:S(m,p);break;case 3:v(m,p);break;case 4:P(m,p);break;case 5:L(m,p);break;case 6:B(m,p);break;case 7:_(m,p);break;case 13:w(m,p);break;case 14:D(m,p);break;case 8:I(m,p);break;case 9:N(m,p);break;case 10:k(m,p);break;case 15:H(m,p);break;case 16:V(m,p);break;case 17:j(m,p);break;case 18:U(m,p);break;case 19:q(m,p);break;case 20:X(m,p);break;case 21:te(m,p);break;case 22:K(m,p);break;case 23:Z(m,p);break;case 24:ee(m,p);break;case 25:me(m,p);break;case 26:xe(m,p);break;case 27:ue(m,p);break;case 28:ye(m,p);break;case 29:Ae(m,p);break;case 30:Pe(m,p);break;case 31:Ee(m,p);break;case 32:je(m,p);break;case 33:it(m,p);break;case 34:Dt(m,p);break;case 35:Gt(m,p);break;case 36:$e(m,p);break;case 37:Ve(m,p);break;case 38:ln(m,p);break;case 39:Vt(m,p);break;case 40:Ct(m,p);break;case 41:gi(m,p);break;default:Pm(m.state)}}if(h>0&&AE(p)){var y=e.charAt(h-1);!AE(y)&&!f.some(Sot)&&f.push(jU(h,0))}}}for(var b=f.length-1;b>=0;b--)f.forEach(function(_e){return an(_e)});return l;function x(_e){if(_e==="#")f.push(Cot(h,28));else if(_e==="@")f.push(Eot(h,30));else if(_e==="/")f.push(pY(h,11));else if(_e==="+")f.push(_Y(h,37));else if(_e==="(")f.push(_Y(h,32));else{if(Gs.test(_e)&&(f.push(_Y(h,38)),f.push(Tot(h,13))),Hpe(_e)){var Ce=_e.toLowerCase()==="m"?15:22;f.push(Aot(h,Ce))}AE(_e)&&f.push(jU(h,0)),eh.test(_e)&&f.push(pY(h,5))}}function A(_e,Ce){Ce===":"?_e.state=2:Ce==="-"?_e.state=1:lY(Ce)||zo(f,_e)}function E(_e,Ce){Ce==="-"||(Ce==="/"?(zo(f,_e),f.push(pY(h,11))):lY(Ce)?_e.state=0:zo(f,_e))}function S(_e,Ce){Ce==="/"?_e.state=3:Ce==="."?zo(f,_e):__(Ce)?(_e.state=5,AE(Ce)&&f.push(jU(h,0))):zo(f,_e)}function v(_e,Ce){Ce==="/"?_e.state=4:uY(Ce)?(_e.state=10,_e.acceptStateReached=!0):an(_e)}function P(_e,Ce){Ce==="/"?_e.state=10:__(Ce)?(_e.state=5,_e.acceptStateReached=!0):zo(f,_e)}function M(_e,Ce){Ce==="/"?_e.state=12:zo(f,_e)}function R(_e,Ce){__(Ce)?_e.state=5:zo(f,_e)}function L(_e,Ce){Ce==="."?_e.state=7:Ce==="-"?_e.state=6:Ce===":"?_e.state=8:zU(Ce)?_e.state=10:VU(Ce)||an(_e)}function B(_e,Ce){Ce==="-"||(Ce==="."?an(_e):__(Ce)?_e.state=5:an(_e))}function _(_e,Ce){Ce==="."?an(_e):__(Ce)?(_e.state=5,_e.acceptStateReached=!0):an(_e)}function w(_e,Ce){Ce==="."?_e.state=14:Ce===":"?_e.state=8:Gs.test(Ce)||(zU(Ce)?_e.state=10:eh.test(Ce)?zo(f,_e):an(_e))}function D(_e,Ce){Gs.test(Ce)?(_e.octetsEncountered++,_e.octetsEncountered===4&&(_e.acceptStateReached=!0),_e.state=13):an(_e)}function I(_e,Ce){Gs.test(Ce)?_e.state=9:an(_e)}function N(_e,Ce){Gs.test(Ce)||(zU(Ce)?_e.state=10:an(_e))}function k(_e,Ce){uY(Ce)||an(_e)}function H(_e,Ce){Ce.toLowerCase()==="a"?_e.state=16:K(_e,Ce)}function V(_e,Ce){Ce.toLowerCase()==="i"?_e.state=17:K(_e,Ce)}function j(_e,Ce){Ce.toLowerCase()==="l"?_e.state=18:K(_e,Ce)}function U(_e,Ce){Ce.toLowerCase()==="t"?_e.state=19:K(_e,Ce)}function q(_e,Ce){Ce.toLowerCase()==="o"?_e.state=20:K(_e,Ce)}function X(_e,Ce){Ce.toLowerCase()===":"?_e.state=21:K(_e,Ce)}function te(_e,Ce){HU(Ce)?_e.state=22:zo(f,_e)}function K(_e,Ce){Ce==="."?_e.state=23:Ce==="@"?_e.state=24:HU(Ce)?_e.state=22:zo(f,_e)}function Z(_e,Ce){Ce==="."?zo(f,_e):Ce==="@"?zo(f,_e):HU(Ce)?_e.state=22:zo(f,_e)}function ee(_e,Ce){__(Ce)?_e.state=25:zo(f,_e)}function me(_e,Ce){Ce==="."?_e.state=27:Ce==="-"?_e.state=26:VU(Ce)||an(_e)}function xe(_e,Ce){Ce==="-"||Ce==="."?an(_e):VU(Ce)?_e.state=25:an(_e)}function ue(_e,Ce){Ce==="."||Ce==="-"?an(_e):__(Ce)?(_e.state=25,_e.acceptStateReached=!0):an(_e)}function ye(_e,Ce){dY(Ce)?(_e.state=29,_e.acceptStateReached=!0):zo(f,_e)}function Ae(_e,Ce){dY(Ce)||an(_e)}function Pe(_e,Ce){hY(Ce)?(_e.state=31,_e.acceptStateReached=!0):zo(f,_e)}function Ee(_e,Ce){hY(Ce)||(eh.test(Ce)?zo(f,_e):an(_e))}function Ve(_e,Ce){Gs.test(Ce)?_e.state=38:(zo(f,_e),x(Ce))}function je(_e,Ce){Gs.test(Ce)?_e.state=33:zo(f,_e),x(Ce)}function it(_e,Ce){Gs.test(Ce)?_e.state=34:zo(f,_e)}function Dt(_e,Ce){Gs.test(Ce)?_e.state=35:zo(f,_e)}function Gt(_e,Ce){Ce===")"?_e.state=36:zo(f,_e)}function $e(_e,Ce){Gs.test(Ce)?_e.state=38:mY(Ce)?_e.state=39:zo(f,_e)}function ln(_e,Ce){_e.acceptStateReached=!0,GU(Ce)?_e.state=40:Ce==="#"?_e.state=41:Gs.test(Ce)||(Ce==="("?_e.state=32:mY(Ce)?_e.state=39:(an(_e),AE(Ce)&&f.push(jU(h,0))))}function Vt(_e,Ce){Gs.test(Ce)?_e.state=38:Ce==="("?_e.state=32:(an(_e),x(Ce))}function Ct(_e,Ce){GU(Ce)||(Ce==="#"?_e.state=41:Gs.test(Ce)?_e.state=38:an(_e))}function gi(_e,Ce){GU(Ce)?_e.state=40:Gs.test(Ce)?zo(f,_e):an(_e)}function an(_e){if(zo(f,_e),!!_e.acceptStateReached){var Ce=_e.startIdx,mn=e.slice(_e.startIdx,h);if(mn=xot(mn),_e.type==="url"){var mt=e.charAt(_e.startIdx-1);if(mt==="@")return;var to=_e.matchType;if(to==="scheme"){var So=cY.exec(mn);if(So&&(Ce=Ce+So.index,mn=mn.slice(So.index)),!Bpe(mn))return}else if(to==="tld"){if(!kpe(mn))return}else if(to==="ipV4"){if(!Upe(mn))return}else Pm(to);l.push(new Vpe({tagBuilder:n,matchedText:mn,offset:Ce,urlMatchType:to,url:mn,protocolRelativeMatch:mn.slice(0,2)==="//",stripPrefix:i,stripTrailingSlash:o,decodePercentEncoding:r}))}else if(_e.type==="email")Gpe(mn)&&l.push(new jpe({tagBuilder:n,matchedText:mn,offset:Ce,email:mn.replace(zpe,"")}));else if(_e.type==="hashtag")Wpe(mn)&&l.push(new Ype({tagBuilder:n,matchedText:mn,offset:Ce,serviceName:s,hashtag:mn.slice(1)}));else if(_e.type==="mention")Xpe(mn,a)&&l.push(new $pe({tagBuilder:n,matchedText:mn,offset:Ce,serviceName:a,mention:mn.slice(1)}));else if(_e.type==="phone"){if(mn=mn.replace(/ +$/g,""),Zpe(mn)){var Ks=mn.replace(/[^0-9,;#]/g,"");l.push(new Qpe({tagBuilder:n,matchedText:mn,offset:Ce,number:Ks,plusSign:mn.charAt(0)==="+"}))}}else Pm(_e)}}}var bot=/[\(\{\[]/,Jpe=/[\)\}\]]/,e_e={")":"(","}":"{","]":"["};function xot(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n);bot.test(i)?t[i]++:Jpe.test(i)&&t[e_e[i]]--}for(var o=e.length-1,r;o>=0;)if(r=e.charAt(o),Jpe.test(r)){var s=e_e[r];if(t[s]<0)t[s]++,o--;else break}else if(Fpe.test(r))o--;else break;return e.slice(0,o+1)}function jU(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"scheme"}}function pY(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"tld"}}function Tot(e,t){return{type:"url",startIdx:e,state:t,acceptStateReached:!1,matchType:"ipV4",octetsEncountered:1}}function Aot(e,t){return{type:"email",startIdx:e,state:t,acceptStateReached:!1}}function Cot(e,t){return{type:"hashtag",startIdx:e,state:t,acceptStateReached:!1}}function Eot(e,t){return{type:"mention",startIdx:e,state:t,acceptStateReached:!1}}function _Y(e,t){return{type:"phone",startIdx:e,state:t,acceptStateReached:!1}}function Sot(e){return e.type==="url"&&e.matchType==="scheme"}function n_e(e,t){for(var n=t.onOpenTag,i=t.onCloseTag,o=t.onText,r=t.onComment,s=t.onDoctype,a=new Rm,l=0,u=e.length,f=0,h=0,p=a;l<u;){var g=e.charAt(l);switch(f){case 0:m(g);break;case 1:y(g);break;case 2:x(g);break;case 3:b(g);break;case 4:A(g);break;case 5:E(g);break;case 6:S(g);break;case 7:v(g);break;case 8:P(g);break;case 9:M(g);break;case 10:R(g);break;case 11:L(g);break;case 12:B(g);break;case 13:_(g);break;case 14:w(g);break;case 15:D(g);break;case 16:I(g);break;case 17:N(g);break;case 18:k(g);break;case 19:H(g);break;case 20:V(g);break;default:Pm(f)}l++}h<l&&X();function m(Z){Z==="<"&&U()}function y(Z){Z==="!"?f=13:Z==="/"?(f=2,p=new Rm(js(js({},p),{isClosing:!0}))):Z==="<"?U():ky.test(Z)?(f=3,p=new Rm(js(js({},p),{isOpening:!0}))):(f=0,p=a)}function b(Z){Cu.test(Z)?(p=new Rm(js(js({},p),{name:te()})),f=4):Z==="<"?U():Z==="/"?(p=new Rm(js(js({},p),{name:te()})),f=12):Z===">"?(p=new Rm(js(js({},p),{name:te()})),q()):!ky.test(Z)&&!Gs.test(Z)&&Z!==":"&&j()}function x(Z){Z===">"?j():ky.test(Z)?f=3:j()}function A(Z){Cu.test(Z)||(Z==="/"?f=12:Z===">"?q():Z==="<"?U():Z==="="||kU.test(Z)||wpe.test(Z)?j():f=5)}function E(Z){Cu.test(Z)?f=6:Z==="/"?f=12:Z==="="?f=7:Z===">"?q():Z==="<"?U():kU.test(Z)&&j()}function S(Z){Cu.test(Z)||(Z==="/"?f=12:Z==="="?f=7:Z===">"?q():Z==="<"?U():kU.test(Z)?j():f=5)}function v(Z){Cu.test(Z)||(Z==='"'?f=8:Z==="'"?f=9:/[>=`]/.test(Z)?j():Z==="<"?U():f=10)}function P(Z){Z==='"'&&(f=11)}function M(Z){Z==="'"&&(f=11)}function R(Z){Cu.test(Z)?f=4:Z===">"?q():Z==="<"&&U()}function L(Z){Cu.test(Z)?f=4:Z==="/"?f=12:Z===">"?q():Z==="<"?U():(f=4,K())}function B(Z){Z===">"?(p=new Rm(js(js({},p),{isClosing:!0})),q()):f=4}function _(Z){e.substr(l,2)==="--"?(l+=2,p=new Rm(js(js({},p),{type:"comment"})),f=14):e.substr(l,7).toUpperCase()==="DOCTYPE"?(l+=7,p=new Rm(js(js({},p),{type:"doctype"})),f=20):j()}function w(Z){Z==="-"?f=15:Z===">"?j():f=16}function D(Z){Z==="-"?f=18:Z===">"?j():f=16}function I(Z){Z==="-"&&(f=17)}function N(Z){Z==="-"?f=18:f=16}function k(Z){Z===">"?q():Z==="!"?f=19:Z==="-"||(f=16)}function H(Z){Z==="-"?f=17:Z===">"?q():f=16}function V(Z){Z===">"?q():Z==="<"&&U()}function j(){f=0,p=a}function U(){f=1,p=new Rm({idx:l})}function q(){var Z=e.slice(h,p.idx);Z&&o(Z,h),p.type==="comment"?r(p.idx):p.type==="doctype"?s(p.idx):(p.isOpening&&n(p.name,p.idx),p.isClosing&&i(p.name,p.idx)),j(),h=l+1}function X(){var Z=e.slice(h,l);o(Z,h),h=l+1}function te(){var Z=p.idx+(p.isClosing?2:1);return e.slice(Z,l).toLowerCase()}function K(){l--}}var Rm=function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e}();var wot=function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=vot(t.urls),this.email=Au(t.email)?t.email:this.email,this.phone=Au(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Au(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Dot(t.stripPrefix),this.stripTrailingSlash=Au(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Au(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&Kpe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&qpe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=Pot(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return n_e(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var l=/(&nbsp;|&#160;|&lt;|&#60;|&gt;|&#62;|&quot;|&#34;|&#39;)/gi,u=s.split(l),f=a;u.forEach(function(h,p){if(p%2===0){var g=n.parseText(h,f);r.push.apply(r,g)}f+=h.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(s){},onDoctype:function(s){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(function(l,u){return l.getOffset()-u.getOffset()});for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length,s=o+r;if(n+1<t.length){if(t[n+1].getOffset()===o){var a=t[n+1].getMatchedText().length>r?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()<s){t.splice(n+1,1);continue}}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||By(t,function(n){return n.getType()==="hashtag"}),this.email||By(t,function(n){return n.getType()==="email"}),this.phone||By(t,function(n){return n.getType()==="phone"}),this.mention||By(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||By(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||By(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||By(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n===void 0&&(n=0),n=n||0;for(var i=t_e(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),o=0,r=i.length;o<r;o++)i[o].setOffset(n+i[o].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"&lt;").replace(/>/g,"&gt;"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof UU)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new Rpe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=Cpe,e}(),i_e=wot;function vot(e){return e==null&&(e=!0),Au(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Au(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Au(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Au(e.ipV4Matches)?e.ipV4Matches:!0}}function Dot(e){return e==null&&(e=!0),Au(e)?{scheme:e,www:e}:{scheme:Au(e.scheme)?e.scheme:!0,www:Au(e.www)?e.www:!0}}function Pot(e){return typeof e=="number"?{length:e,location:"end"}:Epe(e||{},{length:Number.POSITIVE_INFINITY,location:"end"})}var WU=i_e;var d_e;typeof DOMParser<"u"&&(d_e=new DOMParser);var Iot=new WU({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),qU=32,o_e=2414016,r_e=1,s_e=16093e3,a_e=.1,Oot=[null,void 0,"http://www.topografix.com/GPX/1/1"],Ao={gpx:Oot};function Rot(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function gY(e,t){let n=IP(e,"id");return n=c(n)?n:jn(),t.getOrCreateEntity(n)}function yY(e){let t=c_e(e,"lon"),n=c_e(e,"lat"),i=DP(e,"ele",Ao.gpx);return d.fromDegrees(t,n,i)}function c_e(e,t){if(!c(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function IP(e,t){if(!c(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Uy(e,t,n){if(!c(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function bY(e,t,n){if(!c(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function DP(e,t,n){let i=Uy(e,t,n);if(c(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Bl(e,t,n){let i=Uy(e,t,n);if(c(i))return i.textContent.trim()}function h_e(e){let t=new wc;return t.width=qU,t.height=qU,t.scaleByDistance=new Bt(o_e,r_e,s_e,a_e),t.pixelOffsetScaleByDistance=new Bt(o_e,r_e,s_e,a_e),t.verticalOrigin=new Xn(Fn.BOTTOM),t.image=e,t}function Mot(){let e=new Bh;return e.translucencyByDistance=new Bt(3e6,1,5e6,0),e.pixelOffset=new z(17,0),e.horizontalOrigin=xi.LEFT,e.font="16px sans-serif",e.style=Ko.FILL_AND_OUTLINE,e}function m_e(e){let t=new Oc;return t.width=4,t.material=new qb,t.material.color=c(e)?e:G.RED,t.material.outlineWidth=2,t.material.outlineColor=G.BLACK,t}var l_e={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},PP;typeof document<"u"&&(PP=document.createElement("div"));function xY(e,t){let n,i="",o=Object.keys(l_e),r=o.length;for(n=0;n<r;n++){let f=o[n],h=l_e[f];h.value=Bl(e,h.tag,Ao.gpx)??"",c(h.value)&&h.value!==""&&(i=`${i}<p>${h.text}: ${h.value}</p>`)}if(!c(i)||i==="")return;i=Iot.link(i),PP.innerHTML=i;let s=PP.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=G.WHITE,l=G.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${l.toCssColorString()};`,u+='">',u+=`${PP.innerHTML}</div>`,PP.innerHTML="",u}function p_e(e,t,n,i){let o=yY(t),r=gY(t,n);r.position=o;let s=c(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",G.RED,qU);r.billboard=h_e(s);let a=Bl(t,"name",Ao.gpx);r.name=a,r.label=Mot(),r.label.text=a,r.description=xY(t,r),i.clampToGround&&(r.billboard.heightReference=qe.CLAMP_TO_GROUND,r.label.heightReference=qe.CLAMP_TO_GROUND)}function Lot(e,t,n,i){let o=gY(t,n);o.description=xY(t,o);let r=bY(t,"rtept",Ao.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)p_e(e,r[a],n,i),s[a]=yY(r[a]);o.polyline=m_e(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function Not(e,t,n,i){let o=gY(t,n);o.description=xY(t,o);let r=bY(t,"trkseg",Ao.gpx),s=[],a=[],l,u=!0,f=new Ia;for(let h=0;h<r.length;h++)l=Fot(r[h]),s=s.concat(l.positions),l.times.length>0?(a=a.concat(l.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let h=c(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",G.RED,qU);o.billboard=h_e(h),o.position=f,i.clampToGround&&(o.billboard.heightReference=qe.CLAMP_TO_GROUND),o.availability=new Xr,o.availability.addInterval(new Sn({start:a[0],stop:a[a.length-1]}))}o.polyline=m_e(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function Fot(e){let t={positions:[],times:[]},n=bY(e,"trkpt",Ao.gpx),i;for(let o=0;o<n.length;o++){let r=yY(n[o]);t.positions.push(r),i=Bl(n[o],"time",Ao.gpx),c(i)&&t.times.push(Q.fromIso8601(i))}return t}function Bot(e){let t=Uy(e,"metadata",Ao.gpx);if(c(t)){let n={name:Bl(t,"name",Ao.gpx),desc:Bl(t,"desc",Ao.gpx),author:kot(t),copyright:Vot(t),link:__e(t),time:Bl(t,"time",Ao.gpx),keywords:Bl(t,"keywords",Ao.gpx),bounds:zot(t)};if(c(n.name)||c(n.desc)||c(n.author)||c(n.copyright)||c(n.link)||c(n.time)||c(n.keywords)||c(n.bounds))return n}}function kot(e){let t=Uy(e,"author",Ao.gpx);if(c(t)){let n={name:Bl(t,"name",Ao.gpx),email:Uot(t),link:__e(t)};if(c(n.name)||c(n.email)||c(n.link))return n}}function Uot(e){let t=Uy(e,"email",Ao.gpx);if(c(t)){let n=Bl(t,"id",Ao.gpx),i=Bl(t,"domain",Ao.gpx);return`${n}@${i}`}}function __e(e){let t=Uy(e,"link",Ao.gpx);if(c(t)){let n={href:IP(t,"href"),text:Bl(t,"text",Ao.gpx),mimeType:Bl(t,"type",Ao.gpx)};if(c(n.href)||c(n.text)||c(n.mimeType))return n}}function Vot(e){let t=Uy(e,"copyright",Ao.gpx);if(c(t)){let n={author:IP(t,"author"),year:Bl(t,"year",Ao.gpx),license:Bl(t,"license",Ao.gpx)};if(c(n.author)||c(n.year)||c(n.license))return n}}function zot(e){let t=Uy(e,"bounds",Ao.gpx);if(c(t)){let n={minLat:DP(t,"minlat",Ao.gpx),maxLat:DP(t,"maxlat",Ao.gpx),minLon:DP(t,"minlon",Ao.gpx),maxLon:DP(t,"maxlon",Ao.gpx)};if(c(n.minLat)||c(n.maxLat)||c(n.minLon)||c(n.maxLon))return n}}var u_e={wpt:p_e,rte:Lot,trk:Not};function Hot(e,t,n,i){let o=Object.keys(u_e),r=o.length;for(let s=0;s<r;s++){let a=o[s],l=u_e[a],u=t.childNodes,f=u.length;for(let h=0;h<f;h++){let p=u[h];p.localName===a&&Ao.gpx.indexOf(p.namespaceURI)!==-1&&l(e,p,n,i)}}}function f_e(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=IP(o,"version"),s=IP(o,"creator"),a,l=Bot(o);c(l)&&(a=l.name),o.localName==="gpx"?Hot(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let u,f=i.computeAvailability(),h=f.start,p=f.stop,g=Q.equals(h,Ge.MINIMUM_VALUE),m=Q.equals(p,Ge.MAXIMUM_VALUE);if(!g||!m){let b;g&&(b=new Date,b.setHours(0,0,0,0),h=Q.fromDate(b)),m&&(b=new Date,b.setHours(24,0,0,0),p=Q.fromDate(b)),u=new pm,u.startTime=h,u.stopTime=p,u.currentTime=Q.clone(h),u.clockRange=$r.LOOP_STOP,u.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(p,h)/60,1),31556900))}let y=!1;return e._name!==a&&(e._name=a,y=!0),e._creator!==s&&(e._creator=s,y=!0),Got(e._metadata,l)&&(e._metadata=l,y=!0),e._version!==r&&(e._version=r,y=!0),u!==e._clock&&(y=!0,e._clock=u),y&&e._changed.raiseEvent(e),Kr.setLoading(e,!1),e}function Got(e,t){return!c(e)&&!c(t)?!1:c(e)&&c(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function jot(e,t,n,i){i=i??W.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof we){n=we.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(c(s)){let a=s.length;for(let l=0;l<a;l++)r.push(s[l])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?Rot(r).then(function(s){let a,l;try{a=d_e.parseFromString(s,"application/xml")}catch(u){l=u.toString()}if(c(l)||a.body||a.documentElement.tagName==="parsererror"){let u=c(l)?l:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new ae(u)}return f_e(e,a,i)}):f_e(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function CE(){this._changed=new pe,this._error=new pe,this._loading=new pe,this._clock=void 0,this._entityCollection=new la(this),this._entityCluster=new Lf,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new Ny}CE.load=function(e,t){return new CE().load(e,t)};Object.defineProperties(CE.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!c(e))throw new C("value must be defined.");this._entityCluster=e}}});CE.prototype.update=function(e){return!0};CE.prototype.load=function(e,t){if(!c(e))throw new C("data is required.");t=t??W.EMPTY_OBJECT,Kr.setLoading(this,!0);let n=this._name,i=this;return jot(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,l=Q.equals(s,Ge.MINIMUM_VALUE),u=Q.equals(a,Ge.MAXIMUM_VALUE);if(!l||!u){let h;l&&(h=new Date,h.setHours(0,0,0,0),s=Q.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),a=Q.fromDate(h)),o=new pm,o.startTime=s,o.stopTime=a,o.currentTime=Q.clone(s),o.clockRange=$r.LOOP_STOP,o.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Kr.setLoading(i,!1),i}).catch(function(o){return Kr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var YU=CE;function Wot(e,t){this.position=e,this.headingPitchRoll=t}var XU=Wot;var RP=jr(ql(),1);function qot(e,t){this.position=e,this.headingPitchRange=t}var KU=qot;function $U(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new pe,this.tourEnd=new pe,this.entryStart=new pe,this.entryEnd=new pe,this._activeEntries=[]}$U.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};$U.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;y_e.call(this,e,t,function(i){n.playlistIndex=0,i||g_e(n._activeEntries),n.tourEnd.raiseEvent(i)})};$U.prototype.stop=function(){g_e(this._activeEntries)};function g_e(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function y_e(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=Yot.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else c(n)&&n(!1)}function Yot(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,y_e.call(this,e,t,n)}}var ZU=$U;var Pi=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Pi.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?Pi.Bounce.In(e*2)*.5:Pi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),OP=function(){return performance.now()},Xot=function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var o=0,r=n;o<r.length;o++){var s=r[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,o=t;i<o.length;i++){var r=o[i];r._group=void 0,delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=OP()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var r=this._tweens[i[o]],s=!n;r&&r.update(t,s)===!1&&!n&&this.remove(r)}i=Object.keys(this._tweensAddedDuringUpdate)}},e}(),EE={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=EE.Utils.Linear;return t<0?r(e[0],e[1],i):t>1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=EE.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=EE.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n<o+1?n:o+1],e[n<o+2?n:o+2],i-o)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=EE.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}}(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,l=o*a;return(2*t-2*n+r+s)*l+(-3*t+3*n-2*r-s)*a+r*o+t}}},b_e=function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e}(),TY=new Xot,x_e=function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Pi.Linear.None,this._interpolationFunction=EE.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=b_e.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=TY,TY.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=OP()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],l=Array.isArray(a),u=l?"array":typeof a,f=!l&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var h=i[s];if(h.length===0)continue;for(var p=[a],g=0,m=h.length;g<m;g+=1){var y=this._handleRelativeValue(a,h[g]);if(isNaN(y)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}f&&(i[s]=p)}if((u==="object"||l)&&a&&!f){n[s]=l?[]:{};var b=a;for(var x in b)n[s][x]=b[x];o[s]=l?[]:{};var h=i[s];if(!this._isDynamic){var A={};for(var x in h)A[x]=h[x];i[s]=h=A}this._setupProperties(b,n[s],h,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),l||(n[s]*=1),f?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=OP()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=OP()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=Pi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=EE.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,o;if(t===void 0&&(t=OP()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var r;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),l=this._duration+this._repeat*a,u=function(){if(i._duration===0||s>l)return 1;var y=Math.trunc(s/a),b=s-y*a,x=Math.min(b/i._duration,1);return x===0&&s===i._duration?1:x},f=u(),h=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,h),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,m=this._chainedTweens.length;g<m;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],l=Array.isArray(t[r]),u=Array.isArray(a),f=!l&&u;f?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e}();var Mli=b_e.nextId,Mm=TY,Lli=Mm.getAll.bind(Mm),Nli=Mm.removeAll.bind(Mm),Fli=Mm.add.bind(Mm),Bli=Mm.remove.bind(Mm),kli=Mm.update.bind(Mm);var Kot={LINEAR_NONE:Pi.Linear.None,QUADRATIC_IN:Pi.Quadratic.In,QUADRATIC_OUT:Pi.Quadratic.Out,QUADRATIC_IN_OUT:Pi.Quadratic.InOut,CUBIC_IN:Pi.Cubic.In,CUBIC_OUT:Pi.Cubic.Out,CUBIC_IN_OUT:Pi.Cubic.InOut,QUARTIC_IN:Pi.Quartic.In,QUARTIC_OUT:Pi.Quartic.Out,QUARTIC_IN_OUT:Pi.Quartic.InOut,QUINTIC_IN:Pi.Quintic.In,QUINTIC_OUT:Pi.Quintic.Out,QUINTIC_IN_OUT:Pi.Quintic.InOut,SINUSOIDAL_IN:Pi.Sinusoidal.In,SINUSOIDAL_OUT:Pi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Pi.Sinusoidal.InOut,EXPONENTIAL_IN:Pi.Exponential.In,EXPONENTIAL_OUT:Pi.Exponential.Out,EXPONENTIAL_IN_OUT:Pi.Exponential.InOut,CIRCULAR_IN:Pi.Circular.In,CIRCULAR_OUT:Pi.Circular.Out,CIRCULAR_IN_OUT:Pi.Circular.InOut,ELASTIC_IN:Pi.Elastic.In,ELASTIC_OUT:Pi.Elastic.Out,ELASTIC_IN_OUT:Pi.Elastic.InOut,BACK_IN:Pi.Back.In,BACK_OUT:Pi.Back.Out,BACK_IN_OUT:Pi.Back.InOut,BOUNCE_IN:Pi.Bounce.In,BOUNCE_OUT:Pi.Bounce.Out,BOUNCE_IN_OUT:Pi.Bounce.InOut},Qr=Object.freeze(Kot);function QU(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}QU.prototype.play=function(e,t,n){if(this.activeCamera=t,c(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(c(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new le(this.view.position);t.flyToBoundingSphere(o,i)}};QU.prototype.stop=function(){c(this.activeCamera)&&this.activeCamera.cancelFlight(),c(this.activeCallback)&&this.activeCallback(!0)};QU.prototype.getCameraOptions=function(e){let t={duration:this.duration};return c(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Qr.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),c(e)&&(t=xt(t,e)),t};var JU=QU;function AY(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}AY.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};AY.prototype.stop=function(){clearTimeout(this.timeout),c(this.activeCallback)&&this.activeCallback(!0)};var eV=AY;var I_e={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=uT(t),I_e[t]}},PY;typeof DOMParser<"u"&&(PY=new DOMParser);var $ot=new WU({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),Vy=32,T_e=2414016,A_e=1,C_e=16093e3,E_e=.1,S_e=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],w_e=["http://www.google.com/kml/ext/2.2"],Zot=["http://www.w3.org/2005/Atom"],Re={kml:S_e,gx:w_e,atom:Zot,kmlgx:S_e.concat(w_e)},IY={Document:V_e,Folder:_rt,Placemark:grt,NetworkLink:wrt,GroundOverlay:Crt,PhotoOverlay:G_e,ScreenOverlay:Art,Tour:brt};function Lm(e){this._dataSource=e,this._deferred=Yl(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}Object.defineProperties(Lm.prototype,{dataSource:{get:function(){return this._dataSource}}});Lm.prototype.addNodes=function(e,t){this._stack.push({nodes:e,index:0,processingData:t}),this._used=!0};Lm.prototype.addPromise=function(e){this._promises.push(e)};Lm.prototype.wait=function(){let e=this._deferred;return this._used||e.resolve(),Promise.all([e.promise,Promise.all(this._promises)])};Lm.prototype.process=function(){let e=this._stack.length===1;return e&&(this._started=wu._getTimestamp()),this._process(e)};Lm.prototype._giveUpTime=function(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let e=this;setTimeout(function(){e._timeoutSet=!1,e._started=wu._getTimestamp(),e._process(!0)},0)};Lm.prototype._nextNode=function(){let e=this._stack,t=e[e.length-1],n=t.index,i=t.nodes;if(n!==i.length)return++t.index,i[n]};Lm.prototype._pop=function(){let e=this._stack;return e.pop(),e.length===0?(this._deferred.resolve(),!1):!0};Lm.prototype._process=function(e){let t=this.dataSource,n=this._stack[this._stack.length-1].processingData,i=this._nextNode();for(;c(i);){let o=IY[i.localName];if(c(o)&&(Re.kml.indexOf(i.namespaceURI)!==-1||Re.gx.indexOf(i.namespaceURI)!==-1)&&(o(t,i,n,this),this._timeoutSet||wu._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}i=this._nextNode()}this._pop()&&e&&this._process(!0)};function Qot(e){let t=e.slice(0,Math.min(4,e.size)),n=Yl(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function Jot(e){let t=Yl(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function O_e(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(c(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return c(n)&&(e=n+i),e}function R_e(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,o,r;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),o=t,t=e.indexOf(i,t+1),t!==-1?(r=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(r+1,e.length),t=e.indexOf("xmlns:",o-1)):t=e.indexOf("xmlns:",o+1);return e}function ert(e,t){return Promise.resolve(e.getData(new hU)).then(function(n){n=O_e(n),n=R_e(n),t.kml=PY.parseFromString(n,"application/xml")})}function CY(e,t){let n=I_e.detectFromFilename(e.filename)??"application/octet-stream";return Promise.resolve(e.getData(new fU(n))).then(function(i){t[e.filename]=i})}function Eu(e,t,n,i){let o=i.keys,r=new RP.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let l=s[a],u=l.getAttribute(n);if(c(u)){let h=new RP.default(u).absoluteTo(r).toString(),p=o.indexOf(h);if(p!==-1){let g=o[p];l.setAttribute(n,i[g]),t==="a"&&l.getAttribute("download")===null&&l.setAttribute("download",g)}}}}function Su(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let s=o[r],a=s.getAttribute(n),l=OY(a,i);c(l)&&s.setAttribute(n,l.url)}}function M_e(e,t,n){let i=Ss(e,"id");i=c(i)&&i.length!==0?i:jn(),c(n)&&(i=n+i);let o=t.getById(i);return c(o)&&(i=jn(),c(n)&&(i=n+i)),o=t.add(new rr({id:i})),c(o.kml)||(o.addProperty("kml"),o.kml=new Irt),o}function MP(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function oV(e,t){if(!c(e))return d.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!c(n))return d.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,d.fromDegrees(i,o,r,t)}function tV(e,t){if(!c(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!c(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=oV(n[s],t);return o}function zy(e,t){if(!c(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Ss(e,t){if(!c(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Ii(e,t,n){if(!c(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function v_e(e,t,n){if(!c(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function th(e,t,n){if(!c(e))return[];let i=[],o=e.childNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function $n(e,t,n){let i=Ii(e,t,n);if(c(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Dn(e,t,n){let i=Ii(e,t,n);if(c(i))return i.textContent.trim()}function nh(e,t,n){let i=Ii(e,t,n);if(c(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function OY(e,t,n){if(!c(e))return;let i;if(c(n)){e=e.replace(/\\/g,"/");let o=n[e];if(c(o))i=new we({url:o});else{let r=new RP.default(t.getUrlComponent()),s=new RP.default(e);o=n[s.absoluteTo(r)],c(o)&&(i=new we({url:o}))}}return c(i)||(i=t.getDerivedResource({url:e})),i}var kl={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function vY(e,t){if(!c(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255,r=parseInt(e.substring(6,8),16)/255;return t?(r>0?(kl.maximumRed=r,kl.red=void 0):(kl.maximumRed=void 0,kl.red=0),o>0?(kl.maximumGreen=o,kl.green=void 0):(kl.maximumGreen=void 0,kl.green=0),i>0?(kl.maximumBlue=i,kl.blue=void 0):(kl.maximumBlue=void 0,kl.blue=0),kl.alpha=n,G.fromRandom(kl)):new G(r,o,i,n)}function mx(e,t,n){let i=Dn(e,t,n);if(c(i))return vY(i,Dn(e,"colorMode",n)==="random")}function trt(e){let t=Ii(e,"TimeStamp",Re.kmlgx),n=Dn(t,"when",Re.kmlgx);if(!c(t)||!c(n)||n.length===0)return;let i=Q.fromIso8601(n),o=new Xr;return o.addInterval(new Sn({start:i,stop:Ge.MAXIMUM_VALUE})),o}function nrt(e){let t=Ii(e,"TimeSpan",Re.kmlgx);if(!c(t))return;let n,i=Ii(t,"begin",Re.kmlgx),o=c(i)?Q.fromIso8601(i.textContent):void 0,r=Ii(t,"end",Re.kmlgx),s=c(r)?Q.fromIso8601(r.textContent):void 0;if(c(o)&&c(s)){if(Q.lessThan(s,o)){let a=o;o=s,s=a}n=new Xr,n.addInterval(new Sn({start:o,stop:s}))}else c(o)?(n=new Xr,n.addInterval(new Sn({start:o,stop:Ge.MAXIMUM_VALUE}))):c(s)&&(n=new Xr,n.addInterval(new Sn({start:Ge.MINIMUM_VALUE,stop:s})));return n}function L_e(){let e=new wc;return e.width=Vy,e.height=Vy,e.scaleByDistance=new Bt(T_e,A_e,C_e,E_e),e.pixelOffsetScaleByDistance=new Bt(T_e,A_e,C_e,E_e),e}function RY(){let e=new kh;return e.outline=!0,e.outlineColor=G.WHITE,e}function N_e(){let e=new Bh;return e.translucencyByDistance=new Bt(3e6,1,5e6,0),e.pixelOffset=new z(17,0),e.horizontalOrigin=xi.LEFT,e.font="16px sans-serif",e.style=Ko.FILL_AND_OUTLINE,e}function MY(e,t,n,i,o){let r=Dn(e,"href",Re.kml);if(!c(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),l=$n(e,"x",Re.gx)??0,u=$n(e,"y",Re.gx)??0;l=Math.min(l/32,7),u=7-Math.min(u/32,7);let f=8*u+l;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=OY(r,n,i);if(o){let a=Dn(e,"refreshMode",Re.kml),l=Dn(e,"viewRefreshMode",Re.kml);a==="onInterval"||a==="onExpire"?dt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(l==="onStop"||l==="onRegion")&&dt(`kml-refreshMode-${l}`,`KML - Unsupported Icon viewRefreshMode: ${l}`);let u=Dn(e,"viewBoundScale",Re.kml)??1,f=l==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",h=Dn(e,"viewFormat",Re.kml)??f,p=Dn(e,"httpQuery",Re.kml);c(h)&&s.setQueryParameters(Ku(iV(h))),c(p)&&s.setQueryParameters(Ku(iV(p)));let g=t._ellipsoid;return NY(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function irt(e,t,n,i,o){let r=$n(t,"scale",Re.kml),s=$n(t,"heading",Re.kml),a=mx(t,"color",Re.kml),l=Ii(t,"Icon",Re.kml),u=MY(l,e,i,o,!1);c(l)&&!c(u)&&(u=!1);let f=$n(l,"x",Re.gx),h=$n(l,"y",Re.gx),p=$n(l,"w",Re.gx),g=$n(l,"h",Re.gx),m=Ii(t,"hotSpot",Re.kml),y=zy(m,"x"),b=zy(m,"y"),x=Ss(m,"xunits"),A=Ss(m,"yunits"),E=n.billboard;c(E)||(E=L_e(),n.billboard=E),E.image=u,E.scale=r,E.color=a,(c(f)||c(h)||c(p)||c(g))&&(E.imageSubRegion=new Ke(f,h,p,g)),c(s)&&s!==0&&(E.rotation=O.toRadians(-s),E.alignedAxis=d.UNIT_Z),r=r??1;let S,v;c(y)&&(x==="pixels"?S=-y*r:x==="insetPixels"?S=(y-Vy)*r:x==="fraction"&&(S=-y*Vy*r),S+=Vy*.5*r),c(b)&&(A==="pixels"?v=b*r:A==="insetPixels"?v=(-b+Vy)*r:A==="fraction"&&(v=b*Vy*r),v-=Vy*.5*r),(c(S)||c(v))&&(E.pixelOffset=new z(S,v))}function nV(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r<s;r++){let a=t.childNodes.item(r);if(a.localName==="IconStyle")irt(e,a,n,i,o);else if(a.localName==="LabelStyle"){let l=n.label;c(l)||(l=N_e(),n.label=l),l.scale=$n(a,"scale",Re.kml)??l.scale,l.fillColor=mx(a,"color",Re.kml)??l.fillColor,l.text=n.name}else if(a.localName==="LineStyle"){let l=n.polyline;c(l)||(l=new Oc,n.polyline=l),l.width=$n(a,"width",Re.kml),l.material=mx(a,"color",Re.kml),c(mx(a,"outerColor",Re.gx))&&dt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),c($n(a,"outerWidth",Re.gx))&&dt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),c($n(a,"physicalWidth",Re.gx))&&dt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),c(nh(a,"labelVisibility",Re.gx))&&dt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let l=n.polygon;c(l)||(l=RY(),n.polygon=l),l.material=mx(a,"color",Re.kml)??l.material,l.fill=nh(a,"fill",Re.kml)??l.fill,l.outline=nh(a,"outline",Re.kml)??l.outline}else if(a.localName==="BalloonStyle"){let l=vY(Dn(a,"bgColor",Re.kml))??G.WHITE,u=vY(Dn(a,"textColor",Re.kml))??G.BLACK,f=Dn(a,"text",Re.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:l,textColor:u,text:f}}else if(a.localName==="ListStyle"){let l=Dn(a,"listItemType",Re.kml);(l==="radioFolder"||l==="checkOffOnly")&&dt(`kml-listStyle-${l}`,`KML - Unsupported ListStyle with listItemType: ${l}`)}}}function ort(e,t,n,i,o){let r=new rr,s,a=-1,l=t.childNodes,u=l.length;for(let h=0;h<u;h++){let p=l[h];(p.localName==="Style"||p.localName==="StyleMap")&&(a=h)}if(a!==-1){let h=l[a];if(h.localName==="Style")nV(e,h,r,i,o);else{let p=th(h,"Pair",Re.kml);for(let g=0;g<p.length;g++){let m=p[g],y=Dn(m,"key",Re.kml);if(y==="normal"){let b=Dn(m,"styleUrl",Re.kml);if(c(b))s=n.getById(b),c(s)||(s=n.getById(`#${b}`)),c(s)&&r.merge(s);else{let x=Ii(m,"Style",Re.kml);nV(e,x,r,i,o)}}else dt(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let f=Dn(t,"styleUrl",Re.kml);if(c(f)){let h=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];h=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(h),c(s)||(s=n.getById(`#${h}`)),c(s)&&r.merge(s)}return r}function rrt(e,t,n){return t.fetchXML().then(function(i){return F_e(e,i,n,t,!0)})}function F_e(e,t,n,i,o,r){let s,a,l,u,f=v_e(t,"Style",Re.kml);if(c(f)){let y=f.length;for(s=0;s<y;s++)u=f[s],a=Ss(u,"id"),c(a)&&(a=`#${a}`,o&&c(i)&&(a=i.getUrlComponent()+a),c(n.getById(a))||(l=new rr({id:a}),n.add(l),nV(e,u,l,i,r)))}let h=v_e(t,"StyleMap",Re.kml);if(c(h)){let y=h.length;for(s=0;s<y;s++){let b=h[s];if(a=Ss(b,"id"),c(a)){let x=th(b,"Pair",Re.kml);for(let A=0;A<x.length;A++){let E=x[A],S=Dn(E,"key",Re.kml);if(S==="normal"){if(a=`#${a}`,o&&c(i)&&(a=i.getUrlComponent()+a),!c(n.getById(a))){l=n.getOrCreateEntity(a);let v=Dn(E,"styleUrl",Re.kml);if(c(v)){v[0]!=="#"&&(v=`#${v}`),o&&c(i)&&(v=i.getUrlComponent()+v);let P=n.getById(v);c(P)&&l.merge(P)}else u=Ii(E,"Style",Re.kml),nV(e,u,l,i,r)}}else dt(`kml-styleMap-${S}`,`KML - Unsupported StyleMap key: ${S}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),m=g.length;for(s=0;s<m;s++){let y=g[s].textContent;if(y[0]!=="#"){let b=y.split("#");if(b.length===2){let x=b[0],A=i.getDerivedResource({url:x});p.push(rrt(e,A,n))}}}return p}function LY(e,t,n){let i=new dy(e,t.id,["position"]),o=new f_(t.position);t.polyline=c(n.polyline)?n.polyline.clone():new Oc,t.polyline.positions=new uy([i,o])}function B_e(e,t){return!c(e)&&!c(t)||e==="clampToGround"?qe.CLAMP_TO_GROUND:e==="relativeToGround"?qe.RELATIVE_TO_GROUND:e==="absolute"?qe.NONE:t==="clampToSeaFloor"?(dt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),qe.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(dt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),qe.RELATIVE_TO_GROUND):(c(e)?dt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):dt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),qe.CLAMP_TO_GROUND)}function srt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((c(t)&&t!=="clampToGround"||c(n)&&n!=="clampToSeaFloor")&&dt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new f_(e))}function art(e,t,n,i){if(!c(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(c(t)&&t!=="clampToGround"||c(n)&&n!=="clampToSeaFloor")&&dt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function rV(e,t,n,i){let o=t.label;c(o)||(o=c(n.label)?n.label.clone():N_e(),t.label=o),o.text=t.name;let r=t.billboard;c(r)||(r=c(n.billboard)?n.billboard.clone():L_e(),t.billboard=r),c(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(G.YELLOW,64);let s=1;c(r.scale)&&(s=r.scale.getValue(),s!==0?o.pixelOffset=new z(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)),c(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function k_e(e,t){let n=e.path;c(n)||(n=new ig,n.leadTime=0,e.path=n);let i=t.polyline;c(i)&&(n.material=i.material,n.width=i.width)}function crt(e,t,n,i,o){let r=Dn(n,"coordinates",Re.kml),s=Dn(n,"altitudeMode",Re.kml),a=Dn(n,"altitudeMode",Re.gx),l=nh(n,"extrude",Re.kml),u=e._ellipsoid,f=oV(r,u);return i.position=f,rV(e,i,o,B_e(s,a)),l&&MP(s,a)&&LY(t,i,o),!0}function D_e(e,t,n,i,o){let r=Ii(n,"coordinates",Re.kml),s=Dn(n,"altitudeMode",Re.kml),a=Dn(n,"altitudeMode",Re.gx),l=nh(n,"extrude",Re.kml),u=nh(n,"tessellate",Re.kml),f=MP(s,a),h=$n(n,"drawOrder",Re.gx),p=e._ellipsoid,g=tV(r,p),m=o.polyline;if(f&&l){let y=new og;i.wall=y,y.positions=g;let b=o.polygon;c(b)&&(y.fill=b.fill,y.material=b.material),y.outline=!0,c(m)?(y.outlineColor=c(m.material)?m.material.color:G.WHITE,y.outlineWidth=m.width):c(b)&&(y.outlineColor=c(b.material)?b.material.color:G.WHITE)}else if(e._clampToGround&&!f&&u){let y=new Oc;y.clampToGround=!0,i.polyline=y,y.positions=g,c(m)?(y.material=c(m.material)?m.material.color.getValue(Ge.MINIMUM_VALUE):G.WHITE,y.width=m.width??1):(y.material=G.WHITE,y.width=1),y.zIndex=h}else c(h)&&dt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&dt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=c(m)?m.clone():new Oc,i.polyline=m,m.positions=art(g,s,a,p),(!u||f)&&(m.arcType=qt.NONE);return!0}function lrt(e,t,n,i,o){let r=Ii(n,"outerBoundaryIs",Re.kml),s=Ii(r,"LinearRing",Re.kml),a=Ii(s,"coordinates",Re.kml),l=e._ellipsoid,u=tV(a,l),f=nh(n,"extrude",Re.kml),h=Dn(n,"altitudeMode",Re.kml),p=Dn(n,"altitudeMode",Re.gx),g=MP(h,p),m=c(o.polygon)?o.polygon.clone():RY(),y=o.polyline;if(c(y)&&(m.outlineColor=c(y.material)?y.material.color:G.WHITE,m.outlineWidth=y.width),i.polygon=m,g?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),c(u)){let b=new ec(u),x=th(n,"innerBoundaryIs",Re.kml);for(let A=0;A<x.length;A++){s=th(x[A],"LinearRing",Re.kml);for(let E=0;E<s.length;E++)a=Ii(s[E],"coordinates",Re.kml),u=tV(a,l),c(u)&&b.holes.push(new ec(u))}m.hierarchy=b}return!0}function urt(e,t,n,i,o){let r=Dn(n,"altitudeMode",Re.kml),s=Dn(n,"altitudeMode",Re.gx),a=th(n,"coord",Re.gx),l=th(n,"angles",Re.gx),u=th(n,"when",Re.kml),f=nh(n,"extrude",Re.kml),h=MP(r,s),p=e._ellipsoid;l.length>0&&dt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),m=[],y=[];for(let x=0;x<g;x++){let A=oV(a[x].textContent,p);m.push(A),y.push(Q.fromIso8601(u[x].textContent))}let b=new Ia;return b.addSamples(y,m),i.position=b,rV(e,i,o,B_e(r,s)),k_e(i,o),i.availability=new Xr,u.length>0&&i.availability.addInterval(new Sn({start:y[0],stop:y[y.length-1]})),h&&f&&LY(t,i,o),!0}function P_e(e,t,n,i,o,r,s,a,l){let u=e[0],f=e[e.length-1],h=new Ia;h.addSamples(e,t),n.intervals.addInterval(new Sn({start:u,stop:f,isStartIncluded:l,isStopIncluded:l,data:srt(h,s,a)})),i.addInterval(new Sn({start:u,stop:f,isStartIncluded:l,isStopIncluded:l})),o.intervals.addInterval(new Sn({start:u,stop:f,isStartIncluded:l,isStopIncluded:l,data:r}))}function frt(e,t,n,i,o){let r=nh(n,"interpolate",Re.gx),s=th(n,"Track",Re.gx),a,l,u,f=!1,h=new py,p=new Xr,g=new Pa,m=e._ellipsoid;for(let y=0,b=s.length;y<b;y++){let x=s[y],A=th(x,"when",Re.kml),E=th(x,"coord",Re.gx),S=Dn(x,"altitudeMode",Re.kml),v=Dn(x,"altitudeMode",Re.gx),P=MP(S,v),M=nh(x,"extrude",Re.kml),R=Math.min(E.length,A.length),L=[];a=[];for(let B=0;B<R;B++){let _=oV(E[B].textContent,m);L.push(_),a.push(Q.fromIso8601(A[B].textContent))}r&&(c(l)&&P_e([l,a[0]],[u,L[0]],g,p,h,!1,"absolute",void 0,!1),l=a[R-1],u=L[L.length-1]),P_e(a,L,g,p,h,P&&M,S,v,!0),f=f||P&&M}return i.availability=p,i.position=g,rV(e,i,o),k_e(i,o),f&&(LY(t,i,o),i.polyline.show=h),!0}var U_e={Point:crt,LineString:D_e,LinearRing:D_e,Polygon:lrt,Track:urt,MultiTrack:frt,MultiGeometry:drt,Model:hrt};function drt(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let l=0,u=s.length;l<u;l++){let f=s.item(l),h=U_e[f.localName];if(c(h)){let p=M_e(f,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,h(e,t,f,p,o)&&(a=!0)}}return a}function hrt(e,t,n,i,o){return dt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function mrt(e,t){let n=Ii(e,"ExtendedData",Re.kml);if(!c(n))return;c(Ii(n,"SchemaData",Re.kml))&&dt("kml-schemaData","KML - SchemaData is unsupported"),c(Ss(n,"xmlns:prefix"))&&dt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=th(n,"Data",Re.kml);if(c(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],l=Ss(a,"name");c(l)&&(i[l]={displayName:Dn(a,"displayName",Re.kml),value:Dn(a,"value",Re.kml)})}}t.kml.extendedData=i}var lo;typeof document<"u"&&(lo=document.createElement("div"));function prt(e,t,n,i,o){let r,s,a,l=t.kml,u=l.extendedData,f=Dn(e,"description",Re.kml),h=t.balloonStyle??n.balloonStyle,p=G.WHITE,g=G.BLACK,m=f;c(h)&&(p=h.bgColor??G.WHITE,g=h.textColor??G.BLACK,m=h.text??f);let y;if(c(m)){if(m=m.replace("$[name]",t.name??""),m=m.replace("$[description]",f??""),m=m.replace("$[address]",l.address??""),m=m.replace("$[Snippet]",l.snippet??""),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),c(u)){let A=m.match(/\$\[.+?\]/g);if(A!==null)for(r=0;r<A.length;r++){let E=A[r],S=E.substr(2,E.length-3),v=/\/displayName$/.test(S);S=S.replace(/\/displayName$/,""),y=u[S],c(y)&&(y=v?y.displayName:y.value),c(y)&&(m=m.replace(E,y??""))}}}else if(c(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],y=u[s],m+=`<tr><th>${y.displayName??s}</th><td>${y.value??""}</td></tr>`;m+="</tbody></table>"}if(!c(m))return;m=$ot.link(m),lo.innerHTML=m;let b=lo.querySelectorAll("a");for(r=0;r<b.length;r++)b[r].setAttribute("target","_blank");c(i)&&i.keys.length>1&&(Eu(lo,"a","href",i),Eu(lo,"link","href",i),Eu(lo,"area","href",i),Eu(lo,"img","src",i),Eu(lo,"iframe","src",i),Eu(lo,"video","src",i),Eu(lo,"audio","src",i),Eu(lo,"source","src",i),Eu(lo,"track","src",i),Eu(lo,"input","src",i),Eu(lo,"embed","src",i),Eu(lo,"script","src",i),Eu(lo,"video","poster",i)),Su(lo,"a","href",o),Su(lo,"link","href",o),Su(lo,"area","href",o),Su(lo,"img","src",o),Su(lo,"iframe","src",o),Su(lo,"video","src",o),Su(lo,"audio","src",o),Su(lo,"source","src",o),Su(lo,"track","src",o),Su(lo,"input","src",o),Su(lo,"embed","src",o),Su(lo,"script","src",o),Su(lo,"video","poster",o);let x='<div class="cesium-infoBox-description-lighter" style="';x+="overflow:auto;",x+="word-wrap:break-word;",x+=`background-color:${p.toCssColorString()};`,x+=`color:${g.toCssColorString()};`,x+='">',x+=`${lo.innerHTML}</div>`,lo.innerHTML="",t.description=x}function sV(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=M_e(t,i,n.context),l=a.kml,u=ort(e,t,n.styleCollection,r,s),f=Dn(t,"name",Re.kml);a.name=f,a.parent=o;let h=nrt(t);c(h)||(h=trt(t)),a.availability=h,BY(a);function p(E){return E?E.show&&p(E.parent):!0}let g=nh(t,"visibility",Re.kml);a.show=p(o)&&(g??!0);let m=Ii(t,"author",Re.atom),y=l.author;y.name=Dn(m,"name",Re.atom),y.uri=Dn(m,"uri",Re.atom),y.email=Dn(m,"email",Re.atom);let b=Ii(t,"link",Re.atom),x=l.link;x.href=Ss(b,"href"),x.hreflang=Ss(b,"hreflang"),x.rel=Ss(b,"rel"),x.type=Ss(b,"type"),x.title=Ss(b,"title"),x.length=Ss(b,"length"),l.address=Dn(t,"address",Re.kml),l.phoneNumber=Dn(t,"phoneNumber",Re.kml),l.snippet=Dn(t,"Snippet",Re.kml),mrt(t,a),prt(t,a,u,s,r);let A=e._ellipsoid;return H_e(t,a,A),z_e(t,a,A),c(Ii(t,"Region",Re.kml))&&dt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function V_e(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function _rt(e,t,n,i){let o=sV(e,t,n),r=We(n);r.parentEntity=o.entity,V_e(e,t,r,i)}function grt(e,t,n,i){let o=sV(e,t,n),r=o.entity,s=o.styleEntity,a=!1,l=t.childNodes;for(let u=0,f=l.length;u<f&&!a;u++){let h=l.item(u),p=U_e[h.localName];c(p)&&(p(e,n.entityCollection,h,r,s,r.id),a=!0)}a||(r.merge(s),rV(e,r,s))}var yrt={FlyTo:Trt,Wait:xrt,SoundCue:EY,AnimatedUpdate:EY,TourControl:EY};function brt(e,t,n,i){let o=Dn(t,"name",Re.kml),r=Ss(t,"id"),s=new ZU(o,r),a=Ii(t,"Playlist",Re.gx);if(a){let l=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let h=u[f];if(h.localName){let p=yrt[h.localName];p?p(s,h,l):console.log(`Unknown KML Tour playlist entry type ${h.localName}`)}}}e._kmlTours.push(s)}function EY(e,t){dt(`KML Tour unsupported node ${t.localName}`)}function xrt(e,t){let n=$n(t,"duration",Re.gx);e.addPlaylistEntry(new eV(n))}function Trt(e,t,n){let i=$n(t,"duration",Re.gx),o=Dn(t,"flyToMode",Re.gx),r={kml:{}};H_e(t,r,n),z_e(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new JU(i,o,s);e.addPlaylistEntry(a)}function z_e(e,t,n){let i=Ii(e,"Camera",Re.kml);if(c(i)){let o=$n(i,"longitude",Re.kml)??0,r=$n(i,"latitude",Re.kml)??0,s=$n(i,"altitude",Re.kml)??0,a=$n(i,"heading",Re.kml)??0,l=$n(i,"tilt",Re.kml)??0,u=$n(i,"roll",Re.kml)??0,f=d.fromDegrees(o,r,s,n),h=Xa.fromDegrees(a,l-90,u);t.kml.camera=new XU(f,h)}}function H_e(e,t,n){let i=Ii(e,"LookAt",Re.kml);if(c(i)){let o=$n(i,"longitude",Re.kml)??0,r=$n(i,"latitude",Re.kml)??0,s=$n(i,"altitude",Re.kml)??0,a=$n(i,"heading",Re.kml),l=$n(i,"tilt",Re.kml),u=$n(i,"range",Re.kml)??0;l=O.toRadians(l??0),a=O.toRadians(a??0);let f=new $d(a,l-O.PI_OVER_TWO,u),h=d.fromDegrees(o,r,s,n);t.kml.lookAt=new KU(h,f)}}function Art(e,t,n,i){let o=n.screenOverlayContainer;if(!c(o))return;let r=n.sourceResource,s=n.uriResolver,a=Ii(t,"Icon",Re.kml),l=MY(a,e,r,s,!1);if(!c(l))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=l.url,u.onload=function(){let f=["position: absolute"],h=Ii(t,"screenXY",Re.kml),p=Ii(t,"overlayXY",Re.kml),g=Ii(t,"size",Re.kml),m,y,b,x,A,E;c(g)&&(m=zy(g,"x"),y=zy(g,"y"),b=Ss(g,"xunits"),x=Ss(g,"yunits"),c(m)&&m!==-1&&m!==0&&(b==="fraction"?A=`width: ${Math.floor(m*100)}%`:b==="pixels"&&(A=`width: ${m}px`),f.push(A)),c(y)&&y!==-1&&y!==0&&(x==="fraction"?E=`height: ${Math.floor(y*100)}%`:x==="pixels"&&(E=`height: ${y}px`),f.push(E))),u.style=f.join(";");let S=0,v=u.height;c(p)&&(m=zy(p,"x"),y=zy(p,"y"),b=Ss(p,"xunits"),x=Ss(p,"yunits"),c(m)&&(b==="fraction"?S=m*u.width:(b==="pixels"||b==="insetPixels")&&(S=m)),c(y)&&(x==="fraction"?v=y*u.height:(x==="pixels"||x==="insetPixels")&&(v=y))),c(h)&&(m=zy(h,"x"),y=zy(h,"y"),b=Ss(h,"xunits"),x=Ss(h,"yunits"),c(m)&&(b==="fraction"?A=`left: calc(${Math.floor(m*100)}% - ${S}px)`:b==="pixels"?A=`left: ${m-S}px`:b==="insetPixels"&&(A=`right: ${m-S}px`),f.push(A)),c(y)&&(x==="fraction"?E=`bottom: calc(${Math.floor(y*100)}% - ${v}px)`:x==="pixels"?E=`bottom: ${y-v}px`:x==="insetPixels"&&(E=`top: ${y-v}px`),f.push(E))),u.style=f.join(";")},o.appendChild(u)}function Crt(e,t,n,i){let r=sV(e,t,n).entity,s,a=!1,l=e._ellipsoid,u=tV(Ii(t,"LatLonQuad",Re.gx),l),f=$n(t,"drawOrder",Re.kml);if(c(u))s=RY(),s.hierarchy=new ec(u),s.zIndex=f,r.polygon=s,a=!0;else{s=new Uh,s.zIndex=f,r.rectangle=s;let m=Ii(t,"LatLonBox",Re.kml);if(c(m)){let y=$n(m,"west",Re.kml),b=$n(m,"south",Re.kml),x=$n(m,"east",Re.kml),A=$n(m,"north",Re.kml);c(y)&&(y=O.negativePiToPi(O.toRadians(y))),c(b)&&(b=O.clampToLatitudeRange(O.toRadians(b))),c(x)&&(x=O.negativePiToPi(O.toRadians(x))),c(A)&&(A=O.clampToLatitudeRange(O.toRadians(A))),s.coordinates=new ce(y,b,x,A);let E=$n(m,"rotation",Re.kml);if(c(E)){let S=O.toRadians(E);s.rotation=S,s.stRotation=S}}}let h=Ii(t,"Icon",Re.kml),p=MY(h,e,n.sourceResource,n.uriResolver,!0);if(c(p)){a&&dt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=$n(h,"x",Re.gx),y=$n(h,"y",Re.gx),b=$n(h,"w",Re.gx),x=$n(h,"h",Re.gx);(c(m)||c(y)||c(b)||c(x))&&dt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=mx(t,"color",Re.kml),s.material.transparent=!0}else s.material=mx(t,"color",Re.kml);let g=Dn(t,"altitudeMode",Re.kml);c(g)?g==="absolute"?(s.height=$n(t,"altitude",Re.kml),s.zIndex=void 0):g!=="clampToGround"&&dt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Dn(t,"altitudeMode",Re.gx),g==="relativeToSeaFloor"?(dt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=$n(t,"altitude",Re.kml),s.zIndex=void 0):g==="clampToSeaFloor"?dt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):c(g)&&dt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function G_e(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),dt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var Hy={INTERVAL:0,EXPIRE:1,STOP:2};function iV(e){if(!c(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Ert=new ce,SE=new he,SY=new z,Srt=new d;function NY(e,t,n,i,o,r){function s(u){return u<-O.PI_OVER_TWO?-O.PI_OVER_TWO:u>O.PI_OVER_TWO?O.PI_OVER_TWO:u}function a(u){return u>O.PI?u-O.TWO_PI:u<-O.PI?u+O.TWO_PI:u}let l=hT(e.queryParameters);if(l=l.replace(/%5B/g,"[").replace(/%5D/g,"]"),c(t)&&t._mode!==oe.MORPHING){let u,f;if(o=o??Ert,c(n)&&(SY.x=n.clientWidth*.5,SY.y=n.clientHeight*.5,u=t.pickEllipsoid(SY,r,Srt)),c(u)?f=r.cartesianToCartographic(u,SE):(f=ce.center(o,SE),u=r.cartographicToCartesian(f)),c(i)&&!O.equalsEpsilon(i,1,O.EPSILON9)){let x=o.width*i*.5,A=o.height*i*.5;o=new ce(a(f.longitude-x),s(f.latitude-A),a(f.longitude+x),s(f.latitude+A))}l=l.replace("[bboxWest]",O.toDegrees(o.west).toString()),l=l.replace("[bboxSouth]",O.toDegrees(o.south).toString()),l=l.replace("[bboxEast]",O.toDegrees(o.east).toString()),l=l.replace("[bboxNorth]",O.toDegrees(o.north).toString());let h=O.toDegrees(f.longitude).toString(),p=O.toDegrees(f.latitude).toString();l=l.replace("[lookatLon]",h),l=l.replace("[lookatLat]",p),l=l.replace("[lookatTilt]",O.toDegrees(t.pitch).toString()),l=l.replace("[lookatHeading]",O.toDegrees(t.heading).toString()),l=l.replace("[lookatRange]",d.distance(t.positionWC,u)),l=l.replace("[lookatTerrainLon]",h),l=l.replace("[lookatTerrainLat]",p),l=l.replace("[lookatTerrainAlt]",f.height.toString()),r.cartesianToCartographic(t.positionWC,SE),l=l.replace("[cameraLon]",O.toDegrees(SE.longitude).toString()),l=l.replace("[cameraLat]",O.toDegrees(SE.latitude).toString()),l=l.replace("[cameraAlt]",O.toDegrees(SE.height).toString());let g=t.frustum,m=g.aspectRatio,y="",b="";if(c(m)){let x=O.toDegrees(g.fov);m>1?(y=x,b=x/m):(b=x,y=x*m)}l=l.replace("[horizFov]",y.toString()),l=l.replace("[vertFov]",b.toString())}else l=l.replace("[bboxWest]","-180"),l=l.replace("[bboxSouth]","-90"),l=l.replace("[bboxEast]","180"),l=l.replace("[bboxNorth]","90"),l=l.replace("[lookatLon]",""),l=l.replace("[lookatLat]",""),l=l.replace("[lookatRange]",""),l=l.replace("[lookatTilt]",""),l=l.replace("[lookatHeading]",""),l=l.replace("[lookatTerrainLon]",""),l=l.replace("[lookatTerrainLat]",""),l=l.replace("[lookatTerrainAlt]",""),l=l.replace("[cameraLon]",""),l=l.replace("[cameraLat]",""),l=l.replace("[cameraAlt]",""),l=l.replace("[horizFov]",""),l=l.replace("[vertFov]","");c(n)?(l=l.replace("[horizPixels]",n.clientWidth),l=l.replace("[vertPixels]",n.clientHeight)):(l=l.replace("[horizPixels]",""),l=l.replace("[vertPixels]","")),l=l.replace("[terrainEnabled]","1"),l=l.replace("[clientVersion]","1"),l=l.replace("[kmlVersion]","2.2"),l=l.replace("[clientName]","Cesium"),l=l.replace("[language]","English"),e.setQueryParameters(Ku(l))}function wrt(e,t,n,i){let r=sV(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,l=Ii(t,"Link",Re.kml);if(c(l)||(l=Ii(t,"Url",Re.kml)),c(l)){let u=Dn(l,"href",Re.kml),f,h;if(c(u)){let p=u;if(u=OY(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Dn(l,"viewRefreshMode",Re.kml),f==="onRegion"){dt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}h=Dn(l,"viewBoundScale",Re.kml)??1;let b=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",x=Dn(l,"viewFormat",Re.kml)??b,A=Dn(l,"httpQuery",Re.kml);c(x)&&u.setQueryParameters(Ku(iV(x))),c(A)&&u.setQueryParameters(Ku(iV(A)));let E=e._ellipsoid;NY(u,e.camera,e.canvas,h,e._lastCameraView.bbox,E)}let g={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},m=new la,y=FY(e,m,u,g).then(function(b){let x=e._entityCollection,A=m.values;x.suspendEvents();for(let v=0;v<A.length;v++){let P=A[v];c(P.parent)||(P.parent=r,BY(P)),x.add(P)}x.resumeEvents();let E=Dn(l,"refreshMode",Re.kml),S=$n(l,"refreshInterval",Re.kml)??0;if(E==="onInterval"&&S>0||E==="onExpire"||f==="onStop"){let v=Ii(b,"NetworkLinkControl",Re.kml),P=c(v),M=Q.now(),R={id:jn(),href:u,cookie:{},lastUpdated:M,updating:!1,entity:r,viewBoundScale:h,needsUpdate:!1,cameraUpdateTime:M},L=0;if(P&&(R.cookie=Ku(Dn(v,"cookie",Re.kml)??""),L=$n(v,"minRefreshPeriod",Re.kml)??0),E==="onInterval")P&&(S=Math.max(L,S)),R.refreshMode=Hy.INTERVAL,R.time=S;else if(E==="onExpire"){let B;if(P&&(B=Dn(v,"expires",Re.kml)),c(B))try{let _=Q.fromIso8601(B),w=Q.secondsDifference(_,M);w>0&&w<L&&Q.addSeconds(M,L,_),R.refreshMode=Hy.EXPIRE,R.time=_}catch{dt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else dt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else c(e.camera)?(R.refreshMode=Hy.STOP,R.time=$n(l,"viewRefreshTime",Re.kml)??0):dt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");c(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(b){dt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,b)});i.addPromise(y)}}}function vrt(e,t,n,i){let o=IY[t.localName];return c(o)?o(e,t,n,i):G_e(e,t,n,i)}function DY(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,l=a.localName==="Document"?a:Ii(a,"Document",Re.kml),u=Dn(l,"name",Re.kml);c(u)||(u=ly(i.getUrlComponent())),c(e._name)||(e._name=u);let f=new wu._DeferredLoading(e),h=new la(e);return Promise.all(F_e(e,n,h,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let y=0;y<m.length;y++){let b=m[y];if(c(IY[b.localName])){p=b;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:h,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),vrt(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}function Drt(e,t,n,i,o){let r=tn("ThirdParty/Workers/z-worker-pako.js");mE({workerScripts:{deflate:[r,"./pako_deflate.min.js"],inflate:[r,"./pako_inflate.min.js"]}});let s=new vU(new p_(n));return Promise.resolve(s.getEntries()).then(function(a){let l=[],u={},f;for(let h=0;h<a.length;h++){let p=a[h];p.directory||(/\.kml$/i.test(p.filename)&&(!c(f)||!/\//i.test(p.filename))?(c(f)&&l.push(CY(f,u)),f=p):l.push(CY(p,u)))}return c(f)&&l.push(ert(f,u)),Promise.all(l).then(function(){if(s.close(),!c(u.kml))throw new ae("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),DY(e,t,u.kml,i,u,o)})})}function FY(e,t,n,i){i=i??W.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,l=n;if(typeof n=="string"||n instanceof we){n=we.createIfNeeded(n),l=n.fetchBlob(),o=o??n.clone();let u=e._resourceCredits,f=n.credits;if(c(f)){let h=f.length;for(let p=0;p<h;p++)u.push(f[p])}}else o=o??we.DEFAULT.clone();return o=we.createIfNeeded(o),c(a)&&(a=Rn(a)),Promise.resolve(l).then(function(u){return u instanceof Blob?Qot(u).then(function(f){return f?Drt(e,t,u,o,a):Jot(u).then(function(h){h=O_e(h),h=R_e(h);let p,g;try{p=PY.parseFromString(h,"application/xml")}catch(m){g=m.toString()}if(c(g)||p.body||p.documentElement.tagName==="parsererror"){let m=c(g)?g:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new ae(m)}return DY(e,t,p,o,r,a,s)})}):DY(e,t,u,o,r,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}function wu(e){e=e??W.EMPTY_OBJECT;let t=e.camera,n=e.canvas;this._changed=new pe,this._error=new pe,this._loading=new pe,this._refresh=new pe,this._unsupportedNode=new pe,this._clock=void 0,this._entityCollection=new la(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new Ny,this._networkLinks=new Et,this._entityCluster=new Lf,this.canvas=n,this.camera=t,this._lastCameraView={position:c(t)?d.clone(t.positionWC):void 0,direction:c(t)?d.clone(t.directionWC):void 0,up:c(t)?d.clone(t.upWC):void 0,bbox:c(t)?t.computeViewRectangle():ce.clone(ce.MAX_VALUE)},this._ellipsoid=e.ellipsoid??ie.default;let i=e.credit;typeof i=="string"&&(i=new At(i)),this._credit=i,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}wu.load=function(e,t){return t=t??W.EMPTY_OBJECT,new wu(t).load(e,t)};Object.defineProperties(wu.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},refreshEvent:{get:function(){return this._refresh}},unsupportedNodeEvent:{get:function(){return this._unsupportedNode}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){if(!c(e))throw new C("value must be defined.");this._entityCluster=e}},credit:{get:function(){return this._credit}},kmlTours:{get:function(){return this._kmlTours}}});wu.prototype.load=function(e,t){if(!c(e))throw new C("data is required.");t=t??W.EMPTY_OBJECT,Kr.setLoading(this,!0);let n=this._name;this._name=void 0,this._clampToGround=t.clampToGround??!1;let i=this;return FY(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,l=Q.equals(s,Ge.MINIMUM_VALUE),u=Q.equals(a,Ge.MAXIMUM_VALUE);if(!l||!u){let h;l&&(h=new Date,h.setHours(0,0,0,0),s=Q.fromDate(h)),u&&(h=new Date,h.setHours(24,0,0,0),a=Q.fromDate(h)),o=new pm,o.startTime=s,o.stopTime=a,o.currentTime=Q.clone(s),o.clockRange=$r.LOOP_STOP,o.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(a,s)/60,1),31556900))}let f=!1;return o!==i._clock&&(i._clock=o,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Kr.setLoading(i,!1),i}).catch(function(o){return Kr.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};wu.prototype.destroy=function(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()};function BY(e){let t=e.parent;if(c(t)){let n=t.availability;if(c(n)){let i=e.availability;c(i)?i.intersect(n):e.availability=n}}}function Prt(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=Ii(r,"NetworkLinkControl",Re.kml),l=c(a),u=0;if(l){if(c(Ii(a,"Update",Re.kml))){dt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Ku(Dn(a,"cookie",Re.kml)??""),u=$n(a,"minRefreshPeriod",Re.kml)??0}let f=Q.now(),h=t.refreshMode;if(h===Hy.INTERVAL)c(a)&&(t.time=Math.max(u,t.time));else if(h===Hy.EXPIRE){let M;if(c(a)&&(M=Dn(a,"expires",Re.kml)),c(M))try{let R=Q.fromIso8601(M),L=Q.secondsDifference(R,f);L>0&&L<u&&Q.addSeconds(f,u,R),t.time=R}catch{dt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else dt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,m=n.values;function y(M){g.remove(M);let R=M._children,L=R.length;for(let B=0;B<L;++B)y(R[B])}g.suspendEvents();let b=g.values.slice(),x;for(x=0;x<b.length;++x){let M=b[x];M.parent===p&&(M.parent=void 0,y(M))}for(g.resumeEvents(),g.suspendEvents(),x=0;x<m.length;x++){let M=m[x];c(M.parent)||(M.parent=p,BY(M)),g.add(M)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let A=g.computeAvailability(),E=A.start,S=A.stop,v=Q.equals(E,Ge.MINIMUM_VALUE),P=Q.equals(S,Ge.MAXIMUM_VALUE);if(!v||!P){let M=e._clock;(M.startTime!==E||M.stopTime!==S)&&(M.startTime=E,M.stopTime=S,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var wY=new Et;wu.prototype.update=function(e){let t=this._networkLinks;if(t.length===0)return!0;let n=Q.now(),i=this;wY.removeAll();function o(f){let h=f._children,p=h.length;for(let g=0;g<p;++g){let m=h[g];wY.set(m.id,m),o(m)}}let r=!1,s=this._lastCameraView,a=this.camera;c(a)&&!(a.positionWC.equalsEpsilon(s.position,O.EPSILON7)&&a.directionWC.equalsEpsilon(s.direction,O.EPSILON7)&&a.upWC.equalsEpsilon(s.up,O.EPSILON7))&&(s.position=d.clone(a.positionWC),s.direction=d.clone(a.directionWC),s.up=d.clone(a.upWC),s.bbox=a.computeViewRectangle(),r=!0);let l=new Et,u=!1;return t.values.forEach(function(f){let h=f.entity;if(!wY.contains(h.id)){if(!f.updating){let p=!1;if(f.refreshMode===Hy.INTERVAL?Q.secondsDifference(n,f.lastUpdated)>f.time&&(p=!0):f.refreshMode===Hy.EXPIRE?Q.greaterThan(n,f.time)&&(p=!0):f.refreshMode===Hy.STOP&&(r&&(f.needsUpdate=!0,f.cameraUpdateTime=n),f.needsUpdate&&Q.secondsDifference(n,f.cameraUpdateTime)>=f.time&&(p=!0)),p){o(h),f.updating=!0;let g=new la,m=f.href.clone();m.setQueryParameters(f.cookie);let y=i._ellipsoid??ie.default;NY(m,i.camera,i.canvas,f.viewBoundScale,s.bbox,y),FY(i,g,m,{context:h.id}).then(Prt(i,f,g,l,m)).catch(function(b){let x=`NetworkLink ${f.href} refresh failed: ${b}`;console.log(x),i._error.raiseEvent(i,x)}),u=!0}}l.set(f.id,f)}}),u&&(this._networkLinks=l,this._changed.raiseEvent(this)),!0};function Irt(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}wu._DeferredLoading=Lm;wu._getTimestamp=Ei;var wE=wu;function LP(){C.throwInstantiationError()}LP.prototype.update=C.throwInstantiationError;LP.prototype.getBoundingSphere=C.throwInstantiationError;LP.prototype.isDestroyed=C.throwInstantiationError;LP.prototype.destroy=C.throwInstantiationError;var j_e=LP;var NP=`#ifdef MRT
layout (location = 0) out vec4 out_FragData_0;
layout (location = 1) out vec4 out_FragData_1;
#else
layout (location = 0) out vec4 out_FragColor;
#endif
uniform vec4 u_bgColor;
uniform sampler2D u_depthTexture;
in vec2 v_textureCoordinates;
void main()
{
if (texture(u_depthTexture, v_textureCoordinates).r < 1.0)
{
#ifdef MRT
out_FragData_0 = u_bgColor;
out_FragData_1 = vec4(u_bgColor.a);
#else
out_FragColor = u_bgColor;
#endif
return;
}
discard;
}
`;var aV=`in vec2 v_textureCoordinates;
const float M_PI = 3.141592653589793;
float vdcRadicalInverse(int i)
{
float r;
float base = 2.0;
float value = 0.0;
float invBase = 1.0 / base;
float invBi = invBase;
for (int x = 0; x < 100; x++)
{
if (i <= 0)
{
break;
}
r = mod(float(i), base);
value += r * invBi;
invBi *= invBase;
i = int(float(i) * invBase);
}
return value;
}
vec2 hammersley2D(int i, int N)
{
return vec2(float(i) / float(N), vdcRadicalInverse(i));
}
vec3 importanceSampleGGX(vec2 xi, float alphaRoughness, vec3 N)
{
float alphaRoughnessSquared = alphaRoughness * alphaRoughness;
float phi = 2.0 * M_PI * xi.x;
float cosTheta = sqrt((1.0 - xi.y) / (1.0 + (alphaRoughnessSquared - 1.0) * xi.y));
float sinTheta = sqrt(1.0 - cosTheta * cosTheta);
vec3 H = vec3(sinTheta * cos(phi), sinTheta * sin(phi), cosTheta);
vec3 upVector = abs(N.z) < 0.999 ? vec3(0.0, 0.0, 1.0) : vec3(1.0, 0.0, 0.0);
vec3 tangentX = normalize(cross(upVector, N));
vec3 tangentY = cross(N, tangentX);
return tangentX * H.x + tangentY * H.y + N * H.z;
}
float smithVisibilityGGX(float alphaRoughness, float NdotL, float NdotV)
{
float alphaRoughnessSq = alphaRoughness * alphaRoughness;
float GGXV = NdotL * sqrt(NdotV * NdotV * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
float GGXL = NdotV * sqrt(NdotL * NdotL * (1.0 - alphaRoughnessSq) + alphaRoughnessSq);
float GGX = GGXV + GGXL;
if (GGX > 0.0)
{
return 0.5 / GGX;
}
return 0.0;
}
vec2 integrateBrdf(float roughness, float NdotV)
{
vec3 V = vec3(sqrt(1.0 - NdotV * NdotV), 0.0, NdotV);
float A = 0.0;
float B = 0.0;
const int NumSamples = 1024;
float alphaRoughness = roughness * roughness;
for (int i = 0; i < NumSamples; i++)
{
vec2 xi = hammersley2D(i, NumSamples);
vec3 H = importanceSampleGGX(xi, alphaRoughness, vec3(0.0, 0.0, 1.0));
vec3 L = 2.0 * dot(V, H) * H - V;
float NdotL = clamp(L.z, 0.0, 1.0);
float NdotH = clamp(H.z, 0.0, 1.0);
float VdotH = clamp(dot(V, H), 0.0, 1.0);
if (NdotL > 0.0)
{
float G = smithVisibilityGGX(alphaRoughness, NdotL, NdotV);
float G_Vis = 4.0 * G * VdotH * NdotL / NdotH;
float Fc = pow(1.0 - VdotH, 5.0);
A += (1.0 - Fc) * G_Vis;
B += Fc * G_Vis;
}
}
return vec2(A, B) / float(NumSamples);
}
void main()
{
out_FragColor = vec4(integrateBrdf(v_textureCoordinates.y, v_textureCoordinates.x), 0.0, 1.0);
}
`;var cV=`uniform sampler2D u_noiseTexture;
uniform vec3 u_noiseTextureDimensions;
uniform float u_noiseDetail;
in vec2 v_offset;
in vec3 v_maximumSize;
in vec4 v_color;
in float v_slice;
in float v_brightness;
float wrap(float value, float rangeLength) {
if(value < 0.0) {
float absValue = abs(value);
float modValue = mod(absValue, rangeLength);
return mod(rangeLength - modValue, rangeLength);
}
return mod(value, rangeLength);
}
vec3 wrapVec(vec3 value, float rangeLength) {
return vec3(wrap(value.x, rangeLength),
wrap(value.y, rangeLength),
wrap(value.z, rangeLength));
}
vec2 voxelToUV(vec3 voxelIndex) {
float textureSliceWidth = u_noiseTextureDimensions.x;
float noiseTextureRows = u_noiseTextureDimensions.y;
float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
float textureSliceWidthSquared = textureSliceWidth * textureSliceWidth;
vec2 inverseNoiseTextureDimensions = vec2(noiseTextureRows / textureSliceWidthSquared,
inverseNoiseTextureRows / textureSliceWidth);
vec3 wrappedIndex = wrapVec(voxelIndex, textureSliceWidth);
float column = mod(wrappedIndex.z, textureSliceWidth * inverseNoiseTextureRows);
float row = floor(wrappedIndex.z / textureSliceWidth * noiseTextureRows);
float xPixelCoord = wrappedIndex.x + column * textureSliceWidth;
float yPixelCoord = wrappedIndex.y + row * textureSliceWidth;
return vec2(xPixelCoord, yPixelCoord) * inverseNoiseTextureDimensions;
}
vec4 lerpSamplesX(vec3 voxelIndex, float x) {
vec2 uv0 = voxelToUV(voxelIndex);
vec2 uv1 = voxelToUV(voxelIndex + vec3(1.0, 0.0, 0.0));
vec4 sample0 = texture(u_noiseTexture, uv0);
vec4 sample1 = texture(u_noiseTexture, uv1);
return mix(sample0, sample1, x);
}
vec4 sampleNoiseTexture(vec3 position) {
float textureSliceWidth = u_noiseTextureDimensions.x;
vec3 recenteredPos = position + vec3(textureSliceWidth / 2.0);
vec3 lerpValue = fract(recenteredPos);
vec3 voxelIndex = floor(recenteredPos);
vec4 xLerp00 = lerpSamplesX(voxelIndex, lerpValue.x);
vec4 xLerp01 = lerpSamplesX(voxelIndex + vec3(0.0, 0.0, 1.0), lerpValue.x);
vec4 xLerp10 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 0.0), lerpValue.x);
vec4 xLerp11 = lerpSamplesX(voxelIndex + vec3(0.0, 1.0, 1.0), lerpValue.x);
vec4 yLerp0 = mix(xLerp00, xLerp10, lerpValue.y);
vec4 yLerp1 = mix(xLerp01, xLerp11, lerpValue.y);
return mix(yLerp0, yLerp1, lerpValue.z);
}
bool intersectSphere(vec3 origin, vec3 dir, float slice,
out vec3 point, out vec3 normal) {
float A = dot(dir, dir);
float B = dot(origin, dir);
float C = dot(origin, origin) - 0.25;
float discriminant = (B * B) - (A * C);
if(discriminant < 0.0) {
return false;
}
float root = sqrt(discriminant);
float t = (-B - root) / A;
if(t < 0.0) {
t = (-B + root) / A;
}
point = origin + t * dir;
if(slice >= 0.0) {
point.z = (slice / 2.0) - 0.5;
if(length(point) > 0.5) {
return false;
}
}
normal = normalize(point);
point -= czm_epsilon2 * normal;
return true;
}
bool intersectEllipsoid(vec3 origin, vec3 dir, vec3 center, vec3 scale, float slice,
out vec3 point, out vec3 normal) {
if(scale.x <= 0.01 || scale.y < 0.01 || scale.z < 0.01) {
return false;
}
vec3 o = (origin - center) / scale;
vec3 d = dir / scale;
vec3 p, n;
bool intersected = intersectSphere(o, d, slice, p, n);
if(intersected) {
point = (p * scale) + center;
normal = n;
}
return intersected;
}
vec2 phaseShift2D(vec2 p, vec2 freq) {
return (czm_pi / 2.0) * sin(freq.yx * p.yx);
}
vec2 phaseShift3D(vec3 p, vec2 freq) {
return phaseShift2D(p.xy, freq) + czm_pi * vec2(sin(freq.x * p.z));
}
const float T0 = 0.6;
const float k = 0.1;
const float C0 = 0.8;
const float FX0 = 0.6;
const float FY0 = 0.6;
const int octaves = 5;
float T(vec3 point) {
vec2 sum = vec2(0.0);
float Ci = C0;
vec2 FXY = vec2(FX0, FY0);
vec2 PXY = vec2(0.0);
for(int i = 1; i <= octaves; i++) {
PXY = phaseShift3D(point, FXY);
Ci *= 0.707;
FXY *= 2.0;
vec2 sinTerm = sin(FXY * point.xy + PXY);
sum += Ci * sinTerm + vec2(T0);
}
return k * sum.x * sum.y;
}
const float a = 0.5;
const float t = 0.4;
const float s = 0.25;
float I(float Id, float Is, float It) {
return (1.0 - a) * ((1.0 - t) * ((1.0 - s) * Id + s * Is) + t * It) + a;
}
const vec3 lightDir = normalize(vec3(0.2, -1.0, 0.7));
vec4 drawCloud(vec3 rayOrigin, vec3 rayDir, vec3 cloudCenter, vec3 cloudScale, float cloudSlice,
float brightness) {
vec3 cloudPoint, cloudNormal;
if(!intersectEllipsoid(rayOrigin, rayDir, cloudCenter, cloudScale, cloudSlice,
cloudPoint, cloudNormal)) {
return vec4(0.0);
}
float Id = clamp(dot(cloudNormal, -lightDir), 0.0, 1.0);
float Is = max(pow(dot(-lightDir, -rayDir), 2.0), 0.0);
float It = T(cloudPoint);
float intensity = I(Id, Is, It);
vec3 color = vec3(intensity * clamp(brightness, 0.1, 1.0));
vec4 noise = sampleNoiseTexture(u_noiseDetail * cloudPoint);
float W = noise.x;
float W2 = noise.y;
float W3 = noise.z;
float ndDot = clamp(dot(cloudNormal, -rayDir), 0.0, 1.0);
float TR = pow(ndDot, 3.0) - W;
TR *= 1.3;
float minusDot = 0.5 - ndDot;
TR -= min(minusDot * W2, 0.0);
TR -= 0.8 * (minusDot + 0.25) * W3;
float shading = mix(1.0 - 0.8 * W * W, 1.0, Id * TR);
shading = clamp(shading + 0.2, 0.3, 1.0);
vec3 finalColor = mix(vec3(0.5), shading * color, 1.15);
return vec4(finalColor, clamp(TR, 0.0, 1.0)) * v_color;
}
void main() {
#ifdef DEBUG_BILLBOARDS
out_FragColor = vec4(0.0, 0.5, 0.5, 1.0);
#endif
vec2 coordinate = v_maximumSize.xy * v_offset;
vec3 ellipsoidScale = 0.82 * v_maximumSize;
vec3 ellipsoidCenter = vec3(0.0);
float zOffset = max(ellipsoidScale.z - 10.0, 0.0);
vec3 eye = vec3(0, 0, -10.0 - zOffset);
vec3 rayDir = normalize(vec3(coordinate, 1.0) - eye);
vec3 rayOrigin = eye;
#ifdef DEBUG_ELLIPSOIDS
vec3 point, normal;
if(intersectEllipsoid(rayOrigin, rayDir, ellipsoidCenter, ellipsoidScale, v_slice,
point, normal)) {
out_FragColor = v_brightness * v_color;
}
#else
#ifndef DEBUG_BILLBOARDS
vec4 cloud = drawCloud(rayOrigin, rayDir,
ellipsoidCenter, ellipsoidScale, v_slice, v_brightness);
if(cloud.w < 0.01) {
discard;
}
out_FragColor = cloud;
#endif
#endif
}
`;var lV=`#ifdef INSTANCED
in vec2 direction;
#endif
in vec4 positionHighAndScaleX;
in vec4 positionLowAndScaleY;
in vec4 packedAttribute0;
in vec4 packedAttribute1;
in vec4 color;
out vec2 v_offset;
out vec3 v_maximumSize;
out vec4 v_color;
out float v_slice;
out float v_brightness;
void main() {
vec3 positionHigh = positionHighAndScaleX.xyz;
vec3 positionLow = positionLowAndScaleY.xyz;
vec2 scale = vec2(positionHighAndScaleX.w, positionLowAndScaleY.w);
float show = packedAttribute0.x;
float brightness = packedAttribute0.y;
vec2 coordinates = packedAttribute0.wz;
vec3 maximumSize = packedAttribute1.xyz;
float slice = packedAttribute1.w;
#ifdef INSTANCED
vec2 dir = direction;
#else
vec2 dir = coordinates;
#endif
vec2 offset = dir - vec2(0.5, 0.5);
vec2 scaledOffset = scale * offset;
vec4 p = czm_translateRelativeToEye(positionHigh, positionLow);
vec4 positionEC = czm_modelViewRelativeToEye * p;
positionEC.xy += scaledOffset;
positionEC.xyz *= show;
gl_Position = czm_projection * positionEC;
v_offset = offset;
v_maximumSize = maximumSize;
v_color = color;
v_slice = slice;
v_brightness = brightness;
}
`;var uV=`uniform vec3 u_noiseTextureDimensions;
uniform float u_noiseDetail;
uniform vec3 u_noiseOffset;
in vec2 v_position;
float wrap(float value, float rangeLength) {
if(value < 0.0) {
float absValue = abs(value);
float modValue = mod(absValue, rangeLength);
return mod(rangeLength - modValue, rangeLength);
}
return mod(value, rangeLength);
}
vec3 wrapVec(vec3 value, float rangeLength) {
return vec3(wrap(value.x, rangeLength),
wrap(value.y, rangeLength),
wrap(value.z, rangeLength));
}
vec3 random3(vec3 p) {
float dot1 = dot(p, vec3(127.1, 311.7, 932.8));
float dot2 = dot(p, vec3(269.5, 183.3, 421.4));
return fract(vec3(sin(dot1 - dot2), cos(dot1 * dot2), dot1 * dot2));
}
vec3 getWorleyCellPoint(vec3 centerCell, vec3 offset, float freq) {
float textureSliceWidth = u_noiseTextureDimensions.x;
vec3 cell = centerCell + offset;
cell = wrapVec(cell, textureSliceWidth / u_noiseDetail);
cell += floor(u_noiseOffset / u_noiseDetail);
vec3 p = offset + random3(cell);
return p;
}
float worleyNoise(vec3 p, float freq) {
vec3 centerCell = floor(p * freq);
vec3 pointInCell = fract(p * freq);
float shortestDistance = 1000.0;
for(float z = -1.0; z <= 1.0; z++) {
for(float y = -1.0; y <= 1.0; y++) {
for(float x = -1.0; x <= 1.0; x++) {
vec3 offset = vec3(x, y, z);
vec3 point = getWorleyCellPoint(centerCell, offset, freq);
float distance = length(pointInCell - point);
if(distance < shortestDistance) {
shortestDistance = distance;
}
}
}
}
return shortestDistance;
}
const float MAX_FBM_ITERATIONS = 10.0;
float worleyFBMNoise(vec3 p, float octaves, float scale) {
float noise = 0.0;
float freq = 1.0;
float persistence = 0.625;
for(float i = 0.0; i < MAX_FBM_ITERATIONS; i++) {
if(i >= octaves) {
break;
}
noise += worleyNoise(p * scale, freq * scale) * persistence;
persistence *= 0.5;
freq *= 2.0;
}
return noise;
}
void main() {
float textureSliceWidth = u_noiseTextureDimensions.x;
float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
float x = mod(v_position.x, textureSliceWidth);
float y = mod(v_position.y, textureSliceWidth);
float sliceRow = floor(v_position.y / textureSliceWidth);
float z = floor(v_position.x / textureSliceWidth) + sliceRow * inverseNoiseTextureRows * textureSliceWidth;
vec3 position = vec3(x, y, z);
position /= u_noiseDetail;
float worley0 = clamp(worleyFBMNoise(position, 3.0, 1.0), 0.0, 1.0);
float worley1 = clamp(worleyFBMNoise(position, 3.0, 2.0), 0.0, 1.0);
float worley2 = clamp(worleyFBMNoise(position, 3.0, 3.0), 0.0, 1.0);
out_FragColor = vec4(worley0, worley1, worley2, 1.0);
}
`;var fV=`uniform vec3 u_noiseTextureDimensions;
in vec2 position;
out vec2 v_position;
void main()
{
gl_Position = vec4(position, 0.1, 1.0);
float textureSliceWidth = u_noiseTextureDimensions.x;
float noiseTextureRows = u_noiseTextureDimensions.y;
float inverseNoiseTextureRows = u_noiseTextureDimensions.z;
vec2 transformedPos = (position * 0.5) + vec2(0.5);
transformedPos *= textureSliceWidth;
transformedPos.x *= textureSliceWidth * inverseNoiseTextureRows;
transformedPos.y *= noiseTextureRows;
v_position = transformedPos;
}
`;var dV=`uniform sampler2D u_opaqueDepthTexture;
uniform sampler2D u_translucentDepthTexture;
in vec2 v_textureCoordinates;
void main()
{
float opaqueDepth = texture(u_opaqueDepthTexture, v_textureCoordinates).r;
float translucentDepth = texture(u_translucentDepthTexture, v_textureCoordinates).r;
translucentDepth = czm_branchFreeTernary(translucentDepth > opaqueDepth, 1.0, translucentDepth);
out_FragColor = czm_packDepth(translucentDepth);
}
`;var hV=`uniform sampler2D u_opaque;
uniform sampler2D u_accumulation;
uniform sampler2D u_revealage;
in vec2 v_textureCoordinates;
void main()
{
vec4 opaque = texture(u_opaque, v_textureCoordinates);
vec4 accum = texture(u_accumulation, v_textureCoordinates);
float r = texture(u_revealage, v_textureCoordinates).r;
#ifdef MRT
vec4 transparent = vec4(accum.rgb / clamp(r, 1e-4, 5e4), accum.a);
#else
vec4 transparent = vec4(accum.rgb / clamp(accum.a, 1e-4, 5e4), r);
#endif
out_FragColor = (1.0 - transparent.a) * transparent + transparent.a * opaque;
if (opaque != czm_backgroundColor)
{
out_FragColor.a = 1.0;
}
}
`;var mV=`in vec4 positionEC;
void main()
{
vec3 position;
vec3 direction;
if (czm_orthographicIn3D == 1.0)
{
vec2 uv = (gl_FragCoord.xy - czm_viewport.xy) / czm_viewport.zw;
vec2 minPlane = vec2(czm_frustumPlanes.z, czm_frustumPlanes.y);
vec2 maxPlane = vec2(czm_frustumPlanes.w, czm_frustumPlanes.x);
position = vec3(mix(minPlane, maxPlane, uv), 0.0);
direction = vec3(0.0, 0.0, -1.0);
}
else
{
position = vec3(0.0);
direction = normalize(positionEC.xyz);
}
czm_ray ray = czm_ray(position, direction);
vec3 ellipsoid_center = czm_view[3].xyz;
czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);
if (!czm_isEmpty(intersection))
{
out_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
}
else
{
discard;
}
czm_writeLogDepth();
}
`;var pV=`in vec4 position;
out vec4 positionEC;
void main()
{
positionEC = czm_modelView * position;
gl_Position = czm_projection * positionEC;
czm_vertexLogDepth();
}
`;var FP=`uniform vec3 u_radii;
uniform vec3 u_oneOverEllipsoidRadiiSquared;
in vec3 v_positionEC;
vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)
{
vec3 positionEC = czm_pointAlongRay(ray, intersection);
vec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;
vec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));
vec3 sphericalNormal = normalize(positionMC / u_radii);
vec3 normalMC = geodeticNormal * side;
vec3 normalEC = normalize(czm_normal * normalMC);
vec2 st = czm_ellipsoidTextureCoordinates(sphericalNormal);
vec3 positionToEyeEC = -positionEC;
czm_materialInput materialInput;
materialInput.s = st.s;
materialInput.st = st;
materialInput.str = (positionMC + u_radii) / u_radii;
materialInput.normalEC = normalEC;
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);
materialInput.positionToEyeEC = positionToEyeEC;
czm_material material = czm_getMaterial(materialInput);
#ifdef ONLY_SUN_LIGHTING
return czm_private_phong(normalize(positionToEyeEC), material, czm_sunDirectionEC);
#else
return czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
void main()
{
float maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;
vec3 direction = normalize(v_positionEC);
vec3 ellipsoidCenter = czm_modelView[3].xyz;
float t1 = -1.0;
float t2 = -1.0;
float b = -2.0 * dot(direction, ellipsoidCenter);
float c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;
float discriminant = b * b - 4.0 * c;
if (discriminant >= 0.0) {
t1 = (-b - sqrt(discriminant)) * 0.5;
t2 = (-b + sqrt(discriminant)) * 0.5;
}
if (t1 < 0.0 && t2 < 0.0) {
discard;
}
float t = min(t1, t2);
if (t < 0.0) {
t = 0.0;
}
czm_ray ray = czm_ray(t * direction, direction);
vec3 ellipsoid_inverseRadii = vec3(1.0 / u_radii.x, 1.0 / u_radii.y, 1.0 / u_radii.z);
czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoidCenter, ellipsoid_inverseRadii);
if (czm_isEmpty(intersection))
{
discard;
}
vec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);
vec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);
out_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);
out_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);
#if (defined(WRITE_DEPTH) && (__VERSION__ == 300 || defined(GL_EXT_frag_depth)))
t = (intersection.start != 0.0) ? intersection.start : intersection.stop;
vec3 positionEC = czm_pointAlongRay(ray, t);
vec4 positionCC = czm_projection * vec4(positionEC, 1.0);
#ifdef LOG_DEPTH
czm_writeLogDepth(1.0 + positionCC.w);
#else
float z = positionCC.z / positionCC.w;
float n = czm_depthRange.near;
float f = czm_depthRange.far;
gl_FragDepth = (z * (f - n) + f + n) * 0.5;
#endif
#endif
}
`;var BP=`in vec3 position;
uniform vec3 u_radii;
out vec3 v_positionEC;
void main()
{
vec4 p = vec4(u_radii * position, 1.0);
v_positionEC = (czm_modelView * p).xyz;
gl_Position = czm_modelViewProjection * p;
gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far);
czm_vertexLogDepth();
}
`;/**
* @license
* Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of NVIDIA CORPORATION nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/var _V=`#if (FXAA_QUALITY_PRESET == 10)
#define FXAA_QUALITY_PS 3
#define FXAA_QUALITY_P0 1.5
#define FXAA_QUALITY_P1 3.0
#define FXAA_QUALITY_P2 12.0
#endif
#if (FXAA_QUALITY_PRESET == 11)
#define FXAA_QUALITY_PS 4
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 3.0
#define FXAA_QUALITY_P3 12.0
#endif
#if (FXAA_QUALITY_PRESET == 12)
#define FXAA_QUALITY_PS 5
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 4.0
#define FXAA_QUALITY_P4 12.0
#endif
#if (FXAA_QUALITY_PRESET == 13)
#define FXAA_QUALITY_PS 6
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 4.0
#define FXAA_QUALITY_P5 12.0
#endif
#if (FXAA_QUALITY_PRESET == 14)
#define FXAA_QUALITY_PS 7
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 4.0
#define FXAA_QUALITY_P6 12.0
#endif
#if (FXAA_QUALITY_PRESET == 15)
#define FXAA_QUALITY_PS 8
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 2.0
#define FXAA_QUALITY_P6 4.0
#define FXAA_QUALITY_P7 12.0
#endif
#if (FXAA_QUALITY_PRESET == 20)
#define FXAA_QUALITY_PS 3
#define FXAA_QUALITY_P0 1.5
#define FXAA_QUALITY_P1 2.0
#define FXAA_QUALITY_P2 8.0
#endif
#if (FXAA_QUALITY_PRESET == 21)
#define FXAA_QUALITY_PS 4
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 8.0
#endif
#if (FXAA_QUALITY_PRESET == 22)
#define FXAA_QUALITY_PS 5
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 8.0
#endif
#if (FXAA_QUALITY_PRESET == 23)
#define FXAA_QUALITY_PS 6
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 8.0
#endif
#if (FXAA_QUALITY_PRESET == 24)
#define FXAA_QUALITY_PS 7
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 3.0
#define FXAA_QUALITY_P6 8.0
#endif
#if (FXAA_QUALITY_PRESET == 25)
#define FXAA_QUALITY_PS 8
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 2.0
#define FXAA_QUALITY_P6 4.0
#define FXAA_QUALITY_P7 8.0
#endif
#if (FXAA_QUALITY_PRESET == 26)
#define FXAA_QUALITY_PS 9
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 2.0
#define FXAA_QUALITY_P6 2.0
#define FXAA_QUALITY_P7 4.0
#define FXAA_QUALITY_P8 8.0
#endif
#if (FXAA_QUALITY_PRESET == 27)
#define FXAA_QUALITY_PS 10
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 2.0
#define FXAA_QUALITY_P6 2.0
#define FXAA_QUALITY_P7 2.0
#define FXAA_QUALITY_P8 4.0
#define FXAA_QUALITY_P9 8.0
#endif
#if (FXAA_QUALITY_PRESET == 28)
#define FXAA_QUALITY_PS 11
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 2.0
#define FXAA_QUALITY_P6 2.0
#define FXAA_QUALITY_P7 2.0
#define FXAA_QUALITY_P8 2.0
#define FXAA_QUALITY_P9 4.0
#define FXAA_QUALITY_P10 8.0
#endif
#if (FXAA_QUALITY_PRESET == 29)
#define FXAA_QUALITY_PS 12
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.5
#define FXAA_QUALITY_P2 2.0
#define FXAA_QUALITY_P3 2.0
#define FXAA_QUALITY_P4 2.0
#define FXAA_QUALITY_P5 2.0
#define FXAA_QUALITY_P6 2.0
#define FXAA_QUALITY_P7 2.0
#define FXAA_QUALITY_P8 2.0
#define FXAA_QUALITY_P9 2.0
#define FXAA_QUALITY_P10 4.0
#define FXAA_QUALITY_P11 8.0
#endif
#if (FXAA_QUALITY_PRESET == 39)
#define FXAA_QUALITY_PS 12
#define FXAA_QUALITY_P0 1.0
#define FXAA_QUALITY_P1 1.0
#define FXAA_QUALITY_P2 1.0
#define FXAA_QUALITY_P3 1.0
#define FXAA_QUALITY_P4 1.0
#define FXAA_QUALITY_P5 1.5
#define FXAA_QUALITY_P6 2.0
#define FXAA_QUALITY_P7 2.0
#define FXAA_QUALITY_P8 2.0
#define FXAA_QUALITY_P9 2.0
#define FXAA_QUALITY_P10 4.0
#define FXAA_QUALITY_P11 8.0
#endif
#define FxaaBool bool
#define FxaaFloat float
#define FxaaFloat2 vec2
#define FxaaFloat3 vec3
#define FxaaFloat4 vec4
#define FxaaHalf float
#define FxaaHalf2 vec2
#define FxaaHalf3 vec3
#define FxaaHalf4 vec4
#define FxaaInt2 vec2
#define FxaaTex sampler2D
#define FxaaSat(x) clamp(x, 0.0, 1.0)
#define FxaaTexTop(t, p) texture(t, p)
#define FxaaTexOff(t, p, o, r) texture(t, p + (o * r))
FxaaFloat FxaaLuma(FxaaFloat4 rgba) { return rgba.y; }
FxaaFloat4 FxaaPixelShader(
FxaaFloat2 pos,
FxaaTex tex,
FxaaFloat2 fxaaQualityRcpFrame,
FxaaFloat fxaaQualitySubpix,
FxaaFloat fxaaQualityEdgeThreshold,
FxaaFloat fxaaQualityEdgeThresholdMin
) {
FxaaFloat2 posM;
posM.x = pos.x;
posM.y = pos.y;
FxaaFloat4 rgbyM = FxaaTexTop(tex, posM);
#define lumaM rgbyM.y
FxaaFloat lumaS = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0, 1), fxaaQualityRcpFrame.xy));
FxaaFloat lumaE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 0), fxaaQualityRcpFrame.xy));
FxaaFloat lumaN = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 0,-1), fxaaQualityRcpFrame.xy));
FxaaFloat lumaW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 0), fxaaQualityRcpFrame.xy));
FxaaFloat maxSM = max(lumaS, lumaM);
FxaaFloat minSM = min(lumaS, lumaM);
FxaaFloat maxESM = max(lumaE, maxSM);
FxaaFloat minESM = min(lumaE, minSM);
FxaaFloat maxWN = max(lumaN, lumaW);
FxaaFloat minWN = min(lumaN, lumaW);
FxaaFloat rangeMax = max(maxWN, maxESM);
FxaaFloat rangeMin = min(minWN, minESM);
FxaaFloat rangeMaxScaled = rangeMax * fxaaQualityEdgeThreshold;
FxaaFloat range = rangeMax - rangeMin;
FxaaFloat rangeMaxClamped = max(fxaaQualityEdgeThresholdMin, rangeMaxScaled);
FxaaBool earlyExit = range < rangeMaxClamped;
if(earlyExit)
return rgbyM;
FxaaFloat lumaNW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1,-1), fxaaQualityRcpFrame.xy));
FxaaFloat lumaSE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1, 1), fxaaQualityRcpFrame.xy));
FxaaFloat lumaNE = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2( 1,-1), fxaaQualityRcpFrame.xy));
FxaaFloat lumaSW = FxaaLuma(FxaaTexOff(tex, posM, FxaaInt2(-1, 1), fxaaQualityRcpFrame.xy));
FxaaFloat lumaNS = lumaN + lumaS;
FxaaFloat lumaWE = lumaW + lumaE;
FxaaFloat subpixRcpRange = 1.0/range;
FxaaFloat subpixNSWE = lumaNS + lumaWE;
FxaaFloat edgeHorz1 = (-2.0 * lumaM) + lumaNS;
FxaaFloat edgeVert1 = (-2.0 * lumaM) + lumaWE;
FxaaFloat lumaNESE = lumaNE + lumaSE;
FxaaFloat lumaNWNE = lumaNW + lumaNE;
FxaaFloat edgeHorz2 = (-2.0 * lumaE) + lumaNESE;
FxaaFloat edgeVert2 = (-2.0 * lumaN) + lumaNWNE;
FxaaFloat lumaNWSW = lumaNW + lumaSW;
FxaaFloat lumaSWSE = lumaSW + lumaSE;
FxaaFloat edgeHorz4 = (abs(edgeHorz1) * 2.0) + abs(edgeHorz2);
FxaaFloat edgeVert4 = (abs(edgeVert1) * 2.0) + abs(edgeVert2);
FxaaFloat edgeHorz3 = (-2.0 * lumaW) + lumaNWSW;
FxaaFloat edgeVert3 = (-2.0 * lumaS) + lumaSWSE;
FxaaFloat edgeHorz = abs(edgeHorz3) + edgeHorz4;
FxaaFloat edgeVert = abs(edgeVert3) + edgeVert4;
FxaaFloat subpixNWSWNESE = lumaNWSW + lumaNESE;
FxaaFloat lengthSign = fxaaQualityRcpFrame.x;
FxaaBool horzSpan = edgeHorz >= edgeVert;
FxaaFloat subpixA = subpixNSWE * 2.0 + subpixNWSWNESE;
if(!horzSpan) lumaN = lumaW;
if(!horzSpan) lumaS = lumaE;
if(horzSpan) lengthSign = fxaaQualityRcpFrame.y;
FxaaFloat subpixB = (subpixA * (1.0/12.0)) - lumaM;
FxaaFloat gradientN = lumaN - lumaM;
FxaaFloat gradientS = lumaS - lumaM;
FxaaFloat lumaNN = lumaN + lumaM;
FxaaFloat lumaSS = lumaS + lumaM;
FxaaBool pairN = abs(gradientN) >= abs(gradientS);
FxaaFloat gradient = max(abs(gradientN), abs(gradientS));
if(pairN) lengthSign = -lengthSign;
FxaaFloat subpixC = FxaaSat(abs(subpixB) * subpixRcpRange);
FxaaFloat2 posB;
posB.x = posM.x;
posB.y = posM.y;
FxaaFloat2 offNP;
offNP.x = (!horzSpan) ? 0.0 : fxaaQualityRcpFrame.x;
offNP.y = ( horzSpan) ? 0.0 : fxaaQualityRcpFrame.y;
if(!horzSpan) posB.x += lengthSign * 0.5;
if( horzSpan) posB.y += lengthSign * 0.5;
FxaaFloat2 posN;
posN.x = posB.x - offNP.x * FXAA_QUALITY_P0;
posN.y = posB.y - offNP.y * FXAA_QUALITY_P0;
FxaaFloat2 posP;
posP.x = posB.x + offNP.x * FXAA_QUALITY_P0;
posP.y = posB.y + offNP.y * FXAA_QUALITY_P0;
FxaaFloat subpixD = ((-2.0)*subpixC) + 3.0;
FxaaFloat lumaEndN = FxaaLuma(FxaaTexTop(tex, posN));
FxaaFloat subpixE = subpixC * subpixC;
FxaaFloat lumaEndP = FxaaLuma(FxaaTexTop(tex, posP));
if(!pairN) lumaNN = lumaSS;
FxaaFloat gradientScaled = gradient * 1.0/4.0;
FxaaFloat lumaMM = lumaM - lumaNN * 0.5;
FxaaFloat subpixF = subpixD * subpixE;
FxaaBool lumaMLTZero = lumaMM < 0.0;
lumaEndN -= lumaNN * 0.5;
lumaEndP -= lumaNN * 0.5;
FxaaBool doneN = abs(lumaEndN) >= gradientScaled;
FxaaBool doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P1;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P1;
FxaaBool doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P1;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P1;
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P2;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P2;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P2;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P2;
#if (FXAA_QUALITY_PS > 3)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P3;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P3;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P3;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P3;
#if (FXAA_QUALITY_PS > 4)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P4;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P4;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P4;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P4;
#if (FXAA_QUALITY_PS > 5)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P5;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P5;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P5;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P5;
#if (FXAA_QUALITY_PS > 6)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P6;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P6;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P6;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P6;
#if (FXAA_QUALITY_PS > 7)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P7;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P7;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P7;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P7;
#if (FXAA_QUALITY_PS > 8)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P8;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P8;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P8;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P8;
#if (FXAA_QUALITY_PS > 9)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P9;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P9;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P9;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P9;
#if (FXAA_QUALITY_PS > 10)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P10;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P10;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P10;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P10;
#if (FXAA_QUALITY_PS > 11)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P11;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P11;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P11;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P11;
#if (FXAA_QUALITY_PS > 12)
if(doneNP) {
if(!doneN) lumaEndN = FxaaLuma(FxaaTexTop(tex, posN.xy));
if(!doneP) lumaEndP = FxaaLuma(FxaaTexTop(tex, posP.xy));
if(!doneN) lumaEndN = lumaEndN - lumaNN * 0.5;
if(!doneP) lumaEndP = lumaEndP - lumaNN * 0.5;
doneN = abs(lumaEndN) >= gradientScaled;
doneP = abs(lumaEndP) >= gradientScaled;
if(!doneN) posN.x -= offNP.x * FXAA_QUALITY_P12;
if(!doneN) posN.y -= offNP.y * FXAA_QUALITY_P12;
doneNP = (!doneN) || (!doneP);
if(!doneP) posP.x += offNP.x * FXAA_QUALITY_P12;
if(!doneP) posP.y += offNP.y * FXAA_QUALITY_P12;
}
#endif
}
#endif
}
#endif
}
#endif
}
#endif
}
#endif
}
#endif
}
#endif
}
#endif
}
#endif
}
FxaaFloat dstN = posM.x - posN.x;
FxaaFloat dstP = posP.x - posM.x;
if(!horzSpan) dstN = posM.y - posN.y;
if(!horzSpan) dstP = posP.y - posM.y;
FxaaBool goodSpanN = (lumaEndN < 0.0) != lumaMLTZero;
FxaaFloat spanLength = (dstP + dstN);
FxaaBool goodSpanP = (lumaEndP < 0.0) != lumaMLTZero;
FxaaFloat spanLengthRcp = 1.0/spanLength;
FxaaBool directionN = dstN < dstP;
FxaaFloat dst = min(dstN, dstP);
FxaaBool goodSpan = directionN ? goodSpanN : goodSpanP;
FxaaFloat subpixG = subpixF * subpixF;
FxaaFloat pixelOffset = (dst * (-spanLengthRcp)) + 0.5;
FxaaFloat subpixH = subpixG * fxaaQualitySubpix;
FxaaFloat pixelOffsetGood = goodSpan ? pixelOffset : 0.0;
FxaaFloat pixelOffsetSubpix = max(pixelOffsetGood, subpixH);
if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign;
if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign;
return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM);
}
`;var gV=`uniform vec4 u_initialColor;
#if TEXTURE_UNITS > 0
uniform sampler2D u_dayTextures[TEXTURE_UNITS];
uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];
uniform bool u_dayTextureUseWebMercatorT[TEXTURE_UNITS];
#ifdef APPLY_ALPHA
uniform float u_dayTextureAlpha[TEXTURE_UNITS];
#endif
#ifdef APPLY_DAY_NIGHT_ALPHA
uniform float u_dayTextureNightAlpha[TEXTURE_UNITS];
uniform float u_dayTextureDayAlpha[TEXTURE_UNITS];
#endif
#ifdef APPLY_SPLIT
uniform float u_dayTextureSplit[TEXTURE_UNITS];
#endif
#ifdef APPLY_BRIGHTNESS
uniform float u_dayTextureBrightness[TEXTURE_UNITS];
#endif
#ifdef APPLY_CONTRAST
uniform float u_dayTextureContrast[TEXTURE_UNITS];
#endif
#ifdef APPLY_HUE
uniform float u_dayTextureHue[TEXTURE_UNITS];
#endif
#ifdef APPLY_SATURATION
uniform float u_dayTextureSaturation[TEXTURE_UNITS];
#endif
#ifdef APPLY_GAMMA
uniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];
#endif
#ifdef APPLY_IMAGERY_CUTOUT
uniform vec4 u_dayTextureCutoutRectangles[TEXTURE_UNITS];
#endif
#ifdef APPLY_COLOR_TO_ALPHA
uniform vec4 u_colorsToAlpha[TEXTURE_UNITS];
#endif
uniform vec4 u_dayTextureTexCoordsRectangle[TEXTURE_UNITS];
#endif
#if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL))
uniform sampler2D u_waterMask;
uniform vec4 u_waterMaskTranslationAndScale;
uniform float u_zoomedOutOceanSpecularIntensity;
#endif
#ifdef SHOW_OCEAN_WAVES
uniform sampler2D u_oceanNormalMap;
#endif
#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
uniform vec2 u_lightingFadeDistance;
#endif
#ifdef TILE_LIMIT_RECTANGLE
uniform vec4 u_cartographicLimitRectangle;
#endif
#ifdef GROUND_ATMOSPHERE
uniform vec2 u_nightFadeDistance;
#endif
#ifdef ENABLE_CLIPPING_PLANES
uniform highp sampler2D u_clippingPlanes;
uniform mat4 u_clippingPlanesMatrix;
uniform vec4 u_clippingPlanesEdgeStyle;
#endif
#ifdef ENABLE_CLIPPING_POLYGONS
uniform highp sampler2D u_clippingDistance;
in vec2 v_clippingPosition;
flat in int v_regionIndex;
#endif
#if defined(GROUND_ATMOSPHERE) || defined(FOG) && defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
uniform float u_minimumBrightness;
#endif
#ifdef COLOR_CORRECT
uniform vec3 u_hsbShift;
#endif
#ifdef HIGHLIGHT_FILL_TILE
uniform vec4 u_fillHighlightColor;
#endif
#ifdef TRANSLUCENT
uniform vec4 u_frontFaceAlphaByDistance;
uniform vec4 u_backFaceAlphaByDistance;
uniform vec4 u_translucencyRectangle;
#endif
#ifdef UNDERGROUND_COLOR
uniform vec4 u_undergroundColor;
uniform vec4 u_undergroundColorAlphaByDistance;
#endif
#ifdef ENABLE_VERTEX_LIGHTING
uniform float u_lambertDiffuseMultiplier;
uniform float u_vertexShadowDarkness;
#endif
in vec3 v_positionMC;
in vec3 v_positionEC;
in vec3 v_textureCoordinates;
in vec3 v_normalMC;
in vec3 v_normalEC;
#ifdef APPLY_MATERIAL
in float v_height;
in float v_slope;
in float v_aspect;
#endif
#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
in float v_distance;
#endif
#if defined(GROUND_ATMOSPHERE) || defined(FOG)
in vec3 v_atmosphereRayleighColor;
in vec3 v_atmosphereMieColor;
in float v_atmosphereOpacity;
#endif
#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
float interpolateByDistance(vec4 nearFarScalar, float distance)
{
float startDistance = nearFarScalar.x;
float startValue = nearFarScalar.y;
float endDistance = nearFarScalar.z;
float endValue = nearFarScalar.w;
float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
return mix(startValue, endValue, t);
}
#endif
#if defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT) || defined(APPLY_MATERIAL)
vec4 alphaBlend(vec4 sourceColor, vec4 destinationColor)
{
return sourceColor * vec4(sourceColor.aaa, 1.0) + destinationColor * (1.0 - sourceColor.a);
}
#endif
#ifdef TRANSLUCENT
bool inTranslucencyRectangle()
{
return
v_textureCoordinates.x > u_translucencyRectangle.x &&
v_textureCoordinates.x < u_translucencyRectangle.z &&
v_textureCoordinates.y > u_translucencyRectangle.y &&
v_textureCoordinates.y < u_translucencyRectangle.w;
}
#endif
vec4 sampleAndBlend(
vec4 previousColor,
sampler2D textureToSample,
vec2 tileTextureCoordinates,
vec4 textureCoordinateRectangle,
vec4 textureCoordinateTranslationAndScale,
float textureAlpha,
float textureNightAlpha,
float textureDayAlpha,
float textureBrightness,
float textureContrast,
float textureHue,
float textureSaturation,
float textureOneOverGamma,
float split,
vec4 colorToAlpha,
float nightBlend)
{
vec2 alphaMultiplier = step(textureCoordinateRectangle.st, tileTextureCoordinates);
textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;
alphaMultiplier = step(vec2(0.0), textureCoordinateRectangle.pq - tileTextureCoordinates);
textureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;
#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
textureAlpha *= mix(textureDayAlpha, textureNightAlpha, nightBlend);
#endif
vec2 translation = textureCoordinateTranslationAndScale.xy;
vec2 scale = textureCoordinateTranslationAndScale.zw;
vec2 textureCoordinates = tileTextureCoordinates * scale + translation;
vec4 value = texture(textureToSample, textureCoordinates);
vec3 color = value.rgb;
float alpha = value.a;
#ifdef APPLY_COLOR_TO_ALPHA
vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);
colorDiff.r = czm_maximumComponent(colorDiff);
alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);
#endif
#if !defined(APPLY_GAMMA)
vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));
color = tempColor.rgb;
alpha = tempColor.a;
#else
color = pow(color, vec3(textureOneOverGamma));
#endif
#ifdef APPLY_SPLIT
float splitPosition = czm_splitPosition;
if (split < 0.0 && gl_FragCoord.x > splitPosition) {
alpha = 0.0;
}
else if (split > 0.0 && gl_FragCoord.x < splitPosition) {
alpha = 0.0;
}
#endif
#ifdef APPLY_BRIGHTNESS
color = mix(vec3(0.0), color, textureBrightness);
#endif
#ifdef APPLY_CONTRAST
color = mix(vec3(0.5), color, textureContrast);
#endif
#ifdef APPLY_HUE
color = czm_hue(color, textureHue);
#endif
#ifdef APPLY_SATURATION
color = czm_saturation(color, textureSaturation);
#endif
float sourceAlpha = alpha * textureAlpha;
float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);
outAlpha += sign(outAlpha) - 1.0;
vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;
return vec4(outColor, max(outAlpha, 0.0));
}
vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend);
vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float specularMapValue, float fade);
const float fExposure = 2.0;
vec3 computeEllipsoidPosition()
{
float mpp = czm_metersPerPixel(vec4(0.0, 0.0, -czm_currentFrustum.x, 1.0), 1.0);
vec2 xy = gl_FragCoord.xy / czm_viewport.zw * 2.0 - vec2(1.0);
xy *= czm_viewport.zw * mpp * 0.5;
vec3 direction;
if (czm_orthographicIn3D == 1.0)
{
direction = vec3(0.0, 0.0, -1.0);
}
else
{
direction = normalize(vec3(xy, -czm_currentFrustum.x));
}
czm_ray ray = czm_ray(vec3(0.0), direction);
vec3 ellipsoid_center = czm_view[3].xyz;
czm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid_center, czm_ellipsoidInverseRadii);
vec3 ellipsoidPosition = czm_pointAlongRay(ray, intersection.start);
return (czm_inverseView * vec4(ellipsoidPosition, 1.0)).xyz;
}
void main()
{
#ifdef TILE_LIMIT_RECTANGLE
if (v_textureCoordinates.x < u_cartographicLimitRectangle.x || u_cartographicLimitRectangle.z < v_textureCoordinates.x ||
v_textureCoordinates.y < u_cartographicLimitRectangle.y || u_cartographicLimitRectangle.w < v_textureCoordinates.y)
{
discard;
}
#endif
#ifdef ENABLE_CLIPPING_PLANES
float clipDistance = clip(gl_FragCoord, u_clippingPlanes, u_clippingPlanesMatrix);
#endif
#if defined(SHOW_REFLECTIVE_OCEAN) || defined(ENABLE_DAYNIGHT_SHADING) || defined(HDR)
vec3 normalMC = czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));
vec3 normalEC = czm_normal3D * normalMC;
#endif
#if defined(APPLY_DAY_NIGHT_ALPHA) && defined(ENABLE_DAYNIGHT_SHADING)
float nightBlend = 1.0 - clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0, 0.0, 1.0);
#else
float nightBlend = 0.0;
#endif
vec4 color = computeDayColor(u_initialColor, clamp(v_textureCoordinates, 0.0, 1.0), nightBlend);
#ifdef SHOW_TILE_BOUNDARIES
if (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||
v_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))
{
color = vec4(1.0, 0.0, 0.0, 1.0);
}
#endif
#if defined(ENABLE_DAYNIGHT_SHADING) || defined(GROUND_ATMOSPHERE)
float cameraDist;
if (czm_sceneMode == czm_sceneMode2D)
{
cameraDist = max(czm_frustumPlanes.x - czm_frustumPlanes.y, czm_frustumPlanes.w - czm_frustumPlanes.z) * 0.5;
}
else if (czm_sceneMode == czm_sceneModeColumbusView)
{
cameraDist = -czm_view[3].z;
}
else
{
cameraDist = length(czm_view[3]);
}
float fadeOutDist = u_lightingFadeDistance.x;
float fadeInDist = u_lightingFadeDistance.y;
if (czm_sceneMode != czm_sceneMode3D) {
vec3 radii = czm_ellipsoidRadii;
float maxRadii = max(radii.x, max(radii.y, radii.z));
fadeOutDist -= maxRadii;
fadeInDist -= maxRadii;
}
float fade = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.0, 1.0);
#else
float fade = 0.0;
#endif
#if defined(HAS_WATER_MASK) && (defined(SHOW_REFLECTIVE_OCEAN) || defined(APPLY_MATERIAL))
vec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;
vec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;
vec2 waterMaskTextureCoordinates = v_textureCoordinates.xy * waterMaskScale + waterMaskTranslation;
waterMaskTextureCoordinates.y = 1.0 - waterMaskTextureCoordinates.y;
float mask = texture(u_waterMask, waterMaskTextureCoordinates).r;
#ifdef SHOW_REFLECTIVE_OCEAN
if (mask > 0.0)
{
mat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);
vec2 ellipsoidTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC);
vec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidTextureCoordinates(normalMC.zyx);
vec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));
color = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, color, mask, fade);
}
#endif
#endif
#ifdef APPLY_MATERIAL
czm_materialInput materialInput;
materialInput.st = v_textureCoordinates.st;
materialInput.normalEC = normalize(v_normalEC);
materialInput.positionToEyeEC = -v_positionEC;
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalize(v_normalEC));
materialInput.slope = v_slope;
materialInput.height = v_height;
materialInput.aspect = v_aspect;
#ifdef HAS_WATER_MASK
materialInput.waterMask = mask;
#endif
czm_material material = czm_getMaterial(materialInput);
vec4 materialColor = vec4(material.diffuse, material.alpha);
color = alphaBlend(materialColor, color);
#endif
#ifdef ENABLE_VERTEX_LIGHTING
float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalize(v_normalEC)) * u_lambertDiffuseMultiplier + u_vertexShadowDarkness, 0.0, 1.0);
vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
#elif defined(ENABLE_DAYNIGHT_SHADING)
float diffuseIntensity = clamp(czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * 5.0 + 0.3, 0.0, 1.0);
diffuseIntensity = mix(1.0, diffuseIntensity, fade);
vec4 finalColor = vec4(color.rgb * czm_lightColor * diffuseIntensity, color.a);
#else
vec4 finalColor = color;
#endif
#ifdef ENABLE_CLIPPING_PLANES
vec4 clippingPlanesEdgeColor = vec4(1.0);
clippingPlanesEdgeColor.rgb = u_clippingPlanesEdgeStyle.rgb;
float clippingPlanesEdgeWidth = u_clippingPlanesEdgeStyle.a;
if (clipDistance < clippingPlanesEdgeWidth)
{
finalColor = clippingPlanesEdgeColor;
}
#endif
#ifdef ENABLE_CLIPPING_POLYGONS
vec2 clippingPosition = v_clippingPosition;
int regionIndex = v_regionIndex;
clipPolygons(u_clippingDistance, CLIPPING_POLYGON_REGIONS_LENGTH, clippingPosition, regionIndex);
#endif
#ifdef HIGHLIGHT_FILL_TILE
finalColor = vec4(mix(finalColor.rgb, u_fillHighlightColor.rgb, u_fillHighlightColor.a), finalColor.a);
#endif
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
vec3 atmosphereLightDirection = czm_sunDirectionWC;
#else
vec3 atmosphereLightDirection = czm_lightDirectionWC;
#endif
#if defined(GROUND_ATMOSPHERE) || defined(FOG)
if (!czm_backFacing())
{
bool dynamicLighting = false;
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
dynamicLighting = true;
#endif
vec3 rayleighColor;
vec3 mieColor;
float opacity;
vec3 positionWC;
vec3 lightDirection;
#ifdef PER_FRAGMENT_GROUND_ATMOSPHERE
positionWC = computeEllipsoidPosition();
lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
computeAtmosphereScattering(
positionWC,
lightDirection,
rayleighColor,
mieColor,
opacity
);
#else
positionWC = v_positionMC;
lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(positionWC));
rayleighColor = v_atmosphereRayleighColor;
mieColor = v_atmosphereMieColor;
opacity = v_atmosphereOpacity;
#endif
#ifdef COLOR_CORRECT
const bool ignoreBlackPixels = true;
rayleighColor = czm_applyHSBShift(rayleighColor, u_hsbShift, ignoreBlackPixels);
mieColor = czm_applyHSBShift(mieColor, u_hsbShift, ignoreBlackPixels);
#endif
vec4 groundAtmosphereColor = computeAtmosphereColor(positionWC, lightDirection, rayleighColor, mieColor, opacity);
#ifdef FOG
vec3 fogColor = groundAtmosphereColor.rgb;
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
float darken = clamp(dot(normalize(czm_viewerPositionWC), atmosphereLightDirection), u_minimumBrightness, 1.0);
fogColor *= darken;
#endif
#ifndef HDR
fogColor.rgb = czm_pbrNeutralTonemapping(fogColor.rgb);
fogColor.rgb = czm_inverseGamma(fogColor.rgb);
#endif
finalColor = vec4(czm_fog(v_distance, finalColor.rgb, fogColor.rgb, czm_fogVisualDensityScalar), finalColor.a);
#else
const float transmittanceModifier = 0.5;
float transmittance = transmittanceModifier + clamp(1.0 - groundAtmosphereColor.a, 0.0, 1.0);
vec3 finalAtmosphereColor = finalColor.rgb + groundAtmosphereColor.rgb * transmittance;
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_VERTEX_LIGHTING) || defined(ENABLE_DAYNIGHT_SHADING))
float fadeInDist = u_nightFadeDistance.x;
float fadeOutDist = u_nightFadeDistance.y;
float sunlitAtmosphereIntensity = clamp((cameraDist - fadeOutDist) / (fadeInDist - fadeOutDist), 0.05, 1.0);
float darken = clamp(dot(normalize(positionWC), atmosphereLightDirection), 0.0, 1.0);
vec3 darkenendGroundAtmosphereColor = mix(groundAtmosphereColor.rgb, finalAtmosphereColor.rgb, darken);
finalAtmosphereColor = mix(darkenendGroundAtmosphereColor, finalAtmosphereColor, sunlitAtmosphereIntensity);
#endif
#ifndef HDR
finalAtmosphereColor.rgb = vec3(1.0) - exp(-fExposure * finalAtmosphereColor.rgb);
#else
finalAtmosphereColor.rgb = czm_saturation(finalAtmosphereColor.rgb, 1.6);
#endif
finalColor.rgb = mix(finalColor.rgb, finalAtmosphereColor.rgb, fade);
#endif
}
#endif
#ifdef UNDERGROUND_COLOR
if (czm_backFacing())
{
float distanceFromEllipsoid = max(czm_eyeHeight, 0.0);
float distance = max(v_distance - distanceFromEllipsoid, 0.0);
float blendAmount = interpolateByDistance(u_undergroundColorAlphaByDistance, distance);
vec4 undergroundColor = vec4(u_undergroundColor.rgb, u_undergroundColor.a * blendAmount);
finalColor = alphaBlend(undergroundColor, finalColor);
}
#endif
#ifdef TRANSLUCENT
if (inTranslucencyRectangle())
{
vec4 alphaByDistance = gl_FrontFacing ? u_frontFaceAlphaByDistance : u_backFaceAlphaByDistance;
finalColor.a *= interpolateByDistance(alphaByDistance, v_distance);
}
#endif
out_FragColor = finalColor;
}
#ifdef SHOW_REFLECTIVE_OCEAN
float waveFade(float edge0, float edge1, float x)
{
float y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
return pow(1.0 - y, 5.0);
}
float linearFade(float edge0, float edge1, float x)
{
return clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
}
const float oceanFrequencyLowAltitude = 825000.0;
const float oceanAnimationSpeedLowAltitude = 0.004;
const float oceanOneOverAmplitudeLowAltitude = 1.0 / 2.0;
const float oceanSpecularIntensity = 0.5;
const float oceanFrequencyHighAltitude = 125000.0;
const float oceanAnimationSpeedHighAltitude = 0.008;
const float oceanOneOverAmplitudeHighAltitude = 1.0 / 2.0;
vec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec4 imageryColor, float maskValue, float fade)
{
vec3 positionToEyeEC = -positionEyeCoordinates;
float positionToEyeECLength = length(positionToEyeEC);
vec3 normalizedPositionToEyeEC = normalize(normalize(positionToEyeEC));
float waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);
#ifdef SHOW_OCEAN_WAVES
float time = czm_frameNumber * oceanAnimationSpeedHighAltitude;
vec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyHighAltitude, time, 0.0);
vec3 normalTangentSpaceHighAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeHighAltitude);
time = czm_frameNumber * oceanAnimationSpeedLowAltitude;
noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequencyLowAltitude, time, 0.0);
vec3 normalTangentSpaceLowAltitude = vec3(noise.xy, noise.z * oceanOneOverAmplitudeLowAltitude);
float highAltitudeFade = linearFade(0.0, 60000.0, positionToEyeECLength);
float lowAltitudeFade = 1.0 - linearFade(20000.0, 60000.0, positionToEyeECLength);
vec3 normalTangentSpace =
(highAltitudeFade * normalTangentSpaceHighAltitude) +
(lowAltitudeFade * normalTangentSpaceLowAltitude);
normalTangentSpace = normalize(normalTangentSpace);
normalTangentSpace.xy *= waveIntensity;
normalTangentSpace = normalize(normalTangentSpace);
#else
vec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);
#endif
vec3 normalEC = enuToEye * normalTangentSpace;
const vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);
float diffuseIntensity = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC) * maskValue;
vec3 diffuseHighlight = waveHighlightColor * diffuseIntensity * (1.0 - fade);
#ifdef SHOW_OCEAN_WAVES
float tsPerturbationRatio = normalTangentSpace.z;
vec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);
#else
vec3 nonDiffuseHighlight = vec3(0.0);
#endif
float specularIntensity = czm_getSpecular(czm_lightDirectionEC, normalizedPositionToEyeEC, normalEC, 10.0);
float surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), maskValue);
float specular = specularIntensity * surfaceReflectance;
#ifdef HDR
specular *= 1.4;
float e = 0.2;
float d = 3.3;
float c = 1.7;
vec3 color = imageryColor.rgb + (c * (vec3(e) + imageryColor.rgb * d) * (diffuseHighlight + nonDiffuseHighlight + specular));
#else
vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specular;
#endif
return vec4(color, imageryColor.a);
}
#endif // #ifdef SHOW_REFLECTIVE_OCEAN
`;var yV=`#ifdef QUANTIZATION_BITS12
in vec4 compressed0;
in float compressed1;
#else
in vec4 position3DAndHeight;
in vec4 textureCoordAndEncodedNormals;
#endif
#ifdef GEODETIC_SURFACE_NORMALS
in vec3 geodeticSurfaceNormal;
#endif
#ifdef EXAGGERATION
uniform vec2 u_verticalExaggerationAndRelativeHeight;
#endif
uniform vec3 u_center3D;
uniform mat4 u_modifiedModelView;
uniform mat4 u_modifiedModelViewProjection;
uniform vec4 u_tileRectangle;
uniform vec2 u_southAndNorthLatitude;
uniform vec2 u_southMercatorYAndOneOverHeight;
out vec3 v_positionMC;
out vec3 v_positionEC;
out vec3 v_textureCoordinates;
out vec3 v_normalMC;
out vec3 v_normalEC;
#ifdef APPLY_MATERIAL
out float v_slope;
out float v_aspect;
out float v_height;
#endif
#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
out float v_distance;
#endif
#if defined(FOG) || defined(GROUND_ATMOSPHERE)
out vec3 v_atmosphereRayleighColor;
out vec3 v_atmosphereMieColor;
out float v_atmosphereOpacity;
#endif
#ifdef ENABLE_CLIPPING_POLYGONS
uniform highp sampler2D u_clippingExtents;
out vec2 v_clippingPosition;
flat out int v_regionIndex;
#endif
vec4 getPosition(vec3 position, float height, vec2 textureCoordinates);
float get2DYPositionFraction(vec2 textureCoordinates);
vec4 getPosition3DMode(vec3 position, float height, vec2 textureCoordinates)
{
return u_modifiedModelViewProjection * vec4(position, 1.0);
}
float get2DMercatorYPositionFraction(vec2 textureCoordinates)
{
const float maxTileWidth = 0.003068;
float positionFraction = textureCoordinates.y;
float southLatitude = u_southAndNorthLatitude.x;
float northLatitude = u_southAndNorthLatitude.y;
if (northLatitude - southLatitude > maxTileWidth)
{
float southMercatorY = u_southMercatorYAndOneOverHeight.x;
float oneOverMercatorHeight = u_southMercatorYAndOneOverHeight.y;
float currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);
currentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);
positionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorY, oneOverMercatorHeight);
}
return positionFraction;
}
float get2DGeographicYPositionFraction(vec2 textureCoordinates)
{
return textureCoordinates.y;
}
vec4 getPositionPlanarEarth(vec3 position, float height, vec2 textureCoordinates)
{
float yPositionFraction = get2DYPositionFraction(textureCoordinates);
vec4 rtcPosition2D = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
return u_modifiedModelViewProjection * rtcPosition2D;
}
vec4 getPosition2DMode(vec3 position, float height, vec2 textureCoordinates)
{
return getPositionPlanarEarth(position, 0.0, textureCoordinates);
}
vec4 getPositionColumbusViewMode(vec3 position, float height, vec2 textureCoordinates)
{
return getPositionPlanarEarth(position, height, textureCoordinates);
}
vec4 getPositionMorphingMode(vec3 position, float height, vec2 textureCoordinates)
{
vec3 position3DWC = position + u_center3D;
float yPositionFraction = get2DYPositionFraction(textureCoordinates);
vec4 position2DWC = vec4(height, mix(u_tileRectangle.st, u_tileRectangle.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);
vec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);
return czm_modelViewProjection * morphPosition;
}
#ifdef QUANTIZATION_BITS12
uniform vec2 u_minMaxHeight;
uniform mat4 u_scaleAndBias;
#endif
void main()
{
#ifdef QUANTIZATION_BITS12
vec2 xy = czm_decompressTextureCoordinates(compressed0.x);
vec2 zh = czm_decompressTextureCoordinates(compressed0.y);
vec3 position = vec3(xy, zh.x);
float height = zh.y;
vec2 textureCoordinates = czm_decompressTextureCoordinates(compressed0.z);
height = height * (u_minMaxHeight.y - u_minMaxHeight.x) + u_minMaxHeight.x;
position = (u_scaleAndBias * vec4(position, 1.0)).xyz;
#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)) && defined(INCLUDE_WEB_MERCATOR_Y) || defined(APPLY_MATERIAL)
float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
float encodedNormal = compressed1;
#elif defined(INCLUDE_WEB_MERCATOR_Y)
float webMercatorT = czm_decompressTextureCoordinates(compressed0.w).x;
float encodedNormal = 0.0;
#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL)
float webMercatorT = textureCoordinates.y;
float encodedNormal = compressed0.w;
#else
float webMercatorT = textureCoordinates.y;
float encodedNormal = 0.0;
#endif
#else
vec3 position = position3DAndHeight.xyz;
float height = position3DAndHeight.w;
vec2 textureCoordinates = textureCoordAndEncodedNormals.xy;
#if (defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)) && defined(INCLUDE_WEB_MERCATOR_Y)
float webMercatorT = textureCoordAndEncodedNormals.z;
float encodedNormal = textureCoordAndEncodedNormals.w;
#elif defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
float webMercatorT = textureCoordinates.y;
float encodedNormal = textureCoordAndEncodedNormals.z;
#elif defined(INCLUDE_WEB_MERCATOR_Y)
float webMercatorT = textureCoordAndEncodedNormals.z;
float encodedNormal = 0.0;
#else
float webMercatorT = textureCoordinates.y;
float encodedNormal = 0.0;
#endif
#endif
vec3 position3DWC = position + u_center3D;
#ifdef GEODETIC_SURFACE_NORMALS
vec3 ellipsoidNormal = geodeticSurfaceNormal;
#else
vec3 ellipsoidNormal = normalize(position3DWC);
#endif
#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
float exaggeration = u_verticalExaggerationAndRelativeHeight.x;
float relativeHeight = u_verticalExaggerationAndRelativeHeight.y;
float newHeight = (height - relativeHeight) * exaggeration + relativeHeight;
float minRadius = min(min(czm_ellipsoidRadii.x, czm_ellipsoidRadii.y), czm_ellipsoidRadii.z);
newHeight = max(newHeight, -minRadius);
vec3 offset = ellipsoidNormal * (newHeight - height);
position += offset;
position3DWC += offset;
height = newHeight;
#endif
gl_Position = getPosition(position, height, textureCoordinates);
v_positionEC = (u_modifiedModelView * vec4(position, 1.0)).xyz;
v_positionMC = position3DWC;
v_textureCoordinates = vec3(textureCoordinates, webMercatorT);
#if defined(ENABLE_VERTEX_LIGHTING) || defined(GENERATE_POSITION_AND_NORMAL) || defined(APPLY_MATERIAL)
vec3 normalMC = czm_octDecode(encodedNormal);
#if defined(EXAGGERATION) && defined(GEODETIC_SURFACE_NORMALS)
vec3 projection = dot(normalMC, ellipsoidNormal) * ellipsoidNormal;
vec3 rejection = normalMC - projection;
normalMC = normalize(projection + rejection * exaggeration);
#endif
v_normalMC = normalMC;
v_normalEC = czm_normal3D * v_normalMC;
#endif
#ifdef ENABLE_CLIPPING_POLYGONS
vec2 sphericalLatLong = czm_approximateSphericalCoordinates(position3DWC);
sphericalLatLong.y = czm_branchFreeTernary(sphericalLatLong.y < czm_pi, sphericalLatLong.y, sphericalLatLong.y - czm_twoPi);
vec2 minDistance = vec2(czm_infinity);
v_clippingPosition = vec2(czm_infinity);
v_regionIndex = -1;
for (int regionIndex = 0; regionIndex < CLIPPING_POLYGON_REGIONS_LENGTH; regionIndex++) {
vec4 extents = unpackClippingExtents(u_clippingExtents, regionIndex);
vec2 rectUv = (sphericalLatLong.yx - extents.yx) * extents.wz;
vec2 clamped = clamp(rectUv, vec2(0.0), vec2(1.0));
vec2 distance = abs(rectUv - clamped) * extents.wz;
float threshold = 0.01;
if (minDistance.x > distance.x || minDistance.y > distance.y) {
minDistance = distance;
v_clippingPosition = rectUv;
if (rectUv.x > threshold && rectUv.y > threshold && rectUv.x < 1.0 - threshold && rectUv.y < 1.0 - threshold) {
v_regionIndex = regionIndex;
}
}
}
#endif
#if defined(FOG) || (defined(GROUND_ATMOSPHERE) && !defined(PER_FRAGMENT_GROUND_ATMOSPHERE))
bool dynamicLighting = false;
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING) && (defined(ENABLE_DAYNIGHT_SHADING) || defined(ENABLE_VERTEX_LIGHTING))
dynamicLighting = true;
#endif
#if defined(DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN)
vec3 atmosphereLightDirection = czm_sunDirectionWC;
#else
vec3 atmosphereLightDirection = czm_lightDirectionWC;
#endif
vec3 lightDirection = czm_branchFreeTernary(dynamicLighting, atmosphereLightDirection, normalize(position3DWC));
computeAtmosphereScattering(
position3DWC,
lightDirection,
v_atmosphereRayleighColor,
v_atmosphereMieColor,
v_atmosphereOpacity
);
#endif
#if defined(FOG) || defined(GROUND_ATMOSPHERE) || defined(UNDERGROUND_COLOR) || defined(TRANSLUCENT)
v_distance = length((czm_modelView3D * vec4(position3DWC, 1.0)).xyz);
#endif
#ifdef APPLY_MATERIAL
float northPoleZ = czm_ellipsoidRadii.z;
vec3 northPolePositionMC = vec3(0.0, 0.0, northPoleZ);
vec3 vectorEastMC = normalize(cross(northPolePositionMC - v_positionMC, ellipsoidNormal));
float dotProd = abs(dot(ellipsoidNormal, v_normalMC));
v_slope = acos(dotProd);
vec3 normalRejected = ellipsoidNormal * dotProd;
vec3 normalProjected = v_normalMC - normalRejected;
vec3 aspectVector = normalize(normalProjected);
v_aspect = acos(dot(aspectVector, vectorEastMC));
float determ = dot(cross(vectorEastMC, aspectVector), ellipsoidNormal);
v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect);
v_height = height;
#endif
}
`;var kP=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) {
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
float atmosphereInnerRadius = length(positionWC);
computeScattering(
primaryRay,
length(cameraToPositionWC),
lightDirection,
atmosphereInnerRadius,
rayleighColor,
mieColor,
opacity
);
}
`;var bV=`uniform sampler2D u_texture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = texture(u_texture, v_textureCoordinates);
}
`;var xV=`in vec4 position;
in float webMercatorT;
uniform vec2 u_textureDimensions;
out vec2 v_textureCoordinates;
void main()
{
v_textureCoordinates = vec2(position.x, webMercatorT);
gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));
}
`;var UP=`float interpolateByDistance(vec4 nearFarScalar, float distance)
{
float startDistance = nearFarScalar.x;
float startValue = nearFarScalar.y;
float endDistance = nearFarScalar.z;
float endValue = nearFarScalar.w;
float t = clamp((distance - startDistance) / (endDistance - startDistance), 0.0, 1.0);
return mix(startValue, endValue, t);
}
void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity, out float underTranslucentGlobe)
{
float ellipsoidRadiiDifference = czm_ellipsoidRadii.x - czm_ellipsoidRadii.z;
float distanceAdjustMin = czm_ellipsoidRadii.x / 4.0;
float distanceAdjustMax = czm_ellipsoidRadii.x;
float distanceAdjustModifier = ellipsoidRadiiDifference / 2.0;
float distanceAdjust = distanceAdjustModifier * clamp((czm_eyeHeight - distanceAdjustMin) / (distanceAdjustMax - distanceAdjustMin), 0.0, 1.0);
float radiusAdjust = (ellipsoidRadiiDifference / 4.0) + distanceAdjust;
float atmosphereInnerRadius = (length(czm_viewerPositionWC) - czm_eyeHeight) - radiusAdjust;
vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC;
vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC);
czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection);
underTranslucentGlobe = 0.0;
#if defined(GLOBE_TRANSLUCENT)
czm_raySegment primaryRayEarthIntersect = czm_raySphereIntersectionInterval(primaryRay, vec3(0.0), atmosphereInnerRadius + radiusAdjust);
if (primaryRayEarthIntersect.start > 0.0 && primaryRayEarthIntersect.stop > 0.0) {
vec3 direction = normalize(positionWC);
czm_ray ellipsoidRay = czm_ray(positionWC, -direction);
czm_raySegment ellipsoidIntersection = czm_rayEllipsoidIntersectionInterval(ellipsoidRay, vec3(0.0), czm_ellipsoidInverseRadii);
vec3 onEarth = positionWC - (direction * ellipsoidIntersection.start);
float angle = dot(normalize(czm_viewerPositionWC), normalize(onEarth));
opacity = interpolateByDistance(vec4(0.0, 1.0, czm_ellipsoidRadii.x, 0.0), length(czm_viewerPositionWC - onEarth));
vec3 horizonColor = vec3(0.1, 0.2, 0.3);
vec3 nearColor = vec3(0.0);
rayleighColor = mix(nearColor, horizonColor, exp(-angle) * opacity);
underTranslucentGlobe = 1.0;
return;
}
#endif
computeScattering(
primaryRay,
length(cameraToPositionWC),
lightDirection,
atmosphereInnerRadius,
rayleighColor,
mieColor,
opacity
);
float cameraHeight = czm_eyeHeight + atmosphereInnerRadius;
float atmosphereOuterRadius = atmosphereInnerRadius + ATMOSPHERE_THICKNESS;
opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius - atmosphereInnerRadius), 0.0, 1.0);
float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0;
opacity *= pow(nightAlpha, 0.5);
}
`;var TV=`in vec3 v_outerPositionWC;
uniform vec3 u_hsbShift;
#ifndef PER_FRAGMENT_ATMOSPHERE
in vec3 v_mieColor;
in vec3 v_rayleighColor;
in float v_opacity;
in float v_translucent;
#endif
void main (void)
{
float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_outerPositionWC, lightEnum);
vec3 mieColor;
vec3 rayleighColor;
float opacity;
float translucent;
#ifdef PER_FRAGMENT_ATMOSPHERE
computeAtmosphereScattering(
v_outerPositionWC,
lightDirection,
rayleighColor,
mieColor,
opacity,
translucent
);
#else
mieColor = v_mieColor;
rayleighColor = v_rayleighColor;
opacity = v_opacity;
translucent = v_translucent;
#endif
vec4 color = computeAtmosphereColor(v_outerPositionWC, lightDirection, rayleighColor, mieColor, opacity);
#ifndef HDR
color.rgb = czm_pbrNeutralTonemapping(color.rgb);
color.rgb = czm_inverseGamma(color.rgb);
#endif
#ifdef COLOR_CORRECT
const bool ignoreBlackPixels = true;
color.rgb = czm_applyHSBShift(color.rgb, u_hsbShift, ignoreBlackPixels);
#endif
if (translucent == 0.0) {
color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime);
}
out_FragColor = color;
}
`;var AV=`in vec4 position;
out vec3 v_outerPositionWC;
#ifndef PER_FRAGMENT_ATMOSPHERE
out vec3 v_mieColor;
out vec3 v_rayleighColor;
out float v_opacity;
out float v_translucent;
#endif
void main(void)
{
vec4 positionWC = czm_model * position;
float lightEnum = u_radiiAndDynamicAtmosphereColor.z;
vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(positionWC.xyz, lightEnum);
#ifndef PER_FRAGMENT_ATMOSPHERE
computeAtmosphereScattering(
positionWC.xyz,
lightDirection,
v_rayleighColor,
v_mieColor,
v_opacity,
v_translucent
);
#endif
v_outerPositionWC = positionWC.xyz;
gl_Position = czm_modelViewProjection * position;
}
`;var CV=`uniform samplerCube u_cubeMap;
in vec3 v_texCoord;
void main()
{
vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord));
out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime);
}
`;var EV=`in vec3 position;
out vec3 v_texCoord;
void main()
{
vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));
gl_Position = czm_projection * vec4(p, 1.0);
v_texCoord = position.xyz;
}
`;var SV=`uniform sampler2D u_texture;
in vec2 v_textureCoordinates;
void main()
{
vec4 color = texture(u_texture, v_textureCoordinates);
out_FragColor = czm_gammaCorrect(color);
}
`;var wV=`uniform float u_radiusTS;
in vec2 v_textureCoordinates;
vec2 rotate(vec2 p, vec2 direction)
{
return vec2(p.x * direction.x - p.y * direction.y, p.x * direction.y + p.y * direction.x);
}
vec4 addBurst(vec2 position, vec2 direction, float lengthScalar)
{
vec2 rotatedPosition = rotate(position, direction) * vec2(25.0, 0.75);
float radius = length(rotatedPosition) * lengthScalar;
float burst = 1.0 - smoothstep(0.0, 0.55, radius);
return vec4(burst);
}
void main()
{
float lengthScalar = 2.0 / sqrt(2.0);
vec2 position = v_textureCoordinates - vec2(0.5);
float radius = length(position) * lengthScalar;
float surface = step(radius, u_radiusTS);
vec4 color = vec4(vec2(1.0), surface + 0.2, surface);
float glow = 1.0 - smoothstep(0.0, 0.55, radius);
color.ba += mix(vec2(0.0), vec2(1.0), glow) * 0.75;
vec4 burst = vec4(0.0);
burst += 0.4 * addBurst(position, vec2(0.38942, 0.92106), lengthScalar);
burst += 0.4 * addBurst(position, vec2(0.99235, 0.12348), lengthScalar);
burst += 0.4 * addBurst(position, vec2(0.60327, -0.79754), lengthScalar);
burst += 0.3 * addBurst(position, vec2(0.31457, 0.94924), lengthScalar);
burst += 0.3 * addBurst(position, vec2(0.97931, 0.20239), lengthScalar);
burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar);
color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15;
out_FragColor = clamp(color, vec4(0.0), vec4(1.0));
}
`;var vV=`in vec2 direction;
uniform float u_size;
out vec2 v_textureCoordinates;
void main()
{
vec4 position;
if (czm_morphTime == 1.0)
{
position = vec4(czm_sunPositionWC, 1.0);
}
else
{
position = vec4(czm_sunPositionColumbusView.zxy, 1.0);
}
vec4 positionEC = czm_view * position;
vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
vec2 halfSize = vec2(u_size * 0.5);
halfSize *= ((direction * 2.0) - 1.0);
gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);
v_textureCoordinates = direction;
}
`;var DV=`in vec2 v_textureCoordinates;
void main()
{
czm_materialInput materialInput;
materialInput.s = v_textureCoordinates.s;
materialInput.st = v_textureCoordinates;
materialInput.str = vec3(v_textureCoordinates, 0.0);
materialInput.normalEC = vec3(0.0, 0.0, -1.0);
czm_material material = czm_getMaterial(materialInput);
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
}
`;function Ort(e){let t,n=e.name,i=e.message;c(n)&&c(i)?t=`${n}: ${i}`:t=e.toString();let o=e.stack;return c(o)&&(t+=`
${o}`),t}var g_=Ort;async function Rrt(e,t,n,i){return c(i)||(i=!1),T.typeOf.object("terrainProvider",e),T.typeOf.number("level",t),T.typeOf.bool("rejectOnTileFail",i),T.defined("positions",n),Nrt(e,t,n,i)}function Mrt(e,t,n){let i=e[0],o=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!o)return!1;let r;return n?r=o.then(q_e(i)):r=o.then(q_e(i)).catch(Frt(i)),e.shift(),t.push(r),!0}function Lrt(e){return new Promise(function(t){setTimeout(t,e)})}function kY(e,t,n){return e.length?Mrt(e,t,n)?kY(e,t,n):Lrt(100).then(()=>kY(e,t,n)):Promise.resolve()}function Nrt(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let u=o.positionToTileXY(n[r],t);if(!c(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let h={x:u.x,y:u.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[f]=h,s.push(h)}a[f].positions.push(n[r])}let l=[];return kY(s,l,i).then(function(){return Promise.all(l).then(function(){return n})})}function W_e(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function q_e(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let o=!1;for(let r=0;r<t.length;++r){let s=t[r];if(!W_e(s,i,n)){o=!0;break}}return o?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let r=0;r<t.length;++r){let s=t[r];W_e(s,i,n)}}):Promise.resolve()}}function Frt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var PV=Rrt;var UY=new z;async function Y_e(e,t,n){if(c(n)||(n=!1),!c(e))throw new C("terrainProvider is required.");if(!c(t))throw new C("positions is required.");let i=[],o=[],r=e.availability;if(!c(r))throw new C("sampleTerrainMostDetailed requires a terrain provider that has tile availability.");let s=[];for(let l=0;l<t.length;++l){let u=t[l],f=r.computeMaximumLevelAtPosition(u);if(o[l]=f,f===0){e.tilingScheme.positionToTileXY(u,1,UY);let p=e.loadTileDataAvailability(UY.x,UY.y,1);c(p)&&s.push(p)}let h=i[f];c(h)||(i[f]=h=[]),h.push(u)}await Promise.all(s),await Promise.all(i.map(function(l,u){if(c(l))return PV(e,u,l,n)}));let a=[];for(let l=0;l<t.length;++l){let u=t[l];r.computeMaximumLevelAtPosition(u)!==o[l]&&a.push(u)}return a.length>0&&await Y_e(e,a,n),t}var vE=Y_e;async function VY(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===oe.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!c(n))return r;let a=n.availability;if(!c(a)||t.mode===oe.SCENE2D)return r;let l=[ce.center(e),ce.southeast(e),ce.southwest(e),ce.northeast(e),ce.northwest(e)],u=await VY._sampleTerrainMostDetailed(n,l),f=!1,h=u.reduce(function(g,m){return c(m.height)?(f=!0,Math.max(m.height,g)):g},-Number.MAX_VALUE),p=r;return f&&(p.height+=h),p}VY._sampleTerrainMostDetailed=vE;var DE=VY;var Brt={NONE:0,LERC:1},ih=Object.freeze(Brt);var krt={NONE:0,BITS12:1},pa=Object.freeze(krt);var px=new d,Urt=new d,Gf=new z,IV=new F,Vrt=new F,zrt=Math.pow(2,12);function fc(e,t,n,i,o,r,s,a,l,u){let f=pa.NONE,h,p;if(c(t)&&c(n)&&c(i)&&c(o)){let g=t.minimum,m=t.maximum,y=d.subtract(m,g,Urt),b=i-n;Math.max(d.maximumComponent(y),b)<zrt-1?f=pa.BITS12:f=pa.NONE,h=F.inverseTransformation(o,new F);let A=d.negate(g,px);F.multiply(F.fromTranslation(A,IV),h,h);let E=px;E.x=1/y.x,E.y=1/y.y,E.z=1/y.z,F.multiply(F.fromScale(E,IV),h,h),p=F.clone(o),F.setTranslation(p,d.ZERO,p),o=F.clone(o,new F);let S=F.fromTranslation(g,IV),v=F.fromScale(y,Vrt),P=F.multiply(S,v,IV);F.multiply(o,P,o),F.multiply(p,P,p)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=d.clone(e),this.toScaledENU=h,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=l??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}fc.prototype.encode=function(e,t,n,i,o,r,s,a){let l=i.x,u=i.y;if(this.quantization===pa.BITS12){n=F.multiplyByPoint(this.toScaledENU,n,px),n.x=O.clamp(n.x,0,1),n.y=O.clamp(n.y,0,1),n.z=O.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,h=O.clamp((o-this.minimumHeight)/f,0,1);z.fromElements(n.x,n.y,Gf);let p=Ln.compressTextureCoordinates(Gf);z.fromElements(n.z,h,Gf);let g=Ln.compressTextureCoordinates(Gf);z.fromElements(l,u,Gf);let m=Ln.compressTextureCoordinates(Gf);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){z.fromElements(s,0,Gf);let y=Ln.compressTextureCoordinates(Gf);e[t++]=y}}else d.subtract(n,this.center,px),e[t++]=px.x,e[t++]=px.y,e[t++]=px.z,e[t++]=o,e[t++]=l,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=Ln.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var Hrt=new d,X_e=new d;fc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let f=0;f<i;f++){let h=s*i+f,p=s*r+f;t[p]=e[h]}let a=this.decodePosition(t,s,Hrt),l=n.geodeticSurfaceNormal(a,X_e),u=s*r+this._offsetGeodeticSurfaceNormal;t[u]=l.x,t[u+1]=l.y,t[u+2]=l.z}};fc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let o=this.stride;for(let r=0;r<i;r++)for(let s=0;s<o;s++){let a=r*n+s,l=r*o+s;t[l]=e[a]}};fc.prototype.decodePosition=function(e,t,n){if(c(n)||(n=new d),t*=this.stride,this.quantization===pa.BITS12){let i=Ln.decompressTextureCoordinates(e[t],Gf);n.x=i.x,n.y=i.y;let o=Ln.decompressTextureCoordinates(e[t+1],Gf);return n.z=o.x,F.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],d.add(n,this.center,n)};fc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,o=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,X_e),a=this.decodeHeight(e,t),l=Rr.getHeight(a,i,o)-a;n.x+=s.x*l,n.y+=s.y*l,n.z+=s.z*l}return n};fc.prototype.decodeTextureCoordinates=function(e,t,n){return c(n)||(n=new z),t*=this.stride,this.quantization===pa.BITS12?Ln.decompressTextureCoordinates(e[t+2],n):z.fromElements(e[t+4],e[t+5],n)};fc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===pa.BITS12?Ln.decompressTextureCoordinates(e[t+1],Gf).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};fc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===pa.BITS12?Ln.decompressTextureCoordinates(e[t+3],Gf).x:e[t+6]};fc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,o=Math.floor(i),r=(i-o)*256;return z.fromElements(o,r,n)};fc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};fc.prototype._calculateStrideAndOffsets=function(){let e=0;switch(this.quantization){case pa.BITS12:e+=3;break;default:e+=6}this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var OV={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},RV={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};fc.prototype.getAttributes=function(e){let t=$.FLOAT,n=$.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,l){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:l,offsetInBytes:o,strideInBytes:i}),o+=l*n}if(this.quantization===pa.NONE){s(OV.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(OV.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(OV.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,l=this.hasWebMercatorT&&this.hasVertexNormals;s(RV.compressed0,a?4:3),l&&s(RV.compressed1,1),this.hasGeodeticSurfaceNormals&&s(RV.geodeticSurfaceNormal,3)}return r};fc.prototype.getAttributeLocations=function(){return this.quantization===pa.NONE?OV:RV};fc.clone=function(e,t){if(c(e))return c(t)||(t=new fc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=d.clone(e.center),t.toScaledENU=F.clone(e.toScaledENU),t.fromScaledENU=F.clone(e.fromScaledENU),t.matrix=F.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Zc=fc;var Nm={};Nm.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var zY=new d,Grt=new F,jrt=new d,Wrt=new d;Nm.computeVertices=function(e){if(!c(e)||!c(e.heightmap))throw new C("options.heightmap is required.");if(!c(e.width)||!c(e.height))throw new C("options.width and options.height are required.");if(!c(e.nativeRectangle))throw new C("options.nativeRectangle is required.");if(!c(e.skirtHeight))throw new C("options.skirtHeight is required.");let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=O.PI_OVER_TWO,a=O.toRadians,l=e.heightmap,u=e.width,f=e.height,h=e.skirtHeight,p=h>0,g=e.isGeographic??!0,m=e.ellipsoid??ie.default,y=1/m.maximumRadius,b=ce.clone(e.nativeRectangle),x=ce.clone(e.rectangle),A,E,S,v;c(x)?(A=x.west,E=x.south,S=x.east,v=x.north):g?(A=a(b.west),E=a(b.south),S=a(b.east),v=a(b.north)):(A=b.west*y,E=s-2*o(r(-b.south*y)),S=b.east*y,v=s-2*o(r(-b.north*y)));let P=e.relativeToCenter,M=c(P);P=M?P:d.ZERO;let R=e.includeWebMercatorT??!1,L=e.exaggeration??1,B=e.exaggerationRelativeHeight??0,w=L!==1,D=e.structure??Nm.DEFAULT_STRUCTURE,I=D.heightScale??Nm.DEFAULT_STRUCTURE.heightScale,N=D.heightOffset??Nm.DEFAULT_STRUCTURE.heightOffset,k=D.elementsPerHeight??Nm.DEFAULT_STRUCTURE.elementsPerHeight,H=D.stride??Nm.DEFAULT_STRUCTURE.stride,V=D.elementMultiplier??Nm.DEFAULT_STRUCTURE.elementMultiplier,j=D.isBigEndian??Nm.DEFAULT_STRUCTURE.isBigEndian,U=ce.computeWidth(b),q=ce.computeHeight(b),X=U/(u-1),te=q/(f-1);g||(U*=y,q*=y);let K=m.radiiSquared,Z=K.x,ee=K.y,me=K.z,xe=65536,ue=-65536,ye=Ot.eastNorthUpToFixedFrame(P,m),Ae=F.inverseTransformation(ye,Grt),Pe,Ee;R&&(Pe=Li.geodeticLatitudeToMercatorAngle(E),Ee=1/(Li.geodeticLatitudeToMercatorAngle(v)-Pe));let Ve=jrt;Ve.x=Number.POSITIVE_INFINITY,Ve.y=Number.POSITIVE_INFINITY,Ve.z=Number.POSITIVE_INFINITY;let je=Wrt;je.x=Number.NEGATIVE_INFINITY,je.y=Number.NEGATIVE_INFINITY,je.z=Number.NEGATIVE_INFINITY;let it=Number.POSITIVE_INFINITY,Dt=u*f,Gt=h>0?u*2+f*2:0,$e=Dt+Gt,ln=new Array($e),Vt=new Array($e),Ct=new Array($e),gi=R?new Array($e):[],an=w?new Array($e):[],_e=0,Ce=f,mn=0,mt=u;p&&(--_e,++Ce,--mn,++mt);let to=1e-5;for(let Ze=_e;Ze<Ce;++Ze){let pt=Ze;pt<0&&(pt=0),pt>=f&&(pt=f-1);let Ht=b.north-te*pt;g?Ht=a(Ht):Ht=s-2*o(r(-Ht*y));let bn=(Ht-E)/(v-E);bn=O.clamp(bn,0,1);let wo=Ze===_e,yo=Ze===Ce-1;h>0&&(wo?Ht+=to*q:yo&&(Ht-=to*q));let ka=t(Ht),Ua=n(Ht),yi=me*Ua,hi;R&&(hi=(Li.geodeticLatitudeToMercatorAngle(Ht)-Pe)*Ee);for(let $s=mn;$s<mt;++$s){let Hr=$s;Hr<0&&(Hr=0),Hr>=u&&(Hr=u-1);let ol=pt*(u*H)+Hr*H,ho;if(k===1)ho=l[ol];else{ho=0;let Oo;if(j)for(Oo=0;Oo<k;++Oo)ho=ho*V+l[ol+Oo];else for(Oo=k-1;Oo>=0;--Oo)ho=ho*V+l[ol+Oo]}ho=ho*I+N,ue=Math.max(ue,ho),xe=Math.min(xe,ho);let Dr=b.west+X*Hr;g?Dr=a(Dr):Dr=Dr*y;let tp=(Dr-A)/(S-A);tp=O.clamp(tp,0,1);let Gr=pt*u+Hr;if(h>0){let Oo=$s===mn,cn=$s===mt-1,Se=wo||yo||Oo||cn;if((wo||yo)&&(Oo||cn))continue;Se&&(ho-=h,Oo?(Gr=Dt+(f-pt-1),Dr-=to*U):yo?Gr=Dt+f+(u-Hr-1):cn?(Gr=Dt+f+u+pt,Dr+=to*U):wo&&(Gr=Dt+f+u+f+Hr))}let zu=ka*t(Dr),Va=ka*n(Dr),S0=Z*zu,Zs=ee*Va,za=1/i(S0*zu+Zs*Va+yi*Ua),es=S0*za,Hu=Zs*za,Gu=yi*za,ju=new d;ju.x=es+zu*ho,ju.y=Hu+Va*ho,ju.z=Gu+Ua*ho,F.multiplyByPoint(Ae,ju,zY),d.minimumByComponent(zY,Ve,Ve),d.maximumByComponent(zY,je,je),it=Math.min(it,ho),ln[Gr]=ju,Ct[Gr]=new z(tp,bn),Vt[Gr]=ho,R&&(gi[Gr]=hi),w&&(an[Gr]=m.geodeticSurfaceNormal(ju))}}let So=le.fromPoints(ln),Ks;c(x)&&(Ks=Pn.fromRectangle(x,xe,ue,m));let vr;M&&(vr=new cy(m).computeHorizonCullingPointPossiblyUnderEllipsoid(P,ln,xe));let ps=new q0(Ve,je,P),Ne=new Zc(P,ps,it,ue,ye,!1,R,w,L,B),ot=new Float32Array($e*Ne.stride),Xe=0;for(let Ze=0;Ze<$e;++Ze)Xe=Ne.encode(ot,Xe,ln[Ze],Ct[Ze],Vt[Ze],void 0,gi[Ze],an[Ze]);return{vertices:ot,maximumHeight:ue,minimumHeight:xe,encoding:Ne,boundingSphere3D:So,orientedBoundingBox:Ks,occludeePointInScaledSpace:vr}};var VP=Nm;function Gy(){C.throwInstantiationError()}Object.defineProperties(Gy.prototype,{credits:{get:C.throwInstantiationError},waterMask:{get:C.throwInstantiationError}});Gy.prototype.interpolateHeight=C.throwInstantiationError;Gy.prototype.isChildAvailable=C.throwInstantiationError;Gy.prototype.createMesh=C.throwInstantiationError;Gy.prototype.upsample=C.throwInstantiationError;Gy.prototype.wasCreatedByUpsampling=C.throwInstantiationError;Gy.maximumAsynchronousTasks=5;var Fm=Gy;function qrt(e,t,n,i,o,r,s,a,l,u,f,h,p,g,m,y){this.center=e,this.vertices=t,this.stride=u??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.boundingSphere3D=a,this.occludeePointInScaledSpace=l,this.orientedBoundingBox=f,this.encoding=h,this.westIndicesSouthToNorth=p,this.southIndicesEastToWest=g,this.eastIndicesNorthToSouth=m,this.northIndicesWestToEast=y}var oh=qrt;function Qc(){C.throwInstantiationError()}Object.defineProperties(Qc.prototype,{errorEvent:{get:C.throwInstantiationError},credit:{get:C.throwInstantiationError},tilingScheme:{get:C.throwInstantiationError},hasWaterMask:{get:C.throwInstantiationError},hasVertexNormals:{get:C.throwInstantiationError},availability:{get:C.throwInstantiationError}});var K_e=[];Qc.getRegularGridIndices=function(e,t){if(e*t>=O.FOUR_GIGABYTES)throw new C("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=K_e[e];c(n)||(K_e[e]=n=[]);let i=n[t];return c(i)||(e*t<O.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),J_e(e,t,i,0)),i};var $_e=[];Qc.getRegularGridIndicesAndEdgeIndices=function(e,t){if(e*t>=O.FOUR_GIGABYTES)throw new C("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=$_e[e];c(n)||($_e[e]=n=[]);let i=n[t];if(!c(i)){let o=Qc.getRegularGridIndices(e,t),r=Q_e(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,l=r.eastIndicesNorthToSouth,u=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:l,northIndicesWestToEast:u}}return i};var Z_e=[];Qc.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){if(e*t>=O.FOUR_GIGABYTES)throw new C("The total number of vertices (width * height) must be less than 4,294,967,296.");let n=Z_e[e];c(n)||(Z_e[e]=n=[]);let i=n[t];if(!c(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,l=o+s,u=r+a,f=Q_e(e,t),h=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=Fe.createTypedArray(l,u);J_e(e,t,y,0),Qc.addSkirtIndices(h,p,g,m,o,y,r),i=n[t]={indices:y,westIndicesSouthToNorth:h,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:m,indexCountWithoutSkirts:r}}return i};Qc.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=MV(e,a,r,s),a+=e.length,s=MV(t,a,r,s),a+=t.length,s=MV(n,a,r,s),a+=n.length,MV(i,a,r,s)};function Q_e(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),s;for(s=0;s<e;++s)r[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)o[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function J_e(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,l=a+e,u=l+1,f=a+1;n[i++]=a,n[i++]=l,n[i++]=f,n[i++]=f,n[i++]=l,n[i++]=u,++o}++o}}function MV(e,t,n,i){let o=e[0],r=e.length;for(let s=1;s<r;++s){let a=e[s];n[i++]=o,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,o=a,++t}return i}Qc.heightmapTerrainQuality=.25;Qc.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Qc.heightmapTerrainQuality/(t*n)};Qc.prototype.requestTileGeometry=C.throwInstantiationError;Qc.prototype.getLevelMaximumGeometricError=C.throwInstantiationError;Qc.prototype.getTileDataAvailable=C.throwInstantiationError;Qc.prototype.loadTileDataAvailability=C.throwInstantiationError;var us=Qc;function y_(e){if(!c(e)||!c(e.buffer))throw new C("options.buffer is required.");if(!c(e.width))throw new C("options.width is required.");if(!c(e.height))throw new C("options.height is required.");this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??ih.NONE;let t=VP.DEFAULT_STRUCTURE,n=e.structure;c(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===ih.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(y_.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var ege="createVerticesFromHeightmap",Yrt=new bi(ege),Xrt=new bi(ege,Fm.maximumAsynchronousTasks);y_.prototype.createMesh=function(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.tilingScheme",e.tilingScheme),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),T.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,l=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,o),f=t.tileXYToRectangle(n,i,o),h=l.cartographicToCartesian(ce.center(f)),p=this._structure,m=us.getEstimatedLevelZeroGeometricErrorForAHeightmap(l,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(m*4,1e3);let b=(a?Xrt:Yrt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:h,ellipsoid:l,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Oi,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!c(b))return;let x=this;return Promise.resolve(b).then(function(A){let E;x._skirtHeight>0?E=us.getRegularGridAndSkirtIndicesAndEdgeIndices(A.gridWidth,A.gridHeight):E=us.getRegularGridIndicesAndEdgeIndices(A.gridWidth,A.gridHeight);let S=A.gridWidth*A.gridHeight;return x._mesh=new oh(h,new Float32Array(A.vertices),E.indices,E.indexCountWithoutSkirts,S,A.minimumHeight,A.maximumHeight,le.clone(A.boundingSphere3D),d.clone(A.occludeePointInScaledSpace),A.numberOfAttributes,Pn.clone(A.orientedBoundingBox),Zc.clone(A.encoding),E.westIndicesSouthToNorth,E.southIndicesEastToWest,E.eastIndicesNorthToSouth,E.northIndicesWestToEast),x._buffer=void 0,x._mesh})};y_.prototype._createMeshSync=function(e){T.typeOf.object("options.tilingScheme",e.tilingScheme),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),T.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,l=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),f=a.cartographicToCartesian(ce.center(u)),h=this._structure,g=us.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(g*4,1e3);let m=VP.computeVertices({heightmap:this._buffer,structure:h,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:l,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Oi,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=us.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=us.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let b=m.gridWidth*m.gridHeight;return this._mesh=new oh(f,m.vertices,y.indices,y.indexCountWithoutSkirts,b,m.minimumHeight,m.maximumHeight,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};y_.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,l=r.elementMultiplier,u=r.isBigEndian,f=r.heightOffset,h=r.heightScale,p=c(this._mesh),g=this._encoding===ih.LERC;if(!p&&g)return;let y;if(p){let b=this._mesh.vertices,x=this._mesh.encoding;y=tge(b,x,f,h,e,i,o,t,n)}else y=Krt(this._buffer,a,l,s,u,e,i,o,t,n),y=y*h+f;return y};y_.prototype.upsample=function(e,t,n,i,o,r,s){if(!c(e))throw new C("tilingScheme is required.");if(!c(t))throw new C("thisX is required.");if(!c(n))throw new C("thisY is required.");if(!c(i))throw new C("thisLevel is required.");if(!c(o))throw new C("descendantX is required.");if(!c(r))throw new C("descendantY is required.");if(!c(s))throw new C("descendantLevel is required.");if(s-i>1)throw new C("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(l))return;let u=this._width,f=this._height,h=this._structure,p=h.stride,g=new this._bufferType(u*f*p),m=l.vertices,y=l.encoding,b=e.tileXYToRectangle(t,n,i),x=e.tileXYToRectangle(o,r,s),A=h.heightOffset,E=h.heightScale,S=h.elementsPerHeight,v=h.elementMultiplier,P=h.isBigEndian,M=Math.pow(v,S-1);for(let R=0;R<f;++R){let L=O.lerp(x.north,x.south,R/(f-1));for(let B=0;B<u;++B){let _=O.lerp(x.west,x.east,B/(u-1)),w=tge(m,y,A,E,b,u,f,_,L);w=w<h.lowestEncodedHeight?h.lowestEncodedHeight:w,w=w>h.highestEncodedHeight?h.highestEncodedHeight:w,$rt(g,S,v,M,p,P,R*u+B,w)}}return Promise.resolve(new y_({buffer:g,width:u,height:f,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};y_.prototype.isChildAvailable=function(e,t,n,i){if(!c(e))throw new C("thisX is required.");if(!c(t))throw new C("thisY is required.");if(!c(n))throw new C("childX is required.");if(!c(i))throw new C("childY is required.");let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};y_.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function Krt(e,t,n,i,o,r,s,a,l,u){let f=(l-r.west)*(s-1)/(r.east-r.west),h=(u-r.south)*(a-1)/(r.north-r.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let m=h|0,y=m+1;y>=a&&(y=a-1,m=a-2);let b=f-p,x=h-m;m=a-1-m,y=a-1-y;let A=LV(e,t,n,i,o,m*s+p),E=LV(e,t,n,i,o,m*s+g),S=LV(e,t,n,i,o,y*s+p),v=LV(e,t,n,i,o,y*s+g);return nge(b,x,A,E,S,v)}function tge(e,t,n,i,o,r,s,a,l){let u=(a-o.west)*(r-1)/(o.east-o.west),f=(l-o.south)*(s-1)/(o.north-o.south),h=u|0,p=h+1;p>=r&&(p=r-1,h=r-2);let g=f|0,m=g+1;m>=s&&(m=s-1,g=s-2);let y=u-h,b=f-g;g=s-1-g,m=s-1-m;let x=(t.decodeHeight(e,g*r+h)-n)/i,A=(t.decodeHeight(e,g*r+p)-n)/i,E=(t.decodeHeight(e,m*r+h)-n)/i,S=(t.decodeHeight(e,m*r+p)-n)/i;return nge(y,b,x,A,E,S)}function nge(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function LV(e,t,n,i,o,r){r*=i;let s=0,a;if(o)for(a=0;a<t;++a)s=s*n+e[r+a];else for(a=t-1;a>=0;--a)s=s*n+e[r+a];return s}function $rt(e,t,n,i,o,r,s,a){s*=o;let l;if(r)for(l=0;l<t-1;++l)e[s+l]=a/i|0,a-=e[s+l]*i,i/=n;else for(l=t-1;l>0;--l)e[s+l]=a/i|0,a-=e[s+l]*i,i/=n;e[s+l]=a}var dc=y_;function PE(e){e=e??W.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,c(this._tilingScheme)||(this._tilingScheme=new Ki({ellipsoid:e.ellipsoid??ie.default})),this._levelZeroMaximumGeometricError=us.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new pe}Object.defineProperties(PE.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});PE.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new dc({buffer:new Uint8Array(16*16),width:16,height:16}))};PE.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};PE.prototype.getTileDataAvailable=function(e,t,n){};PE.prototype.loadTileDataAvailability=function(e,t,n){};var b_=PE;var Zrt=new z;function Qrt(e,t){T.typeOf.object("clippingPlaneCollection",e),T.typeOf.object("context",t);let n=e.unionClippingRegions,i=e.length,o=xs.useFloatTexture(t),r=xs.getTextureResolution(e,t,Zrt),s=r.x,a=r.y,l=o?tst(s,a):nst(s,a);return l+=`
`,l+=n?Jrt(i):est(i),l}function Jrt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
{
vec4 position = czm_windowToEyeCoordinates(fragCoord);
vec3 clipNormal = vec3(0.0);
vec3 clipPosition = vec3(0.0);
float clipAmount;
float pixelWidth = czm_metersPerPixel(position);
bool breakAndDiscard = false;
for (int i = 0; i < ${e}; ++i)
{
vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
clipNormal = clippingPlane.xyz;
clipPosition = -clippingPlane.w * clipNormal;
float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
clipAmount = czm_branchFreeTernary(i == 0, amount, min(amount, clipAmount));
if (amount <= 0.0)
{
breakAndDiscard = true;
break;
}
}
if (breakAndDiscard) {
discard;
}
return clipAmount;
}
`}function est(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix)
{
bool clipped = true;
vec4 position = czm_windowToEyeCoordinates(fragCoord);
vec3 clipNormal = vec3(0.0);
vec3 clipPosition = vec3(0.0);
float clipAmount = 0.0;
float pixelWidth = czm_metersPerPixel(position);
for (int i = 0; i < ${e}; ++i)
{
vec4 clippingPlane = getClippingPlane(clippingPlanes, i, clippingPlanesMatrix);
clipNormal = clippingPlane.xyz;
clipPosition = -clippingPlane.w * clipNormal;
float amount = dot(clipNormal, (position.xyz - clipPosition)) / pixelWidth;
clipAmount = max(amount, clipAmount);
clipped = clipped && (amount <= 0.0);
}
if (clipped)
{
discard;
}
return clipAmount;
}
`}function tst(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
{
int pixY = clippingPlaneNumber / ${e};
int pixX = clippingPlaneNumber - (pixY * ${e});
float u = (float(pixX) + 0.5) * ${o};
float v = (float(pixY) + 0.5) * ${r};
vec4 plane = texture(packedClippingPlanes, vec2(u, v));
return czm_transformPlane(plane, transform);
}
`}function nst(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform)
{
int clippingPlaneStartIndex = clippingPlaneNumber * 2;
int pixY = clippingPlaneStartIndex / ${e};
int pixX = clippingPlaneStartIndex - (pixY * ${e});
float u = (float(pixX) + 0.5) * ${o};
float v = (float(pixY) + 0.5) * ${r};
vec4 oct32 = texture(packedClippingPlanes, vec2(u, v)) * 255.0;
vec2 oct = vec2(oct32.x * 256.0 + oct32.y, oct32.z * 256.0 + oct32.w);
vec4 plane;
plane.xyz = czm_octDecode(oct, 65535.0);
plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${o}, v)));
return czm_transformPlane(plane, transform);
}
`}var jy=Qrt;function ist(e,t,n,i,o,r){this.numberOfDayTextures=e,this.flags=t,this.material=n,this.shaderProgram=i,this.clippingShaderState=o,this.clippingPolygonShaderState=r}function HY(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}function ost(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case oe.SCENE3D:o=t;break;case oe.SCENE2D:case oe.COLUMBUS_VIEW:o=n;break;case oe.MORPHING:o=i;break}return o}function rst(e){return e.webgl2?`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
czm_clipPolygons(clippingDistance, regionsLength, clippingPosition, regionIndex);
}`:`void clipPolygons(highp sampler2D clippingDistance, int regionsLength, vec2 clippingPosition, int regionIndex) {
}`}function sst(e){return e.webgl2?`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
return czm_unpackClippingExtents(extentsTexture, index);
}`:`vec4 unpackClippingExtents(highp sampler2D extentsTexture, int index) {
return vec4();
}`}function ast(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}HY.prototype.getShaderProgram=function(e){let t=e.frameState,n=e.surfaceTile,i=e.numberOfDayTextures,o=e.applyBrightness,r=e.applyContrast,s=e.applyHue,a=e.applySaturation,l=e.applyGamma,u=e.applyAlpha,f=e.applyDayNightAlpha,h=e.applySplit,p=e.hasWaterMask,g=e.showReflectiveOcean,m=e.showOceanWaves,y=e.enableLighting,b=e.dynamicAtmosphereLighting,x=e.dynamicAtmosphereLightingFromSun,A=e.showGroundAtmosphere,E=e.perFragmentGroundAtmosphere,S=e.hasVertexNormals,v=e.useWebMercatorProjection,P=e.enableFog,M=e.enableClippingPlanes,R=e.clippingPlanes,L=e.enableClippingPolygons,B=e.clippingPolygons,_=e.clippedByBoundaries,w=e.hasImageryLayerCutout,D=e.colorCorrect,I=e.highlightFillTile,N=e.colorToAlpha,k=e.hasGeodeticSurfaceNormals,H=e.hasExaggeration,V=e.showUndergroundColor,j=e.translucent,U=0,q="",te=n.renderedMesh.encoding;te.quantization===pa.BITS12&&(U=1,q="QUANTIZATION_BITS12");let Z=0,ee="";_&&(Z=1,ee="TILE_LIMIT_RECTANGLE");let me=0,xe="";w&&(me=1,xe="APPLY_IMAGERY_CUTOUT");let ue=t.mode,ye=ue|o<<2|r<<3|s<<4|a<<5|l<<6|u<<7|p<<8|g<<9|m<<10|y<<11|b<<12|x<<13|A<<14|E<<15|S<<16|v<<17|P<<18|U<<19|h<<20|M<<21|L<<22|Z<<23|me<<24|D<<25|I<<26|N<<27|k<<28|H<<29|V<<30|j<<31|f<<32,Ae=0;c(R)&&R.length>0&&(Ae=M?R.clippingPlanesState:0);let Pe=0;c(B)&&B.length>0&&(Pe=L?B.clippingPolygonsState:0);let Ee=n.surfaceShader;if(c(Ee)&&Ee.numberOfDayTextures===i&&Ee.flags===ye&&Ee.material===this.material&&Ee.clippingShaderState===Ae&&Ee.clippingPolygonShaderState===Pe)return Ee.shaderProgram;let Ve=this._shadersByTexturesFlags[i];if(c(Ve)||(Ve=this._shadersByTexturesFlags[i]=[]),Ee=Ve[ye],!c(Ee)||Ee.material!==this.material||Ee.clippingShaderState!==Ae||Ee.clippingPolygonShaderState!==Pe){let je=this.baseVertexShaderSource.clone(),it=this.baseFragmentShaderSource.clone();Ae!==0&&it.sources.unshift(jy(R,t.context)),Pe!==0&&(it.sources.unshift(rst(t.context)),je.sources.unshift(sst(t.context))),je.defines.push(q),it.defines.push(`TEXTURE_UNITS ${i}`,ee,xe),o&&it.defines.push("APPLY_BRIGHTNESS"),r&&it.defines.push("APPLY_CONTRAST"),s&&it.defines.push("APPLY_HUE"),a&&it.defines.push("APPLY_SATURATION"),l&&it.defines.push("APPLY_GAMMA"),u&&it.defines.push("APPLY_ALPHA"),f&&it.defines.push("APPLY_DAY_NIGHT_ALPHA"),p&&it.defines.push("HAS_WATER_MASK"),g&&(it.defines.push("SHOW_REFLECTIVE_OCEAN"),je.defines.push("SHOW_REFLECTIVE_OCEAN")),m&&it.defines.push("SHOW_OCEAN_WAVES"),N&&it.defines.push("APPLY_COLOR_TO_ALPHA"),V&&(je.defines.push("UNDERGROUND_COLOR"),it.defines.push("UNDERGROUND_COLOR")),j&&(je.defines.push("TRANSLUCENT"),it.defines.push("TRANSLUCENT")),y&&(S?(je.defines.push("ENABLE_VERTEX_LIGHTING"),it.defines.push("ENABLE_VERTEX_LIGHTING")):(je.defines.push("ENABLE_DAYNIGHT_SHADING"),it.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(je.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),it.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(je.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),it.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),A&&(je.defines.push("GROUND_ATMOSPHERE"),it.defines.push("GROUND_ATMOSPHERE"),E&&(je.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),it.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),je.defines.push("INCLUDE_WEB_MERCATOR_Y"),it.defines.push("INCLUDE_WEB_MERCATOR_Y"),P&&(je.defines.push("FOG"),it.defines.push("FOG")),h&&it.defines.push("APPLY_SPLIT"),M&&it.defines.push("ENABLE_CLIPPING_PLANES"),L&&(it.defines.push("ENABLE_CLIPPING_POLYGONS"),je.defines.push("ENABLE_CLIPPING_POLYGONS"),B.inverse&&it.defines.push("CLIPPING_INVERSE"),it.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${B.extentsCount}`),je.defines.push(`CLIPPING_POLYGON_REGIONS_LENGTH ${B.extentsCount}`)),D&&it.defines.push("COLOR_CORRECT"),I&&it.defines.push("HIGHLIGHT_FILL_TILE"),k&&je.defines.push("GEODETIC_SURFACE_NORMALS"),H&&je.defines.push("EXAGGERATION");let Dt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend)
{
vec4 color = initialColor;
`;w&&(Dt+=` vec4 cutoutAndColorResult;
bool texelUnclipped;
`);for(let $e=0;$e<i;++$e)w?Dt+=` cutoutAndColorResult = u_dayTextureCutoutRectangles[${$e}];
texelUnclipped = v_textureCoordinates.x < cutoutAndColorResult.x || cutoutAndColorResult.z < v_textureCoordinates.x || v_textureCoordinates.y < cutoutAndColorResult.y || cutoutAndColorResult.w < v_textureCoordinates.y;
cutoutAndColorResult = sampleAndBlend(
`:Dt+=` color = sampleAndBlend(
`,Dt+=` color,
u_dayTextures[${$e}],
u_dayTextureUseWebMercatorT[${$e}] ? textureCoordinates.xz : textureCoordinates.xy,
u_dayTextureTexCoordsRectangle[${$e}],
u_dayTextureTranslationAndScale[${$e}],
${u?`u_dayTextureAlpha[${$e}]`:"1.0"},
${f?`u_dayTextureNightAlpha[${$e}]`:"1.0"},
${f?`u_dayTextureDayAlpha[${$e}]`:"1.0"},
${o?`u_dayTextureBrightness[${$e}]`:"0.0"},
${r?`u_dayTextureContrast[${$e}]`:"0.0"},
${s?`u_dayTextureHue[${$e}]`:"0.0"},
${a?`u_dayTextureSaturation[${$e}]`:"0.0"},
${l?`u_dayTextureOneOverGamma[${$e}]`:"0.0"},
${h?`u_dayTextureSplit[${$e}]`:"0.0"},
${N?`u_colorsToAlpha[${$e}]`:"vec4(0.0)"},
nightBlend );
`,w&&(Dt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color);
`);Dt+=` return color;
}`,it.sources.push(Dt),je.sources.push(ost(ue)),je.sources.push(ast(v));let Gt=en.fromCache({context:t.context,vertexShaderSource:je,fragmentShaderSource:it,attributeLocations:te.getAttributeLocations()});Ee=Ve[ye]=new ist(i,ye,this.material,Gt,Ae,Pe)}return n.surfaceShader=Ee,Ee.shaderProgram};HY.prototype.destroy=function(){let e,t,n=this._shadersByTexturesFlags;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];if(!c(o))continue;for(e in o)o.hasOwnProperty(e)&&(t=o[e],c(t)&&t.shaderProgram.destroy())}return de(this)};var NV=HY;var cst={NONE:-1,PARTIAL:0,FULL:1},Sr=Object.freeze(cst);function FV(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=r??0,this.retry=!1,this.error=s}FV.reportError=function(e,t,n,i,o,r,s,a){let l=e;return c(e)?(l.provider=t,l.message=i,l.x=o,l.y=r,l.level=s,l.retry=!1,l.error=a,++l.timesRetried):l=new FV(t,i,o,r,s,0,a),c(n)&&n.numberOfListeners>0?n.raiseEvent(l):c(t)&&console.log(`An error occurred in "${t.constructor.name}": ${g_(i)}`),l};FV.reportSuccess=function(e){c(e)&&(e.timesRetried=-1)};var Io=FV;var lst={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7},ai=Object.freeze(lst);var ust={START:0,LOADING:1,DONE:2,FAILED:3},_a=Object.freeze(ust);var fst={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6},uo=Object.freeze(fst);function Jo(){this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new d,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=uo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new le,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}Object.defineProperties(Jo.prototype,{eligibleForUnloading:{get:function(){let e=this.terrainState,n=!(e===uo.RECEIVING||e===uo.TRANSFORMING),i=this.imagery;for(let o=0,r=i.length;n&&o<r;++o){let s=i[o];n=!c(s.loadingImagery)||s.loadingImagery.state!==ai.TRANSITIONING}return n}},renderedMesh:{get:function(){if(c(this.vertexArray))return this.mesh;if(c(this.fill))return this.fill.mesh}}});var dst=new he;function GY(e,t,n,i,o,r){let s=e.getExaggeratedPosition(i,o,r);if(c(t)&&t!==oe.SCENE3D){let l=n.ellipsoid.cartesianToCartographic(s,dst);s=n.project(l,r),s=d.fromElements(s.z,s.x,s.y,r)}return s}var hst=new d,mst=new d,pst=new d;Jo.prototype.pick=function(e,t,n,i,o){let r=this.renderedMesh;if(!c(r))return;let s=r.vertices,a=r.indices,l=r.encoding,u=a.length,f=Number.MAX_VALUE;for(let h=0;h<u;h+=3){let p=a[h],g=a[h+1],m=a[h+2],y=GY(l,t,n,s,p,hst),b=GY(l,t,n,s,g,mst),x=GY(l,t,n,s,m,pst),A=Qn.rayTriangleParametric(e,y,b,x,i);c(A)&&A<f&&A>=0&&(f=A)}return f!==Number.MAX_VALUE?_n.getPoint(e,f,o):void 0};Jo.prototype.freeResources=function(){c(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),this.terrainData=void 0,this.terrainState=uo.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let e=this.imagery;for(let t=0,n=e.length;t<n;++t)e[t].freeResources();this.imagery.length=0,this.freeVertexArray()};Jo.prototype.freeVertexArray=function(){Jo._freeVertexArray(this.vertexArray),this.vertexArray=void 0,Jo._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0};Jo.initialize=function(e,t,n){let i=e.data;c(i)||(i=e.data=new Jo),e.state===_a.START&&(_st(e,t,n),e.state=_a.LOADING)};Jo.processStateMachine=function(e,t,n,i,o,r,s){Jo.initialize(e,n,i);let a=e.data;if(e.state===_a.LOADING&&gst(e,t,n,i,o,r),s)return;let l=e.renderable;e.renderable=c(a.vertexArray);let u=a.terrainState===uo.READY;e.upsampledFromParent=c(a.terrainData)&&a.terrainData.wasCreatedByUpsampling();let f=a.processImagery(e,n,t);if(u&&f){let h=e._loadedCallbacks,p={};for(let g in h)h.hasOwnProperty(g)&&(h[g](e)||(p[g]=h[g]));e._loadedCallbacks=p,e.state=_a.DONE}l&&(e.renderable=!0)};Jo.prototype.processImagery=function(e,t,n,i){let o=e.data,r=e.upsampledFromParent,s=!1,a=!0,l=o.imagery,u,f;for(u=0,f=l.length;u<f;++u){let h=l[u];if(!c(h.loadingImagery)){r=!1;continue}if(h.loadingImagery.state===ai.PLACEHOLDER){let g=h.loadingImagery.imageryLayer;if(g.ready){h.freeResources(),l.splice(u,1),g._createTileImagerySkeletons(e,t,u),--u,f=l.length;continue}else r=!1}let p=h.processStateMachine(e,n,i);a=a&&p,s=s||p||c(h.readyImagery),r=r&&c(h.loadingImagery)&&(h.loadingImagery.state===ai.FAILED||h.loadingImagery.state===ai.INVALID)}return e.upsampledFromParent=r,e.renderable=e.renderable&&(s||a),a};function ige(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,l=Zc.clone(s);l.hasGeodeticSurfaceNormals=t,l=Zc.clone(l);let u=l.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(r,f,n):s.removeGeodeticSurfaceNormals(r,f),o.vertices=f,o.stride=u,o!==e.mesh?(Jo._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=Jo._createVertexArrayForMesh(i.context,o)):(Jo._freeVertexArray(e.vertexArray),e.vertexArray=Jo._createVertexArrayForMesh(i.context,o)),Jo._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}Jo.prototype.addGeodeticSurfaceNormals=function(e,t){ige(this,!0,e,t)};Jo.prototype.removeGeodeticSurfaceNormals=function(e){ige(this,!1,void 0,e)};Jo.prototype.updateExaggeration=function(e,t,n){let i=this,o=i.renderedMesh;if(o===void 0)return;let r=t.verticalExaggeration,s=t.verticalExaggerationRelativeHeight,a=r!==1,l=o.encoding,u=l.exaggeration!==r,f=l.exaggerationRelativeHeight!==s;if(u||f){if(u)if(a&&!l.hasGeodeticSurfaceNormals){let h=e.tilingScheme.ellipsoid;i.addGeodeticSurfaceNormals(h,t)}else!a&&l.hasGeodeticSurfaceNormals&&i.removeGeodeticSurfaceNormals(t);if(l.exaggeration=r,l.exaggerationRelativeHeight=s,n!==void 0){n._tileToUpdateHeights.push(e);let h=e.customData,p=h.length;for(let g=0;g<p;g++){let m=h[g];m.level=-1}}}};function _st(e,t,n){let i=t.getTileDataAvailable(e.x,e.y,e.level);if(!c(i)&&c(e.parent)){let o=e.parent,r=o.data;c(r)&&c(r.terrainData)&&(i=r.terrainData.isChildAvailable(o.x,o.y,e.x,e.y))}i===!1&&(e.data.terrainState=uo.FAILED);for(let o=0,r=n.length;o<r;++o){let s=n.get(o);s.show&&s._createTileImagerySkeletons(e,t)}}function gst(e,t,n,i,o,r){let s=e.data,a=e.parent;if(s.terrainState===uo.FAILED&&a!==void 0&&(a.data!==void 0&&a.data.terrainData!==void 0&&a.data.terrainData.canUpsample!==!1||Jo.processStateMachine(a,t,n,i,o,r,!0)),s.terrainState===uo.FAILED&&yst(s,e,t,n,e.x,e.y,e.level),s.terrainState===uo.UNLOADED&&bst(s,n,e.x,e.y,e.level),s.terrainState===uo.RECEIVED&&Tst(s,t,n,e.x,e.y,e.level),s.terrainState===uo.TRANSFORMED&&(Ast(s,t.context,n,e.x,e.y,e.level,r),s.updateExaggeration(e,t,o)),s.terrainState>=uo.RECEIVED&&s.waterMaskTexture===void 0&&n.hasWaterMask)if(s.terrainData.waterMask!==void 0)Est(t.context,s);else{let u=s._findAncestorTileWithTerrainData(e);c(u)&&c(u.data.waterMaskTexture)&&(s.waterMaskTexture=u.data.waterMaskTexture,++s.waterMaskTexture.referenceCount,s._computeWaterMaskTranslationAndScale(e,u,s.waterMaskTranslationAndScale))}}function yst(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=_a.FAILED;return}let l=a.data.terrainData,u=a.x,f=a.y,h=a.level;if(!c(l))return;let p=l.upsample(i.tilingScheme,u,f,h,o,r,s);c(p)&&(e.terrainState=uo.RECEIVING,Promise.resolve(p).then(function(g){c(g)&&(e.terrainData=g,e.terrainState=uo.RECEIVED)}).catch(function(){e.terrainState=uo.FAILED}))}function bst(e,t,n,i,o){function r(l){if(!c(l)){e.terrainState=uo.UNLOADED,e.request=void 0;return}e.terrainData=l,e.terrainState=uo.RECEIVED,e.request=void 0}function s(l){if(e.request.state===Zn.CANCELLED){e.terrainData=void 0,e.terrainState=uo.UNLOADED,e.request=void 0;return}e.terrainState=uo.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${l}"`;t._requestError=Io.reportError(t._requestError,t,t.errorEvent,u,n,i,o),t._requestError.retry&&a()}function a(){let l=new ir({throttle:!1,throttleByServer:!0,type:gs.TERRAIN});e.request=l;let u=t.requestTileGeometry(n,i,o,l);c(u)?(e.terrainState=uo.RECEIVING,Promise.resolve(u).then(function(f){r(f)}).catch(function(f){s(f)})):(e.terrainState=uo.UNLOADED,e.request=void 0)}a()}var xst={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Tst(e,t,n,i,o,r){let s=n.tilingScheme,a=xst;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);c(u)&&(e.terrainState=uo.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=uo.TRANSFORMED}).catch(function(){e.terrainState=uo.FAILED}))}Jo._createVertexArrayForMesh=function(e,t){let n=t.vertices,i=bt.createVertexBuffer({context:e,typedArray:n,usage:Be.STATIC_DRAW}),o=t.encoding.getAttributes(i),r=t.indices.indexBuffers||{},s=r[e.id];if(!c(s)||s.isDestroyed()){let a=t.indices;s=bt.createIndexBuffer({context:e,typedArray:a,usage:Be.STATIC_DRAW,indexDatatype:Fe.fromSizeInBytes(a.BYTES_PER_ELEMENT)}),s.vertexArrayDestroyable=!1,s.referenceCount=1,r[e.id]=s,t.indices.indexBuffers=r}else++s.referenceCount;return new ni({context:e,attributes:o,indexBuffer:s})};Jo._freeVertexArray=function(e){if(c(e)){let t=e.indexBuffer;e.isDestroyed()||e.destroy(),c(t)&&!t.isDestroyed()&&c(t.referenceCount)&&(--t.referenceCount,t.referenceCount===0&&t.destroy())}};function Ast(e,t,n,i,o,r,s){e.vertexArray=Jo._createVertexArrayForMesh(t,e.mesh),e.terrainState=uo.READY,e.fill=e.fill&&e.fill.destroy(s)}function Cst(e){let t=e.cache.tile_waterMaskData;if(!c(t)){let n=Rt.create({context:e,pixelFormat:ke.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:ui.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Est(e,t){let n=t.terrainData.waterMask,i=Cst(e),o,r=n.length;if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=Rt.create({context:e,pixelFormat:ke.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}Jo.prototype._findAncestorTileWithTerrainData=function(e){let t=e.parent;for(;c(t)&&(!c(t.data)||!c(t.data.terrainData)||t.data.terrainData.wasCreatedByUpsampling());)t=t.parent;return t};Jo.prototype._computeWaterMaskTranslationAndScale=function(e,t,n){let i=t.rectangle,o=e.rectangle,r=o.width,s=o.height,a=r/i.width,l=s/i.height;return n.x=a*(o.west-i.west)/r,n.y=l*(o.south-i.south)/s,n.z=a,n.w=l,n};var rh=Jo;function Wy(e){if(e=e??W.EMPTY_OBJECT,this._ellipsoid=e.ellipsoid??ie.default,this._numberOfLevelZeroTilesX=e.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=e.numberOfLevelZeroTilesY??1,this._projection=new Li(this._ellipsoid),c(e.rectangleSouthwestInMeters)&&c(e.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=e.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=e.rectangleNortheastInMeters;else{let i=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new z(-i,-i),this._rectangleNortheastInMeters=new z(i,i)}let t=this._projection.unproject(this._rectangleSouthwestInMeters),n=this._projection.unproject(this._rectangleNortheastInMeters);this._rectangle=new ce(t.longitude,t.latitude,n.longitude,n.latitude)}Object.defineProperties(Wy.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}},projection:{get:function(){return this._projection}}});Wy.prototype.getNumberOfXTilesAtLevel=function(e){return this._numberOfLevelZeroTilesX<<e};Wy.prototype.getNumberOfYTilesAtLevel=function(e){return this._numberOfLevelZeroTilesY<<e};Wy.prototype.rectangleToNativeRectangle=function(e,t){let n=this._projection,i=n.project(ce.southwest(e)),o=n.project(ce.northeast(e));return c(t)?(t.west=i.x,t.south=i.y,t.east=o.x,t.north=o.y,t):new ce(i.x,i.y,o.x,o.y)};Wy.prototype.tileXYToNativeRectangle=function(e,t,n,i){let o=this.getNumberOfXTilesAtLevel(n),r=this.getNumberOfYTilesAtLevel(n),s=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,a=this._rectangleSouthwestInMeters.x+e*s,l=this._rectangleSouthwestInMeters.x+(e+1)*s,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,f=this._rectangleNortheastInMeters.y-t*u,h=this._rectangleNortheastInMeters.y-(t+1)*u;return c(i)?(i.west=a,i.south=h,i.east=l,i.north=f,i):new ce(a,h,l,f)};Wy.prototype.tileXYToRectangle=function(e,t,n,i){let o=this.tileXYToNativeRectangle(e,t,n,i),r=this._projection,s=r.unproject(new z(o.west,o.south)),a=r.unproject(new z(o.east,o.north));return o.west=s.longitude,o.south=s.latitude,o.east=a.longitude,o.north=a.latitude,o};Wy.prototype.positionToTileXY=function(e,t,n){let i=this._rectangle;if(!ce.contains(i,e))return;let o=this.getNumberOfXTilesAtLevel(t),r=this.getNumberOfYTilesAtLevel(t),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/r,h=this._projection.project(e),p=h.x-this._rectangleSouthwestInMeters.x,g=this._rectangleNortheastInMeters.y-h.y,m=p/a|0;m>=o&&(m=o-1);let y=g/u|0;return y>=r&&(y=r-1),c(n)?(n.x=m,n.y=y,n):new z(m,y)};var fs=Wy;var jY,oge="AAPTxy8BH1VEsoebNVZXo8HurEOF051kAEKlhkOhBEc9BmRwxo7rIWoXrG5RJkAAlrdL0n_Ha7z7WbgHT-DpRd_LxLSeba-Kg8HsK3kJVUF2iiOVOza8OZ-DIdJzjyBZ9IIc5W0JagV3wyuZ9CKE3RHRSADOw-9FbeeUyfJA8iS2mKcK8768q4g11vlHUzVYFhWoKctRWWeG3Amwm6ez2n3vMc1fTSqDdbFP2O6x5eslQDE.AT1_SOxgo20E",IE={};IE.defaultAccessToken=oge;IE.defaultWorldImageryServer=new we({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});IE.defaultWorldHillshadeServer=new we({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});IE.defaultWorldOceanServer=new we({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});IE.getDefaultTokenCredit=function(e){if(e===oge){if(!c(jY)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';jY=new At(t,!0)}return jY}};var jf=IE;function WY(e){if(e=e??W.EMPTY_OBJECT,!c(e.missingImageUrl))throw new C("options.missingImageUrl is required.");if(!c(e.pixelsToCheck))throw new C("options.pixelsToCheck is required.");this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=we.createIfNeeded(e.missingImageUrl),n=this;function i(r){c(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Ah(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,l=r.width,u=e.pixelsToCheck;for(let f=0,h=u.length;a&&f<h;++f){let p=u[f],g=p.x*4+p.y*l;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}WY.prototype.isReady=function(){return this._isReady};WY.prototype.shouldDiscardImage=function(e){if(!this._isReady)throw new C("shouldDiscardImage must not be called before the discard policy is ready.");let t=this._pixelsToCheck,n=this._missingImagePixels;if(!c(n)||c(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=Ah(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],l=a.x*4+a.y*o;for(let u=0;u<4;++u){let f=l+u;if(i[f]!==n[f])return!1}}return!0};var BV=WY;function qY(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}qY.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let o=i.toLowerCase();t>1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}c(n)&&(this.name=e[n])};qY.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];c(r)&&(typeof r=="object"?i+=`<tr><td>${o}</td><td>${t(r)}</td></tr>`:i+=`<tr><td>${o}</td><td>${r}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var Bm=qY;function OE(){C.throwInstantiationError()}Object.defineProperties(OE.prototype,{rectangle:{get:C.throwInstantiationError},tileWidth:{get:C.throwInstantiationError},tileHeight:{get:C.throwInstantiationError},maximumLevel:{get:C.throwInstantiationError},minimumLevel:{get:C.throwInstantiationError},tilingScheme:{get:C.throwInstantiationError},tileDiscardPolicy:{get:C.throwInstantiationError},errorEvent:{get:C.throwInstantiationError},credit:{get:C.throwInstantiationError},proxy:{get:C.throwInstantiationError},hasAlphaChannel:{get:C.throwInstantiationError}});OE.prototype.getTileCredits=function(e,t,n){C.throwInstantiationError()};OE.prototype.requestImage=function(e,t,n,i){C.throwInstantiationError()};OE.prototype.pickFeatures=function(e,t,n,i,o){C.throwInstantiationError()};var Sst=/\.ktx2$/i;OE.loadImage=function(e,t){T.defined("url",t);let n=we.createIfNeeded(t);return Sst.test(n.url)?Xl(n):c(e)&&c(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Ul=OE;var wst={SATELLITE:1,OCEANS:2,HILLSHADE:3},km=Object.freeze(wst);function rge(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new Ki({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new At(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=e.tileWidth??256,this.tileHeight=e.tileHeight??256,this.maximumLevel=e.maximumLevel}rge.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!c(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new BV({missingImageUrl:sge(e,0,0,this.maximumLevel).url,pixelsToCheck:[new z(0,0),new z(200,20),new z(20,200),new z(80,110),new z(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function vst(e,t){let n=e.tileInfo;if(!c(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new fs({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Ki({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new ae(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,c(e.fullExtent)){if(c(e.fullExtent.spatialReference)&&c(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Li,o=e.fullExtent,r=i.unproject(new d(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new d(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ce(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ce.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new ae(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}c(e.copyrightText)&&e.copyrightText.length>0&&(c(t.credit)?t.tileCredits=[new At(e.copyrightText)]:t.credit=new At(e.copyrightText))}function Dst(e,t){let n=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(n+=`: ${t.message}`),new ae(n)}async function Pst(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();vst(i,t)}catch(i){Dst(e,i)}}function Um(e){e=e??W.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Ki({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0;let t=e.credit;typeof t=="string"&&(t=new At(t)),this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new pe}Um.fromBasemapType=async function(e,t){T.defined("style",e),t=t??W.EMPTY_OBJECT;let n,i,o;switch(e){case km.SATELLITE:{n=t.token??jf.defaultAccessToken,i=we.createIfNeeded(jf.defaultWorldImageryServer),i.appendForwardSlash();let r=jf.getDefaultTokenCredit(n);c(r)&&(o=At.clone(r))}break;case km.OCEANS:{n=t.token??jf.defaultAccessToken,i=we.createIfNeeded(jf.defaultWorldOceanServer),i.appendForwardSlash();let r=jf.getDefaultTokenCredit(n);c(r)&&(o=At.clone(r))}break;case km.HILLSHADE:{n=t.token??jf.defaultAccessToken,i=we.createIfNeeded(jf.defaultWorldHillshadeServer),i.appendForwardSlash();let r=jf.getDefaultTokenCredit(n);c(r)&&(o=At.clone(r))}break;default:throw new C(`Unsupported basemap type: ${e}`)}return Um.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function sge(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),l={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Oi?(l.bboxSR=4326,l.imageSR=4326):(l.bboxSR=3857,l.imageSR=3857),e.layers&&(l.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:l})}return r}Object.defineProperties(Um.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});Um.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=we.createIfNeeded(e);n.appendForwardSlash(),c(t.token)&&n.setQueryParameters({token:t.token});let i=new Um(t);i._resource=n;let o=new rge(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Pst(n,o),o.build(i),i};Um.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Um.prototype.requestImage=function(e,t,n,i){return Ul.loadImage(this,sge(this,e,t,n,i))};Um.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,l;if(this._tilingScheme.projection instanceof Oi)s=O.toDegrees(i),a=O.toDegrees(o),l="4326";else{let p=this._tilingScheme.projection.project(new he(i,o,0));s=p.x,a=p.y,l="3857"}let u="visible";c(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:l,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],m=p.results;if(!c(m))return g;for(let y=0;y<m.length;++y){let b=m[y],x=new Bm;if(x.data=b,x.name=b.value,x.properties=b.attributes,x.configureDescriptionFromProperties(b.attributes),b.geometryType==="esriGeometryPoint"&&b.geometry){let A=b.geometry.spatialReference&&b.geometry.spatialReference.wkid?b.geometry.spatialReference.wkid:4326;if(A===4326||A===4283)x.position=he.fromDegrees(b.geometry.x,b.geometry.y,b.geometry.z);else if(A===102100||A===900913||A===3857){let E=new Li;x.position=E.unproject(new d(b.geometry.x,b.geometry.y,b.geometry.z))}}g.push(x)}return g})};Um._metadataCache={};var qy=Um;var Ist={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"},zP=Object.freeze(Ist);function HP(e){}HP.prototype.isReady=function(){return!0};HP.prototype.shouldDiscardImage=function(e){return HP.EMPTY_IMAGE===e};var kV;Object.defineProperties(HP,{EMPTY_IMAGE:{get:function(){return c(kV)||(kV=new Image,kV.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),kV}}});var GP=HP;function age(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}age.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let o=t[n];if(o.credit instanceof At)break;o.credit=new At(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let l=r[s],u=l.bbox;l.bbox=new ce(O.toRadians(u[1]),O.toRadians(u[0]),O.toRadians(u[3]),O.toRadians(u[2]))}}};function Ost(e,t){if(e.resourceSets.length!==1)throw new ae("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;c(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>c(r.bbox)))),t.attributionList=i}function Rst(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(i+=`: ${t.message}`),Io.reportError(void 0,n,c(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ae(i)}async function Mst(e,t,n){let i=e.url,o=ws._metadataCache[i];c(o)||(o=e.fetchJsonp("jsonp"),ws._metadataCache[i]=o);try{let r=await o;return Ost(r,t)}catch(r){Rst(e,r,n)}}function ws(e){e=e??W.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=e.mapStyle??zP.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,c(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new GP),this._proxy=e.proxy,this._credit=new At(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${ws.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new fs({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new pe}Object.defineProperties(ws.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return c(this.mapLayer)}}});ws.fromUrl=async function(e,t){t=t??W.EMPTY_OBJECT,T.defined("url",e),T.defined("options.key",t.key);let n=t.tileProtocol;c(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=t.mapStyle??zP.AERIAL,o=we.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};c(t.mapLayer)&&(r.mapLayer=t.mapLayer),c(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new ws(t);a._resource=o;let l=new age(t);return await Mst(s,l),l.build(a),a};var Lst=new ce;ws.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Lst);return Bst(this._attributionList,n,i)};ws.prototype.requestImage=function(e,t,n,i){let o=Ul.loadImage(this,Nst(this,e,t,n,i));if(c(o))return o.catch(function(r){return c(r.blob)&&r.blob.size===0?GP.EMPTY_IMAGE:Promise.reject(r)})};ws.prototype.pickFeatures=function(e,t,n,i,o){};ws.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;e&r&&(s|=1),t&r&&(s|=2),i+=s}return i};ws.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];s&1&&(t|=r),s&2&&(n|=r)}return{x:t,y:n,level:i}};ws._logoUrl=void 0;Object.defineProperties(ws,{logoUrl:{get:function(){return c(ws._logoUrl)||(ws._logoUrl=tn("Assets/Images/bing_maps_credit.png")),ws._logoUrl},set:function(e){T.defined("value",e),ws._logoUrl=e}}});function Nst(e,t,n,i,o){let r=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:ws.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var Fst=new ce;function Bst(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,l=!1;for(let u=0,f=s.coverageAreas.length;!l&&u<f;++u){let h=a[u];if(t>=h.zoomMin&&t<=h.zoomMax){let p=ce.intersection(n,h.bbox,Fst);c(p)&&(l=!0)}}l&&i.push(s.credit)}return i}ws._metadataCache={};var UV=ws;var cge=/{[^}]+}/g,lge={x:zst,y:Gst,z:qst,s:Yst,reverseX:Hst,reverseY:jst,reverseZ:Wst,westDegrees:Xst,southDegrees:Kst,eastDegrees:$st,northDegrees:Zst,westProjected:Qst,southProjected:Jst,eastProjected:eat,northProjected:tat,width:nat,height:iat},kst=xt(lge,{i:oat,j:rat,reverseI:sat,reverseJ:aat,longitudeDegrees:lat,latitudeDegrees:uat,longitudeProjected:fat,latitudeProjected:dat,format:mat});function jP(e){e=e??W.EMPTY_OBJECT,this._errorEvent=new pe,T.defined("options.url",e.url);let t=we.createIfNeeded(e.url),n=we.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():c(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new fs({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=ce.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new At(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,s=xt(lge,r),a=xt(kst,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=e.enablePickFeatures??!0}Object.defineProperties(jP.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});jP.prototype.getTileCredits=function(e,t,n){};jP.prototype.requestImage=function(e,t,n,i){return Ul.loadImage(this,Ust(this,e,t,n,i))};jP.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!c(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(u,f){return u.callback(f)}function l(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[r],f=Vst(s,e,t,n,i,o,u.format);return++r,u.type==="json"?f.fetchJson().then(u.callback).catch(l):u.type==="xml"?f.fetchXML().then(u.callback).catch(l):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(l):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(l)}return l()};var VV=!1,vu=new ce,zV=!1,WP=new ce;function Ust(e,t,n,i,o){VV=!1,zV=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,l={},u=s.match(cge);return c(u)&&u.forEach(function(f){let h=f.substring(1,f.length-1);c(a[h])&&(l[h]=a[h](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:l})}var YY=!1,ME=new z,XY=!1;function Vst(e,t,n,i,o,r,s){VV=!1,zV=!1,YY=!1,XY=!1;let a=e._pickFeaturesResource,l=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},h=l.match(cge);return c(h)&&h.forEach(function(p){let g=p.substring(1,p.length-1);c(u[g])&&(f[g]=u[g](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:f})}function LE(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function zst(e,t,n,i){return LE(e,"{x}",t)}function Hst(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return LE(e,"{reverseX}",o)}function Gst(e,t,n,i){return LE(e,"{y}",n)}function jst(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return LE(e,"{reverseY}",o)}function Wst(e,t,n,i){let o=e.maximumLevel,r=c(o)&&i<o?o-i-1:i;return LE(e,"{reverseZ}",r)}function qst(e,t,n,i){return LE(e,"{z}",i)}function Yst(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function HV(e,t,n,i){VV||(e.tilingScheme.tileXYToRectangle(t,n,i,vu),vu.west=O.toDegrees(vu.west),vu.south=O.toDegrees(vu.south),vu.east=O.toDegrees(vu.east),vu.north=O.toDegrees(vu.north),VV=!0)}function Xst(e,t,n,i){return HV(e,t,n,i),vu.west}function Kst(e,t,n,i){return HV(e,t,n,i),vu.south}function $st(e,t,n,i){return HV(e,t,n,i),vu.east}function Zst(e,t,n,i){return HV(e,t,n,i),vu.north}function GV(e,t,n,i){zV||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,WP),zV=!0)}function Qst(e,t,n,i){return GV(e,t,n,i),WP.west}function Jst(e,t,n,i){return GV(e,t,n,i),WP.south}function eat(e,t,n,i){return GV(e,t,n,i),WP.east}function tat(e,t,n,i){return GV(e,t,n,i),WP.north}function nat(e,t,n,i){return e.tileWidth}function iat(e,t,n,i){return e.tileHeight}function oat(e,t,n,i,o,r,s){return jV(e,t,n,i,o,r),ME.x}function rat(e,t,n,i,o,r,s){return jV(e,t,n,i,o,r),ME.y}function sat(e,t,n,i,o,r,s){return jV(e,t,n,i,o,r),e.tileWidth-ME.x-1}function aat(e,t,n,i,o,r,s){return jV(e,t,n,i,o,r),e.tileHeight-ME.y-1}var cat=new ce,RE=new d;function jV(e,t,n,i,o,r,s){if(YY)return;KY(e,t,n,i,o,r);let a=RE,l=e.tilingScheme.tileXYToNativeRectangle(t,n,i,cat);ME.x=e.tileWidth*(a.x-l.west)/l.width|0,ME.y=e.tileHeight*(l.north-a.y)/l.height|0,YY=!0}function lat(e,t,n,i,o,r,s){return O.toDegrees(o)}function uat(e,t,n,i,o,r,s){return O.toDegrees(r)}function fat(e,t,n,i,o,r,s){return KY(e,t,n,i,o,r),RE.x}function dat(e,t,n,i,o,r,s){return KY(e,t,n,i,o,r),RE.y}var hat=new he;function KY(e,t,n,i,o,r,s){if(!XY){if(e.tilingScheme.projection instanceof Oi)RE.x=O.toDegrees(o),RE.y=O.toDegrees(r);else{let a=hat;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,RE)}XY=!0}}function mat(e,t,n,i,o,r,s){return s}var hc=jP;function Wf(e){hc.call(this,e)}Wf._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return Wf._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof sp)return Wf._metadataFailure(e,t);throw o}};Wf.fromUrl=async function(e,t){T.defined("url",e);let n=we.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=t??W.EMPTY_OBJECT;let r=await Wf._requestMetadata(t,i,o);return new Wf(r)};c(Object.create)&&(Wf.prototype=Object.create(hc.prototype),Wf.prototype.constructor=Wf);function uge(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function fge(e,t,n){let i=e.positionToTileXY(ce.southwest(t),n),o=e.positionToTileXY(ce.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}Wf._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,l=/boundingbox/i,u,f,h,p=[],g=e.childNodes[0].childNodes;for(let R=0;R<g.length;R++)if(r.test(g.item(R).nodeName))u=g.item(R);else if(a.test(g.item(R).nodeName)){h=g.item(R);let L=g.item(R).childNodes;for(let B=0;B<L.length;B++)s.test(L.item(B).nodeName)&&p.push(L.item(B))}else l.test(g.item(R).nodeName)&&(f=g.item(R));let m;if(!c(h)||!c(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,c(o)&&Io.reportError(void 0,o,o.errorEvent,m),new ae(m);let y=t.fileExtension??u.getAttribute("extension"),b=t.tileWidth??parseInt(u.getAttribute("width"),10),x=t.tileHeight??parseInt(u.getAttribute("height"),10),A=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),E=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),S=h.getAttribute("profile"),v=t.tilingScheme;if(!c(v))if(S==="geodetic"||S==="global-geodetic")v=new Ki({ellipsoid:t.ellipsoid});else if(S==="mercator"||S==="global-mercator")v=new fs({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${S}.`,c(o)&&Io.reportError(void 0,o,o.errorEvent,m),new ae(m);let P=ce.clone(t.rectangle);if(!c(P)){let R,L,B,_;t.flipXY??!1?(B=new z(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new z(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(B=new z(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new z(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let D=S==="geodetic"||S==="mercator";if(v.projection instanceof Oi||D)R=he.fromDegrees(B.x,B.y),L=he.fromDegrees(_.x,_.y);else{let I=v.projection;R=I.unproject(B),L=I.unproject(_)}P=new ce(R.longitude,R.latitude,L.longitude,L.latitude)}return P=uge(P,v),A=fge(v,P,A),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${y}`}),tilingScheme:v,rectangle:P,tileWidth:b,tileHeight:x,minimumLevel:A,maximumLevel:E,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};Wf._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,o=e.tileHeight??256,r=e.maximumLevel,s=c(e.tilingScheme)?e.tilingScheme:new fs({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=uge(a,s);let l=fge(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:l,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var _x=Wf;function dge(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}dge.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function pat(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!c(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new ae(o)}if(!c(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new ae(o)}if(t.version=i.version,c(n.projection)&&n.projection==="flat")t.tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!c(n.projection)||n.projection==="mercator")t.tilingScheme=new fs({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new ae(o)}return!0}function _at(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw c(e)&&c(e.message)&&(i+=`: ${e.message}`),Io.reportError(void 0,n,c(n)?n._errorEvent:void 0,i),new ae(i)}async function gat(e,t,n){try{let i=await e.fetchText();pat(i,t)}catch(i){_at(i,e,n)}}function Vl(e){e=e??{},this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new At(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Vl.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new pe}Object.defineProperties(Vl.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});Vl.fromUrl=async function(e,t,n){T.defined("url",e),T.defined("channel",t),n=n??{};let i=n.path??"/default_map",o=we.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new dge(n);s.channel=t,await gat(r,s);let a=new Vl(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};Vl.prototype.getTileCredits=function(e,t,n){};Vl.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return Ul.loadImage(this,o)};Vl.prototype.pickFeatures=function(e,t,n,i,o){};Vl._logoUrl=void 0;Object.defineProperties(Vl,{logoUrl:{get:function(){return c(Vl._logoUrl)||(Vl._logoUrl=tn("Assets/Images/google_earth_credit.png")),Vl._logoUrl},set:function(e){T.defined("value",e),Vl._logoUrl=e}}});var WV=Vl;var yat=/\/$/,hge=new At('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function NE(e){e=e??W.EMPTY_OBJECT;let t=e.mapId;if(!c(t))throw new C("options.mapId is required.");let n=e.accessToken;if(!c(n))throw new C("options.accessToken is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=we.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let o=e.format??"png";/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();yat.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;c(e.credit)?(s=e.credit,typeof s=="string"&&(s=new At(s))):s=hge,this._resource=i,this._imageryProvider=new hc({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(NE.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});NE.prototype.getTileCredits=function(e,t,n){};NE.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};NE.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};NE._defaultCredit=hge;var qV=NE;function gx(e){e=e??W.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=e.rectangle??ce.MAX_VALUE,n=new Ki({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new pe;let i=e.credit;typeof i=="string"&&(i=new At(i)),this._credit=i,T.defined("options.url",e.url);let o=we.createIfNeeded(e.url);this._resource=o,T.typeOf.number("options.tileWidth",e.tileWidth),T.typeOf.number("options.tileHeight",e.tileHeight),this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(gx.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function bat(e,t,n,i){let o=`Failed to load image ${e.url}`;c(t)&&c(t.message)&&(o+=`: ${t.message}`);let r=Io.reportError(i,n,c(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return $Y(e,n,r);throw c(n)&&(n._hasError=!0),new ae(o)}async function $Y(e,t,n){try{return await Ul.loadImage(null,e)}catch(i){return bat(e,i,t,n)}}gx.fromUrl=async function(e,t){T.defined("url",e);let n=we.createIfNeeded(e),i=await $Y(n);t=t??W.EMPTY_OBJECT;let o=new gx({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};gx.prototype.getTileCredits=function(e,t,n){};gx.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!c(this._image)){let o=await $Y(this._resource,this);return this._image=o,Io.reportSuccess(this._errorEvent),o}return this._image};gx.prototype.pickFeatures=function(e,t,n,i,o){};var YV=gx;function xat(e,t,n){if(!c(e))throw new C("type is required.");if(this.type=e,!c(t))if(e==="json")t="application/json";else if(e==="xml")t="text/xml";else if(e==="html")t="text/html";else if(e==="text")t="text/plain";else throw new C('format is required when type is not "json", "xml", "html", or "text".');if(this.format=t,!c(n))if(e==="json")n=Tat;else if(e==="xml")n=Sat;else if(e==="html")n=mge;else if(e==="text")n=mge;else throw new C('callback is required when type is not "json", "xml", "html", or "text".');this.callback=n}function Tat(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Bm;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),c(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=he.fromDegrees(s,a)}t.push(r)}return t}var ZY="http://www.mapinfo.com/mxp",Aat="http://www.esri.com/wms",Cat="http://www.opengis.net/wfs",Eat="http://www.opengis.net/gml";function Sat(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===ZY)return wat(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Aat)return vat(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Cat)return Dat(e);if(t.localName==="ServiceExceptionReport")throw new ae(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Pat(e):Iat(e)}function wat(e){let t=[],i=e.documentElement.getElementsByTagNameNS(ZY,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(ZY,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let h=f.getAttribute("ref"),p=f.textContent.trim();s[h]=p}}let l=new Bm;l.data=r,l.properties=s,l.configureNameFromProperties(s),l.configureDescriptionFromProperties(s),t.push(l)}return t}function vat(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let l=0;l<a.length;++l){let u=a[l];i[u.name]=u.value}n.push(XV(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let l=a.childNodes;for(let u=0;u<l.length;++u){let f=l[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(XV(a,i))}}return n}function Dat(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Eat,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};QY(r,s),t.push(XV(r,s))}return t}function Pat(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!c(n))throw new ae("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};QY(s,a),t.push(XV(s,a))}}return t}function QY(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let o=e.childNodes[i];o.nodeType===Node.ELEMENT_NODE&&(n=!1),!(o.localName==="Point"||o.localName==="LineString"||o.localName==="Polygon"||o.localName==="boundedBy")&&o.hasChildNodes()&&QY(o,t)&&(t[o.localName]=o.textContent)}return n}function XV(e,t){let n=new Bm;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Iat(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Bm;return o.data=e,o.description=n.innerHTML,[o]}var Oat=/<body>\s*<\/body>/im,Rat=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Mat=/<title>([\s\S]*)<\/title>/im;function mge(e){if(Oat.test(e)||Rat.test(e))return;let t,n=Mat.exec(e);n&&n.length>1&&(t=n[1]);let i=new Bm;return i.name=t,i.description=e,i.data=e,[i]}var FE=xat;function qP(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.clock",e.clock),T.typeOf.object("options.times",e.times),T.typeOf.func("options.requestImageFunction",e.requestImageFunction),T.typeOf.func("options.reloadFunction",e.reloadFunction),this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(qP.prototype,{clock:{get:function(){return this._clock},set:function(e){if(!c(e))throw new C("value is required.");this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){if(!c(e))throw new C("value is required.");this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});qP.prototype.getFromCache=function(e,t,n,i){let o=pge(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(c(s)&&c(s[o])){let a=s[o];r=a.promise.catch(function(l){throw i.state=a.request.state,l}),delete s[o]}return r};qP.prototype.checkApproachingInterval=function(e,t,n,i){let o=pge(e,t,n),r=this._tilesRequestedForInterval,s=_ge(this),a={key:o,priorityFunction:i.priorityFunction};(!c(s)||!gge(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};qP.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=_ge(this);if(c(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let l=s.pop();a=gge(this,l,r),a||s.push(l)}}};function pge(e,t,n){return`${e}-${t}-${n}`}function Lat(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function _ge(e){let t=e._times;if(!c(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let l=t.get(a);return r>0?(s=Q.secondsDifference(l.stop,i),++a):(s=Q.secondsDifference(l.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function gge(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];c(r)||(r=o[i]={});let s=t.key;if(c(r[s]))return!0;let a=Lat(s),l=new ir({throttle:!1,throttleByServer:!0,type:gs.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,l,n);return c(u)?(r[s]={promise:u,request:l},!0):!1}var BE=qP;var Nat=[3034,3035,3042,3043,3044],Fat=[4471,4559];function sh(e){if(e=e??W.EMPTY_OBJECT,!c(e.url))throw new C("options.url is required.");if(!c(e.layers))throw new C("options.layers is required.");if(c(e.times)&&!c(e.clock))throw new C("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=we.createIfNeeded(e.url),n=we.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(sh.DefaultParameters,!0),n.setQueryParameters(sh.GetFeatureInfoDefaultParameters,!0),c(e.parameters)&&t.setQueryParameters(yge(e.parameters)),c(e.getFeatureInfoParameters)&&n.setQueryParameters(yge(e.getFeatureInfoParameters));let i=this;this._reload=void 0,c(e.times)&&(this._timeDynamicImagery=new BE({clock:e.clock,times:e.times,requestImageFunction:function(s,a,l,u,f){return bge(i,s,a,l,u,f)},reloadFunction:function(){c(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof Li?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!Fat.includes(a)||Nat.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof Li?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new hc({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Ki({ellipsoid:e.ellipsoid}),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:e.getFeatureInfoFormats??sh.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function bge(e,t,n,i,o,r){let s=c(r)?r.data:void 0,a=e._tileProvider;return c(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function Bat(e,t,n,i,o,r,s){let a=c(s)?s.data:void 0,l=e._tileProvider;return c(a)&&l._pickFeaturesResource.setQueryParameters(a),l.pickFeatures(t,n,i,o,r)}Object.defineProperties(sh.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});sh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};sh.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return c(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),c(o)||(o=bge(this,e,t,n,i,s)),c(o)&&c(r)&&r.checkApproachingInterval(e,t,n,i),o};sh.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=c(r)?r.currentInterval:void 0;return Bat(this,e,t,n,i,o,s)};sh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});sh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});sh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new FE("json","application/json")),Object.freeze(new FE("xml","text/xml")),Object.freeze(new FE("text","text/html"))]);function yge(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var KV=sh;var kat=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});function YP(e){if(e=e??W.EMPTY_OBJECT,!c(e.url))throw new C("options.url is required.");if(!c(e.layer))throw new C("options.layer is required.");if(!c(e.style))throw new C("options.style is required.");if(!c(e.tileMatrixSetID))throw new C("options.tileMatrixSetID is required.");if(c(e.times)&&!c(e.clock))throw new C("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=we.createIfNeeded(e.url),n=e.style,i=e.tileMatrixSetID,o=t.url,r=o.match(/{/g);if(!c(r)||r.length===1&&/{s}/.test(o))t.setQueryParameters(kat),this._useKvp=!0;else{let h={style:n,Style:n,TileMatrixSet:i};t.setTemplateValues(h),this._useKvp=!1}this._resource=t,this._layer=e.layer,this._style=n,this._tileMatrixSetID=i,this._tileMatrixLabels=e.tileMatrixLabels,this._format=e.format??"image/jpeg",this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=c(e.tilingScheme)?e.tilingScheme:new fs({ellipsoid:e.ellipsoid}),this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._dimensions=e.dimensions;let s=this;this._reload=void 0,c(e.times)&&(this._timeDynamicImagery=new BE({clock:e.clock,times:e.times,requestImageFunction:function(h,p,g,m,y){return xge(s,h,p,g,m,y)},reloadFunction:function(){c(s._reload)&&s._reload()}}));let a=this._tilingScheme.positionToTileXY(ce.southwest(this._rectangle),this._minimumLevel),l=this._tilingScheme.positionToTileXY(ce.northeast(this._rectangle),this._minimumLevel),u=(Math.abs(l.x-a.x)+1)*(Math.abs(l.y-a.y)+1);if(u>4)throw new C(`The imagery provider's rectangle and minimumLevel indicate that there are ${u} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`);this._errorEvent=new pe;let f=e.credit;this._credit=typeof f=="string"?new At(f):f,this._subdomains=e.subdomains,Array.isArray(this._subdomains)?this._subdomains=this._subdomains.slice():c(this._subdomains)&&this._subdomains.length>0?this._subdomains=this._subdomains.split(""):this._subdomains=["a","b","c"]}function xge(e,t,n,i,o,r){let s=e._tileMatrixLabels,a=c(s)?s[i]:i.toString(),l=e._subdomains,u=e._dimensions,f=c(r)?r.data:void 0,h,p;if(!e._useKvp)p={TileMatrix:a,TileRow:n.toString(),TileCol:t.toString(),s:l[(t+n+i)%l.length]},h=e._resource.getDerivedResource({request:o}),h.setTemplateValues(p),c(u)&&h.setTemplateValues(u),c(f)&&h.setTemplateValues(f);else{let g={};g.tilematrix=a,g.layer=e._layer,g.style=e._style,g.tilerow=n,g.tilecol=t,g.tilematrixset=e._tileMatrixSetID,g.format=e._format,c(u)&&(g=xt(g,u)),c(f)&&(g=xt(g,f)),p={s:l[(t+n+i)%l.length]},h=e._resource.getDerivedResource({queryParameters:g,request:o}),h.setTemplateValues(p)}return Ul.loadImage(e,h)}Object.defineProperties(YP.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,c(this._reload)&&this._reload())}}});YP.prototype.getTileCredits=function(e,t,n){};YP.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return c(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),c(o)||(o=xge(this,e,t,n,i,s)),c(o)&&c(r)&&r.checkApproachingInterval(e,t,n,i),o};YP.prototype.pickFeatures=function(e,t,n,i,o){};var $V=YP;var Uat={ARCGIS_MAPSERVER:qy.fromUrl,BING:async(e,t)=>UV.fromUrl(e,t),GOOGLE_EARTH:async(e,t)=>{let n=t.channel;return delete t.channel,WV.fromUrl(e,n,t)},MAPBOX:(e,t)=>new qV({url:e,...t}),SINGLE_TILE:YV.fromUrl,TMS:_x.fromUrl,URL_TEMPLATE:(e,t)=>new hc({url:e,...t}),WMS:(e,t)=>new KV({url:e,...t}),WMTS:(e,t)=>new $V({url:e,...t})};function Vm(e){e=e??W.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new pe}Object.defineProperties(Vm.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});Vm.fromAssetId=async function(e,t){T.typeOf.number("assetId",e),t=t??W.EMPTY_OBJECT;let n=uf._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=Vm._endpointCache[i];c(o)||(o=n.fetchJson(),Vm._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new ae(`Cesium ion asset ${e} is not an imagery asset.`);let s,a=r.externalType;if(!c(a))s=await _x.fromUrl(new uf(r,n));else{let u=Uat[a];if(!c(u))throw new ae(`Unrecognized Cesium ion imagery type: ${a}`);let f={...r.options},h=f.url;delete f.url,s=await u(h,f)}let l=new Vm(t);return s.errorEvent.addEventListener(function(u){u.provider=l,l._errorEvent.raiseEvent(u)}),l._tileCredits=uf.getCreditsFromEndpoint(r,n),l._imageryProvider=s,l};Vm.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return c(i)?this._tileCredits.concat(i):this._tileCredits};Vm.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Vm.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Vm._endpointCache={};var Yy=Vm;var Vat={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4},Xy=Object.freeze(Vat);function zat(e){e=e??W.EMPTY_OBJECT;let t=e.style??Xy.AERIAL;return Yy.fromAssetId(t)}var Ky=zat;function kE(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=ai.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!c(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}kE.createPlaceholder=function(e){let t=new kE(e,0,0,0);return t.addReference(),t.state=ai.PLACEHOLDER,t};kE.prototype.addReference=function(){++this.referenceCount};kE.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),c(this.parent)&&this.parent.releaseReference(),c(this.image)&&c(this.image.destroy)&&this.image.destroy(),c(this.texture)&&this.texture.destroy(),c(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),de(this),0):this.referenceCount};kE.prototype.processStateMachine=function(e,t,n){this.state===ai.UNLOADED&&!n&&(this.state=ai.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===ai.RECEIVED&&(this.state=ai.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===ai.READY&&t&&!this.texture;(this.state===ai.TEXTURE_LOADED||i)&&(this.state=ai.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var XP=kE;function JY(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}JY.prototype.freeResources=function(){c(this.readyImagery)&&this.readyImagery.releaseReference(),c(this.loadingImagery)&&this.loadingImagery.releaseReference()};JY.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===ai.READY)return c(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;c(r)&&(r.state!==ai.READY||!this.useWebMercatorT&&!c(r.texture));)r.state!==ai.FAILED&&r.state!==ai.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(c(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,c(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===ai.FAILED||i.state===ai.INVALID?c(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var KP=JY;function _i(e,t){this._imageryProvider=e,this._readyEvent=new pe,this._errorEvent=new pe,t=t??W.EMPTY_OBJECT,e=e??W.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??_i.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??_i.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??_i.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??_i.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??_i.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??_i.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??_i.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??_i.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??ce.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new KP(XP.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=t.colorToAlphaThreshold??_i.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(_i.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return c(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});_i.DEFAULT_BRIGHTNESS=1;_i.DEFAULT_CONTRAST=1;_i.DEFAULT_HUE=0;_i.DEFAULT_SATURATION=1;_i.DEFAULT_GAMMA=1;_i.DEFAULT_SPLIT=qr.NONE;_i.DEFAULT_MINIFICATION_FILTER=Yt.LINEAR;_i.DEFAULT_MAGNIFICATION_FILTER=ui.LINEAR;_i.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;_i.fromProviderAsync=function(e,t){T.typeOf.object("imageryProviderPromise",e);let n=new _i(void 0,t);return qat(n,Promise.resolve(e)),n};_i.fromWorldImagery=function(e){return e=e??W.EMPTY_OBJECT,_i.fromProviderAsync(Ky({style:e.style}),e)};_i.prototype.isBaseLayer=function(){return this._isBaseLayer};_i.prototype.isDestroyed=function(){return!1};_i.prototype.destroy=function(){return de(this)};var Cge=new ce,Tge=new ce,eX=new ce,Ege=new ce;_i.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ce.intersection(e.rectangle,t)};_i.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!c(t)||c(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||c(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;c(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof Li&&e.rectangle.north<Li.MaximumLatitude&&e.rectangle.south>-Li.MaximumLatitude,s=ce.intersection(o.rectangle,this._rectangle,Cge),a=ce.intersection(e.rectangle,s,Tge);if(!c(a)){if(!this.isBaseLayer())return!1;let D=s,I=e.rectangle;a=Tge,I.south>=D.north?a.north=a.south=D.north:I.north<=D.south?a.north=a.south=D.south:(a.south=Math.max(I.south,D.south),a.north=Math.min(I.north,D.north)),I.west>=D.east?a.west=a.east=D.east:I.east<=D.west?a.west=a.east=D.west:(a.west=Math.max(I.west,D.west),a.east=Math.min(I.east,D.east))}let l=0;a.south>0?l=a.south:a.north<0&&(l=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),h=jat(this,f,l);h=Math.max(0,h);let p=o.maximumLevel;if(h>p&&(h=p),c(o.minimumLevel)){let D=o.minimumLevel;h<D&&(h=D)}let g=o.tilingScheme,m=g.positionToTileXY(ce.northwest(a),h),y=g.positionToTileXY(ce.southeast(a),h),b=e.rectangle.width/512,x=e.rectangle.height/512,A=g.tileXYToRectangle(m.x,m.y,h);Math.abs(A.south-e.rectangle.north)<x&&m.y<y.y&&++m.y,Math.abs(A.east-e.rectangle.west)<b&&m.x<y.x&&++m.x;let E=g.tileXYToRectangle(y.x,y.y,h);Math.abs(E.north-e.rectangle.south)<x&&y.y>m.y&&--y.y,Math.abs(E.west-e.rectangle.east)<b&&y.x>m.x&&--y.x;let S=ce.clone(e.rectangle,Ege),v=g.tileXYToRectangle(m.x,m.y,h),P=ce.intersection(v,s,eX),M;r?(g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(v,v),g.rectangleToNativeRectangle(P,P),g.rectangleToNativeRectangle(s,s),M=g.tileXYToNativeRectangle.bind(g),b=S.width/512,x=S.height/512):M=g.tileXYToRectangle.bind(g);let R,L=0,B=1,_;!this.isBaseLayer()&&Math.abs(P.west-S.west)>=b&&(L=Math.min(1,(P.west-S.west)/S.width)),!this.isBaseLayer()&&Math.abs(P.north-S.north)>=x&&(B=Math.max(0,(P.north-S.south)/S.height));let w=B;for(let D=m.x;D<=y.x;D++)if(R=L,v=M(D,m.y,h),P=ce.simpleIntersection(v,s,eX),!!c(P)){L=Math.min(1,(P.east-S.west)/S.width),D===y.x&&(this.isBaseLayer()||Math.abs(P.east-S.east)<b)&&(L=1),B=w;for(let I=m.y;I<=y.y;I++){if(_=B,v=M(D,I,h),P=ce.simpleIntersection(v,s,eX),!c(P))continue;B=Math.max(0,(P.south-S.south)/S.height),I===y.y&&(this.isBaseLayer()||Math.abs(P.south-S.south)<x)&&(B=0);let N=new se(R,B,L,_),k=this.getImageryFromCache(D,I,h);i.imagery.splice(n,0,new KP(k,N,r)),++n}}return!0};_i.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let l=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=l.rectangleToNativeRectangle(n,Cge),i=l.rectangleToNativeRectangle(i,Ege)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new se(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};_i.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!c(s))return o();e.image=s,e.state=ai.RECEIVED,e.request=void 0,Io.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===Zn.CANCELLED){e.state=ai.UNLOADED,e.request=void 0;return}e.state=ai.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Io.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new ir({throttle:!1,throttleByServer:!0,type:gs.IMAGERY});e.request=s,e.state=ai.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!c(a)){e.state=ai.UNLOADED,e.request=void 0;return}c(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(l){i(l)}).catch(function(l){o(l)})}r()};_i.prototype._createTextureWebGL=function(e,t){let n=new Qt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return c(i.internalFormat)?new Rt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Rt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?ke.RGBA:ke.RGB,sampler:n})};_i.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(c(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(c(r)){if(!r.isReady()){t.state=ai.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=ai.INVALID;return}}}if(this.minificationFilter!==Yt.NEAREST&&this.minificationFilter!==Yt.LINEAR)throw new C("ImageryLayer minification filter must be NEAREST or LINEAR");let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Li?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=ai.TEXTURE_LOADED};function Age(e,t,n){return`${e}:${t}:${n}`}_i.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Yt.LINEAR&&i===ui.LINEAR&&!ke.isCompressedFormat(t.pixelFormat)&&O.isPowerOfTwo(t.width)&&O.isPowerOfTwo(t.height)){n=Yt.LINEAR_MIPMAP_LINEAR;let r=ut.maximumTextureFilterAnisotropy,s=Math.min(r,this._maximumAnisotropy??r),a=Age(n,i,s),l=e.cache.imageryLayerMipmapSamplers;c(l)||(l={},e.cache.imageryLayerMipmapSamplers=l);let u=l[a];c(u)||(u=l[a]=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(hd.NICEST),t.sampler=u}else{let r=Age(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;c(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];c(a)||(a=s[r]=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};_i.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof Oi)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new cl({persists:!0,owner:this,preExecute:function(l){Gat(l,r,i,t.rectangle)},postExecute:function(l){t.texture=l,s._finalizeReprojectTexture(r,l),t.state=ai.READY,t.releaseReference()},canceled:function(){t.state=ai.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=ai.READY};_i.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};_i.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){c(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};_i.prototype.getImageryFromCache=function(e,t,n,i){let o=Sge(e,t,n),r=this._imageryCache[o];return c(r)||(r=new XP(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};_i.prototype.removeImageryFromCache=function(e){let t=Sge(e.x,e.y,e.level);delete this._imageryCache[t]};function Sge(e,t,n){return JSON.stringify([e,t,n])}var ZV={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new z,texture:void 0},Hat=zt.supportsTypedArrays()?new Float32Array(2*64):void 0;function Gat(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!c(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){c(this.framebuffer)&&this.framebuffer.destroy(),c(this.vertexArray)&&this.vertexArray.destroy(),c(this.shaderProgram)&&this.shaderProgram.destroy()}};let b=new Float32Array(2*64*2),x=0;for(let P=0;P<64;++P){let M=P/63;b[x++]=0,b[x++]=M,b[x++]=1,b[x++]=M}let A={position:0,webMercatorT:1},E=us.getRegularGridIndices(2,64),S=bt.createIndexBuffer({context:t,typedArray:E,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});o.vertexArray=new ni({context:t,attributes:[{index:A.position,vertexBuffer:bt.createVertexBuffer({context:t,typedArray:b,usage:Be.STATIC_DRAW}),componentsPerAttribute:2},{index:A.webMercatorT,vertexBuffer:bt.createVertexBuffer({context:t,sizeInBytes:64*2*4,usage:Be.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:S});let v=new He({sources:[xV]});o.shaderProgram=en.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:bV,attributeLocations:A}),o.sampler=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:ui.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;ZV.textureDimensions.x=r,ZV.textureDimensions.y=s,ZV.texture=n;let a=Math.sin(i.south),l=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-l),h=new Rt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});O.isPowerOfTwo(r)&&O.isPowerOfTwo(s)&&h.generateMipmap(hd.NICEST);let p=i.south,g=i.north,m=Hat,y=0;for(let b=0;b<64;++b){let x=b/63,A=O.lerp(p,g,x);a=Math.sin(A);let S=(.5*Math.log((1+a)/(1-a))-l)*f;m[y++]=S,m[y++]=S}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=o.shaderProgram,e.outputTexture=h,e.uniformMap=ZV,e.vertexArray=o.vertexArray}function jat(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Oi?1:Math.cos(n),a=o.rectangle,u=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function Wat(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function qat(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Wat(e._errorEvent,i)}}var mc=_i;var Yat={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},yn=Yat;var wge={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=wge.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},Yn=wge;function VE(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se}VE.prototype.update=function(e,t,n){this.changedThisFrame&&(Mge(e,t,this.tile,n),this.changedThisFrame=!1)};VE.prototype.destroy=function(e){this._destroyVertexArray(e),c(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};VE.prototype._destroyVertexArray=function(e){c(this.vertexArray)&&(c(e)?e.push(this.vertexArray):rh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var Xat=new pb;VE.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=Xat;a.clear();for(let u=0;u<t.length;++u){let f=t[u];c(f.data.vertexArray)&&a.enqueue(t[u])}let l=a.dequeue();for(;l!==void 0;){let u=l.findTileToWest(r),f=l.findTileToSouth(r),h=l.findTileToEast(r),p=l.findTileToNorth(r);vs(e,n,l,u,s,yn.EAST,!1,a,i),vs(e,n,l,f,s,yn.NORTH,!1,a,i),vs(e,n,l,h,s,yn.WEST,!1,a,i),vs(e,n,l,p,s,yn.SOUTH,!1,a,i);let g=u.findTileToNorth(r),m=u.findTileToSouth(r),y=h.findTileToNorth(r),b=h.findTileToSouth(r);vs(e,n,l,g,s,yn.SOUTHEAST,!1,a,i),vs(e,n,l,y,s,yn.SOUTHWEST,!1,a,i),vs(e,n,l,m,s,yn.NORTHEAST,!1,a,i),vs(e,n,l,b,s,yn.NORTHWEST,!1,a,i),l=a.dequeue()}};function vs(e,t,n,i,o,r,s,a,l){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==o||Yn.wasKicked(u._lastSelectionResult)||Yn.originalResult(u._lastSelectionResult)===Yn.CULLED);){if(s)return;let f=u.parent;if(r>=yn.NORTHWEST&&f!==void 0)switch(r){case yn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case yn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case yn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case yn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===Yn.RENDERED){if(c(u.data.vertexArray))return;Kat(e,t,n,u,r,o,a,l);return}if(Yn.originalResult(i._lastSelectionResult)!==Yn.CULLED)switch(r){case yn.WEST:vs(e,t,n,i.northwestChild,o,r,!0,a,l),vs(e,t,n,i.southwestChild,o,r,!0,a,l);break;case yn.EAST:vs(e,t,n,i.southeastChild,o,r,!0,a,l),vs(e,t,n,i.northeastChild,o,r,!0,a,l);break;case yn.SOUTH:vs(e,t,n,i.southwestChild,o,r,!0,a,l),vs(e,t,n,i.southeastChild,o,r,!0,a,l);break;case yn.NORTH:vs(e,t,n,i.northeastChild,o,r,!0,a,l),vs(e,t,n,i.northwestChild,o,r,!0,a,l);break;case yn.NORTHWEST:vs(e,t,n,i.northwestChild,o,r,!0,a,l);break;case yn.NORTHEAST:vs(e,t,n,i.northeastChild,o,r,!0,a,l);break;case yn.SOUTHWEST:vs(e,t,n,i.southwestChild,o,r,!0,a,l);break;case yn.SOUTHEAST:vs(e,t,n,i.southeastChild,o,r,!0,a,l);break;default:throw new C("Invalid edge")}}}function Kat(e,t,n,i,o,r,s,a){let l=i.data;if(l.fill===void 0)l.fill=new VE(i);else if(l.fill.visitedFrame===r)return;l.fill.enqueuedFrame!==r&&(l.fill.enqueuedFrame=r,l.fill.changedThisFrame=!1,s.enqueue(i)),$at(e,t,n,i,o,a)}function $at(e,t,n,i,o,r){let s=i.data.fill,a,l=n.data.fill;c(l)?(l.visitedFrame=t.frameNumber,l.changedThisFrame&&(Mge(e,t,n,r),l.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(o){case yn.WEST:u=s.westMeshes,f=s.westTiles;break;case yn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case yn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case yn.NORTH:u=s.northMeshes,f=s.northTiles;break;case yn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case yn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case yn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case yn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let h,p,g,m,y=n.rectangle,b,x=i.rectangle;switch(o){case yn.WEST:for(b=(x.north-x.south)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.greaterThan(y.north,m.south,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.greaterThanOrEquals(y.south,m.north,b));++p);break;case yn.SOUTH:for(b=(x.east-x.west)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.lessThan(y.west,m.east,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.lessThanOrEquals(y.east,m.west,b));++p);break;case yn.EAST:for(b=(x.north-x.south)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.lessThan(y.south,m.north,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.lessThanOrEquals(y.north,m.south,b));++p);break;case yn.NORTH:for(b=(x.east-x.west)*O.EPSILON5,h=0;h<f.length&&(g=f[h],m=g.rectangle,!O.greaterThan(y.east,m.west,b));++h);for(p=h;p<f.length&&(g=f[p],m=g.rectangle,!O.greaterThanOrEquals(y.west,m.east,b));++p);break}p-h===1?(s.changedThisFrame=s.changedThisFrame||u[h]!==a,u[h]=a,f[h]=n):(s.changedThisFrame=!0,u.splice(h,p-h,a),f.splice(h,p-h,n))}var yx=new he,Zat=new he,UE=new d,oX=new d,tX=new z,nX=new z,Du=new z;function oz(){this.height=0,this.encodedNormal=new z}function QV(e,t,n,i,o,r,s,a,l){if(c(o))return o;let u;if(c(r)&&c(s))u=(r.height+s.height)*.5;else if(c(r))u=r.height;else if(c(s))u=s.height;else if(c(a))u=a.height;else{let h=e.tile.data.tileBoundingRegion,p=0,g=0;c(h)&&(p=h.minimumHeight,g=h.maximumHeight),u=(p+g)*.5}return Lge(e,t,n,i,u,l),l}var Qat={minimumHeight:0,maximumHeight:0},Jat=new d,vge=new oz,Dge=new oz,Pge=new oz,Ige=new oz,ect=typeof Uint8Array<"u"?new Uint8Array(9*9):void 0,tct={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function Mge(e,t,n,i){rh.initialize(n,e.terrainProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,l=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,h=ez(r,f,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,Pge),p=ez(r,f,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,vge),g=ez(r,f,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,Dge),m=ez(r,f,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,Ige);h=QV(r,f,0,1,h,p,m,g,Pge),p=QV(r,f,0,0,p,h,g,m,vge),g=QV(r,f,1,1,g,p,m,h,Dge),m=QV(r,f,1,1,m,g,h,p,Ige);let y=p.height,b=g.height,x=h.height,A=m.height,E=Math.min(y,b,x,A),S=Math.max(y,b,x,A),v=(E+S)*.5,P,M,R=e.getLevelMaximumGeometricError(n.level),L=f.maximumRadius-R,B=Math.acos(L/f.maximumRadius)*4;if(B*=1.5,s.width>B&&S-E<=R){let D=new dc({width:9,height:9,buffer:ect,structure:{heightOffset:S}}),I=tct;I.tilingScheme=n.tilingScheme,I.x=n.x,I.y=n.y,I.level=n.level,I.exaggeration=a,I.exaggerationRelativeHeight=l,r.mesh=D._createMeshSync(I)}else{let D=u,I=ce.center(s,Zat);I.height=v;let N=f.cartographicToCartesian(I,Jat),k=new Zc(N,void 0,void 0,void 0,void 0,!0,!0,D,a,l),H=5,V;for(V=r.westMeshes,P=0,M=V.length;P<M;++P)H+=V[P].eastIndicesNorthToSouth.length;for(V=r.southMeshes,P=0,M=V.length;P<M;++P)H+=V[P].northIndicesWestToEast.length;for(V=r.eastMeshes,P=0,M=V.length;P<M;++P)H+=V[P].westIndicesSouthToNorth.length;for(V=r.northMeshes,P=0,M=V.length;P<M;++P)H+=V[P].southIndicesEastToWest.length;let j=Qat;j.minimumHeight=E,j.maximumHeight=S;let U=k.stride,q=new Float32Array(H*U),X=0,te=X;X=JV(f,s,k,q,X,0,1,h.height,h.encodedNormal,1,j),X=nz(r,f,k,q,X,r.westTiles,r.westMeshes,yn.EAST,j);let K=X;X=JV(f,s,k,q,X,0,0,p.height,p.encodedNormal,0,j),X=nz(r,f,k,q,X,r.southTiles,r.southMeshes,yn.NORTH,j);let Z=X;X=JV(f,s,k,q,X,1,0,g.height,g.encodedNormal,0,j),X=nz(r,f,k,q,X,r.eastTiles,r.eastMeshes,yn.WEST,j);let ee=X;X=JV(f,s,k,q,X,1,1,m.height,m.encodedNormal,1,j),X=nz(r,f,k,q,X,r.northTiles,r.northMeshes,yn.SOUTH,j),E=j.minimumHeight,S=j.maximumHeight;let me=Pn.fromRectangle(s,E,S,n.tilingScheme.ellipsoid),xe=Li.geodeticLatitudeToMercatorAngle(s.south),ue=1/(Li.geodeticLatitudeToMercatorAngle(s.north)-xe),ye=(Li.geodeticLatitudeToMercatorAngle(I.latitude)-xe)*ue,Ae=f.geodeticSurfaceNormalCartographic(yx,oX),Pe=Ln.octEncode(Ae,tX),Ee=X;k.encode(q,X*U,me.center,z.fromElements(.5,.5,Du),v,Pe,ye,Ae),++X;let Ve=X,je=Ve<256?1:2,it=(Ve-1)*3,Dt=it*je,Gt=(q.length-Ve*U)*Float32Array.BYTES_PER_ELEMENT,$e;if(Gt>=Dt){let _e=Ve*U*Float32Array.BYTES_PER_ELEMENT;$e=Ve<256?new Uint8Array(q.buffer,_e,it):new Uint16Array(q.buffer,_e,it)}else $e=Ve<256?new Uint8Array(it):new Uint16Array(it);q=new Float32Array(q.buffer,0,Ve*U);let ln=0;for(P=0;P<Ve-2;++P)$e[ln++]=Ee,$e[ln++]=P,$e[ln++]=P+1;$e[ln++]=Ee,$e[ln++]=P,$e[ln++]=0;let Vt=[];for(P=K;P>=te;--P)Vt.push(P);let Ct=[];for(P=Z;P>=K;--P)Ct.push(P);let gi=[];for(P=ee;P>=Z;--P)gi.push(P);let an=[];for(an.push(0),P=Ee-1;P>=ee;--P)an.push(P);r.mesh=new oh(k.center,q,$e,it,Ve,E,S,le.fromOrientedBoundingBox(me),cct(e,me.center,s,E,S),k.stride,me,k,Vt,Ct,gi,an)}let _=t.context;r._destroyVertexArray(i),r.vertexArray=rh._createVertexArrayForMesh(_,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let w=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let D=o._findAncestorTileWithTerrainData(n);c(D)&&c(D.data.waterMaskTexture)&&(r.waterMaskTexture=D.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,D,r.waterMaskTranslationAndScale))}c(w)&&(--w.referenceCount,w.referenceCount===0&&w.destroy())}function JV(e,t,n,i,o,r,s,a,l,u,f){let h=yx;h.longitude=O.lerp(t.west,t.east,r),h.latitude=O.lerp(t.south,t.north,s),h.height=a;let p=e.cartographicToCartesian(h,UE),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,oX));let m=nX;return m.x=r,m.y=s,n.encode(i,o*n.stride,p,m,a,l,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),o+1}var iz=new ce;function $P(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=ce.clone(e.rectangle,iz),o.west-=O.TWO_PI,o.east-=O.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=ce.clone(e.rectangle,iz),o.west+=O.TWO_PI,o.east+=O.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,l=(r.east-o.west)/s,u=o.north-o.south,f=(r.south-o.south)/u,h=(r.north-o.south)/u,p=(n.x-a)/(l-a),g=(n.y-f)/(h-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var nct=new z;function iX(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var ict=new z,oct=new d;function rct(e,t,n,i,o,r,s,a,l,u){let f=i.encoding,h=i.vertices,p=$P(t,n,f.decodeTextureCoordinates(h,o,Du),Du),g=$P(t,n,f.decodeTextureCoordinates(h,r,nX),nX),m;l?m=(s-p.x)/(g.x-p.x):m=(a-p.y)/(g.y-p.y);let y=f.decodeHeight(h,o),b=f.decodeHeight(h,r),x=n.rectangle;yx.longitude=O.lerp(x.west,x.east,s),yx.latitude=O.lerp(x.south,x.north,a),u.height=yx.height=O.lerp(y,b,m);let A;if(f.hasVertexNormals){let E=f.getOctEncodedNormal(h,o,nct),S=f.getOctEncodedNormal(h,r,ict),v=Ln.octDecode(E.x,E.y,UE),P=Ln.octDecode(S.x,S.y,oct);A=d.lerp(v,P,m,UE),d.normalize(A,A),Ln.octEncode(A,u.encodedNormal)}else A=e.geodeticSurfaceNormalCartographic(yx,UE),Ln.octEncode(A,u.encodedNormal)}function Lge(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(yx,UE);Ln.octEncode(s,r.encodedNormal)}function ez(e,t,n,i,o,r,s,a,l,u,f){if(Rge(e,t,a,s,!1,n,i,f)||Rge(e,t,u,l,!0,n,i,f))return f;let p;if(rX(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],iX(r,p,n,i,f),f;let g;if(n===0?i===0?g=tz(e.westMeshes,e.westTiles,yn.EAST,e.southMeshes,e.southTiles,yn.NORTH,n,i):g=tz(e.northMeshes,e.northTiles,yn.SOUTH,e.westMeshes,e.westTiles,yn.EAST,n,i):i===0?g=tz(e.southMeshes,e.southTiles,yn.NORTH,e.eastMeshes,e.eastTiles,yn.WEST,n,i):g=tz(e.eastMeshes,e.eastTiles,yn.WEST,e.northMeshes,e.northTiles,yn.SOUTH,n,i),c(g))return Lge(e,t,n,i,g,f),f}function tz(e,t,n,i,o,r,s,a){let l=Oge(e,t,!1,n,s,a),u=Oge(i,o,!0,r,s,a);return c(l)&&c(u)?(l+u)*.5:c(l)?l:u}function nz(e,t,n,i,o,r,s,a,l){for(let u=0;u<r.length;++u)o=sct(e,t,n,i,o,r[u],s[u],a,l);return o}function sct(e,t,n,i,o,r,s,a,l){let u=r.rectangle;a===yn.EAST&&e.tile.x===0?(u=ce.clone(r.rectangle,iz),u.west-=O.TWO_PI,u.east-=O.TWO_PI):a===yn.WEST&&r.x===0&&(u=ce.clone(r.rectangle,iz),u.west+=O.TWO_PI,u.east+=O.TWO_PI);let f=e.tile.rectangle,h,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Du),h=Du.x,p=Du.y);let g,m;switch(a){case yn.WEST:g=s.westIndicesSouthToNorth,m=!1;break;case yn.NORTH:g=s.northIndicesWestToEast,m=!0;break;case yn.EAST:g=s.eastIndicesNorthToSouth,m=!1;break;case yn.SOUTH:g=s.southIndicesEastToWest,m=!0;break}let y=r,b=e.tile,x=s.encoding,A=s.vertices,E=n.stride,S,v;x.hasWebMercatorT&&(S=Li.geodeticLatitudeToMercatorAngle(f.south),v=1/(Li.geodeticLatitudeToMercatorAngle(f.north)-S));for(let P=0;P<g.length;++P){let M=g[P],R=x.decodeTextureCoordinates(A,M,Du);$P(y,b,R,R);let L=R.x,B=R.y,_=m?L:B;if(_<0||_>1||Math.abs(L-h)<O.EPSILON5&&Math.abs(B-p)<O.EPSILON5)continue;let w=Math.abs(L)<O.EPSILON5||Math.abs(L-1)<O.EPSILON5,D=Math.abs(B)<O.EPSILON5||Math.abs(B-1)<O.EPSILON5;if(w&&D)continue;let I=x.decodePosition(A,M,UE),N=x.decodeHeight(A,M),k;x.hasVertexNormals?k=x.getOctEncodedNormal(A,M,tX):(k=tX,k.x=0,k.y=0);let H=B;if(x.hasWebMercatorT){let j=O.lerp(f.south,f.north,B);H=(Li.geodeticLatitudeToMercatorAngle(j)-S)*v}let V;n.hasGeodeticSurfaceNormals&&(V=t.geodeticSurfaceNormal(I,oX)),n.encode(i,o*E,I,R,N,k,H,V),l.minimumHeight=Math.min(l.minimumHeight,N),l.maximumHeight=Math.max(l.maximumHeight,N),++o}return o}function Oge(e,t,n,i,o,r){let s,a,l;n?(s=0,a=e.length,l=1):(s=e.length-1,a=-1,l=-1);for(let u=s;u!==a;u+=l){let f=e[u],h=t[u];if(!rX(h,f))continue;let p;switch(i){case yn.WEST:p=f.westIndicesSouthToNorth;break;case yn.SOUTH:p=f.southIndicesEastToWest;break;case yn.EAST:p=f.eastIndicesNorthToSouth;break;case yn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(c(g))return f.encoding.decodeHeight(f.vertices,g)}}function rX(e,t){return c(t)&&(!c(e.data.fill)||!e.data.fill.changedThisFrame)}function Rge(e,t,n,i,o,r,s,a){let l,u,f,h,p,g=i[o?0:n.length-1],m=n[o?0:n.length-1];if(rX(g,m)&&(r===0?s===0?(l=o?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=o,f=o):(l=o?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!o,f=!1):s===0?(l=o?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!o,f=!0):(l=o?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=o,f=!o),l.length>0)){h=o?0:l.length-1,p=l[h],m.encoding.decodeTextureCoordinates(m.vertices,p,Du);let y=$P(g,e.tile,Du,Du);if(y.x===r&&y.y===s)return iX(m,p,r,s,a),!0;if(h=Mo(l,u?r:s,function(b,x){m.encoding.decodeTextureCoordinates(m.vertices,b,Du);let A=$P(g,e.tile,Du,Du);return f?u?A.x-r:A.y-s:u?r-A.x:s-A.y}),h<0){if(h=~h,h>0&&h<l.length)return rct(t,g,e.tile,m,l[h-1],l[h],r,s,u,a),!0}else return iX(m,l[h],r,s,a),!0}return!1}var act=[new d,new d,new d,new d];function cct(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,l=act;return d.fromRadians(n.west,n.south,o,a,l[0]),d.fromRadians(n.east,n.south,o,a,l[1]),d.fromRadians(n.west,n.north,o,a,l[2]),d.fromRadians(n.east,n.north,o,a,l[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,i,r)}var ZP=VE;function er(e){if(!c(e))throw new C("options is required.");if(c(e.terrainProvider))if(c(e.imageryLayers)){if(!c(e.surfaceShaderSet))throw new C("options.surfaceShaderSet is required.")}else throw new C("options.imageryLayers is required.");else throw new C("options.terrainProvider is required.");this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=Tn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=e.terrainProvider,this._imageryLayers=e.imageryLayers,this._surfaceShaderSet=e.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new pe,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(er.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(er.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(er.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(er.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new pe,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new G(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this.cartographicLimitRectangle=ce.clone(ce.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0}Object.defineProperties(er.prototype,{baseColor:{get:function(){return this._baseColor},set:function(e){if(!c(e))throw new C("value is required.");this._baseColor=e,this._firstPassInitialColor=se.fromColor(e,this._firstPassInitialColor)}},quadtree:{get:function(){return this._quadtree},set:function(e){if(!c(e))throw new C("value is required.");this._quadtree=e}},tilingScheme:{get:function(){if(c(this._terrainProvider))return this._terrainProvider.tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},imageryLayersUpdatedEvent:{get:function(){return this._imageryLayersUpdatedEvent}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){this._terrainProvider!==e&&(this._terrainProvider=e,c(this._quadtree)&&this._quadtree.invalidateAllTiles())}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){xs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Zh.setOwner(e,this,"_clippingPolygons")}}});function lct(e,t){let n=e.loadingImagery;c(n)||(n=e.readyImagery);let i=t.loadingImagery;return c(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}er.prototype.update=function(e){this._imageryLayers._update()};function uct(e,t){let n=t.creditDisplay,i=e._terrainProvider;c(i)&&c(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&c(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}er.prototype.initialize=function(e){this._imageryLayers.queueReprojectionCommands(e),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(i){i.data.imagery.sort(lct)})),uct(this,e);let t=this._vertexArraysToDestroy,n=t.length;for(let i=0;i<n;++i)rh._freeVertexArray(t[i]);t.length=0};er.prototype.beginUpdate=function(e){let t=this._tilesToRenderByTextureCount;for(let o=0,r=t.length;o<r;++o){let s=t[o];c(s)&&(s.length=0)}let n=this._clippingPlanes;c(n)&&n.enabled&&n.update(e);let i=this._clippingPolygons;c(i)&&i.enabled&&(i.update(e),i.queueCommands(e)),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1};er.prototype.endUpdate=function(e){if(!c(this._renderState)){this._renderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Dc.LESS}}),this._blendRenderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Dc.LESS_OR_EQUAL},blending:un.ALPHA_BLEND});let s=We(this._renderState,!0);s.cull.enabled=!1,this._disableCullingRenderState=ze.fromCache(s),s=We(this._blendRenderState,!0),s.cull.enabled=!1,this._disableCullingBlendRenderState=ze.fromCache(s)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&ZP.updateFillTiles(this,this._quadtree._tilesToRender,e,this._vertexArraysToDestroy);let t=this.quadtree,n=e.verticalExaggeration,i=e.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==n||this._oldVerticalExaggerationRelativeHeight!==i;this._oldVerticalExaggeration=n,this._oldVerticalExaggerationRelativeHeight=i,o&&t.forEachLoadedTile(function(s){s.data.updateExaggeration(s,e,t)});let r=this._tilesToRenderByTextureCount;for(let s=0,a=r.length;s<a;++s){let l=r[s];if(c(l))for(let u=0,f=l.length;u<f;++u){let h=l[u],p=h.data.tileBoundingRegion;Lct(this,h,e),e.minimumTerrainHeight=Math.min(e.minimumTerrainHeight,p.minimumHeight)}}};function Uge(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}er.prototype.updateForPick=function(e){let t=this._drawCommands;for(let n=0,i=this._usedDrawCommands;n<i;++n)Uge(t[n],e)};er.prototype.cancelReprojections=function(){this._imageryLayers.cancelReprojections()};er.prototype.getLevelMaximumGeometricError=function(e){return c(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(e):0};er.prototype.loadTile=function(e,t){let n=t.data,i=!0,o;c(n)&&(i=n.boundingVolumeSourceTile!==t||t._lastSelectionResult===Yn.CULLED_BUT_NEEDED,o=n.terrainState),rh.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i),n=t.data,i&&o!==t.data.terrainState&&this.computeTileVisibility(t,e,this.quadtree.occluders)!==Sr.NONE&&n.boundingVolumeSourceTile===t&&(i=!1,rh.processStateMachine(t,e,this.terrainProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,i))};var fct=new le,Vge=new ce,dct=new ce,hct=new he;function sz(e,t){if(t.west<t.east)return t;let n=ce.clone(t,dct);return ce.center(e,hct).longitude>0?n.east=O.PI:n.west=-O.PI,n}function zge(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(c(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(c(i)&&i.enabled||!ce.equals(e.cartographicLimitRectangle,ce.MAX_VALUE))}er.prototype.computeTileVisibility=function(e,t,n){let i=this.computeDistanceToTile(e,t);e._distance=i;let o=zge(this,t);if(t.fog.enabled&&!o&&O.fog(i,t.fog.density)>=1)return Sr.NONE;let r=e.data,s=r.tileBoundingRegion;if(r.boundingVolumeSourceTile===void 0)return Sr.PARTIAL;let a=t.cullingVolume,l=s.boundingVolume;c(l)||(l=s.boundingSphere),r.clippedByBoundaries=!1;let u=sz(e.rectangle,this.cartographicLimitRectangle),f=ce.simpleIntersection(u,e.rectangle,Vge);if(!c(f))return Sr.NONE;if(ce.equals(f,e.rectangle)||(r.clippedByBoundaries=!0),t.mode!==oe.SCENE3D&&(l=fct,le.fromRectangleWithHeights2D(e.rectangle,t.mapProjection,s.minimumHeight,s.maximumHeight,l),d.fromElements(l.center.z,l.center.x,l.center.y,l.center),t.mode===oe.MORPHING&&c(r.renderedMesh)&&(l=le.union(s.boundingSphere,l,l))),!c(l))return Sr.PARTIAL;let h=this._clippingPlanes;if(c(h)&&h.enabled){let b=h.computeIntersectionWithBoundingVolume(l);if(e.isClipped=b!==Wt.INSIDE,b===Wt.OUTSIDE)return Sr.NONE}let p=this._clippingPolygons;if(c(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(s);e.isClipped=b!==Wt.OUTSIDE}let g,m=a.computeVisibility(l);if(m===Wt.OUTSIDE?g=Sr.NONE:m===Wt.INTERSECTING?g=Sr.PARTIAL:m===Wt.INSIDE&&(g=Sr.FULL),g===Sr.NONE)return g;let y=t.mode===oe.SCENE3D&&t.camera.frustum instanceof on;if(t.mode===oe.SCENE3D&&!y&&c(n)&&!o){let b=r.occludeePointInScaledSpace;return!c(b)||n.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,s.minimumHeight)?g:Sr.NONE}return g};er.prototype.canRefine=function(e){return c(e.data.terrainData)?!0:this.terrainProvider.getTileDataAvailable(e.x*2,e.y*2,e.level+1)!==void 0};var mct=[],pct=[];er.prototype.canRenderWithoutLosingDetail=function(e,t){let n=e.data,i=mct;i.length=this._imageryLayers.length;let o=!1,r=!1,s;c(n)&&(o=n.terrainState===uo.READY,r=!0,s=n.imagery);let a,l;for(a=0,l=i.length;a<l;++a)i[a]=r;if(c(s))for(a=0,l=s.length;a<l;++a){let h=s[a],p=h.loadingImagery,g=!c(p)||p.state===ai.FAILED||p.state===ai.INVALID,m=(h.loadingImagery||h.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=pct;for(f.length=0,f.push(e.southwestChild,e.southeastChild,e.northwestChild,e.northeastChild);f.length>0;){let h=f.pop(),p=h._lastSelectionResultFrame===u?h._lastSelectionResult:Yn.NONE;if(p===Yn.RENDERED){let g=h.data;if(!c(g))continue;if(!o&&h.data.terrainState===uo.READY)return!1;let m=h.data.imagery;for(a=0,l=m.length;a<l;++a){let y=m[a],b=y.loadingImagery,x=!c(b)||b.state===ai.FAILED||b.state===ai.INVALID,A=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(x&&!i[A])return!1}}else p===Yn.REFINED&&f.push(h.southwestChild,h.southeastChild,h.northwestChild,h.northeastChild)}return!0};var _ct=new d;er.prototype.computeTileLoadPriority=function(e,t){let n=e.data;if(n===void 0)return 0;let i=n.tileBoundingRegion.boundingVolume;if(i===void 0)return 0;let o=t.camera.positionWC,r=t.camera.directionWC,s=d.subtract(i.center,o,_ct),a=d.magnitude(s);return a<O.EPSILON5?0:(d.divideByScalar(s,a,s),(1-d.dot(s,r))*e._distance)};var Nge=new F,rz=new F,gct=new se,yct=new se,bct=new se,xct=new d,Fge=new d,Tct=new d,Act=new d;er.prototype.showTileThisFrame=function(e,t){let n=0,i=e.data.imagery;for(let a=0,l=i.length;a<l;++a){let u=i[a];c(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++n}let o=this._tilesToRenderByTextureCount[n];c(o)||(o=[],this._tilesToRenderByTextureCount[n]=o),o.push(e);let r=e.data;c(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let s=this._debug;++s.tilesRendered,s.texturesRendered+=n};var Cct=[new d,new d,new d,new d];function Bge(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,l=Cct;return d.fromRadians(n.west,n.south,o,a,l[0]),d.fromRadians(n.east,n.south,o,a,l[1]),d.fromRadians(n.west,n.north,o,a,l[2]),d.fromRadians(n.east,n.north,o,a,l[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,l,i,r)}er.prototype.computeDistanceToTile=function(e,t){Ect(e,this,t);let n=e.data;if(n.boundingVolumeSourceTile===void 0)return 9999999999;let o=n.tileBoundingRegion,r=o.minimumHeight,s=o.maximumHeight;if(n.boundingVolumeSourceTile!==e){let l=t.camera.positionCartographic.height,u=Math.abs(l-r),f=Math.abs(l-s);u>f?(o.minimumHeight=r,o.maximumHeight=r):(o.minimumHeight=s,o.maximumHeight=s)}let a=o.distanceToCamera(t);return o.minimumHeight=r,o.maximumHeight=s,a};function Ect(e,t,n){let i=e.data;i===void 0&&(i=e.data=new rh);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Pf({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,l=!1,u=e,f=i.mesh,h=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight,l=!0;else if(h!==void 0&&h._minimumHeight!==void 0&&h._maximumHeight!==void 0)r.minimumHeight=h._minimumHeight,r.maximumHeight=h._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let m=g.mesh,y=g.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){r.minimumHeight=m.minimumHeight,r.maximumHeight=m.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){r.minimumHeight=y._minimumHeight,r.maximumHeight=y._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(l=!1,r.minimumHeight=Rr.getHeight(r.minimumHeight,p,g),r.maximumHeight=Rr.getHeight(r.maximumHeight,p,g)),l)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=Pn.clone(f.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=le.clone(f.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=d.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),c(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=Bge(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let y=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||y)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=Bge(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=l}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}er.prototype.isDestroyed=function(){return!1};er.prototype.destroy=function(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=this._clippingPolygons&&this._clippingPolygons.destroy(),this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),de(this)};function Sct(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,l=a.length,u;for(u=0;u<l;++u)if(o=a[u],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(o=a[f],r=c(o)?o.readyImagery??o.loadingImagery:void 0,!c(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}er.prototype._onLayerAdded=function(e,t){if(!this.isDestroyed()&&e.show){let n=this._terrainProvider,i=this,o=this._imageryLayersUpdatedEvent,r=function(){e._imageryCache={},i._quadtree.forEachLoadedTile(function(s){if(c(s._loadedCallbacks[e._layerIndex]))return;let a,l=s.data.imagery,u=l.length,f=-1,h=0;for(a=0;a<u;++a){let g=l[a];if((g.readyImagery??g.loadingImagery).imageryLayer===e)f===-1&&(f=a),++h;else if(f!==-1)break}if(f===-1)return;let p=f+h;e._createTileImagerySkeletons(s,n,p)&&(s._loadedCallbacks[e._layerIndex]=Sct(h,e,n),s.state=_a.LOADING)})};if(e.ready){let s=e.imageryProvider;s._reload=r}this._quadtree.forEachLoadedTile(function(s){e._createTileImagerySkeletons(s,n)&&(s.state=_a.LOADING,s.level!==0&&(s._lastSelectionResultFrame!==i.quadtree._lastSelectionFrameNumber||s._lastSelectionResult!==Yn.RENDERED)&&(s.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}};er.prototype._onLayerRemoved=function(e,t){this._quadtree.forEachLoadedTile(function(n){let i=n.data.imagery,o=-1,r=0;for(let s=0,a=i.length;s<a;++s){let l=i[s],u=l.loadingImagery;if(c(u)||(u=l.readyImagery),u.imageryLayer===e)o===-1&&(o=s),l.freeResources(),++r;else if(o!==-1)break}o!==-1&&i.splice(o,r)}),c(e.imageryProvider)&&(e.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()};er.prototype._onLayerMoved=function(e,t,n){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()};er.prototype._onLayerShownOrHidden=function(e,t,n){n?this._onLayerAdded(e,t):this._onLayerRemoved(e,t)};var wct=new F,vct=new F;function kge(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=F.multiplyByPoint(i,this.properties.rtc,Fge);return F.setTranslation(i,o,Nge),Nge},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=F.multiplyByPoint(i,this.properties.rtc,Fge);return F.setTranslation(i,r,rz),F.multiply(o,rz,rz),rz},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return c(i)&&c(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=c(i)?F.multiply(e.context.uniformState.view,i.modelMatrix,wct):F.IDENTITY;return F.inverseTranspose(o,vct)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_clippingDistance:function(){let i=t._clippingPolygons.clippingTexture;return c(i)?i:e.context.defaultTexture},u_clippingExtents:function(){let i=t._clippingPolygons.extentsTexture;return c(i)?i:e.context.defaultTexture},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new G(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new z(65e5,9e6),nightFadeDistance:new z(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new d(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new d(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new d,center3D:void 0,rtc:new d,modifiedModelView:new F,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new z(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new z,southMercatorYAndOneOverHeight:new z,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new z,scaleAndBias:new F,clippingPlanesEdgeColor:G.clone(G.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:G.clone(G.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0}};return c(t.materialUniformMap)?xt(n,t.materialUniformMap):n}function Dct(e,t,n){let i=n.data,o,r;if(c(i.vertexArray)?(o=i.mesh,r=i.vertexArray):c(i.fill)&&c(i.fill.vertexArray)&&(o=i.fill.mesh,r=i.fill.vertexArray),!(!c(o)||!c(r))){if(c(i.wireframeVertexArray)){if(i.wireframeVertexArray.mesh===o)return;i.wireframeVertexArray.destroy(),i.wireframeVertexArray=void 0}i.wireframeVertexArray=Pct(e,r,o),i.wireframeVertexArray.mesh=o}}function Pct(e,t,n){let o={indices:n.indices,primitiveType:Me.TRIANGLES};Nn.toWireframe(o);let r=o.indices,s=bt.createIndexBuffer({context:e,typedArray:r,usage:Be.STATIC_DRAW,indexDatatype:Fe.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new ni({context:e,attributes:t._attributes,indexBuffer:s})}var Hge,Gge,az;(function(){let e=new St({geometry:Mh.fromDimensions({dimensions:new d(2,2,2)})}),t=new St({geometry:new Jg({radius:1})}),n=new F,i,o;function r(s){return new In({geometryInstances:s,appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})}Hge=function(s,a){return s===i||(az(),i=s,n=F.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=jt.fromColor(a),o=r(e)),o},Gge=function(s,a){return s===i||(az(),i=s,n=F.fromTranslation(s.center,n),n=F.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=jt.fromColor(a),o=r(t)),o},az=function(){c(o)&&(o.destroy(),o=void 0,i=void 0)}})();var Ict=new se(0,0,0,0),Oct={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0},Rct=G.TRANSPARENT,Mct=new Bt;function Lct(e,t,n){let i=t.data;c(i.vertexArray)||(i.fill===void 0&&(i.fill=new ZP(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(c(r)&&c(r.credits)){let _e=r.credits;for(let Ce=0,mn=_e.length;Ce<mn;++Ce)o.addCreditToNextFrame(_e[Ce])}let s=ut.maximumTextureImageUnits,a=i.waterMaskTexture,l=i.waterMaskTranslationAndScale;!c(a)&&c(i.fill)&&(a=i.fill.waterMaskTexture,l=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,h=f.translucent,p=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,m=f.rectangle,y=e.undergroundColor??Rct,b=e.undergroundColorAlphaByDistance??Mct,x=zge(e,n)&&n.mode===oe.SCENE3D&&y.alpha>0&&(b.nearValue>0||b.farValue>0),A=e.lambertDiffuseMultiplier,E=e.vertexShadowDarkness,S=e.hasWaterMask&&c(a),v=S&&e.showWaterEffect,P=e.oceanNormalMap,M=v&&c(P),R=e.terrainProvider,L=c(R)&&e.terrainProvider.hasVertexNormals,B=n.fog.enabled&&n.fog.renderable&&!u,_=e.showGroundAtmosphere&&n.mode===oe.SCENE3D,w=Tn.castShadows(e.shadows)&&!h,D=Tn.receiveShadows(e.shadows)&&!h,I=e.hueShift,N=e.saturationShift,k=e.brightnessShift,H=!(O.equalsEpsilon(I,0,O.EPSILON7)&&O.equalsEpsilon(N,0,O.EPSILON7)&&O.equalsEpsilon(k,0,O.EPSILON7)),V=!1;if(_){let _e=d.magnitude(n.camera.positionWC),Ce=e.nightFadeOutDistance;V=_e>Ce}S&&--s,M&&--s,c(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,c(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,c(e.clippingPolygons)&&e.clippingPolygons.enabled&&(--s,--s),s-=f.numberOfTextureUniforms;let j=i.renderedMesh,U=j.center,q=j.encoding,X=i.tileBoundingRegion,te=n.verticalExaggeration,K=n.verticalExaggerationRelativeHeight,Z=te!==1,ee=q.hasGeodeticSurfaceNormals,me=gct,xe=0,ue=0,ye=0,Ae=0,Pe=!1;if(n.mode!==oe.SCENE3D){let _e=n.mapProjection,Ce=_e.project(ce.southwest(t.rectangle),Tct),mn=_e.project(ce.northeast(t.rectangle),Act);if(me.x=Ce.x,me.y=Ce.y,me.z=mn.x,me.w=mn.y,n.mode!==oe.MORPHING&&(U=xct,U.x=0,U.y=(me.z+me.x)*.5,U.z=(me.w+me.y)*.5,me.x-=U.y,me.y-=U.z,me.z-=U.y,me.w-=U.z),n.mode===oe.SCENE2D&&q.quantization===pa.BITS12){let mt=1/(Math.pow(2,12)-1)*.5,to=(me.z-me.x)*mt,So=(me.w-me.y)*mt;me.x-=to,me.y-=So,me.z+=to,me.w+=So}_e instanceof Li&&(xe=t.rectangle.south,ue=t.rectangle.north,ye=Li.geodeticLatitudeToMercatorAngle(xe),Ae=1/(Li.geodeticLatitudeToMercatorAngle(ue)-ye),Pe=!0)}let Ee=Oct;Ee.frameState=n,Ee.surfaceTile=i,Ee.hasWaterMask=S,Ee.showReflectiveOcean=v,Ee.showOceanWaves=M,Ee.enableLighting=e.enableLighting,Ee.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ee.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ee.showGroundAtmosphere=_,Ee.atmosphereLightIntensity=e.atmosphereLightIntensity,Ee.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ee.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ee.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ee.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ee.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ee.perFragmentGroundAtmosphere=V,Ee.hasVertexNormals=L,Ee.useWebMercatorProjection=Pe,Ee.clippedByBoundaries=i.clippedByBoundaries,Ee.hasGeodeticSurfaceNormals=ee,Ee.hasExaggeration=Z;let Ve=i.imagery,je=0,it=Ve.length,Dt=e.showSkirts&&!u&&!h,Gt=e.backFaceCulling&&!u&&!h,$e=Gt?e._renderState:e._disableCullingRenderState,ln=Gt?e._blendRenderState:e._disableCullingBlendRenderState,Vt=$e,Ct=e._firstPassInitialColor,gi=n.context;if(c(e._debug.boundingSphereTile)||az(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let _e=e._drawCommands.length;for(let Ce=0;Ce<_e;++Ce)e._uniformMaps[Ce]=kge(n,e)}do{let _e=0,Ce,mn;if(e._drawCommands.length<=e._usedDrawCommands?(Ce=new Je,Ce.owner=t,Ce.cull=!1,Ce.boundingVolume=new le,Ce.orientedBoundingBox=void 0,mn=kge(n,e),e._drawCommands.push(Ce),e._uniformMaps.push(mn)):(Ce=e._drawCommands[e._usedDrawCommands],mn=e._uniformMaps[e._usedDrawCommands]),Ce.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Zs=X.boundingVolume,rl=X.boundingSphere;c(Zs)?Hge(Zs,G.RED).update(n):c(rl)&&Gge(rl,G.RED).update(n)}let mt=mn.properties;se.clone(Ct,mt.initialColor),mt.oceanNormalMap=P,mt.lightingFadeDistance.x=e.lightingFadeOutDistance,mt.lightingFadeDistance.y=e.lightingFadeInDistance,mt.nightFadeDistance.x=e.nightFadeOutDistance,mt.nightFadeDistance.y=e.nightFadeInDistance,mt.atmosphereLightIntensity=e.atmosphereLightIntensity,mt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,mt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,mt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,mt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,mt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,mt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let to=u?g:p,So=u?p:g;c(to)&&(se.fromElements(to.near,to.nearValue,to.far,to.farValue,mt.frontFaceAlphaByDistance),se.fromElements(So.near,So.nearValue,So.far,So.farValue,mt.backFaceAlphaByDistance)),se.fromElements(b.near,b.nearValue,b.far,b.farValue,mt.undergroundColorAlphaByDistance),G.clone(y,mt.undergroundColor),mt.lambertDiffuseMultiplier=A,mt.vertexShadowDarkness=E;let Ks=!c(i.vertexArray)&&c(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Ks&&G.clone(e.fillHighlightColor,mt.fillHighlightColor),mt.verticalExaggerationAndRelativeHeight.x=te,mt.verticalExaggerationAndRelativeHeight.y=K,mt.center3D=j.center,d.clone(U,mt.rtc),se.clone(me,mt.tileRectangle),mt.southAndNorthLatitude.x=xe,mt.southAndNorthLatitude.y=ue,mt.southMercatorYAndOneOverHeight.x=ye,mt.southMercatorYAndOneOverHeight.y=Ae;let vr=yct,ps=sz(t.rectangle,e.cartographicLimitRectangle),Ne=bct,ot=sz(t.rectangle,m);d.fromElements(I,N,k,mt.hsbShift);let Xe=t.rectangle,Ze=1/Xe.width,pt=1/Xe.height;vr.x=(ps.west-Xe.west)*Ze,vr.y=(ps.south-Xe.south)*pt,vr.z=(ps.east-Xe.west)*Ze,vr.w=(ps.north-Xe.south)*pt,se.clone(vr,mt.localizedCartographicLimitRectangle),Ne.x=(ot.west-Xe.west)*Ze,Ne.y=(ot.south-Xe.south)*pt,Ne.z=(ot.east-Xe.west)*Ze,Ne.w=(ot.north-Xe.south)*pt,se.clone(Ne,mt.localizedTranslucencyRectangle);let Ht=B&&O.fog(t._distance,n.fog.density)>O.EPSILON3;H=H&&(Ht||_);let bn=!1,wo=!1,yo=!1,ka=!1,Ua=!1,yi=!1,hi=!1,$s=!1,Hr=!1,ol=!1;for(;_e<s&&je<it;){let Zs=Ve[je],rl=Zs.readyImagery;if(++je,!c(rl)||rl.imageryLayer.alpha===0)continue;let za=Zs.useWebMercatorT?rl.textureWebMercator:rl.texture;if(!c(za))throw new C("readyImagery is not actually ready!");let es=rl.imageryLayer;c(Zs.textureTranslationAndScale)||(Zs.textureTranslationAndScale=es._calculateTextureTranslationAndScale(t,Zs)),mt.dayTextures[_e]=za,mt.dayTextureTranslationAndScale[_e]=Zs.textureTranslationAndScale,mt.dayTextureTexCoordsRectangle[_e]=Zs.textureCoordinateRectangle,mt.dayTextureUseWebMercatorT[_e]=Zs.useWebMercatorT,mt.dayTextureAlpha[_e]=es.alpha,yi=yi||mt.dayTextureAlpha[_e]!==1,mt.dayTextureNightAlpha[_e]=es.nightAlpha,hi=hi||mt.dayTextureNightAlpha[_e]!==1,mt.dayTextureDayAlpha[_e]=es.dayAlpha,hi=hi||mt.dayTextureDayAlpha[_e]!==1,mt.dayTextureBrightness[_e]=es.brightness,bn=bn||mt.dayTextureBrightness[_e]!==mc.DEFAULT_BRIGHTNESS,mt.dayTextureContrast[_e]=es.contrast,wo=wo||mt.dayTextureContrast[_e]!==mc.DEFAULT_CONTRAST,mt.dayTextureHue[_e]=es.hue,yo=yo||mt.dayTextureHue[_e]!==mc.DEFAULT_HUE,mt.dayTextureSaturation[_e]=es.saturation,ka=ka||mt.dayTextureSaturation[_e]!==mc.DEFAULT_SATURATION,mt.dayTextureOneOverGamma[_e]=1/es.gamma,Ua=Ua||mt.dayTextureOneOverGamma[_e]!==1/mc.DEFAULT_GAMMA,mt.dayTextureSplit[_e]=es.splitDirection,$s=$s||mt.dayTextureSplit[_e]!==0;let Hu=mt.dayTextureCutoutRectangles[_e];if(c(Hu)||(Hu=mt.dayTextureCutoutRectangles[_e]=new se),se.clone(se.ZERO,Hu),c(es.cutoutRectangle)){let Oo=sz(Xe,es.cutoutRectangle),cn=ce.simpleIntersection(Oo,Xe,Vge);Hr=c(cn)||Hr,Hu.x=(Oo.west-Xe.west)*Ze,Hu.y=(Oo.south-Xe.south)*pt,Hu.z=(Oo.east-Xe.west)*Ze,Hu.w=(Oo.north-Xe.south)*pt}let Gu=mt.colorsToAlpha[_e];c(Gu)||(Gu=mt.colorsToAlpha[_e]=new se);let ju=c(es.colorToAlpha)&&es.colorToAlphaThreshold>0;if(ol=ol||ju,ju){let Oo=es.colorToAlpha;Gu.x=Oo.red,Gu.y=Oo.green,Gu.z=Oo.blue,Gu.w=es.colorToAlphaThreshold}else Gu.w=-1;if(c(rl.credits)){let Oo=rl.credits;for(let cn=0,Se=Oo.length;cn<Se;++cn)o.addCreditToNextFrame(Oo[cn])}++_e}mt.dayTextures.length=_e,mt.waterMask=a,se.clone(l,mt.waterMaskTranslationAndScale),mt.minMaxHeight.x=q.minimumHeight,mt.minMaxHeight.y=q.maximumHeight,F.clone(q.matrix,mt.scaleAndBias);let ho=e._clippingPlanes,Dr=c(ho)&&ho.enabled&&t.isClipped;Dr&&(mt.clippingPlanesEdgeColor=G.clone(ho.edgeColor,mt.clippingPlanesEdgeColor),mt.clippingPlanesEdgeWidth=ho.edgeWidth);let tp=e._clippingPolygons,Gr=c(tp)&&tp.enabled&&t.isClipped;Ee.numberOfDayTextures=_e,Ee.applyBrightness=bn,Ee.applyContrast=wo,Ee.applyHue=yo,Ee.applySaturation=ka,Ee.applyGamma=Ua,Ee.applyAlpha=yi,Ee.applyDayNightAlpha=hi,Ee.applySplit=$s,Ee.enableFog=Ht,Ee.enableClippingPlanes=Dr,Ee.clippingPlanes=ho,Ee.enableClippingPolygons=Gr,Ee.clippingPolygons=tp,Ee.hasImageryLayerCutout=Hr,Ee.colorCorrect=H,Ee.highlightFillTile=Ks,Ee.colorToAlpha=ol,Ee.showUndergroundColor=x,Ee.translucent=h;let zu=i.renderedMesh.indices.length;Dt||(zu=i.renderedMesh.indexCountWithoutSkirts),Ce.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ee),Ce.castShadows=w,Ce.receiveShadows=D,Ce.renderState=Vt,Ce.primitiveType=Me.TRIANGLES,Ce.vertexArray=i.vertexArray||i.fill.vertexArray,Ce.count=zu,Ce.uniformMap=mn,Ce.pass=De.GLOBE,e._debug.wireframe&&(Dct(gi,e,t),c(i.wireframeVertexArray)&&(Ce.vertexArray=i.wireframeVertexArray,Ce.primitiveType=Me.LINES,Ce.count=zu*2));let Va=Ce.boundingVolume,S0=Ce.orientedBoundingBox;n.mode!==oe.SCENE3D?(le.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,X.minimumHeight,X.maximumHeight,Va),d.fromElements(Va.center.z,Va.center.x,Va.center.y,Va.center),n.mode===oe.MORPHING&&(Va=le.union(X.boundingSphere,Va,Va))):(Ce.boundingVolume=le.clone(X.boundingSphere,Va),Ce.orientedBoundingBox=Pn.clone(X.boundingVolume,S0)),Ce.dirty=!0,h&&f.updateDerivedCommands(Ce,n),Uge(Ce,n),Vt=ln,Ct=Ict}while(je<it)}var cz=er;function jge(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ce.clone(ce.MAX_VALUE)}Object.defineProperties(jge.prototype,{enabled:{get:function(){return this._enabled},set:function(e){T.typeOf.bool("enabled",e),this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){T.typeOf.number.greaterThanOrEquals("frontFaceAlpha",e,0),T.typeOf.number.lessThanOrEquals("frontFaceAlpha",e,1),this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new C("far distance must be greater than near distance.");this._frontFaceAlphaByDistance=Bt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){T.typeOf.number.greaterThanOrEquals("backFaceAlpha",e,0),T.typeOf.number.lessThanOrEquals("backFaceAlpha",e,1),this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new C("far distance must be greater than near distance.");this._backFaceAlphaByDistance=Bt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){c(e)||(e=ce.clone(ce.MAX_VALUE)),ce.clone(e,this._rectangle)}}});var lz=jge;function Ds(){this._layers=[],this.layerAdded=new pe,this.layerRemoved=new pe,this.layerMoved=new pe,this.layerShownOrHidden=new pe}Object.defineProperties(Ds.prototype,{length:{get:function(){return this._layers.length}}});Ds.prototype.add=function(e,t){let n=c(t);if(!c(e))throw new C("layer is required.");if(n){if(t<0)throw new C("index must be greater than or equal to zero.");if(t>this._layers.length)throw new C("index must be less than or equal to the number of layers.")}n?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};Ds.prototype.addImageryProvider=function(e,t){if(!c(e))throw new C("imageryProvider is required.");let n=new mc(e);return this.add(n,t),n};Ds.prototype.remove=function(e,t){t=t??!0;let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};Ds.prototype.removeAll=function(e){e=e??!0;let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};Ds.prototype.contains=function(e){return this.indexOf(e)!==-1};Ds.prototype.indexOf=function(e){return this._layers.indexOf(e)};Ds.prototype.get=function(e){if(!c(e))throw new C("index is required.","index");return this._layers[e]};function uz(e,t){if(!c(t))throw new C("layer is required.");let n=e.indexOf(t);if(n===-1)throw new C("layer is not in this collection.");return n}function Wge(e,t,n){let i=e._layers;if(t=O.clamp(t,0,i.length-1),n=O.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}Ds.prototype.raise=function(e){let t=uz(this._layers,e);Wge(this,t,t+1)};Ds.prototype.lower=function(e){let t=uz(this._layers,e);Wge(this,t,t-1)};Ds.prototype.raiseToTop=function(e){let t=uz(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};Ds.prototype.lowerToBottom=function(e){let t=uz(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var Nct=new ce;function qge(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!c(r)&&a<o.length;++a){let l=o[a];ce.contains(l.rectangle,t)&&(r=l)}if(!c(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let l=s[a],u=l.readyImagery;if(!c(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!c(f.pickFeatures)||!ce.contains(u.rectangle,t))continue;let h=Nct,p=1/1024;h.west=O.lerp(r.rectangle.west,r.rectangle.east,l.textureCoordinateRectangle.x-p),h.east=O.lerp(r.rectangle.west,r.rectangle.east,l.textureCoordinateRectangle.z+p),h.south=O.lerp(r.rectangle.south,r.rectangle.north,l.textureCoordinateRectangle.y-p),h.north=O.lerp(r.rectangle.south,r.rectangle.north,l.textureCoordinateRectangle.w+p),ce.contains(h,t)&&i(u)}}Ds.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!c(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(qge(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};Ds.prototype.pickImageryLayerFeatures=function(e,t){let n=t.globe.pick(e,t);if(!c(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[],r=[];if(qge(t,i,!0,function(s){if(!s.imageryLayer.ready)return;let l=s.imageryLayer.imageryProvider.pickFeatures(s.x,s.y,s.level,i.longitude,i.latitude);c(l)&&(o.push(l),r.push(s.imageryLayer))}),o.length!==0)return Promise.all(o).then(function(s){let a=[];for(let l=0;l<s.length;++l){let u=s[l],f=r[l];if(c(u)&&u.length>0)for(let h=0;h<u.length;++h){let p=u[h];p.imageryLayer=f,c(p.position)||(p.position=i),a.push(p)}}return a})};Ds.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Ds.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Ds.prototype.isDestroyed=function(){return!1};Ds.prototype.destroy=function(){return this.removeAll(!0),de(this)};Ds.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(c(i._show)&&(c(n)||(n=[]),n.push(i)),i._show=i.show);if(c(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var fz=Ds;function Yge(e){this._ellipsoid=new cy(e.ellipsoid,d.ZERO)}Object.defineProperties(Yge.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var dz=Yge;var sX=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}clear(){this.cache.clear()}},Fct=1e3;function Ws(e){if(!c(e))throw new C("options is required.");if(c(e.x))if(c(e.y)){if(e.x<0||e.y<0)throw new C("options.x and options.y must be greater than or equal to zero.")}else throw new C("options.y is required.");else throw new C("options.x is required.");if(!c(e.level))throw new C("options.level is required and must be greater than or equal to zero.");if(!c(e.tilingScheme))throw new C("options.tilingScheme is required.");this._tilingScheme=e.tilingScheme,this._x=e.x,this._y=e.y,this._level=e.level,this._parent=e.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=[],this._frameUpdated=void 0,this._lastSelectionResult=Yn.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new sX(Fct),this.state=_a.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}Ws.createLevelZeroTiles=function(e){if(!c(e))throw new C("tilingScheme is required.");let t=e.getNumberOfXTilesAtLevel(0),n=e.getNumberOfYTilesAtLevel(0),i=new Array(t*n),o=0;for(let r=0;r<n;++r)for(let s=0;s<t;++s)i[o++]=new Ws({tilingScheme:e,x:s,y:r,level:0});return i};var Bct=256;function kct(e,t,n,i){let o=n.width/Bct*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}Ws.prototype._getCacheKey=function(e,t){return kct(e.longitude,e.latitude,this._rectangle,t)};Ws.prototype.getPositionCacheEntry=function(e,t){return this._positionCache.get(this._getCacheKey(e,t))};Ws.prototype.setPositionCacheEntry=function(e,t,n){this._positionCache.set(this._getCacheKey(e,t),n)};Ws.prototype.clearPositionCache=function(){this._positionCache.size>0&&this._positionCache.clear()};Ws.prototype._updateCustomData=function(e,t,n){let i=this.customData,o,r,s;if(c(t)&&c(n)){for(i=i.filter(function(a){return n.indexOf(a)===-1}),this._customData=i,s=this._rectangle,o=0;o<t.length;++o)r=t[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=e}else{let a=this._parent;if(c(a)&&this._frameUpdated!==a._frameUpdated){i.length=0,s=this._rectangle;let l=a.customData;for(o=0;o<l.length;++o)r=l[o],ce.contains(s,r.positionCartographic)&&i.push(r);this._frameUpdated=a._frameUpdated}}};Object.defineProperties(Ws.prototype,{tilingScheme:{get:function(){return this._tilingScheme}},x:{get:function(){return this._x}},y:{get:function(){return this._y}},level:{get:function(){return this._level}},parent:{get:function(){return this._parent}},rectangle:{get:function(){return this._rectangle}},children:{get:function(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}},southwestChild:{get:function(){return c(this._southwestChild)||(this._southwestChild=new Ws({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}},southeastChild:{get:function(){return c(this._southeastChild)||(this._southeastChild=new Ws({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}},northwestChild:{get:function(){return c(this._northwestChild)||(this._northwestChild=new Ws({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}},northeastChild:{get:function(){return c(this._northeastChild)||(this._northeastChild=new Ws({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}},customData:{get:function(){return this._customData}},needsLoading:{get:function(){return this.state<_a.DONE}},eligibleForUnloading:{get:function(){let e=!0;return c(this.data)&&(e=this.data.eligibleForUnloading,c(e)||(e=!0)),e}}});Ws.prototype.findLevelZeroTile=function(e,t,n){let i=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(t<0?t+=i:t>=i&&(t-=i),!(n<0||n>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return e.filter(function(o){return o.x===t&&o.y===n})[0]};Ws.prototype.findTileToWest=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x-1,this.y);if(t.southeastChild===this)return t.southwestChild;if(t.northeastChild===this)return t.northwestChild;let n=t.findTileToWest(e);if(n!==void 0)return t.southwestChild===this?n.southeastChild:n.northeastChild};Ws.prototype.findTileToEast=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x+1,this.y);if(t.southwestChild===this)return t.southeastChild;if(t.northwestChild===this)return t.northeastChild;let n=t.findTileToEast(e);if(n!==void 0)return t.southeastChild===this?n.southwestChild:n.northwestChild};Ws.prototype.findTileToSouth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y+1);if(t.northwestChild===this)return t.southwestChild;if(t.northeastChild===this)return t.southeastChild;let n=t.findTileToSouth(e);if(n!==void 0)return t.southwestChild===this?n.northwestChild:n.northeastChild};Ws.prototype.findTileToNorth=function(e){let t=this.parent;if(t===void 0)return this.findLevelZeroTile(e,this.x,this.y-1);if(t.southwestChild===this)return t.northwestChild;if(t.southeastChild===this)return t.northeastChild;let n=t.findTileToNorth(e);if(n!==void 0)return t.northwestChild===this?n.southwestChild:n.southeastChild};Ws.prototype.freeResources=function(){this.clearPositionCache(),this.state=_a.START,this.renderable=!1,this.upsampledFromParent=!1,c(this.data)&&c(this.data.freeResources)&&this.data.freeResources(),hz(this._southwestChild),this._southwestChild=void 0,hz(this._southeastChild),this._southeastChild=void 0,hz(this._northwestChild),this._northwestChild=void 0,hz(this._northeastChild),this._northeastChild=void 0};function hz(e){c(e)&&e.freeResources()}var mz=Ws;function pz(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}pz.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};pz.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&c(this._lastBeforeStartOfFrame)&&this.count>e&&c(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),Xge(this,t)),t=i}};function Xge(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}pz.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!c(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(c(e.replacementPrevious)||c(e.replacementNext))&&Xge(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var _z=pz;function qf(e){if(!c(e)||!c(e.tileProvider))throw new C("options.tileProvider is required.");if(c(e.tileProvider.quadtree))throw new C("A QuadtreeTileProvider can only be used with a single QuadtreePrimitive");this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new _z,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._lastTileIndex=0,this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new dz({ellipsoid:n}),this._tileLoadProgressEvent=new pe,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(qf.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});qf.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Uct(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,$ge(e);let n=e._levelZeroTiles;if(c(n))for(let i=0;i<n.length;++i){let r=n[i].customData,s=r.length;for(let a=0;a<s;++a){let l=r[a];l.level=0,e._addHeightCallbacks.push(l)}n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}qf.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;c(t);)t.state!==_a.START&&e(t),t=t.replacementNext};qf.prototype.forEachRenderedTile=function(e){let t=this._tilesToRender;for(let n=0,i=t.length;n<i;++n)e(t[n])};qf.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length;for(let s=0;s<r;++s)if(o[s]===i){o.splice(s,1);break}n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};qf.prototype.update=function(e){c(this._tileProvider.update)&&this._tileProvider.update(e)};function $ge(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}qf.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Uct(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),$ge(this),!this._debug.suspendLodUpdate&&this._tileReplacementQueue.markStartOfRenderFrame())};qf.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Gct(this,e),Jct(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Vct(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=pe.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}qf.prototype.endFrame=function(e){!e.passes.render||e.mode===oe.MORPHING||(Kct(this,e),Qct(this,e),Vct(this,e))};qf.prototype.isDestroyed=function(){return!1};qf.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var JP,Kge=new he;function zct(e,t){let n=ce.center(e.rectangle,Kge),i=n.longitude-JP.longitude,o=n.latitude-JP.latitude;n=ce.center(t.rectangle,Kge);let r=n.longitude-JP.longitude,s=n.latitude-JP.latitude;return i*i+o*o-(r*r+s*s)}var Hct=new d,QP=[];function Gct(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o,r=e._tileProvider;if(!c(e._levelZeroTiles)){let y=r.tilingScheme;if(c(y)){let b=r.tilingScheme;e._levelZeroTiles=mz.createLevelZeroTiles(b);let x=e._levelZeroTiles.length;if(QP.length<x)for(QP=new Array(x),o=0;o<x;++o)QP[o]===void 0&&(QP[o]=new eI)}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let s,a=e._levelZeroTiles,l=a.length>1?e._occluders:void 0;JP=t.camera.positionCartographic,a.sort(zct);let u=e._addHeightCallbacks,f=e._removeHeightCallbacks,h=t.frameNumber,p;if(u.length>0||f.length>0){for(o=0,p=a.length;o<p;++o)s=a[o],s._updateCustomData(h,u,f);u.length=0,f.length=0}let g=t.camera;e._cameraPositionCartographic=g.positionCartographic;let m=F.getTranslation(g.transform,Hct);for(e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(m,e._cameraReferenceFrameOriginCartographic),o=0,p=a.length;o<p;++o)s=a[o],e._tileReplacementQueue.markTileRendered(s),s.renderable?La(e,s,r,t,l,!1,QP[o]):(x_(e,e._tileLoadQueueHigh,s,t),++n.tilesWaitingForChildren);e._lastSelectionFrameNumber=h}function x_(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function eI(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Zge(){this.southwest=new eI,this.southeast=new eI,this.northwest=new eI,this.northeast=new eI}Zge.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var cX=new Array(31);for(let e=0;e<cX.length;++e)cX[e]=new Zge;function jct(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n._updateCustomData(t.frameNumber),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=Yct(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,l=n.southeastChild,u=n.northwestChild,f=n.northeastChild,h=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===h?n._lastSelectionResult:Yn.NONE,g=e.tileProvider;if(s||i){let m=Yn.originalResult(p)===Yn.RENDERED,y=Yn.originalResult(p)===Yn.CULLED||p===Yn.NONE,b=n.state===_a.DONE,x=m||y||b;if(x||c(g.canRenderWithoutLosingDetail)&&(x=g.canRenderWithoutLosingDetail(n)),x){s&&x_(e,e._tileLoadQueueMedium,n,t),gz(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&x_(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&l.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){gz(e,n),x_(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(l),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.REFINED;let y=e._tilesToRender.length,b=e._tileLoadQueueLow.length,x=e._tileLoadQueueMedium.length,A=e._tileLoadQueueHigh.length,E=e._tileToUpdateHeights.length;if(Wct(e,a,l,u,f,t,i,o),y!==e._tilesToRender.length){let S=o.allAreRenderable,v=o.anyWereRenderedLastFrame,P=o.notYetRenderableCount,M=!1;if(!S&&!v){let R=e._tilesToRender;for(let B=y;B<R.length;++B){let _=R[B];for(;_!==void 0&&_._lastSelectionResult!==Yn.KICKED&&_!==n;)_._lastSelectionResult=Yn.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=E,gz(e,n),n._lastSelectionResult=Yn.RENDERED;let L=p===Yn.RENDERED;!L&&P>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=b,e._tileLoadQueueMedium.length=x,e._tileLoadQueueHigh.length=A,x_(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,M=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=L,L||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!M&&x_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=Yn.RENDERED,gz(e,n),x_(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===Yn.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function Wct(e,t,n,i,o,r,s,a){let l=r.camera.positionCartographic,u=e._tileProvider,f=e._occluders,h=cX[t.level],p=h.southwest,g=h.southeast,m=h.northwest,y=h.northeast;l.longitude<t.rectangle.east?l.latitude<t.rectangle.north?(La(e,t,u,r,f,s,p),La(e,n,u,r,f,s,g),La(e,i,u,r,f,s,m),La(e,o,u,r,f,s,y)):(La(e,i,u,r,f,s,m),La(e,t,u,r,f,s,p),La(e,o,u,r,f,s,y),La(e,n,u,r,f,s,g)):l.latitude<t.rectangle.north?(La(e,n,u,r,f,s,g),La(e,t,u,r,f,s,p),La(e,o,u,r,f,s,y),La(e,i,u,r,f,s,m)):(La(e,o,u,r,f,s,y),La(e,i,u,r,f,s,m),La(e,n,u,r,f,s,g),La(e,t,u,r,f,s,p)),h.combine(a)}function qct(e,t){let n=t.rectangle;return c(e._cameraPositionCartographic)&&ce.contains(n,e._cameraPositionCartographic)||c(e._cameraReferenceFrameOriginCartographic)&&ce.contains(n,e._cameraReferenceFrameOriginCartographic)}function La(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==Sr.NONE)return jct(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,qct(e,t)){(!c(t.data)||!c(t.data.vertexArray))&&x_(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,l=t._lastSelectionResultFrame===a?t._lastSelectionResult:Yn.NONE;l!==Yn.CULLED_BUT_NEEDED&&l!==Yn.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=Yn.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(x_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=Yn.CULLED):t._lastSelectionResult=Yn.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Yct(e,t,n){if(t.mode===oe.SCENE2D||t.camera.frustum instanceof on||t.camera.frustum instanceof jo)return Xct(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=O.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function Xct(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;c(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,l=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,l),h=u/f;return t.fog.enabled&&t.mode!==oe.SCENE2D&&(h-=O.fog(n._distance,t.fog.density)*t.fog.sse),h/=t.pixelRatio,h}function gz(e,t){e._tilesToRender.push(t)}function Kct(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=Ei()+e._loadQueueTimeSlice,s=e._tileProvider,a=aX(e,t,s,r,n,!1);a=aX(e,t,s,r,i,a),aX(e,t,s,r,o,a)}function $ct(e,t){return e._loadPriority-t._loadPriority}function aX(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort($ct);for(let s=0,a=o.length;s<a&&(Ei()<i||!r);++s){let l=o[s];e._tileReplacementQueue.markTileRendered(l),n.loadTile(t,l),r=!0}return r}var zE=new _n,yz=new he,$y=new d,Zct=[];function Qct(e,t){if(!c(e.tileProvider.tilingScheme))return;let n=Zct;n.length=0;let i=e._tileToUpdateHeights,o=Ei(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,l=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let h=i[0];if(!c(h.data)||!c(h.data.mesh)){let y=h._lastSelectionResultFrame===e._lastSelectionFrameNumber?h._lastSelectionResult:Yn.NONE;(y===Yn.RENDERED||y===Yn.CULLED_BUT_NEEDED)&&n.push(h),h.clearPositionCache(),i.shift(),e._lastTileIndex=0;continue}let p=h.customData,g=p.length,m=!1;for(f=e._lastTileIndex;f<g;++f){let y=p[f],b=h.data.terrainData,x=c(b)&&b.wasCreatedByUpsampling();if(h.level>y.level&&!x){let A,E=h.getPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError);if(c(E))A=E;else{if(c(y.positionOnEllipsoidSurface)||(y.positionOnEllipsoidSurface=d.fromRadians(y.positionCartographic.longitude,y.positionCartographic.latitude,0,u)),a===oe.SCENE3D){let S=u.geodeticSurfaceNormal(y.positionOnEllipsoidSurface,zE.direction),v=u.getSurfaceNormalIntersectionWithZAxis(y.positionOnEllipsoidSurface,11500,zE.origin);if(!c(v)){let P=0;c(h.data.tileBoundingRegion)&&(P=h.data.tileBoundingRegion.minimumHeight);let M=Math.min(P,-11500),R=d.multiplyByScalar(S,Math.abs(M)+1,$y);d.subtract(y.positionOnEllipsoidSurface,R,zE.origin)}}else he.clone(y.positionCartographic,yz),yz.height=-11500,l.project(yz,$y),d.fromElements($y.z,$y.x,$y.y,$y),d.clone($y,zE.origin),d.clone(d.UNIT_X,zE.direction);A=h.data.pick(zE,a,l,!1,$y),c(A)&&h.setPositionCacheEntry(y.positionCartographic,e.maximumScreenSpaceError,A)}if(c(A)){if(c(y.callback)){let S=u.cartesianToCartographic(A,yz);y.callback(S)}y.level=h.level}}if(Ei()>=s){m=!0;break}}if(m){e._lastTileIndex=f;break}else e._lastTileIndex=0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function Jct(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var bz=qf;function ah(e){e=e??ie.default;let t=new b_({ellipsoid:e}),n=new fz;this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new NV,this._material=void 0,this._surface=new bz({tileProvider:new cz({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet})}),this._terrainProvider=t,this._terrainProviderChanged=new pe,this._undergroundColor=G.clone(G.BLACK),this._undergroundColorAlphaByDistance=new Bt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new lz,uX(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new we({url:tn("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ie.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=O.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=O.PI*e.minimumRadius,this.nightFadeOutDistance=O.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*O.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Tn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(ah.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return c(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){c(e)||(e=ce.clone(ce.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,this._terrainProviderChanged.raiseEvent(e),c(this._material)&&uX(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,uX(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=G.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){if(c(e)&&e.far<e.near)throw new C("far distance must be greater than near distance.");this._undergroundColorAlphaByDistance=Bt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function uX(e){let t=[],n=c(e._material)&&(c(e._material.shaderSource.match(/slope/))||c(e._material.shaderSource.match("normalEC"))),i=[Qh,kP];c(e._material)&&(!n||e._terrainProvider.requestVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(gV),e._surfaceShaderSet.baseVertexShaderSource=new He({sources:[Qh,kP,yV],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new He({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function elt(e){return function(t,n){let i=le.distanceSquaredTo(t.pickBoundingSphere,e),o=le.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var tlt=[],nlt={start:0,stop:0};ah.prototype.pickWorldCoordinates=function(e,t,n,i){if(!c(e))throw new C("ray is required");if(!c(t))throw new C("scene is required");n=n??!0;let o=t.mode,r=t.mapProjection,s=tlt;s.length=0;let a=this._surface._tilesToRender,l=a.length,u,f;for(f=0;f<l;++f){u=a[f];let p=u.data;if(!c(p))continue;let g=p.pickBoundingSphere;if(o!==oe.SCENE3D)p.pickBoundingSphere=g=le.fromRectangleWithHeights2D(u.rectangle,r,p.tileBoundingRegion.minimumHeight,p.tileBoundingRegion.maximumHeight,g),d.fromElements(g.center.z,g.center.x,g.center.y,g.center);else if(c(p.renderedMesh))le.clone(p.tileBoundingRegion.boundingSphere,g);else continue;let m=Qn.raySphere(e,g,nlt);c(m)&&s.push(p)}s.sort(elt(e.origin));let h;for(l=s.length,f=0;f<l&&(h=s[f].pick(e,t.mode,t.mapProjection,n,i),!c(h));++f);return h};var ilt=new he;ah.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),c(n)&&t.mode!==oe.SCENE3D){n=d.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,ilt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var olt=new d,Qge=new d,rlt=new he,slt=new _n;function lX(e,t){return c(e)&&ce.contains(e.rectangle,t)?e:void 0}ah.prototype.getHeight=function(e){if(!c(e))throw new C("cartographic is required");let t=this._surface._levelZeroTiles;if(!c(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!ce.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;c(n);)n=lX(n._southwestChild,e)||lX(n._southeastChild,e)||lX(n._northwestChild,e)||n._northeastChild,c(n)&&c(n.data)&&c(n.data.renderedMesh)&&(r=n);if(n=r,!c(n)||!c(n.data)||!c(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,l=d.fromRadians(e.longitude,e.latitude,0,a,olt),u=slt,f=a.geodeticSurfaceNormal(l,u.direction),h=a.getSurfaceNormalIntersectionWithZAxis(l,11500,u.origin);if(!c(h)){let g;c(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(g??0,-11500),y=d.multiplyByScalar(f,Math.abs(m)+1,Qge);d.subtract(l,y,u.origin)}let p=n.data.pick(u,void 0,s,!1,Qge);if(c(p))return a.cartesianToCartographic(p,rlt).height};ah.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};ah.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=c(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,l=a.url;if(c(l)){let u=this;a.fetchImage().then(function(f){l===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Rt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===oe.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};ah.prototype.render=function(e){this.show&&(c(this._material)&&this._material.update(e.context),this._surface.render(e))};ah.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};ah.prototype.isDestroyed=function(){return!1};ah.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),de(this)};var xz=ah;function alt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var Tz=alt;var dye={},clt=32.184,llt=2451545,Jge=-.0529921,eye=-.1059842,tye=13.0120009,nye=13.3407154,iye=.9856003,oye=26.4057084,rye=13.064993,sye=.3287146,aye=1.7484877,cye=-.1589763,lye=.0036096,uye=.1643573,fye=12.9590088,fX=new Q;dye.ComputeMoon=function(e,t){c(e)||(e=Q.now()),fX=Q.addSeconds(e,clt,fX);let n=Q.totalDays(fX)-llt,i=n/qn.DAYS_PER_JULIAN_CENTURY,o=(125.045+Jge*n)*O.RADIANS_PER_DEGREE,r=(250.089+eye*n)*O.RADIANS_PER_DEGREE,s=(260.008+tye*n)*O.RADIANS_PER_DEGREE,a=(176.625+nye*n)*O.RADIANS_PER_DEGREE,l=(357.529+iye*n)*O.RADIANS_PER_DEGREE,u=(311.589+oye*n)*O.RADIANS_PER_DEGREE,f=(134.963+rye*n)*O.RADIANS_PER_DEGREE,h=(276.617+sye*n)*O.RADIANS_PER_DEGREE,p=(34.226+aye*n)*O.RADIANS_PER_DEGREE,g=(15.134+cye*n)*O.RADIANS_PER_DEGREE,m=(119.743+lye*n)*O.RADIANS_PER_DEGREE,y=(239.961+uye*n)*O.RADIANS_PER_DEGREE,b=(25.053+fye*n)*O.RADIANS_PER_DEGREE,x=Math.sin(o),A=Math.sin(r),E=Math.sin(s),S=Math.sin(a),v=Math.sin(l),P=Math.sin(u),M=Math.sin(f),R=Math.sin(h),L=Math.sin(p),B=Math.sin(g),_=Math.sin(m),w=Math.sin(y),D=Math.sin(b),I=Math.cos(o),N=Math.cos(r),k=Math.cos(s),H=Math.cos(a),V=Math.cos(l),j=Math.cos(u),U=Math.cos(f),q=Math.cos(h),X=Math.cos(p),te=Math.cos(g),K=Math.cos(m),Z=Math.cos(y),ee=Math.cos(b),me=(269.9949+.0031*i-3.8787*x-.1204*A+.07*E-.0172*S+.0072*P-.0052*B+.0043*D)*O.RADIANS_PER_DEGREE,xe=(66.5392+.013*i+1.5419*I+.0239*N-.0278*k+.0068*H-.0029*j+9e-4*U+8e-4*te-9e-4*ee)*O.RADIANS_PER_DEGREE,ue=(38.3213+13.17635815*n-14e-13*n*n+3.561*x+.1208*A-.0642*E+.0158*S+.0252*v-.0066*P-.0047*M-.0046*R+.0028*L+.0052*B+.004*_+.0019*w-.0044*D)*O.RADIANS_PER_DEGREE,ye=(13.17635815-14e-13*(2*n)+3.561*I*Jge+.1208*N*eye-.0642*k*tye+.0158*H*nye+.0252*V*iye-.0066*j*oye-.0047*U*rye-.0046*q*sye+.0028*X*aye+.0052*te*cye+.004*K*lye+.0019*Z*uye-.0044*ee*fye)/86400*O.RADIANS_PER_DEGREE;return c(t)||(t=new Tz),t.rightAscension=me,t.declination=xe,t.rotation=ue,t.rotationRate=ye,t};var Az=dye;function hye(e){(!c(e)||typeof e!="function")&&(e=Az.ComputeMoon),this._computeFunction=e}var ult=new d,flt=new d,dlt=new d;function hlt(e,t,n){let i=ult;i.x=Math.cos(e+O.PI_OVER_TWO),i.y=Math.sin(e+O.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=dlt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=d.cross(r,i,flt);return c(n)||(n=new J),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var mlt=new J,plt=new Le;hye.prototype.evaluate=function(e,t){c(e)||(e=Q.now());let n=this._computeFunction(e),i=hlt(n.rightAscension,n.declination,t),o=O.zeroToTwoPi(n.rotation),r=Le.fromAxisAngle(d.UNIT_Z,o,plt),s=J.fromQuaternion(Le.conjugate(r,r),mlt);return J.multiply(s,i,i)};var Cz=hye;var dX={position:0};function Ez(e){e=e??W.EMPTY_OBJECT,this.center=d.clone(e.center??d.ZERO),this._center=new d,this.radii=d.clone(e.radii),this._radii=new d,this._oneOverEllipsoidRadiiSquared=new d,this._boundingSphere=new le,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=new F,this._computedModelMatrix=new F,this.show=e.show??!0,this.material=e.material??Xi.fromType(Xi.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=e.depthTestEnabled??!0,this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new Je({owner:e._owner??this}),this._pickCommand=new Je({owner:e._owner??this,pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function _lt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(c(t))return t;let n=Za.createGeometry(Za.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY}));return t=ni.fromGeometry({context:e,geometry:n,attributeLocations:dX,bufferUsage:Be.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}Ez.prototype.update=function(e){if(!this.show||e.mode!==oe.SCENE3D||!c(this.center)||!c(this.radii))return;if(!c(this.material))throw new C("this.material must be defined.");let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!c(this._rs)||i)&&(this._translucent=n,this._rs=ze.fromCache({cull:{enabled:!0,face:Ti.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?un.ALPHA_BLEND:void 0})),c(this._va)||(this._va=_lt(t));let o=!1,r=this.radii;if(!d.equals(this._radii,r)){d.clone(r,this._radii);let y=this._oneOverEllipsoidRadiiSquared;y.x=1/(r.x*r.x),y.y=1/(r.y*r.y),y.z=1/(r.z*r.z),o=!0}(!F.equals(this.modelMatrix,this._modelMatrix)||!d.equals(this.center,this._center))&&(F.clone(this.modelMatrix,this._modelMatrix),d.clone(this.center,this._center),F.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(d.clone(d.ZERO,this._boundingSphere.center),this._boundingSphere.radius=d.maximumComponent(r),le.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let l=e.useLogDepth,u=this._useLogDepth!==l;this._useLogDepth=l;let f=this._colorCommand,h,p;(s||a||i||u)&&(h=new He({sources:[BP]}),p=new He({sources:[this.material.shaderSource,FP]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=en.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:dX}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=xt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?De.TRANSLUCENT:De.OPAQUE,g.push(f)),m.pick){let y=this._pickCommand;(!c(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!c(this._pickSP)||u)&&(h=new He({sources:[BP]}),p=new He({sources:[this.material.shaderSource,FP],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(h.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=en.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:h,fragmentShaderSource:p,attributeLocations:dX}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=xt(xt(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?De.TRANSLUCENT:De.OPAQUE,g.push(y)}};Ez.prototype.isDestroyed=function(){return!1};Ez.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),de(this)};var Sz=Ez;function tI(e){e=e??W.EMPTY_OBJECT;let t=e.textureUrl;c(t)||(t=tn("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??ie.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new Sz({radii:this.ellipsoid.radii,material:Xi.fromType(Xi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new Cz}Object.defineProperties(tI.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var wz=new J,glt=new J,ylt=new d,vz=[];tI.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;c(Ot.computeIcrfToFixedMatrix(n,wz))||Ot.computeTemeToPseudoFixedMatrix(n,wz);let i=this._axes.evaluate(n,glt);J.transpose(i,i),J.multiply(wz,i,i);let o=z0.computeMoonPositionInEarthInertialFrame(n,ylt);J.multiplyByVector(wz,o,o),F.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=vz,vz.length=0,t.update(e),e.commandList=r,vz.length===1?vz[0]:void 0};tI.prototype.isDestroyed=function(){return!1};tI.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),de(this)};var Dz=tI;var hX=[],mX=[];function blt(e,t,n,i,o,r){let s=o-i+1,a=r-o,l=hX,u=mX,f,h;for(f=0;f<s;++f)l[f]=e[i+f];for(h=0;h<a;++h)u[h]=e[o+h+1];f=0,h=0;for(let p=i;p<=r;++p){let g=l[f],m=u[h];f<s&&(h>=a||t(g,m,n)<=0)?(e[p]=g,++f):h<a&&(e[p]=m,++h)}}function pX(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);pX(e,t,n,i,r),pX(e,t,n,r+1,o),blt(e,t,n,i,r,o)}function xlt(e,t,n){if(!c(e))throw new C("array is required.");if(!c(t))throw new C("comparator is required.");let i=e.length,o=Math.ceil(i*.5);hX.length=o,mX.length=o,pX(e,t,n,0,i-1),hX.length=0,mX.length=0}var Zy=xlt;function pc(e,t){if(!c(e))throw new C("occluderBoundingSphere is required.");if(!c(t))throw new C("camera position is required.");this._occluderPosition=d.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var Pz=new d;Object.defineProperties(pc.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){if(!c(e))throw new C("cameraPosition is required.");e=d.clone(e,this._cameraPosition);let t=d.subtract(this._occluderPosition,e,Pz),n=d.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=d.multiplyByScalar(t,n,Pz);let a=o*o*n;s=d.add(e,d.multiplyByScalar(r,a,Pz),Pz)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});pc.fromBoundingSphere=function(e,t,n){if(!c(e))throw new C("occluderBoundingSphere is required.");if(!c(t))throw new C("camera position is required.");return c(n)?(d.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new pc(e,t)};var pye=new d;pc.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=d.subtract(e,this._occluderPosition,pye),n=this._occluderRadius;if(n=d.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=d.subtract(e,this._cameraPosition,t),n*n>d.magnitudeSquared(t)}return!1};var Tlt=new d;pc.prototype.isBoundingSphereVisible=function(e){let t=d.clone(e.center,Tlt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,pye),o=this._occluderRadius-n;if(o=d.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i),o*o+n*n>d.magnitudeSquared(i)):!1;if(o>0){i=d.subtract(t,this._cameraPosition,i);let r=d.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var Alt=new d;pc.prototype.computeVisibility=function(e){if(!c(e))throw new C("occludeeBS is required.");let t=d.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Sr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=d.subtract(t,this._occluderPosition,Alt),o=this._occluderRadius-n,r=d.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=d.subtract(t,this._cameraPosition,i);let s=d.magnitudeSquared(i);return o*o+n*n<s?Sr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?Sr.FULL:Sr.PARTIAL):(i=d.subtract(t,this._horizonPlanePosition,i),d.dot(i,this._horizonPlaneNormal)>-n?Sr.PARTIAL:Sr.FULL))}}return Sr.NONE};var Iz=new d;pc.computeOccludeePoint=function(e,t,n){if(!c(e))throw new C("occluderBoundingSphere is required.");if(!c(n))throw new C("positions is required.");if(n.length===0)throw new C("positions must contain at least one element");let i=d.clone(t),o=d.clone(e.center),r=e.radius,s=n.length;if(d.equals(o,t))throw new C("occludeePosition must be different than occluderBoundingSphere.center");let a=d.normalize(d.subtract(i,o,Iz),Iz),l=-d.dot(a,o),u=pc._anyRotationVector(o,a,l),f=pc._horizonToPlaneNormalDotProduct(e,a,l,u,n[0]);if(!f)return;let h;for(let g=1;g<s;++g){if(h=pc._horizonToPlaneNormalDotProduct(e,a,l,u,n[g]),!h)return;h<f&&(f=h)}if(f<.0017453283658983088)return;let p=r/f;return d.add(o,d.multiplyByScalar(a,p,Iz),Iz)};var Clt=[];pc.computeOccludeePointFromRectangle=function(e,t){if(!c(e))throw new C("rectangle is required.");t=t??ie.default;let n=ce.subsample(e,t,0,Clt),i=le.fromPoints(n),o=d.ZERO;if(!d.equals(o,i.center))return pc.computeOccludeePoint(new le(o,t.minimumRadius),i.center,n)};var Elt=new d;pc._anyRotationVector=function(e,t,n){let i=d.abs(t,Elt),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new d,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=d.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=d.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=d.UNIT_Z);let a=(d.dot(t,i)+n)/-d.dot(t,s);return d.normalize(d.subtract(d.add(i,d.multiplyByScalar(s,a,r),i),e,i),i)};var Slt=new d;pc._rotationVector=function(e,t,n,i,o){let r=d.subtract(i,e,Slt);if(r=d.normalize(r,r),d.dot(t,r)<.9999999847691291){let s=d.cross(t,r,r);if(d.magnitude(s)>O.EPSILON13)return d.normalize(s,new d)}return o};var _X=new d,wlt=new d,Oz=new d,mye=new d;pc._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=d.clone(o,_X),s=d.clone(e.center,wlt),a=e.radius,l=d.subtract(s,r,Oz),u=d.magnitudeSquared(l),f=a*a;if(u<f)return!1;let h=u-f,p=Math.sqrt(h),m=1/Math.sqrt(u),b=p*m*p;l=d.normalize(l,l);let x=d.add(r,d.multiplyByScalar(l,b,mye),mye),A=Math.sqrt(h-b*b),E=this._rotationVector(s,t,n,r,i),S=d.fromElements(E.x*E.x*l.x+(E.x*E.y-E.z)*l.y+(E.x*E.z+E.y)*l.z,(E.x*E.y+E.z)*l.x+E.y*E.y*l.y+(E.y*E.z-E.x)*l.z,(E.x*E.z-E.y)*l.x+(E.y*E.z+E.x)*l.y+E.z*E.z*l.z,_X);S=d.normalize(S,S);let v=d.multiplyByScalar(S,A,_X);E=d.normalize(d.subtract(d.add(x,v,Oz),s,Oz),Oz);let P=d.dot(t,E);E=d.normalize(d.subtract(d.subtract(x,v,E),s,E),E);let M=d.dot(t,E);return P<M?P:M};var Rz=pc;function zm(e){e=e??W.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new ys,this._perspectiveMatrix=new F,this._infinitePerspective=new F}function gX(e){if(!c(e.right)||!c(e.left)||!c(e.top)||!c(e.bottom)||!c(e.near)||!c(e.far))throw new C("right, left, top, bottom, near, or far parameters are not set.");let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;if(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far){if(e.near<=0||e.near>e.far)throw new C("near must be greater than zero and less than far.");e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=F.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=F.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective)}}Object.defineProperties(zm.prototype,{projectionMatrix:{get:function(){return gX(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return gX(this),this._infinitePerspective}}});var vlt=new d,Dlt=new d,Plt=new d,Ilt=new d;zm.prototype.computeCullingVolume=function(e,t,n){if(!c(e))throw new C("position is required.");if(!c(t))throw new C("direction is required.");if(!c(n))throw new C("up is required.");let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,l=this.near,u=this.far,f=d.cross(t,n,vlt),h=Dlt;d.multiplyByScalar(t,l,h),d.add(e,h,h);let p=Plt;d.multiplyByScalar(t,u,p),d.add(e,p,p);let g=Ilt;d.multiplyByScalar(f,a,g),d.add(h,g,g),d.subtract(g,e,g),d.normalize(g,g),d.cross(g,n,g),d.normalize(g,g);let m=i[0];return c(m)||(m=i[0]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),d.multiplyByScalar(f,s,g),d.add(h,g,g),d.subtract(g,e,g),d.cross(n,g,g),d.normalize(g,g),m=i[1],c(m)||(m=i[1]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),d.multiplyByScalar(n,r,g),d.add(h,g,g),d.subtract(g,e,g),d.cross(f,g,g),d.normalize(g,g),m=i[2],c(m)||(m=i[2]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),d.multiplyByScalar(n,o,g),d.add(h,g,g),d.subtract(g,e,g),d.cross(g,f,g),d.normalize(g,g),m=i[3],c(m)||(m=i[3]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,e),m=i[4],c(m)||(m=i[4]=new se),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-d.dot(t,h),d.negate(t,g),m=i[5],c(m)||(m=i[5]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-d.dot(g,p),this._cullingVolume};zm.prototype.getPixelDimensions=function(e,t,n,i,o){if(gX(this),!c(e)||!c(t))throw new C("Both drawingBufferWidth and drawingBufferHeight are required.");if(e<=0)throw new C("drawingBufferWidth must be greater than zero.");if(t<=0)throw new C("drawingBufferHeight must be greater than zero.");if(!c(n))throw new C("distance is required.");if(!c(i))throw new C("pixelRatio is required");if(i<=0)throw new C("pixelRatio must be greater than zero.");if(!c(o))throw new C("A result object is required.");let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let l=2*i*n*s/e;return o.x=l,o.y=a,o};zm.prototype.clone=function(e){return c(e)||(e=new zm),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};zm.prototype.equals=function(e){return c(e)&&e instanceof zm&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};zm.prototype.equalsEpsilon=function(e,t,n){return e===this||c(e)&&e instanceof zm&&O.equalsEpsilon(this.right,e.right,t,n)&&O.equalsEpsilon(this.left,e.left,t,n)&&O.equalsEpsilon(this.top,e.top,t,n)&&O.equalsEpsilon(this.bottom,e.bottom,t,n)&&O.equalsEpsilon(this.near,e.near,t,n)&&O.equalsEpsilon(this.far,e.far,t,n)};var zl=zm;function Hl(e){e=e??W.EMPTY_OBJECT,this._offCenterFrustum=new zl,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}Hl.packedLength=6;Hl.pack=function(e,t,n){return T.typeOf.object("value",e),T.defined("array",t),n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};Hl.unpack=function(e,t,n){return T.defined("array",e),t=t??0,c(n)||(n=new Hl),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function ch(e){if(!c(e.fov)||!c(e.aspectRatio)||!c(e.near)||!c(e.far))throw new C("fov, aspectRatio, near, or far parameters are not set.");if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;if(T.typeOf.number.greaterThanOrEquals("fov",e.fov,0),T.typeOf.number.lessThan("fov",e.fov,Math.PI),T.typeOf.number.greaterThanOrEquals("aspectRatio",e.aspectRatio,0),T.typeOf.number.greaterThanOrEquals("near",e.near,0),e.near>e.far)throw new C("near must be less than far.");e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(Hl.prototype,{projectionMatrix:{get:function(){return ch(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return ch(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return ch(this),this._fovy}},sseDenominator:{get:function(){return ch(this),this._sseDenominator}},offCenterFrustum:{get:function(){return ch(this),this._offCenterFrustum}}});Hl.prototype.computeCullingVolume=function(e,t,n){return ch(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Hl.prototype.getPixelDimensions=function(e,t,n,i,o){return ch(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};Hl.prototype.clone=function(e){return c(e)||(e=new Hl),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};Hl.prototype.equals=function(e){return!c(e)||!(e instanceof Hl)?!1:(ch(this),ch(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Hl.prototype.equalsEpsilon=function(e,t,n){return!c(e)||!(e instanceof Hl)?!1:(ch(this),ch(e),O.equalsEpsilon(this.fov,e.fov,t,n)&&O.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var wi=Hl;function nI(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(nI.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function Olt(e,t,n){let i=t.createViewportQuadCommand(aV,{framebuffer:n,renderState:ze.fromCache({viewport:new Ke(0,0,256,256)})});e._drawCommand=i}nI.prototype.update=function(e){if(!c(this._colorTexture)){let t=e.context,n=new Rt({context:t,width:256,height:256,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Qt.NEAREST});this._colorTexture=n;let i=new Wr({context:t,colorTextures:[n],destroyAttachments:!1});Olt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};nI.prototype.isDestroyed=function(){return!1};nI.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),de(this)};var Mz=nI;var bye={};function Rlt(e,t,n){let i,o,r;if(e instanceof wi){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof zl)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var Mlt=new d,_ye=new d;function xye(e,t,n,i){if(c(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,l=s-r;return function(u){let f=n(u);if(u<=.5){let p=(f-o)/a;return O.lerp(e,-O.PI_OVER_TWO,p)}let h=(f-r)/l;return O.lerp(-O.PI_OVER_TWO,t,1-h)}}return function(o){return O.lerp(e,t,o)}}function bX(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!c(r)){let a=e.position,l=t,u=e.up,f=e.right,h=e.frustum,p=d.subtract(a,l,Mlt),g=d.magnitude(d.multiplyByScalar(u,d.dot(p,u),_ye)),m=d.magnitude(d.multiplyByScalar(f,d.dot(p,f),_ye));r=Math.min(Rlt(h,g,m)*.2,1e9)}if(s<r){let u=-Math.pow((r-n)*1e6,.125),f=Math.pow((r-i)*1e6,1/8);return function(h){let p=h*(f-u)+u;return-Math.pow(p,8)/1e6+r}}return function(a){return O.lerp(n,i,a)}}function iI(e,t){return O.equalsEpsilon(e,O.TWO_PI,O.EPSILON11)&&(e=0),t>e+Math.PI?e+=O.TWO_PI:t<e-Math.PI&&(e-=O.TWO_PI),e}var Tye=new d;function Llt(e,t,n,i,o,r,s,a){let l=e.camera,u=d.clone(l.position,Tye),f=l.pitch,h=iI(l.heading,i),p=iI(l.roll,r),g=bX(l,n,u.z,n.z,s),m=xye(f,o,g,a);function y(b){let x=b.time/t;l.setView({orientation:{heading:O.lerp(h,i,x),pitch:m(x),roll:O.lerp(p,r,x)}}),z.lerp(u,n,x,l.position),l.position.z=g(x)}return y}function Nlt(e,t){e.longitude<t.longitude?e.longitude+=O.TWO_PI:t.longitude+=O.TWO_PI}function Flt(e,t){let n=e.longitude-t.longitude;n<-O.PI?e.longitude+=O.TWO_PI:n>O.PI&&(t.longitude+=O.TWO_PI)}var Blt=new he,klt=new he;function Ult(e,t,n,i,o,r,s,a,l,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,Blt),m=f.pitch,y=iI(f.heading,i),b=iI(f.roll,r),x=p.cartesianToCartographic(n,klt);g.longitude=O.zeroToTwoPi(g.longitude),x.longitude=O.zeroToTwoPi(x.longitude);let A=!1;if(c(a)){let P=O.zeroToTwoPi(a),M=Math.min(g.longitude,x.longitude),R=Math.max(g.longitude,x.longitude),L=P>=M&&P<=R;if(c(l)){let B=Math.abs(g.longitude-x.longitude),_=O.TWO_PI-B;(L?B:_)<(L?_:B)*l&&!L&&(A=!0)}else L||(A=!0)}A?Nlt(g,x):Flt(g,x);let E=bX(f,n,g.height,x.height,s),S=xye(m,o,E,u);function v(){let P=g.longitude,M=x.longitude,R=g.latitude,L=x.latitude;return function(_){let w=_.time/t,D=d.fromRadians(O.lerp(P,M,w),O.lerp(R,L,w),E(w),p);f.setView({destination:D,orientation:{heading:O.lerp(y,i,w),pitch:S(w),roll:O.lerp(b,r,w)}})}}return v()}function Vlt(e,t,n,i,o,r,s){let a=e.camera,l=d.clone(a.position,Tye),u=iI(a.heading,i),f=a.frustum.right-a.frustum.left,h=bX(a,n,f,n.z,s);function p(g){let m=g.time/t;a.setView({orientation:{heading:O.lerp(u,i,m)}}),z.lerp(l,n,m,a.position);let y=h(m),b=a.frustum,x=b.top/b.right,A=(y-(b.right-b.left))*.5;b.right+=A,b.left-=A,b.top=x*b.right,b.bottom=-b.top}return p}var gye=new he,zlt=new d;function yX(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function yye(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}bye.createTween=function(e,t){t=t??W.EMPTY_OBJECT;let n=t.destination;if(!c(e))throw new C("scene is required.");if(!c(n))throw new C("destination is required.");let i=e.mode;if(i===oe.MORPHING)return yX();let o=t.convert??!0,r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,l=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,h=t.easingFunction;o&&i!==oe.SCENE3D&&(s.cartesianToCartographic(n,gye),n=r.project(gye,zlt));let p=e.camera,g=t.endTransform;c(g)&&p._setTransform(g);let m=t.duration;c(m)||(m=Math.ceil(d.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let y=t.heading??0,b=t.pitch??-O.PI_OVER_TWO,x=t.roll??0,A=e.screenSpaceCameraController;A.enableInputs=!1;let E=yye(A,t.complete),S=yye(A,t.cancel),v=p.frustum,P=e.mode===oe.SCENE2D;if(P=P&&z.equalsEpsilon(p.position,n,O.EPSILON6),P=P&&O.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,O.EPSILON6),P=P||e.mode!==oe.SCENE2D&&d.equalsEpsilon(n,p.position,O.EPSILON10),P=P&&O.equalsEpsilon(O.negativePiToPi(y),O.negativePiToPi(p.heading),O.EPSILON10)&&O.equalsEpsilon(O.negativePiToPi(b),O.negativePiToPi(p.pitch),O.EPSILON10)&&O.equalsEpsilon(O.negativePiToPi(x),O.negativePiToPi(p.roll),O.EPSILON10),P)return yX(E,S);let M=new Array(4);if(M[oe.SCENE2D]=Vlt,M[oe.SCENE3D]=Ult,M[oe.COLUMBUS_VIEW]=Llt,m<=0)return yX(function(){M[i](e,1,n,y,b,x,a,l,u,f)({time:1}),typeof E=="function"&&E()},S);let R=M[i](e,m,n,y,b,x,a,l,u,f);if(!c(h)){let L=p.positionCartographic.height,B=i===oe.SCENE3D?s.cartesianToCartographic(n).height:n.z;L>B&&L>11500?h=Qr.CUBIC_OUT:h=Qr.QUINTIC_IN_OUT}return{duration:m,easingFunction:h,startObject:{time:0},stopObject:{time:m},update:R,complete:E,cancel:S}};var Lz=bye;var Hlt={ROTATE:0,INFINITE_SCROLL:1},Pu=Object.freeze(Hlt);function Jt(e){if(!c(e))throw new C("scene is required.");this._scene=e,this._transform=F.clone(F.IDENTITY),this._invTransform=F.clone(F.IDENTITY),this._actualTransform=F.clone(F.IDENTITY),this._actualInvTransform=F.clone(F.IDENTITY),this._transformChanged=!1,this.position=new d,this._position=new d,this._positionWC=new d,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new d,this._direction=new d,this._directionWC=new d,this.up=new d,this._up=new d,this._upWC=new d,this.right=new d,this._right=new d,this._rightWC=new d,this.frustum=new wi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=O.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new pe,this._moveEnd=new pe,this._changed=new pe,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new F,this._invViewMatrix=new F,Pye(this),this._mode=oe.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,O.PI_OVER_TWO)),this._max2Dfrustum=void 0,zye(this,Jt.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=d.magnitude(this.position);n+=n*Jt.DEFAULT_VIEW_FACTOR,d.normalize(this.position,this.position),d.multiplyByScalar(this.position,n,this.position)}Jt.TRANSFORM_2D=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Jt.TRANSFORM_2D_INVERSE=F.inverseTransformation(Jt.TRANSFORM_2D,new F);Jt.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-95,-20,-70,90);Jt.DEFAULT_VIEW_FACTOR=.5;Jt.DEFAULT_OFFSET=new $d(0,-O.PI_OVER_FOUR,0);function Pye(e){F.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),F.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),F.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function Glt(e){if(!c(e._oldPositionWC))e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=d.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=d.magnitude(t),e._oldPositionWC=d.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Ei()):e.timeSinceMoved=Math.max(Ei()-e._lastMovedTimestamp,0)/1e3}}Jt.prototype.canPreloadFlight=function(){return c(this._currentFlight)&&this._mode!==oe.SCENE2D};Jt.prototype._updateCameraChanged=function(){let e=this;if(Glt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;c(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%O.TWO_PI;i=i>O.PI?O.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;c(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%O.TWO_PI;s=s>O.PI?O.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===oe.SCENE2D){if(!c(e._changedFrustum)){e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,m=e.frustum,y=e._changedFrustum,b=p.x+m.left,x=p.x+m.right,A=g.x+y.left,E=g.x+y.right,S=p.y+m.bottom,v=p.y+m.top,P=g.y+y.bottom,M=g.y+y.top,R=Math.max(b,A),L=Math.min(x,E),B=Math.max(S,P),_=Math.min(v,M),w;if(R>=L||B>=v)w=1;else{let D=y;b<A&&x>E&&S<P&&v>M&&(D=m),w=1-(L-R)*(_-B)/((D.right-D.left)*(D.top-D.bottom))}w>t&&(e._changed.raiseEvent(w),e._changedPosition=d.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!c(e._changedDirection)){e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection);return}let l=O.acosClamped(d.dot(e.directionWC,e._changedDirection)),u;c(e.frustum.fovy)?u=l/(e.frustum.fovy*.5):u=l;let h=d.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||h>t)&&(e._changed.raiseEvent(Math.max(u,h)),e._changedPosition=d.clone(e.positionWC,e._changedPosition),e._changedDirection=d.clone(e.directionWC,e._changedDirection))};function jlt(e){Ot.basisTo2D(e._projection,e._transform,e._actualTransform)}var Wlt=new he,qlt=new d,Nz=new d,Ylt=new se,Xlt=new se,Klt=new se,$lt=new se,Zlt=new se;function Qlt(e){let t=e._projection,n=t.ellipsoid,i=F.getColumn(e._transform,3,Ylt),o=n.cartesianToCartographic(i,Wlt),r=t.project(o,qlt),s=Xlt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=se.clone(se.UNIT_X,Zlt),l=se.add(F.getColumn(e._transform,0,Nz),i,Nz);n.cartesianToCartographic(l,o),t.project(o,r);let u=Klt;u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,d.subtract(u,s,u),u.x=0;let f=$lt;if(d.magnitudeSquared(u)>O.EPSILON10)d.cross(a,u,f);else{let h=se.add(F.getColumn(e._transform,1,Nz),i,Nz);n.cartesianToCartographic(h,o),t.project(o,r),f.x=r.z,f.y=r.x,f.z=r.y,f.w=0,d.subtract(f,s,f),f.x=0,d.magnitudeSquared(f)<O.EPSILON10&&(se.clone(se.UNIT_Y,u),se.clone(se.UNIT_Z,f))}d.cross(f,a,u),d.normalize(u,u),d.cross(a,u,f),d.normalize(f,f),F.setColumn(e._actualTransform,0,u,e._actualTransform),F.setColumn(e._actualTransform,1,f,e._actualTransform),F.setColumn(e._actualTransform,2,a,e._actualTransform),F.setColumn(e._actualTransform,3,s,e._actualTransform)}var xX=new d;function gc(e){let t=e._mode,n=!1,i=0;t===oe.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!d.equals(o,e.position)||n;r&&(o=d.clone(e.position,e._position));let s=e._direction,a=!d.equals(s,e.direction);a&&(d.normalize(e.direction,e.direction),s=d.clone(e.direction,e._direction));let l=e._up,u=!d.equals(l,e.up);u&&(d.normalize(e.up,e.up),l=d.clone(e.up,e._up));let f=e._right,h=!d.equals(f,e.right);h&&(d.normalize(e.right,e.right),f=d.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(F.inverseTransformation(e._transform,e._invTransform),e._mode===oe.COLUMBUS_VIEW||e._mode===oe.SCENE2D?F.equals(F.IDENTITY,e._transform)?F.clone(Jt.TRANSFORM_2D,e._actualTransform):e._mode===oe.COLUMBUS_VIEW?jlt(e):Qlt(e):F.clone(e._transform,e._actualTransform),F.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(r||p)if(e._positionWC=F.multiplyByPoint(g,o,e._positionWC),t===oe.SCENE3D||t===oe.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=xX;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===oe.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||h){let m=d.dot(s,d.cross(l,f,xX));if(Math.abs(1-m)>O.EPSILON2){let y=1/d.magnitudeSquared(l),b=d.dot(l,s)*y,x=d.multiplyByScalar(s,b,xX);l=d.normalize(d.subtract(l,x,e._up),e._up),d.clone(l,e.up),f=d.cross(s,l,e._right),d.clone(f,e.right)}}(a||p)&&(e._directionWC=F.multiplyByPointAsVector(g,s,e._directionWC),d.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=F.multiplyByPointAsVector(g,l,e._upWC),d.normalize(e._upWC,e._upWC)),(h||p)&&(e._rightWC=F.multiplyByPointAsVector(g,f,e._rightWC),d.normalize(e._rightWC,e._rightWC)),(r||a||u||h||p)&&Pye(e)}function Iye(e,t){let n;return O.equalsEpsilon(Math.abs(e.z),1,O.EPSILON3)?n=Math.atan2(t.y,t.x)-O.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-O.PI_OVER_TWO,O.TWO_PI-O.zeroToTwoPi(n)}function Oye(e){return O.PI_OVER_TWO-O.acosClamped(e.z)}function Rye(e,t,n){let i=0;return O.equalsEpsilon(Math.abs(e.z),1,O.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=O.zeroToTwoPi(i+O.TWO_PI)),i}var kz=new F,Uz=new F;Object.defineProperties(Jt.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return gc(this),this._invTransform}},viewMatrix:{get:function(){return gc(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return gc(this),this._invViewMatrix}},positionCartographic:{get:function(){return gc(this),this._positionCartographic}},positionWC:{get:function(){return gc(this),this._positionWC}},directionWC:{get:function(){return gc(this),this._directionWC}},upWC:{get:function(){return gc(this),this._upWC}},rightWC:{get:function(){return gc(this),this._rightWC}},heading:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,kz),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,Uz);this._setTransform(n);let i=Iye(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,kz),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,Uz);this._setTransform(n);let i=Oye(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==oe.MORPHING){let e=this._projection.ellipsoid,t=F.clone(this._transform,kz),n=Ot.eastNorthUpToFixedFrame(this.positionWC,e,Uz);this._setTransform(n);let i=Rye(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});Jt.prototype.update=function(e){if(!c(e))throw new C("mode is required.");if(e===oe.SCENE2D&&!(this.frustum instanceof jo))throw new C("An OrthographicOffCenterFrustum is required in 2D.");if((e===oe.SCENE3D||e===oe.COLUMBUS_VIEW)&&!(this.frustum instanceof wi)&&!(this.frustum instanceof on))throw new C("A PerspectiveFrustum or OrthographicFrustum is required in 3D and Columbus view");let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==oe.MORPHING,t=this._mode===oe.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone();if(!(n instanceof jo))throw new C("The camera frustum is expected to be orthographic for 2D camera control.");let i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===oe.SCENE2D&&Fye(this,this.position)};var Jlt=new d,eut=new d,tut=new d;Jt.prototype._setTransform=function(e){let t=d.clone(this.positionWC,Jlt),n=d.clone(this.upWC,eut),i=d.clone(this.directionWC,tut);F.clone(e,this._transform),this._transformChanged=!0,gc(this);let o=this._actualInvTransform;F.multiplyByPoint(o,t,this.position),F.multiplyByPointAsVector(o,i,this.direction),F.multiplyByPointAsVector(o,n,this.up),d.cross(this.direction,this.up,this.right),gc(this)};var nut=new z,iut=new _n,out=new d,rut=new d;function Mye(e){if(!F.equals(F.IDENTITY,e.transform))return d.magnitude(e.position);let t=e._scene,n=t.globe,i=nut;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(c(n)){let a=e.getPickRay(i,iut);o=n.pickWorldCoordinates(a,t,!0,out)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,rut));let s;if(c(o)||c(r)){let a=c(r)?d.distance(r,e.positionWC):Number.POSITIVE_INFINITY,l=c(o)?d.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,l)}else s=Math.max(e.positionCartographic.height,0);return s}Jt.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof on&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=Mye(this)))};var Vz=new d,SX=new F,sut=new F,wX=new Le,vX=new J,Lye=new he;function aut(e,t,n){if(isNaN(t.x)||isNaN(t.y)||isNaN(t.z))throw new C("position has a NaN component");let i=F.clone(e.transform,SX),o=Ot.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,sut);e._setTransform(o),d.clone(d.ZERO,e.position),n.heading=n.heading-O.PI_OVER_TWO;let r=Le.fromHeadingPitchRoll(n,wX),s=J.fromQuaternion(r,vX);J.getColumn(s,0,e.direction),J.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function cut(e,t,n,i){let o=F.clone(e.transform,SX);if(e._setTransform(F.IDENTITY),!d.equals(t,e.positionWC)){if(i){let a=e._projection,l=a.ellipsoid.cartesianToCartographic(t,Lye);t=a.project(l,Vz)}d.clone(t,e.position)}n.heading=n.heading-O.PI_OVER_TWO;let r=Le.fromHeadingPitchRoll(n,wX),s=J.fromQuaternion(r,vX);J.getColumn(s,0,e.direction),J.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function lut(e,t,n,i){let o=F.clone(e.transform,SX);if(e._setTransform(F.IDENTITY),!d.equals(t,e.positionWC)){if(i){let l=e._projection,u=l.ellipsoid.cartesianToCartographic(t,Lye);t=l.project(u,Vz)}z.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let l=a.top/a.right;a.right=s,a.left=r,a.top=a.right*l,a.bottom=-a.top}}if(e._scene.mapMode2D===Pu.ROTATE){n.heading=n.heading-O.PI_OVER_TWO,n.pitch=-O.PI_OVER_TWO,n.roll=0;let r=Le.fromHeadingPitchRoll(n,wX),s=J.fromQuaternion(r,vX);J.getColumn(s,2,e.up),d.cross(e.direction,e.up,e.right)}e._setTransform(o)}var uut=new d,fut=new d,dut=new d;function Nye(e,t,n,i){let o=d.clone(n.direction,uut),r=d.clone(n.up,fut);if(e._scene.mode===oe.SCENE3D){let a=e._projection.ellipsoid,l=Ot.eastNorthUpToFixedFrame(t,a,kz),u=F.inverseTransformation(l,Uz);F.multiplyByPointAsVector(u,o,o),F.multiplyByPointAsVector(u,r,r)}let s=d.cross(o,r,dut);return i.heading=Iye(o,r),i.pitch=Oye(o),i.roll=Rye(o,r,s),i}var EX={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},HE=new Xa;Jt.prototype.setView=function(e){e=e??W.EMPTY_OBJECT;let t=e.orientation??W.EMPTY_OBJECT,n=this._mode;if(n===oe.MORPHING)return;c(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??d.clone(this.positionWC,Vz);if(c(o)&&c(o.west)){if(o=this.getRectangleCameraCoordinates(o,Vz),isNaN(o.x)||isNaN(o.y))throw new C("destination has a NaN component");i=!1}c(t.direction)&&(t=Nye(this,o,t,EX.orientation)),HE.heading=t.heading??0,HE.pitch=t.pitch??-O.PI_OVER_TWO,HE.roll=t.roll??0,n===oe.SCENE3D?aut(this,o,HE):n===oe.SCENE2D?lut(this,o,HE,i):cut(this,o,HE,i)};var hut=new d;Jt.prototype.flyHome=function(e){let t=this._mode;if(t===oe.MORPHING&&this._scene.completeMorph(),t===oe.SCENE2D)this.flyTo({destination:Jt.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:F.IDENTITY});else if(t===oe.SCENE3D){let n=this.getRectangleCameraCoordinates(Jt.DEFAULT_VIEW_RECTANGLE),i=d.magnitude(n);i+=i*Jt.DEFAULT_VIEW_FACTOR,d.normalize(n,n),d.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:F.IDENTITY})}else if(t===oe.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new d(0,-1,1);i=d.multiplyByScalar(d.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(d.normalize(i,hut).z),roll:0},endTransform:F.IDENTITY,convert:!1})}};Jt.prototype.worldToCameraCoordinates=function(e,t){if(!c(e))throw new C("cartesian is required.");return c(t)||(t=new se),gc(this),F.multiplyByVector(this._actualInvTransform,e,t)};Jt.prototype.worldToCameraCoordinatesPoint=function(e,t){if(!c(e))throw new C("cartesian is required.");return c(t)||(t=new d),gc(this),F.multiplyByPoint(this._actualInvTransform,e,t)};Jt.prototype.worldToCameraCoordinatesVector=function(e,t){if(!c(e))throw new C("cartesian is required.");return c(t)||(t=new d),gc(this),F.multiplyByPointAsVector(this._actualInvTransform,e,t)};Jt.prototype.cameraToWorldCoordinates=function(e,t){if(!c(e))throw new C("cartesian is required.");return c(t)||(t=new se),gc(this),F.multiplyByVector(this._actualTransform,e,t)};Jt.prototype.cameraToWorldCoordinatesPoint=function(e,t){if(!c(e))throw new C("cartesian is required.");return c(t)||(t=new d),gc(this),F.multiplyByPoint(this._actualTransform,e,t)};Jt.prototype.cameraToWorldCoordinatesVector=function(e,t){if(!c(e))throw new C("cartesian is required.");return c(t)||(t=new d),gc(this),F.multiplyByPointAsVector(this._actualTransform,e,t)};function Fye(e,t){let n=e._scene.mapMode2D===Pu.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var Aye=new d;Jt.prototype.move=function(e,t){if(!c(e))throw new C("direction is required.");let n=this.position;d.multiplyByScalar(e,t,Aye),d.add(n,Aye,n),this._mode===oe.SCENE2D&&Fye(this,n),this._adjustOrthographicFrustum(!0)};Jt.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?zz(this,e):this.move(this.direction,e)};Jt.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===oe.SCENE2D?zz(this,-e):this.move(this.direction,-e)};Jt.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};Jt.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};Jt.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};Jt.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};Jt.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,-e)};Jt.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.up,e)};Jt.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,-e)};Jt.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==oe.SCENE2D&&this.look(this.right,e)};var mut=new Le,put=new J;Jt.prototype.look=function(e,t){if(!c(e))throw new C("axis is required.");let n=t??this.defaultLookAmount,i=Le.fromAxisAngle(e,-n,mut),o=J.fromQuaternion(i,put),r=this.direction,s=this.up,a=this.right;J.multiplyByVector(o,r,r),J.multiplyByVector(o,s,s),J.multiplyByVector(o,a,a)};Jt.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};Jt.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var _ut=new Le,gut=new J;Jt.prototype.rotate=function(e,t){if(!c(e))throw new C("axis is required.");let n=t??this.defaultRotateAmount,i=Le.fromAxisAngle(e,-n,_ut),o=J.fromQuaternion(i,gut);J.multiplyByVector(o,this.position,this.position),J.multiplyByVector(o,this.direction,this.direction),J.multiplyByVector(o,this.up,this.up),d.cross(this.direction,this.up,this.right),d.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};Jt.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,Bye(this,e)};Jt.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,Bye(this,-e)};var yut=new d,but=new d,xut=new d,Cye=new d;function Bye(e,t){let n=e.position;if(c(e.constrainedAxis)&&!d.equalsEpsilon(e.position,d.ZERO,O.EPSILON2)){let i=d.normalize(n,yut),o=d.equalsEpsilon(i,e.constrainedAxis,O.EPSILON2),r=d.equalsEpsilon(i,d.negate(e.constrainedAxis,Cye),O.EPSILON2);if(!o&&!r){let s=d.normalize(e.constrainedAxis,but),a=d.dot(i,s),l=O.acosClamped(a);t>0&&t>l&&(t=l-O.EPSILON4),a=d.dot(i,d.negate(s,Cye)),l=O.acosClamped(a),t<0&&-t>l&&(t=-l+O.EPSILON4);let u=d.cross(s,i,xut);e.rotate(u,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}Jt.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,kye(this,-e)};Jt.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,kye(this,e)};function kye(e,t){c(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function zz(e,t){let n=e.frustum;if(!(n instanceof jo)||!c(n.left)||!c(n.right)||!c(n.bottom)||!c(n.top))throw new C("The camera frustum is expected to be orthographic for 2D camera control.");let i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===Pu.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===Pu.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function Uye(e,t){e.move(e.direction,t)}Jt.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?zz(this,e):Uye(this,e)};Jt.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===oe.SCENE2D?zz(this,-e):Uye(this,-e)};Jt.prototype.getMagnitude=function(){if(this._mode===oe.SCENE3D)return d.magnitude(this.position);if(this._mode===oe.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===oe.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var Tut=new F;Jt.prototype.lookAt=function(e,t){if(!c(e))throw new C("target is required");if(!c(t))throw new C("offset is required");if(this._mode===oe.MORPHING)throw new C("lookAt is not supported while morphing.");let i=this._scene.ellipsoid??ie.default,o=Ot.eastNorthUpToFixedFrame(e,i,Tut);this.lookAtTransform(o,t)};var Aut=new d,Cut=new Le,Eut=new Le,Sut=new J;function Vye(e,t,n){t=O.clamp(t,-O.PI_OVER_TWO,O.PI_OVER_TWO),e=O.zeroToTwoPi(e)-O.PI_OVER_TWO;let i=Le.fromAxisAngle(d.UNIT_Y,-t,Cut),o=Le.fromAxisAngle(d.UNIT_Z,-e,Eut),r=Le.multiply(o,i,o),s=J.fromQuaternion(r,Sut),a=d.clone(d.UNIT_X,Aut);return J.multiplyByVector(s,a,a),d.negate(a,a),d.multiplyByScalar(a,n,a),a}Jt.prototype.lookAtTransform=function(e,t){if(!c(e))throw new C("transform is required");if(this._mode===oe.MORPHING)throw new C("lookAtTransform is not supported while morphing.");if(this._setTransform(e),!c(t))return;let n;if(c(t.heading)?n=Vye(t.heading,t.pitch,t.range):n=t,this._mode===oe.SCENE2D){z.clone(z.ZERO,this.position),d.negate(n,this.up),this.up.z=0,d.magnitudeSquared(this.up)<O.EPSILON10&&d.clone(d.UNIT_Y,this.up),d.normalize(this.up,this.up),this._setTransform(F.IDENTITY),d.negate(d.UNIT_Z,this.direction),d.cross(this.direction,this.up,this.right),d.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=d.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}d.clone(n,this.position),d.negate(this.position,this.direction),d.normalize(this.direction,this.direction),d.cross(this.direction,d.UNIT_Z,this.right),d.magnitudeSquared(this.right)<O.EPSILON10&&d.clone(d.UNIT_X,this.right),d.normalize(this.right,this.right),d.cross(this.right,this.direction,this.up),d.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var oI=new he,wut=new he,vut=new d,Dut=new d,Put=new d,Iut=new d,Out=new d,Rut=new d,Mut=new d,TX=new d,Lut={direction:new d,right:new d,up:new d},Eye;function _c(e,t,n,i){return Math.abs(d.dot(t,n))/i-d.dot(e,n)}function zye(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:Lut,{north:s,south:a,west:l}=t,{east:u}=t;l>u&&(u+=O.TWO_PI);let f=(l+u)*.5,h;if(a<-O.PI_OVER_TWO+O.RADIANS_PER_DEGREE&&s>O.PI_OVER_TWO-O.RADIANS_PER_DEGREE)h=0;else{let L=oI;L.longitude=f,L.latitude=s,L.height=0;let B=wut;B.longitude=f,B.latitude=a,B.height=0;let _=Eye;(!c(_)||_.ellipsoid!==o)&&(Eye=_=new J_(void 0,void 0,o)),_.setEndPoints(L,B),h=_.interpolateUsingFraction(.5,oI).latitude}let p=oI;p.longitude=f,p.latitude=h,p.height=0;let g=o.cartographicToCartesian(p,Mut),m=oI;m.longitude=u,m.latitude=s;let y=o.cartographicToCartesian(m,vut);m.longitude=l;let b=o.cartographicToCartesian(m,Put);m.longitude=f;let x=o.cartographicToCartesian(m,Out);m.latitude=a;let A=o.cartographicToCartesian(m,Rut);m.longitude=u;let E=o.cartographicToCartesian(m,Iut);m.longitude=l;let S=o.cartographicToCartesian(m,Dut);d.subtract(b,g,b),d.subtract(E,g,E),d.subtract(y,g,y),d.subtract(S,g,S),d.subtract(x,g,x),d.subtract(A,g,A);let v=o.geodeticSurfaceNormal(g,r.direction);d.negate(v,v);let P=d.cross(v,d.UNIT_Z,r.right);d.normalize(P,P);let M=d.cross(P,v,r.up),R;if(e.frustum instanceof on){let L=Math.max(d.distance(y,b),d.distance(E,S)),B=Math.max(d.distance(y,E),d.distance(b,S)),_,w,D=e.frustum._offCenterFrustum,I=D.right/D.top,N=B*I;L>N?(_=L,w=_/I):(w=B,_=N),R=Math.max(_,w)}else{let L=Math.tan(e.frustum.fovy*.5),B=e.frustum.aspectRatio*L;if(R=Math.max(_c(v,M,b,L),_c(v,M,E,L),_c(v,M,y,L),_c(v,M,S,L),_c(v,M,x,L),_c(v,M,A,L),_c(v,P,b,B),_c(v,P,E,B),_c(v,P,y,B),_c(v,P,S,B),_c(v,P,x,B),_c(v,P,A,B)),a<0&&s>0){let _=oI;_.longitude=l,_.latitude=0,_.height=0;let w=o.cartographicToCartesian(_,TX);d.subtract(w,g,w),R=Math.max(R,_c(v,M,w,L),_c(v,P,w,B)),_.longitude=u,w=o.cartographicToCartesian(_,TX),d.subtract(w,g,w),R=Math.max(R,_c(v,M,w,L),_c(v,P,w,B))}}return d.add(g,d.multiplyByScalar(v,-R,TX),n)}var Nut=new he,Fut=new d,But=new d;function kut(e,t,n){let i=e._projection;t.west>t.east&&(t=ce.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=Nut;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,Fut);F.multiplyByPoint(o,a,a),F.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let l=i.project(s,But);if(F.multiplyByPoint(o,l,l),F.multiplyByPoint(r,l,l),n.x=(a.x-l.x)*.5+l.x,n.y=(a.y-l.y)*.5+l.y,c(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-l.x)/f,(a.y-l.y)/u)*.5}else{let u=a.x-l.x,f=a.y-l.y;n.z=Math.max(u,f)}return n}var Uut=new he,Vut=new d,zut=new d;function Hut(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===Pu.INFINITE_SCROLL?o+=O.TWO_PI:(t=ce.MAX_VALUE,o=t.east));let r=Uut;r.longitude=o,r.latitude=t.north;let s=i.project(r,Vut);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,zut),l=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,h,p=e.frustum.right/e.frustum.top,g=u*p;return l>g?(f=l,h=f/p):(h=u,f=g),u=Math.max(2*f,2*h),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=u,n=i.project(r,n),n}Jt.prototype.getRectangleCameraCoordinates=function(e,t){if(!c(e))throw new C("rectangle is required");let n=this._mode;if(c(t)||(t=new d),n===oe.SCENE3D)return zye(this,e,t);if(n===oe.COLUMBUS_VIEW)return kut(this,e,t);if(n===oe.SCENE2D)return Hut(this,e,t)};var Gut=new _n;function jut(e,t,n,i){n=n??ie.default;let o=e.getPickRay(t,Gut),r=Qn.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return _n.getPoint(o,s,i)}var Wut=new _n;function qut(e,t,n,i){let r=e.getPickRay(t,Wut).origin;r=d.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-O.PI_OVER_TWO||s.latitude>O.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var Yut=new _n;function Xut(e,t,n,i){let o=e.getPickRay(t,Yut),r=-o.origin.x/o.direction.x;_n.getPoint(o,r,i);let s=n.unproject(new d(i.y,i.z,0));if(!(s.latitude<-O.PI_OVER_TWO||s.latitude>O.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}Jt.prototype.pickEllipsoid=function(e,t,n){if(!c(e))throw new C("windowPosition is required.");let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(c(n)||(n=new d),t=t??ie.default,this._mode===oe.SCENE3D)n=jut(this,e,t,n);else if(this._mode===oe.SCENE2D)n=qut(this,e,this._projection,n);else if(this._mode===oe.COLUMBUS_VIEW)n=Xut(this,e,this._projection,n);else return;return n}};var Kut=new d,$ut=new d,Zut=new d;function Qut(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,l=e.frustum.near,u=2/o*t.x-1,f=2/r*(r-t.y)-1,h=e.positionWC;d.clone(h,n.origin);let p=d.multiplyByScalar(e.directionWC,l,Kut);d.add(h,p,p);let g=d.multiplyByScalar(e.rightWC,u*l*a,$ut),m=d.multiplyByScalar(e.upWC,f*l*s,Zut),y=d.add(p,g,n.direction);return d.add(y,m,y),d.subtract(y,h,y),d.normalize(y,y),n}var Fz=new d;function Jut(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;c(a)&&(s=a);let l=2/o*t.x-1;l*=(s.right-s.left)*.5;let u=2/r*(r-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;return d.clone(e.positionWC,f),d.multiplyByScalar(e.rightWC,l,Fz),d.add(Fz,f,f),d.multiplyByScalar(e.upWC,u,Fz),d.add(Fz,f,f),d.clone(e.directionWC,n.direction),n}Jt.prototype.getPickRay=function(e,t){if(!c(e))throw new C("windowPosition is required.");c(t)||(t=new _n);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return c(i.aspectRatio)&&c(i.fov)&&c(i.near)?Qut(this,e,t):Jut(this,e,t)};var eft=new d,tft=new d;Jt.prototype.distanceToBoundingSphere=function(e){if(!c(e))throw new C("boundingSphere is required.");let t=d.subtract(this.positionWC,e.center,eft),n=d.multiplyByScalar(this.directionWC,d.dot(t,this.directionWC),tft);return Math.max(0,d.magnitude(n)-e.radius)};var nft=new z;Jt.prototype.getPixelSize=function(e,t,n){if(!c(e))throw new C("boundingSphere is required.");if(!c(t))throw new C("drawingBufferWidth is required.");if(!c(n))throw new C("drawingBufferHeight is required.");let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,nft);return Math.max(o.x,o.y)};function ift(e,t,n,i,o,r){let s=d.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(l){let u=d.lerp(t,s,l.time,new d);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Qr.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var oft=new d,Sye=new d,rft=new d,sft=new d;function aft(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(d.UNIT_X,oft),r=-d.dot(o,n)/d.dot(o,i),s=d.add(n,d.multiplyByScalar(i,r,Sye),Sye);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,rft);let a=Math.tan(e.frustum.fovy*.5),l=e.frustum.aspectRatio*a,u=d.magnitude(d.subtract(n,s,sft)),f=l*u,h=a*u,p=e._maxCoord.x,g=e._maxCoord.y,m=Math.max(f-p,p),y=Math.max(h-g,g);if(n.z<-m||n.z>m||n.y<-y||n.y>y){let b=s.y<-m||s.y>m,x=s.z<-y||s.z>y;if(b||x)return ift(e,n,s,m,y,t)}}Jt.prototype.createCorrectPositionTween=function(e){if(!c(e))throw new C("duration is required.");if(this._mode===oe.COLUMBUS_VIEW)return aft(this,e)};var cft=new d,qs={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};Jt.prototype.cancelFlight=function(){c(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};Jt.prototype.completeFlight=function(){if(c(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=qs.destination,e.orientation.heading=qs.heading,e.orientation.pitch=qs.pitch,e.orientation.roll=qs.roll,this.setView(e),c(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};Jt.prototype.flyTo=function(e){e=e??W.EMPTY_OBJECT;let t=e.destination;if(!c(t))throw new C("destination is required.");if(this._mode===oe.MORPHING)return;this.cancelFlight();let i=t instanceof ce;i&&(t=this.getRectangleCameraCoordinates(t,cft));let o=e.orientation??W.EMPTY_OBJECT;if(c(o.direction)&&(o=Nye(this,t,o,EX.orientation)),c(e.duration)&&e.duration<=0){let f=EX;f.destination=e.destination,f.orientation.heading=o.heading,f.orientation.pitch=o.pitch,f.orientation.roll=o.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let r=this,s;qs.destination=t,qs.heading=o.heading,qs.pitch=o.pitch,qs.roll=o.roll,qs.duration=e.duration,qs.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),c(e.complete)&&e.complete()},qs.cancel=e.cancel,qs.endTransform=e.endTransform,qs.convert=i?!1:e.convert,qs.maximumHeight=e.maximumHeight,qs.pitchAdjustHeight=e.pitchAdjustHeight,qs.flyOverLongitude=e.flyOverLongitude,qs.flyOverLongitudeWeight=e.flyOverLongitudeWeight,qs.easingFunction=e.easingFunction;let a=this._scene,l=Lz.createTween(a,qs);if(l.duration===0){typeof l.complete=="function"&&l.complete();return}s=a.tweens.add(l),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==oe.SCENE2D&&(c(u)||(u=Jt.clone(this)),u.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function lft(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function uft(e,t){let n=e.frustum,i=n.offCenterFrustum;c(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var fft=100;function Hye(e,t,n){n=$d.clone(c(n)?n:Jt.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!c(r)||r===0){let s=t.radius;s===0?n.range=fft:e.frustum instanceof on||e._mode===oe.SCENE2D?n.range=uft(e,s):n.range=lft(e,s),n.range=O.clamp(n.range,i,o)}return n}Jt.prototype.viewBoundingSphere=function(e,t){if(!c(e))throw new C("boundingSphere is required.");if(this._mode===oe.MORPHING)throw new C("viewBoundingSphere is not supported while morphing.");t=Hye(this,e,t),this.lookAt(e.center,t)};var dft=new F,hft=new d,mft=new d,pft=new d,_ft=new d,gft=new se,yft=new Le,bft=new J;Jt.prototype.flyToBoundingSphere=function(e,t){if(!c(e))throw new C("boundingSphere is required.");t=t??W.EMPTY_OBJECT;let n=this._mode===oe.SCENE2D||this._mode===oe.COLUMBUS_VIEW;this._setTransform(F.IDENTITY);let i=Hye(this,e,t.offset),o;n?o=d.multiplyByScalar(d.UNIT_Z,i.range,hft):o=Vye(i.heading,i.pitch,i.range);let s=this._scene.ellipsoid??ie.default,a=Ot.eastNorthUpToFixedFrame(e.center,s,dft);F.multiplyByPoint(a,o,o);let l,u;if(!n){if(l=d.subtract(e.center,o,mft),d.normalize(l,l),u=F.multiplyByPointAsVector(a,d.UNIT_Z,pft),1-Math.abs(d.dot(l,u))<O.EPSILON6){let h=Le.fromAxisAngle(l,i.heading,yft),p=J.fromQuaternion(h,bft);d.fromCartesian4(F.getColumn(a,1,gft),u),J.multiplyByVector(p,u,u)}let f=d.cross(l,u,_ft);d.cross(f,l,u),d.normalize(u,u)}this.flyTo({destination:o,orientation:{direction:l,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var wye=new d,vye=new d,AX=new d,Dye=new d,rI=[new d,new d,new d,new d];function xft(e,t){let n=t.radii,i=e.positionWC,o=d.multiplyComponents(t.oneOverRadii,i,wye),r=d.magnitude(o),s=d.normalize(o,vye),a,l;d.equalsEpsilon(s,d.UNIT_Z,O.EPSILON10)?(a=new d(0,1,0),l=new d(0,0,1)):(a=d.normalize(d.cross(d.UNIT_Z,s,AX),AX),l=d.normalize(d.cross(s,a,Dye),Dye));let u=Math.sqrt(d.magnitudeSquared(o)-1),f=d.multiplyByScalar(s,1/r,wye),h=u/r,p=d.multiplyByScalar(a,h,vye),g=d.multiplyByScalar(l,h,AX),m=d.add(f,g,rI[0]);d.subtract(m,p,m),d.multiplyComponents(n,m,m);let y=d.subtract(f,g,rI[1]);d.subtract(y,p,y),d.multiplyComponents(n,y,y);let b=d.subtract(f,g,rI[2]);d.add(b,p,b),d.multiplyComponents(n,b,b);let x=d.add(f,g,rI[3]);return d.add(x,p,x),d.multiplyComponents(n,x,x),rI}var CX=new z,Tft=new d,Qy=[new he,new he,new he,new he];function Bz(e,t,n,i,o,r){CX.x=e,CX.y=t;let s=i.pickEllipsoid(CX,o,Tft);return c(s)?(Qy[n]=o.cartesianToCartographic(s,Qy[n]),1):(Qy[n]=o.cartesianToCartographic(r[n],Qy[n]),0)}Jt.prototype.computeViewRectangle=function(e,t){e=e??ie.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new le(d.ZERO,e.maximumRadius);if(n.computeVisibility(i)===Wt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,l=0,u=xft(this,e);if(l+=Bz(0,0,0,this,e,u),l+=Bz(0,a,1,this,e,u),l+=Bz(s,a,2,this,e,u),l+=Bz(s,0,3,this,e,u),l<2)return ce.MAX_VALUE;t=ce.fromCartographicArray(Qy,t);let f=0,h=Qy[3].longitude;for(let p=0;p<4;++p){let g=Qy[p].longitude,m=Math.abs(g-h);m>O.PI?f+=O.TWO_PI-m:f+=m,h=g}return O.equalsEpsilon(Math.abs(f),O.TWO_PI,O.EPSILON9)&&(t.west=-O.PI,t.east=O.PI,Qy[0].latitude>=0?t.north=O.PI_OVER_TWO:t.south=-O.PI_OVER_TWO),t};Jt.prototype.switchToPerspectiveFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof wi)return;let e=this._scene;this.frustum=new wi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=O.toRadians(60)};Jt.prototype.switchToOrthographicFrustum=function(){if(this._mode===oe.SCENE2D||this.frustum instanceof on)return;let e=Mye(this),t=this._scene;this.frustum=new on,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};Jt.clone=function(e,t){return c(t)||(t=new Jt(e._scene)),d.clone(e.position,t.position),d.clone(e.direction,t.direction),d.clone(e.up,t.up),d.clone(e.right,t.right),F.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var ro=Jt;function Aft(e){T.typeOf.object("options",e),T.typeOf.number("options.pass",e.pass),this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var lh=Aft;var Yye=jr(ql(),1),Gye=576,Cft=100,sI="#ffffff",Hz="#48b";function Xye(e,t){this.credit=e,this.count=t??1}function Eft(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(At.equals(o,t))return!0}return!1}function Sft(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;At.equals(n,t)||(c(t)&&e._cesiumCreditContainer.removeChild(t.element),c(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var Kye="cesium-credit-delimiter";function jye(e){let t=document.createElement("span");return t.textContent=e,t.className=Kye,t}function Wye(e,t){if(c(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function qye(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(c(a)){if(r=s,c(n)&&(r*=2,s>0)){let u=r-1;if(o.length<=u)e.appendChild(jye(n));else{let f=o[u];f.className!==Kye&&e.replaceChild(jye(n),f)}}let l=a.element;if(o.length<=r)e.appendChild(Wye(l,i));else{let u=o[r];u._creditId!==a._id&&e.replaceChild(Wye(l,i),u)}}}for(++r;r<o.length;)e.removeChild(o[r])}function wft(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<Gye?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=Gye&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function vft(e){let t=`
.cesium-credit-lightbox-overlay {
display: none;
z-index: 1;
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(80, 80, 80, 0.8);
}
.cesium-credit-lightbox {
background-color: #303336;
color: ${sI};
position: relative;
min-height: ${Cft}px;
margin: auto;
}
.cesium-credit-lightbox > ul > li a,
.cesium-credit-lightbox > ul > li a:visited,
.cesium-credit-wrapper a,
.cesium-credit-wrapper a:visited {
color: ${sI};
}
.cesium-credit-lightbox > ul > li a:hover {
color: ${Hz};
}
.cesium-credit-lightbox.cesium-credit-lightbox-expanded {
border: 1px solid #444;
border-radius: 5px;
max-width: 370px;
}
.cesium-credit-lightbox.cesium-credit-lightbox-mobile {
height: 100%;
width: 100%;
}
.cesium-credit-lightbox-title {
padding: 20px 20px 0 20px;
}
.cesium-credit-lightbox-close {
font-size: 18pt;
cursor: pointer;
position: absolute;
top: 0;
right: 6px;
color: ${sI};
}
.cesium-credit-lightbox-close:hover {
color: ${Hz};
}
.cesium-credit-lightbox > ul {
margin: 0;
padding: 12px 20px 12px 40px;
font-size: 13px;
}
.cesium-credit-lightbox > ul > li {
padding-bottom: 6px;
}
.cesium-credit-lightbox > ul > li * {
padding: 0;
margin: 0;
}
.cesium-credit-expand-link {
padding-left: 5px;
cursor: pointer;
text-decoration: underline;
color: ${sI};
}
.cesium-credit-expand-link:hover {
color: ${Hz};
}
.cesium-credit-text {
color: ${sI};
}
.cesium-credit-delimiter {
padding: 0 5px;
}
.cesium-credit-textContainer *,
.cesium-credit-logoContainer * {
display: inline;
}
.cesium-credit-textContainer a:hover {
color: ${Hz}
}
.cesium-credit-textContainer .cesium-credit-wrapper:first-of-type {
padding-left: 5px;
}
`;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=n(e)??document.head,o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function dr(e,t,n){T.defined("container",e);let i=this;n=n??document.body;let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",o.appendChild(r);function s(m){r.contains(m.target)||i.hideLightbox()}o.addEventListener("click",s,!1);let a=document.createElement("div");a.className="cesium-credit-lightbox-title",a.textContent="Data provided by:",r.appendChild(a);let l=document.createElement("a");l.onclick=this.hideLightbox.bind(this),l.innerHTML="&times;",l.className="cesium-credit-lightbox-close",r.appendChild(l);let u=document.createElement("ul");r.appendChild(u);let f=document.createElement("div");f.className="cesium-credit-logoContainer",f.style.display="inline",e.appendChild(f);let h=document.createElement("div");h.className="cesium-credit-textContainer",h.style.display="inline",e.appendChild(h);let p=document.createElement("a");p.className="cesium-credit-expand-link",p.onclick=this.showLightbox.bind(this),p.textContent="Data attribution",e.appendChild(p),vft(e);let g=At.clone(dr.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=h,this._cesiumCreditContainer=f,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=s,this._expandLink=p,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=g,this._previousCesiumCredit=void 0,this._currentCesiumCredit=g,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Et,lightboxCredits:new Et},this._defaultCredit=void 0,this.viewport=n,this.container=e}function $ye(e,t,n,i){i=i??1;let o=t.get(n.id);if(c(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new Xye(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}dr.prototype.addCreditToNextFrame=function(e){if(T.defined("credit",e),e.isIon()){c(this._defaultCredit)||(this._defaultCredit=At.clone(Zye())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,$ye(this,t,e)};dr.prototype.addStaticCredit=function(e){T.defined("credit",e);let t=this._staticCredits;Eft(t,e)||t.push(e)};dr.prototype.removeStaticCredit=function(e){T.defined("credit",e);let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};dr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0};dr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1};dr.prototype.update=function(){this._expanded&&wft(this)};dr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&At.equals(dr.cesiumCredit,this._cesiumCredit)||$ye(this,s,r,Number.MAX_VALUE)}At.equals(dr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=At.clone(dr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};dr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;qye(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",qye(this._creditList,t,void 0,"li"),Sft(this)};dr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),de(this)};dr.prototype.isDestroyed=function(){return!1};dr._cesiumCredit=void 0;dr._cesiumCreditInitialized=!1;var Gz;function Zye(){if(!c(Gz)){let e=tn("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new Yye.default(e).path()),Gz=new At(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return dr._cesiumCreditInitialized||(dr._cesiumCredit=Gz,dr._cesiumCreditInitialized=!0),Gz}Object.defineProperties(dr,{cesiumCredit:{get:function(){return Zye(),dr._cesiumCredit},set:function(e){dr._cesiumCredit=e,dr._cesiumCreditInitialized=!0}}});dr.CreditDisplayElement=Xye;var jz=dr;var Wz=0,Dft=1;function bx(e){T.typeOf.object("options",e),T.typeOf.object("options.frustum",e.frustum),T.typeOf.object("options.origin",e.origin),T.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??Ie.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof wi?(s=Wz,a=wi.packedLength):t instanceof on&&(s=Dft,a=on.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+d.packedLength+Le.packedLength+Ie.packedLength}bx.pack=function(e,t,n){T.typeOf.object("value",e),T.defined("array",t),n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===Wz?(wi.pack(o,t,n),n+=wi.packedLength):(on.pack(o,t,n),n+=on.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,Ie.pack(e._vertexFormat,t,n),n+=Ie.packedLength,t[n]=e._drawNearPlane?1:0,t};var Pft=new wi,Ift=new on,Oft=new Le,Rft=new d,Mft=new Ie;bx.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=e[t++],o;i===Wz?(o=wi.unpack(e,t,Pft),t+=wi.packedLength):(o=on.unpack(e,t,Ift),t+=on.packedLength);let r=d.unpack(e,t,Rft);t+=d.packedLength;let s=Le.unpack(e,t,Oft);t+=Le.packedLength;let a=Ie.unpack(e,t,Mft);t+=Ie.packedLength;let l=e[t]===1;if(!c(n))return new bx({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:l});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(u),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Le.clone(s,n._orientation),n._vertexFormat=Ie.clone(a,n._vertexFormat),n._drawNearPlane=l,n};function GE(e,t,n,i,o,r,s,a){let l=e/3*2;for(let u=0;u<4;++u)c(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),c(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),c(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[l]=0,o[l+1]=0,o[l+2]=1,o[l+3]=0,o[l+4]=1,o[l+5]=1,o[l+6]=0,o[l+7]=1}var Lft=new J,Nft=new F,DX=new F,Qye=new d,Jye=new d,e0e=new d,Fft=new d,Bft=new d,kft=new d,Jy=new Array(3),aI=new Array(4);aI[0]=new se(-1,-1,1,1);aI[1]=new se(1,-1,1,1);aI[2]=new se(1,1,1,1);aI[3]=new se(-1,1,1,1);var t0e=new Array(4);for(let e=0;e<4;++e)t0e[e]=new se;bx._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let l=J.fromQuaternion(t,Lft),u=r??Qye,f=s??Jye,h=a??e0e;u=J.getColumn(l,0,u),f=J.getColumn(l,1,f),h=J.getColumn(l,2,h),d.normalize(u,u),d.normalize(f,f),d.normalize(h,h),d.negate(u,u);let p=F.computeView(e,h,f,u,Nft),g,m,y=i.projectionMatrix;if(n===Wz){let b=F.multiply(y,p,DX);m=F.inverse(b,DX)}else g=F.inverseTransformation(p,DX);c(m)?(Jy[0]=i.near,Jy[1]=i.far):(Jy[0]=0,Jy[1]=i.near,Jy[2]=i.far);for(let b=0;b<2;++b)for(let x=0;x<4;++x){let A=se.clone(aI[x],t0e[x]);if(c(m)){A=F.multiplyByVector(m,A,A);let E=1/A.w;d.multiplyByScalar(A,E,A),d.subtract(A,e,A),d.normalize(A,A);let S=d.dot(h,A);d.multiplyByScalar(A,Jy[b]/S,A),d.add(A,e,A)}else{let E=i.offCenterFrustum;c(E)&&(i=E);let S=Jy[b],v=Jy[b+1];A.x=(A.x*(i.right-i.left)+i.left+i.right)*.5,A.y=(A.y*(i.top-i.bottom)+i.bottom+i.top)*.5,A.z=(A.z*(S-v)-S-v)*.5,A.w=1,F.multiplyByVector(g,A,A)}o[12*b+x*3]=A.x,o[12*b+x*3+1]=A.y,o[12*b+x*3+2]=A.z}};bx.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,l=new Float64Array(3*4*6);bx._computeNearFarPlanes(i,o,t,n,l);let u=3*4*2;l[u]=l[3*4],l[u+1]=l[3*4+1],l[u+2]=l[3*4+2],l[u+3]=l[0],l[u+4]=l[1],l[u+5]=l[2],l[u+6]=l[3*3],l[u+7]=l[3*3+1],l[u+8]=l[3*3+2],l[u+9]=l[3*7],l[u+10]=l[3*7+1],l[u+11]=l[3*7+2],u+=3*4,l[u]=l[3*5],l[u+1]=l[3*5+1],l[u+2]=l[3*5+2],l[u+3]=l[3],l[u+4]=l[4],l[u+5]=l[5],l[u+6]=l[0],l[u+7]=l[1],l[u+8]=l[2],l[u+9]=l[3*4],l[u+10]=l[3*4+1],l[u+11]=l[3*4+2],u+=3*4,l[u]=l[3],l[u+1]=l[4],l[u+2]=l[5],l[u+3]=l[3*5],l[u+4]=l[3*5+1],l[u+5]=l[3*5+2],l[u+6]=l[3*6],l[u+7]=l[3*6+1],l[u+8]=l[3*6+2],l[u+9]=l[3*2],l[u+10]=l[3*2+1],l[u+11]=l[3*2+2],u+=3*4,l[u]=l[3*2],l[u+1]=l[3*2+1],l[u+2]=l[3*2+2],l[u+3]=l[3*6],l[u+4]=l[3*6+1],l[u+5]=l[3*6+2],l[u+6]=l[3*7],l[u+7]=l[3*7+1],l[u+8]=l[3*7+2],l[u+9]=l[3*3],l[u+10]=l[3*3+1],l[u+11]=l[3*3+2],r||(l=l.subarray(3*4));let f=new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:l})});if(c(s.normal)||c(s.tangent)||c(s.bitangent)||c(s.st)){let p=c(s.normal)?new Float32Array(12*a):void 0,g=c(s.tangent)?new Float32Array(3*4*a):void 0,m=c(s.bitangent)?new Float32Array(3*4*a):void 0,y=c(s.st)?new Float32Array(2*4*a):void 0,b=Qye,x=Jye,A=e0e,E=d.negate(b,Fft),S=d.negate(x,Bft),v=d.negate(A,kft);u=0,r&&(GE(u,p,g,m,y,v,b,x),u+=3*4),GE(u,p,g,m,y,A,E,x),u+=3*4,GE(u,p,g,m,y,E,v,x),u+=3*4,GE(u,p,g,m,y,S,v,E),u+=3*4,GE(u,p,g,m,y,b,A,x),u+=3*4,GE(u,p,g,m,y,x,A,E),c(p)&&(f.normal=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:p})),c(g)&&(f.tangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:g})),c(m)&&(f.bitangent=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:m})),c(y)&&(f.st=new ve({componentDatatype:$.FLOAT,componentsPerAttribute:2,values:y}))}let h=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,m=p*4;h[g]=m,h[g+1]=m+1,h[g+2]=m+2,h[g+3]=m,h[g+4]=m+2,h[g+5]=m+3}return new ct({attributes:f,indices:h,primitiveType:Me.TRIANGLES,boundingSphere:le.fromVertices(l)})};var jE=bx;var PX=0,Uft=1;function cI(e){T.typeOf.object("options",e),T.typeOf.object("options.frustum",e.frustum),T.typeOf.object("options.origin",e.origin),T.typeOf.object("options.orientation",e.orientation);let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof wi?(r=PX,s=wi.packedLength):t instanceof on&&(r=Uft,s=on.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=d.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+d.packedLength+Le.packedLength}cI.pack=function(e,t,n){T.typeOf.object("value",e),T.defined("array",t),n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===PX?(wi.pack(o,t,n),n+=wi.packedLength):(on.pack(o,t,n),n+=on.packedLength),d.pack(e._origin,t,n),n+=d.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,t[n]=e._drawNearPlane?1:0,t};var Vft=new wi,zft=new on,Hft=new Le,Gft=new d;cI.unpack=function(e,t,n){T.defined("array",e),t=t??0;let i=e[t++],o;i===PX?(o=wi.unpack(e,t,Vft),t+=wi.packedLength):(o=on.unpack(e,t,zft),t+=on.packedLength);let r=d.unpack(e,t,Gft);t+=d.packedLength;let s=Le.unpack(e,t,Hft);t+=Le.packedLength;let a=e[t]===1;if(!c(n))return new cI({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let l=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(l),n._frustumType=i,n._origin=d.clone(r,n._origin),n._orientation=Le.clone(s,n._orientation),n._drawNearPlane=a,n};cI.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(3*4*2);jE._computeNearFarPlanes(i,o,t,n,s);let a=new hn({position:new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:s})}),l,u,f=r?2:1,h=new Uint16Array(8*(f+1)),p=r?0:1;for(;p<2;++p)l=r?p*8:0,u=p*4,h[l]=u,h[l+1]=u+1,h[l+2]=u+1,h[l+3]=u+2,h[l+4]=u+2,h[l+5]=u+3,h[l+6]=u+3,h[l+7]=u;for(p=0;p<2;++p)l=(f+p)*8,u=p*4,h[l]=u,h[l+1]=u+4,h[l+2]=u+1,h[l+3]=u+5,h[l+4]=u+2,h[l+5]=u+6,h[l+6]=u+3,h[l+7]=u+7;return new ct({attributes:a,indices:h,primitiveType:Me.LINES,boundingSphere:le.fromVertices(s)})};var qz=cI;function Yz(e){if(e=e??W.EMPTY_OBJECT,!c(e.camera))throw new C("options.camera is required.");this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??G.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var jft=new d,Wft=new J,qft=new Le,Yft=new wi,Xft=new zl,Kft=new on,$ft=new jo,Zft=new G,Qft=[1,1e5];Yz.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof wi?a=Yft:s instanceof zl?a=Xft:s instanceof on?a=Kft:a=$ft,a=s.clone(a);let l,u=this._frustumSplits;!c(u)||u.length<=1?(u=Qft,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,l=1):l=u.length-1;let f=r.positionWC,h=r.directionWC,p=r.upWC,g=r.rightWC;g=d.negate(g,jft);let m=Wft;J.setColumn(m,0,g,m),J.setColumn(m,1,p,m),J.setColumn(m,2,h,m);let y=Le.fromRotationMatrix(m,qft);for(t.length=n.length=l,i=0;i<l;++i)a.near=u[i],a.far=u[i+1],t[i]=new In({geometryInstances:new St({geometry:new jE({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:jt.fromColor(G.fromAlpha(this._color,.1,Zft))},id:this.id,pickPrimitive:this}),appearance:new rn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new St({geometry:new qz({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:jt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};Yz.prototype.isDestroyed=function(){return!1};Yz.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return de(this)};var T_=Yz;function uI(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=e??0}var lI=zt.supportsTypedArrays()?new Float32Array(12):[],n0e=new d,i0e=new d,IX=new d,o0e=new d,Xz=new d;function Jft(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof on)o=d.ZERO,r=i.rightWC,s=i.upWC;else{let h=i.positionWC,p=d.multiplyComponents(e.oneOverRadii,h,n0e),g=d.normalize(p,i0e),m=d.normalize(d.cross(d.UNIT_Z,p,IX),IX),y=d.normalize(d.cross(g,m,o0e),o0e),b=d.magnitude(p),x=Math.sqrt(b*b-1);o=d.multiplyByScalar(g,1/b,n0e);let A=x/b;r=d.multiplyByScalar(m,A,i0e),s=d.multiplyByScalar(y,A,IX)}let a=d.add(o,s,Xz);d.subtract(a,r,a),d.multiplyComponents(n,a,a),d.pack(a,lI,0);let l=d.subtract(o,s,Xz);d.subtract(l,r,l),d.multiplyComponents(n,l,l),d.pack(l,lI,3);let u=d.add(o,s,Xz);d.add(u,r,u),d.multiplyComponents(n,u,u),d.pack(u,lI,6);let f=d.subtract(o,s,Xz);return d.add(f,r,f),d.multiplyComponents(n,f,f),d.pack(f,lI,9),lI}uI.prototype.update=function(e){if(this._mode=e.mode,e.mode!==oe.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ie(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(c(this._command)||(this._rs=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new Je({renderState:this._rs,boundingVolume:new le(d.ZERO,i.maximumRadius),pass:De.OPAQUE,owner:this})),!c(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new He({sources:[pV]}),a=new He({sources:[mV]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=en.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=Jft(i,e);if(c(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new ct({attributes:{position:new ve({componentDatatype:$.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Me.TRIANGLES});this._va=ni.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Be.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};uI.prototype.execute=function(e,t){this._mode===oe.SCENE3D&&this._command.execute(e,t)};uI.prototype.isDestroyed=function(){return!1};uI.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var Kz=uI;function qE(){}var edt=/\bgl_FragDepth\b/,tdt=/\bdiscard\b/;function ndt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(c(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(edt.test(r[a])||tdt.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main()
{
out_FragColor = vec4(1.0);
}
`;i=new He({sources:[a]})}else if(!o&&s){let a=`void main()
{
out_FragColor = vec4(1.0);
czm_writeLogDepth();
}
`;i=new He({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function idt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(c(i))return i;let o=ze.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=ze.fromCache(o);return n[t.id]=r,r}qE.createDepthOnlyDerivedCommand=function(e,t,n,i){c(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=Je.shallowClone(t,i.depthOnlyCommand),!c(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=ndt(n,t.shaderProgram),i.depthOnlyCommand.renderState=idt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var odt=/\s+czm_writeLogDepth\(/,rdt=/\s+czm_vertexLogDepth\(/;function sdt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(c(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=c(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=c(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,l=r.sources;for(let f=0;f<l.length;++f)if(rdt.test(l[f])){a=!0;break}if(!a){for(let h=0;h<l.length;++h)l[h]=He.replaceMain(l[h],"czm_log_depth_main");l.push(`
void main()
{
czm_log_depth_main();
czm_vertexLogDepth();
}
`)}l=s.sources,a=!1;for(let f=0;f<l.length;++f)odt.test(l[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<l.length;f++)l[f]=He.replaceMain(l[f],"czm_log_depth_main");u=`
void main()
{
czm_log_depth_main();
czm_writeLogDepth();
}
`}return l.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}qE.createLogDepthCommand=function(e,t,n){c(n)||(n={});let i=n.command?.shaderProgram;return n.command=Je.shallowClone(e,n.command),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=sdt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function adt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(c(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,l=r.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main ()
{
czm_non_pick_main();
if (${l}.a == 0.0) {
discard;
}
${l} = ${n};
} `,f=r.length,h=new Array(f+1);for(let g=0;g<f;++g)h[g]=He.replaceMain(r[g],"czm_non_pick_main");h[f]=u;let p=new He({sources:h,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function r0e(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(c(i))return i;let o=ze.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=ze.fromCache(o);return n[t.id]=r,r}qE.createPickDerivedCommand=function(e,t,n,i){c(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=Je.shallowClone(t,i.pickCommand),!c(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=adt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=r0e(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};function WE(e,t,n){let i=e.length;for(let o=0;o<i;o++)e[o].trimStart().split(/\s+/)[0]===t&&(e[o]=`${t} ${n}`)}function s0e(e){return e.isArray?e.arrayLength:at.getComponentCount(e.type)}function cdt(e){let t=s0e(e);return e.normalized?t===1?"float":`vec${t}`:t===1?"int":`ivec${t}`}function a0e(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function c0e(e,t){let n=Nt.getMaximum(t);return`(${e}) / float(${n})`}function ldt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=a0e(n,i,o)}return e.normalized||(n=c0e(n,e.componentType)),n}function udt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=a0e(o,r,s)}return e.normalized||(o=c0e(o,e.componentType)),o}function fdt(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(c(a))return a;let l=n.metadataProperty,u=n.classProperty,f=cdt(u),h=["0.0","0.0","0.0","0.0"],p=s0e(u);if(p===1)h[0]=ldt(u,l);else{let b=["x","y","z","w"];for(let x=0;x<p;x++)h[x]=udt(u,l,b[x])}let g=t.fragmentShaderSource.defines.slice();g.push(yf.METADATA_PICKING_ENABLED),WE(g,yf.METADATA_PICKING_VALUE_TYPE,f),WE(g,yf.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),WE(g,yf.METADATA_PICKING_VALUE_COMPONENT_X,h[0]),WE(g,yf.METADATA_PICKING_VALUE_COMPONENT_Y,h[1]),WE(g,yf.METADATA_PICKING_VALUE_COMPONENT_Z,h[2]),WE(g,yf.METADATA_PICKING_VALUE_COMPONENT_W,h[3]);let m=new He({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}qE.createPickMetadataDerivedCommand=function(e,t,n,i){return c(i)||(i={}),i.pickMetadataCommand=Je.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=fdt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=r0e(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function ddt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(c(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=c(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=c(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}qE.createHdrCommand=function(e,t,n){c(n)||(n={});let i=n.command?.shaderProgram;return n.command=Je.shallowClone(e,n.command),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=ddt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var A_=qE;function $z(e){if(!c(e))throw new C("scene is required.");this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!c(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=O.toRadians(o),t._beta=O.toRadians(i.beta),t._gamma=O.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var hdt=new Le,l0e=new Le,mdt=new J;function pdt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Le.fromAxisAngle(o,n,l0e),l=Le.fromAxisAngle(r,i,hdt),u=Le.multiply(l,a,l),f=Le.fromAxisAngle(s,t,l0e);Le.multiply(f,u,u);let h=J.fromQuaternion(u,mdt);J.multiplyByVector(h,r,r),J.multiplyByVector(h,s,s),J.multiplyByVector(h,o,o)}$z.prototype.update=function(){if(!c(this._alpha))return;c(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;pdt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};$z.prototype.isDestroyed=function(){return!1};$z.prototype.destroy=function(){return this._removeListener(),de(this)};var Zz=$z;function OX(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(OX.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){if(c(e)&&e<0)throw new C("value must be positive.");this._heightFalloff=e}}});var _dt=new d;OX.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!c(i)||i.height>this.maxHeight||e.mode!==oe.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,O.EPSILON4),-Math.max(this._heightFalloff,0)),s=d.normalize(n.positionWC,_dt),a=Math.abs(d.dot(n.directionWC,s));r*=1-a,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var Qz=OX;function gdt(e,t,n){this.context=e,this.commandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=oe.SCENE3D,this.morphTime=oe.getMorphTime(oe.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0}var Jz=gdt;var ga={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},xx=ga.DERIVED_COMMANDS_MAXIMUM_LENGTH,b0e=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function Tx(){this._frontFaceAlphaByDistance=new Bt(0,1,0,1),this._backFaceAlphaByDistance=new Bt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ce.clone(ce.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(xx),this._derivedBlendCommandTypes=new Array(xx),this._derivedPickCommandTypes=new Array(xx),this._derivedCommandTypesToUpdate=new Array(xx),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(Tx.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});Tx.prototype.update=function(e){let t=e.globe;if(!c(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=u0e(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=u0e(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=f0e(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=f0e(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=Tdt(this,e,t),this._sunVisibleThroughGlobe=ydt(this,e),this._environmentVisible=bdt(this,e),this._useDepthPlane=xdt(this,e),this._numberOfTextureUniforms=Adt(this),this._rectangle=ce.clone(t.translucency.rectangle,this._rectangle),Cdt(this,e)};function u0e(e,t,n,i){return e?c(n)?(Bt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function f0e(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function ydt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function bdt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function xdt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function Tdt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==oe.SCENE2D&&t.context.depthTexture}function Adt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function Cdt(e,t){e._derivedCommandsLength=RX(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=RX(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=RX(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<xx;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!c(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=kdt())}function RX(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let l=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?ga.PICK_FRONT_FACE:u?ga.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:ga.TRANSLUCENT_FRONT_FACE,h=i?ga.PICK_BACK_FACE:u?ga.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:ga.TRANSLUCENT_BACK_FACE;return t.mode===oe.SCENE2D?(o[r++]=ga.DEPTH_ONLY_FRONT_FACE,o[r++]=f,r):(a?(n||(o[r++]=ga.DEPTH_ONLY_FRONT_AND_BACK_FACE),l?(o[r++]=f,o[r++]=h):(o[r++]=h,o[r++]=f)):l?(n||(o[r++]=ga.DEPTH_ONLY_BACK_FACE),o[r++]=ga.OPAQUE_FRONT_FACE,o[r++]=h):(n||(o[r++]=ga.DEPTH_ONLY_FRONT_FACE),o[r++]=ga.OPAQUE_BACK_FACE,o[r++]=f),r)}function Yf(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function d0e(e,t){return e.indexOf(t)>-1}function Edt(e,t){Yf(e.defines,"TRANSLUCENT"),Yf(t.defines,"TRANSLUCENT")}function Sdt(e,t){Yf(e.defines,"GROUND_ATMOSPHERE"),Yf(t.defines,"GROUND_ATMOSPHERE"),Yf(e.defines,"FOG"),Yf(t.defines,"FOG"),Yf(e.defines,"TRANSLUCENT"),Yf(t.defines,"TRANSLUCENT")}function MX(e,t){if(d0e(t.defines,"TILE_LIMIT_RECTANGLE")||d0e(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main()
{
out_FragColor = vec4(1.0);
}
`;t.sources=[n]}function LX(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=He.replaceMain(n[r],"czm_globe_translucency_main");n.push(`
uniform sampler2D u_classificationTexture;
void main()
{
vec2 st = gl_FragCoord.xy / czm_viewport.zw;
#ifdef MANUAL_DEPTH_TEST
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, st));
if (logDepthOrDepth != 0.0)
{
vec4 eyeCoordinate = czm_windowToEyeCoordinates(gl_FragCoord.xy, logDepthOrDepth);
float depthEC = eyeCoordinate.z / eyeCoordinate.w;
if (v_positionEC.z < depthEC)
{
discard;
}
}
#endif
czm_globe_translucency_main();
vec4 classificationColor = texture(u_classificationTexture, st);
if (classificationColor.a > 0.0)
{
// Reverse premultiplication process to get the correct composited result of the classification primitives
classificationColor.rgb /= classificationColor.a;
}
out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a);
}
`)}function x0e(e,t){LX(e,t),Yf(e.defines,"GROUND_ATMOSPHERE"),Yf(t.defines,"GROUND_ATMOSPHERE"),Yf(e.defines,"FOG"),Yf(t.defines,"FOG")}function wdt(e,t){LX(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function vdt(e,t){x0e(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function h0e(e,t){let n=`uniform sampler2D u_classificationTexture;
void main()
{
vec2 st = gl_FragCoord.xy / czm_viewport.zw;
vec4 pickColor = texture(u_classificationTexture, st);
if (pickColor == vec4(0.0))
{
discard;
}
out_FragColor = pickColor;
}
`;t.sources=[n]}function Ddt(e,t,n,i,o,r){if(!c(o))return t;if(!i&&c(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!c(s)){let a=t._attributeLocations,l=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();l.defines=c(l.defines)?l.defines.slice(0):[],u.defines=c(u.defines)?u.defines.slice(0):[],o(l,u),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:l,fragmentShaderSource:u,attributeLocations:a})}return s}function Pdt(e){e.cull.face=Ti.BACK,e.cull.enabled=!0}function Idt(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0}function Odt(e){e.cull.face=Ti.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Rdt(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Mdt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function m0e(e){e.cull.face=Ti.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function p0e(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=un.ALPHA_BLEND}function Ldt(e){e.cull.face=Ti.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function Ndt(e){e.cull.face=Ti.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function Fdt(e,t,n,i,o){if(!c(i))return e;if(!n&&c(t))return t;let r=o[e.id];if(!c(r)){let s=ze.getState(e);i(s),r=ze.fromCache(s),o[e.id]=r}return r}function YE(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Bdt(e,t,n,i,o){return c(o)?!i&&c(n)?n:xt(t,o(e),!1):t}function uh(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function kdt(){return[new uh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:Edt,getRenderStateFunction:Pdt,getUniformMapFunction:void 0}),new uh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:Sdt,getRenderStateFunction:Idt,getUniformMapFunction:void 0}),new uh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:MX,getRenderStateFunction:Odt,getUniformMapFunction:void 0}),new uh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:MX,getRenderStateFunction:Rdt,getUniformMapFunction:void 0}),new uh({pass:De.GLOBE,pickOnly:!1,getShaderProgramFunction:MX,getRenderStateFunction:Mdt,getUniformMapFunction:void 0}),new uh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:LX,getRenderStateFunction:m0e,getUniformMapFunction:YE}),new uh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:x0e,getRenderStateFunction:p0e,getUniformMapFunction:YE}),new uh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:wdt,getRenderStateFunction:m0e,getUniformMapFunction:YE}),new uh({pass:De.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:vdt,getRenderStateFunction:p0e,getUniformMapFunction:YE}),new uh({pass:De.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:h0e,getRenderStateFunction:Ldt,getUniformMapFunction:YE}),new uh({pass:De.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:h0e,getRenderStateFunction:Ndt,getUniformMapFunction:YE})]}var _0e=new Array(xx),g0e=new Array(xx);Tx.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)g0e[o]=this._derivedCommandPacks[n[o]],_0e[o]=b0e[n[o]];Udt(this,e,i,n,_0e,g0e,t)}};function Udt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,l=e._derivedCommandsDirty;if(t.dirty||!c(a)||l){t.dirty=!1,c(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=a.uniformMapDirtyFrame??0,h=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,g=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),y&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let b=0;b<n;++b){let x=r[b],A=i[b],E=o[b],S=a[E],v,P,M;c(S)?(v=S.uniformMap,P=S.shaderProgram,M=S.renderState):(v=void 0,P=void 0,M=void 0),S=Je.shallowClone(t,S),a[E]=S;let R=S.derivedCommands.uniformMapDirtyFrame??0,L=S.derivedCommands.shaderProgramDirtyFrame??0,B=S.derivedCommands.renderStateDirtyFrame??0,_=g||R<f,w=m||L<h,D=y||B<p;_&&(S.derivedCommands.uniformMapDirtyFrame=u),w&&(S.derivedCommands.shaderProgramDirtyFrame=u),D&&(S.derivedCommands.renderStateDirtyFrame=u),S.derivedCommands.type=A,S.pass=x.pass,S.pickOnly=x.pickOnly,S.uniformMap=Bdt(e,t.uniformMap,v,_,x.getUniformMapFunction),S.shaderProgram=Ddt(s.context,t.shaderProgram,P,w,x.getShaderProgramFunction,E),S.renderState=Fdt(t.renderState,M,D,x.getRenderStateFunction,x.renderStateCache)}}}Tx.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let l=b0e[o[a]];n.commandList.push(s[l])}};function T0e(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],l=a.derivedCommands.type;(!c(r)||r.indexOf(l)>-1)&&n(a,i,o)}}function y0e(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var Vdt=[ga.OPAQUE_FRONT_FACE,ga.OPAQUE_BACK_FACE],zdt=[ga.DEPTH_ONLY_FRONT_FACE,ga.DEPTH_ONLY_BACK_FACE,ga.DEPTH_ONLY_FRONT_AND_BACK_FACE];Tx.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[De.GLOBE],a=e.indices[De.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),T0e(s,a,t,i,o,Vdt))};Tx.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[De.GLOBE],l=e.indices[De.GLOBE],u=e.commands[De.TERRAIN_CLASSIFICATION],f=e.indices[De.TERRAIN_CLASSIFICATION];if(l===0||f===0)return;let h=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!h||!p)&&y0e(u,f,t,i,o),!h&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,T0e(a,l,t,i,o,zdt),r.depthTexture){let y=n.packDepth(r,o);s.globeDepthTexture=y}y0e(u,f,t,i,o),s.globeDepthTexture=g,o.framebuffer=m};var e4=Tx;var Iu=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = texture(colorTexture, v_textureCoordinates);
}
`;function Hm(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new pi({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new pi({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ti({color:new G(0,0,0,0),owner:this}),this._clearCommand=new ti({color:new G(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(Hm.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Hm.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var Hdt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},Gdt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:Vn.NOT_EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.NEVER,reference:0,mask:kt.CLASSIFICATION_MASK},blending:un.ALPHA_BLEND},jdt={depthMask:!0,depthTest:{enabled:!0},stencilTest:kt.setCesium3DTileBit(),stencilMask:kt.CESIUM_3D_TILE_MASK,blending:un.ALPHA_BLEND},Wdt=`uniform sampler2D colorTexture;
uniform sampler2D depthTexture;
uniform sampler2D classifiedTexture;
in vec2 v_textureCoordinates;
void main()
{
vec4 color = texture(colorTexture, v_textureCoordinates);
if (color.a == 0.0)
{
discard;
}
bool isClassified = all(equal(texture(classifiedTexture, v_textureCoordinates), vec4(0.0)));
#ifdef UNCLASSIFIED
vec4 highlightColor = czm_invertClassificationColor;
if (isClassified)
{
discard;
}
#else
vec4 highlightColor = vec4(1.0);
if (!isClassified)
{
discard;
}
#endif
out_FragColor = color * highlightColor;
gl_FragDepth = texture(depthTexture, v_textureCoordinates).r;
}
`,qdt=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
void main()
{
vec4 color = texture(colorTexture, v_textureCoordinates);
if (color.a == 0.0)
{
discard;
}
#ifdef UNCLASSIFIED
out_FragColor = color * czm_invertClassificationColor;
#else
out_FragColor = color;
#endif
}
`;Hm.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,l=!c(i)||i.width!==s||i.height!==a;if((l||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),c(this._previousFramebuffer)||(this._depthStencilTexture=new Rt({context:e,width:s,height:a,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new tf({context:e,width:s,height:a,format:Ec.DEPTH24_STENCIL8,numSamples:t})))),!c(this._fbo.framebuffer)||l||o||r){this._fbo.destroy(),this._fboClassified.destroy();let u,f;c(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),c(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),c(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(c(this._rsUnclassified)||(this._rsUnclassified=ze.fromCache(Hdt),this._rsClassified=ze.fromCache(Gdt),this._rsDefault=ze.fromCache(jdt)),!c(this._unclassifiedCommand)||o||r){c(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=c(this._previousFramebuffer)?qdt:Wdt,f=new He({defines:["UNCLASSIFIED"],sources:[u]}),h=new He({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:c(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(h,{renderState:c(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),c(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),c(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(Iu,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Hm.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Hm.prototype.clear=function(e,t){c(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};Hm.prototype.executeClassified=function(e,t){if(!c(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};Hm.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Hm.prototype.isDestroyed=function(){return!1};Hm.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),c(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),de(this)};var fI=Hm;function t4(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(t4.prototype,{total:{get:function(){return this._total}}});function e0(e){if(c(e)&&e.length!==wa.NUMBER_OF_JOB_TYPES)throw new C("A budget must be specified for each job type; budgets.length should equal JobType.NUMBER_OF_JOB_TYPES.");let t=new Array(wa.NUMBER_OF_JOB_TYPES);t[wa.TEXTURE]=new t4(c(e)?e[wa.TEXTURE]:10),t[wa.PROGRAM]=new t4(c(e)?e[wa.PROGRAM]:10),t[wa.BUFFER]=new t4(c(e)?e[wa.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}e0.getTimestamp=Ei;Object.defineProperties(e0.prototype,{totalBudget:{get:function(){return this._totalBudget}}});e0.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};e0.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};e0.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let l=n.length,u;for(u=0;u<l&&(r=n[u],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++u);if(u===l&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=e0.getTimestamp();e.execute();let a=e0.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var n4=e0;function i4(e){e=e??W.EMPTY_OBJECT;let t=Rn(e.container);if(!c(t))throw new C("container is required");this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=Ei(),this._lastMsSampleTime=Ei(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(i4.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});i4.prototype.update=function(e){let t=Ei(),n=e??!0;this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};i4.prototype.destroy=function(){return de(this)};var t0=i4;var ya={};ya.decodeRawMetadataValue=function(e,t,n){switch(e){case Nt.INT8:return t.getInt8(n);case Nt.UINT8:return t.getUint8(n);case Nt.INT16:return t.getInt16(n,!0);case Nt.UINT16:return t.getUint16(n,!0);case Nt.INT32:return t.getInt32(n,!0);case Nt.UINT32:return t.getUint32(n,!0);case Nt.INT64:return t.getBigInt64(n,!0);case Nt.UINT64:return t.getBigUint64(n,!0);case Nt.FLOAT32:return t.getFloat32(n,!0);case Nt.FLOAT64:return t.getFloat64(n,!0)}throw new ae(`Invalid component type: ${e}`)};ya.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=ya.decodeRawMetadataValue(i,t,n);return e.normalized?Nt.normalize(o,i):o};ya.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Nt.getSizeInBytes(i),r=e.type,s=at.getComponentCount(r),a=o*s;if(s>1){let f=Array(s);for(let h=0;h<s;h++){let p=n*a+h*o,g=ya.decodeRawMetadataValueComponent(e,t,p);f[h]=g}return f}let l=n*a;return ya.decodeRawMetadataValueComponent(e,t,l)};ya.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let o=e.arrayLength,r=Array(o);for(let s=0;s<o;s++){let a=ya.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return ya.decodeRawMetadataValueElement(e,n,0)};ya.convertToObjectType=function(e,t){if(!c(t)||e===at.SCALAR||e===at.STRING||e===at.BOOLEAN||e===at.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case at.VEC2:return z.unpack(n,0,new z);case at.VEC3:return d.unpack(n,0,new d);case at.VEC4:return se.unpack(n,0,new se);case at.MAT2:return Ri.unpack(n,0,new Ri);case at.MAT3:return J.unpack(n,0,new J);case at.MAT4:return F.unpack(n,0,new F)}throw new ae(`Invalid metadata object type: ${e}`)};ya.convertFromObjectType=function(e,t){if(!c(t)||e===at.SCALAR||e===at.STRING||e===at.BOOLEAN||e===at.ENUM)return t;switch(e){case at.VEC2:return z.pack(t,Array(2));case at.VEC3:return d.pack(t,Array(3));case at.VEC4:return se.pack(t,Array(4));case at.MAT2:return Ri.pack(t,Array(4));case at.MAT3:return J.pack(t,Array(9));case at.MAT4:return F.pack(t,Array(16))}throw new ae(`Invalid metadata object type: ${e}`)};ya.decodeMetadataValues=function(e,t,n){let i=ya.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=ya.convertFromObjectType(e.type,t.offset),s=ya.convertFromObjectType(e.type,t.scale);i=vp.valueTransformInPlace(i,r,s,Nt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let l=i[a],u=ya.convertToObjectType(e.type,l);s[a]=u}return s}return ya.convertToObjectType(e.type,i)};var o4=Object.freeze(ya);function Ax(){this._framebuffer=new pi,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(Ax.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Ydt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function Xdt(e,t,n){c(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture;
in vec2 v_textureCoordinates;
void main()
{
vec4 globeDepthPacked = texture(czm_globeDepthTexture, v_textureCoordinates);
float globeDepth = czm_unpackDepth(globeDepthPacked);
float depth = texture(colorTexture, v_textureCoordinates).r;
out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0,
czm_packDepth(depth), globeDepthPacked);
}
`,{renderState:ze.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}Ax.prototype.update=function(e,t){Ydt(this,e,t),Xdt(this,e,t)};var Kdt=new se,$dt=new se(1,1/255,1/65025,1/16581375);Ax.prototype.getDepth=function(e,t,n){if(!c(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=se.unpack(i,0,Kdt);return se.divideByScalar(o,255,o),se.dot(o,$dt)};Ax.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};Ax.prototype.isDestroyed=function(){return!1};Ax.prototype.destroy=function(){return this._framebuffer.destroy(),c(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=c(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),de(this)};var r4=Ax;function Zdt(e,t){this.near=e??0,this.far=t??0;let n=De.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var s4=Zdt;var Cx=`uniform highp sampler2D u_depthTexture;
in vec2 v_textureCoordinates;
void main()
{
out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r);
}
`;function Gm(){this._picking=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._outputFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new pi,this._tempCopyDepthFramebuffer=new pi,this._updateDepthFramebuffer=new pi({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(Gm.prototype,{colorFramebufferManager:{get:function(){return this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}}});function A0e(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!Ke.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,Ke.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Ke.clone(o.viewport,e._scissorRectangle),a=!0),(!c(e._rs)||!Ke.equals(r,e._rs.viewport)||a)&&(e._rs=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND}),e._rsUpdate=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,frontOperation:{fail:ft.KEEP,zFail:ft.KEEP,zPass:ft.KEEP},backFunction:Vn.NEVER,reference:kt.CESIUM_3D_TILE_MASK,mask:kt.CESIUM_3D_TILE_MASK}})),c(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Cx,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,c(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(Iu,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,c(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Cx,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,c(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(Iu,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,c(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ti({color:new G(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}Gm.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,l=o?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,l),this._copyDepthFramebuffer.update(e,s,a),A0e(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};Gm.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};Gm.prototype.executeCopyDepth=function(e,t){c(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};Gm.prototype.executeUpdateDepth=function(e,t,n){let i=c(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){c(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!c(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!c(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,s,a),A0e(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};Gm.prototype.executeCopyColor=function(e,t){c(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};Gm.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;c(i)&&(G.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};Gm.prototype.isDestroyed=function(){return!1};Gm.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),c(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),c(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),c(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),c(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),de(this)};var a4=Gm;function Ex(){this._framebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new pi,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new Ke,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(Ex.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function Qdt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Jdt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function eht(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!Ke.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,Ke.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=Ke.clone(o.viewport,e._scissorRectangle),s=!0),(!c(e._renderState)||!Ke.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),c(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(Cx,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),c(e._clearCommand)||(e._clearCommand=new ti({color:new G(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}Ex.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;Jdt(this,n,o,r,e),eht(this,n,o,r,i),this._useHdr=e};Ex.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};Ex.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};Ex.prototype.isDestroyed=function(){return!1};Ex.prototype.destroy=function(){return Qdt(this),de(this)};var c4=Ex;function C_(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new pi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new pi({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new pi({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new pi({createColorAttachments:!1}),this._opaqueClearCommand=new ti({color:new G(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ti({color:new G(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ti({color:new G(0,0,0,0),owner:this}),this._alphaClearCommand=new ti({color:new G(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new Ke,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function C0e(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function NX(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function E0e(e){C0e(e),NX(e)}function tht(e,t,n,i){C0e(e),e._accumulationTexture=new Rt({context:t,width:n,height:i,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT}),e._revealageTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.FLOAT,width:n,height:i,flipY:!1})}function nht(e,t){NX(e);let n=ne.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(NX(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,l=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!l||!u)&&(E0e(e),e._translucentMultipassSupport=!1,i=!1)}return i}C_.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,l=!c(a)||a.width!==r||a.height!==s||i!==this._useHDR,u=this._numSamples!==o;if((l||u)&&(this._numSamples=o,tht(this,e,r,s)),(!c(this._translucentFBO.framebuffer)||l||u)&&!nht(this,e))return;this._useHDR=i;let f=this,h,p;c(this._compositeCommand)||(h=new He({sources:[hV]}),this._translucentMRTSupport&&h.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})),c(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(h=new He({defines:["MRT"],sources:[NP]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(h=new He({sources:[NP]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(h,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let g=!Ke.equals(this._viewport,t.viewport),m=g!==this._useScissorTest;this._useScissorTest=g,Ke.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=Ke.clone(t.viewport,this._scissorRectangle),m=!0),(!c(this._rs)||!Ke.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=ze.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),c(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),c(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var iht={enabled:!0,color:new G(0,0,0,0),equationRgb:Qa.ADD,equationAlpha:Qa.ADD,functionSourceRgb:vo.ONE,functionDestinationRgb:vo.ONE,functionSourceAlpha:vo.ZERO,functionDestinationAlpha:vo.ONE_MINUS_SOURCE_ALPHA},oht={enabled:!0,color:new G(0,0,0,0),equationRgb:Qa.ADD,equationAlpha:Qa.ADD,functionSourceRgb:vo.ONE,functionDestinationRgb:vo.ONE,functionSourceAlpha:vo.ONE,functionDestinationAlpha:vo.ONE},rht={enabled:!0,color:new G(0,0,0,0),equationRgb:Qa.ADD,equationAlpha:Qa.ADD,functionSourceRgb:vo.ZERO,functionDestinationRgb:vo.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:vo.ZERO,functionDestinationAlpha:vo.ONE_MINUS_SOURCE_ALPHA};function FX(e,t,n,i){let o=n[i.id];if(!c(o)){let r=ze.getState(i);r.depthMask=!1,r.blending=t,o=ze.fromCache(r),n[i.id]=o}return o}function sht(e,t,n){return FX(t,iht,e._translucentRenderStateCache,n)}function aht(e,t,n){return FX(t,oht,e._translucentRenderStateCache,n)}function cht(e,t,n){return FX(t,rht,e._alphaRenderStateCache,n)}var lht=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;
float ai = czm_out_FragColor.a;
float wzi = czm_alphaWeight(ai);
out_FragData_0 = vec4(Ci * wzi, ai);
out_FragData_1 = vec4(ai * wzi);
`,uht=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a;
float ai = czm_out_FragColor.a;
float wzi = czm_alphaWeight(ai);
out_FragColor = vec4(Ci, ai) * wzi;
`,fht=` float ai = czm_out_FragColor.a;
out_FragColor = vec4(ai);
`;function BX(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(c(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return He.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`vec4 czm_out_FragColor;
bool czm_discard = false;
`);let l=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<l.length;f++){let h=l[f];u=`layout (location = ${h[1]}) out vec4 ${h[0]};
${u}`}return a.sources.push(u),a.sources.push(`void main()
{
czm_translucent_main();
if (czm_discard)
{
discard;
}
${i}}
`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function dht(e,t){return BX(e,t,"translucentMRT",lht)}function hht(e,t){return BX(e,t,"translucentMultipass",uht)}function mht(e,t){return BX(e,t,"alphaMultipass",fht)}C_.prototype.createDerivedCommands=function(e,t,n){if(c(n)||(n={}),this._translucentMRTSupport){let a,l;return c(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,l=n.translucentCommand.renderState),n.translucentCommand=Je.shallowClone(e,n.translucentCommand),!c(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=dht(t,e.shaderProgram),n.translucentCommand.renderState=sht(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=l),n}let i,o,r,s;return c(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=Je.shallowClone(e,n.translucentCommand),n.alphaCommand=Je.shallowClone(e,n.alphaCommand),!c(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=hht(t,e.shaderProgram),n.translucentCommand.renderState=aht(this,t,e.renderState),n.alphaCommand.shaderProgram=mht(t,e.shaderProgram),n.alphaCommand.renderState=cht(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function pht(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:l,shadowState:u}=a,f=t._hdr,h=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=l?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let b=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(b,t,i,g)}if(c(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=l?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let b=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(b,t,i,g)}if(c(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(y,t,i,g)}i.framebuffer=h}function _ht(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:l,shadowState:u}=a,f=t._hdr,h=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<o.length;++m){let y=o[m];y=l?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let b=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(b,t,i,g)}if(c(r)){let m=r.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=h}C_.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){_ht(this,e,t,n,i,o);return}pht(this,e,t,n,i,o)};C_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};C_.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,G.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};C_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};C_.prototype.isDestroyed=function(){return!1};C_.prototype.destroy=function(){return E0e(this),c(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),c(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),c(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),de(this)};var l4=C_;function dI(){this._framebuffer=new pi({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(dI.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function ght(e){e._framebuffer.destroy()}function yht(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new Cc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new Ke},o.viewport=new Ke,e._passState=o}dI.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&yht(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};dI.prototype.isDestroyed=function(){return!1};dI.prototype.destroy=function(){return ght(this),de(this)};var u4=dI;function XE(e){let t=new Cc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new Ke},t.viewport=new Ke,this._context=e,this._fb=new pi({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}XE.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return Ke.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};var hI=new G;XE.prototype.end=function(e){let t=e.width??1,n=e.height??1,i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.max(t,n),s=r*r,a=Math.floor(t*.5),l=Math.floor(n*.5),u=0,f=0,h=0,p=-1;for(let g=0;g<s;++g){if(-a<=u&&u<=a&&-l<=f&&f<=l){let m=4*((l-f)*t+u+a);hI.red=G.byteToFloat(o[m]),hI.green=G.byteToFloat(o[m+1]),hI.blue=G.byteToFloat(o[m+2]),hI.alpha=G.byteToFloat(o[m+3]);let y=i.getObjectByPickColor(hI);if(c(y))return y}if(u===f||u<0&&-u===f||u>0&&u===1-f){let m=h;h=-p,p=m}u+=h,f+=p}};XE.prototype.readCenterPixel=function(e){let t=e.width??1,n=e.height??1,o=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+r);return o.slice(a,a+4)};XE.prototype.isDestroyed=function(){return!1};XE.prototype.destroy=function(){return this._fb.destroy(),de(this)};var f4=XE;function E_(){this._numSamples=1,this._colorFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new pi({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new G(0,0,0,0),this._clearCommand=new ti({color:new G(0,0,0,0),depth:1,owner:this})}function bht(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(E_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});E_.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};E_.prototype.clear=function(e,t,n){G.clone(n,this._clearCommand.color),G.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};E_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};E_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};E_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};E_.prototype.isDestroyed=function(){return!1};E_.prototype.destroy=function(){return bht(this),de(this)};var KE=E_;function Sx(){}Sx.getShadowCastShaderKeyword=function(e,t,n,i){return`castShadow ${e} ${t} ${n} ${i}`};Sx.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=He.findPositionVarying(e),s=c(r);if(t&&!s){let a=o.length;for(let u=0;u<a;++u)o[u]=He.replaceMain(o[u],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC;
void main()
{
czm_shadow_cast_main();
v_positionEC = (czm_inverseProjection * gl_Position).xyz;
}`)}return new He({defines:i,sources:o})};Sx.createShadowCastFragmentShader=function(e,t,n,i){let o=e.defines.slice(0),r=e.sources.slice(0);o.push("SHADOW_MAP");let s=He.findPositionVarying(e),a=c(s);a||(s="v_positionEC");let l=r.length;for(let f=0;f<l;++f)r[f]=He.replaceMain(r[f],"czm_shadow_cast_main");let u="";return t&&(a||(u+=`in vec3 v_positionEC;
`),u+=`uniform vec4 shadowMap_lightPositionEC;
`),i?u+=`void main()
{
`:u+=`void main()
{
czm_shadow_cast_main();
if (out_FragColor.a == 0.0)
{
discard;
}
`,t?u+=` float distance = length(${s});
if (distance >= shadowMap_lightPositionEC.w)
{
discard;
}
distance /= shadowMap_lightPositionEC.w; // radius
out_FragColor = czm_packDepth(distance);
`:n?u+=` out_FragColor = vec4(1.0);
`:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z);
`,u+=`}
`,r.push(u),new He({defines:o,sources:r})};Sx.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,l=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${l}${u}${f}${t}${n}${i}`};Sx.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new He({defines:i,sources:o})};Sx.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=He.findNormalVarying(e),s=!i&&c(r)||i&&o,a=He.findPositionVarying(e),l=c(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,h=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,m=t.debugCascadeColors,y=t.softShadows,b=h?t._pointBias:i?t._terrainBias:t._primitiveBias,x=e.defines.slice(0),A=e.sources.slice(0),E=A.length;for(let P=0;P<E;++P)A[P]=He.replaceMain(A[P],"czm_shadow_receive_main");h?x.push("USE_CUBE_MAP_SHADOW"):u&&x.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!h&&x.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?x.push("ENABLE_VERTEX_LIGHTING"):x.push("ENABLE_DAYNIGHT_SHADING")),n&&b.normalShading&&s&&(x.push("USE_NORMAL_SHADING"),b.normalShadingSmooth>0&&x.push("USE_NORMAL_SHADING_SMOOTH"));let S="";h?S+=`uniform samplerCube shadowMap_textureCube;
`:S+=`uniform sampler2D shadowMap_texture;
`;let v;return l?v=` return vec4(${a}, 1.0);
`:v=`#ifndef LOG_DEPTH
return czm_windowToEyeCoordinates(gl_FragCoord);
#else
return vec4(v_logPositionEC, 1.0);
#endif
`,S+=`uniform mat4 shadowMap_matrix;
uniform vec3 shadowMap_lightDirectionEC;
uniform vec4 shadowMap_lightPositionEC;
uniform vec4 shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness;
uniform vec4 shadowMap_texelSizeDepthBiasAndNormalShadingSmooth;
#ifdef LOG_DEPTH
in vec3 v_logPositionEC;
#endif
vec4 getPositionEC()
{
${v}}
vec3 getNormalEC()
{
${s?` return normalize(${r});
`:` return vec3(1.0);
`}}
void applyNormalOffset(inout vec4 positionEC, vec3 normalEC, float nDotL)
{
${b.normalOffset&&s?` float normalOffset = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.x;
float normalOffsetScale = 1.0 - nDotL;
vec3 offset = normalOffset * normalOffsetScale * normalEC;
positionEC.xyz += offset;
`:""}}
`,S+=`void main()
{
czm_shadow_receive_main();
vec4 positionEC = getPositionEC();
vec3 normalEC = getNormalEC();
float depth = -positionEC.z;
`,S+=` czm_shadowParameters shadowParameters;
shadowParameters.texelStepSize = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.xy;
shadowParameters.depthBias = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.z;
shadowParameters.normalShadingSmooth = shadowMap_texelSizeDepthBiasAndNormalShadingSmooth.w;
shadowParameters.darkness = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.w;
`,i?S+=` shadowParameters.depthBias *= max(depth * 0.01, 1.0);
`:f||(S+=` shadowParameters.depthBias *= mix(1.0, 100.0, depth * 0.0015);
`),h?S+=` vec3 directionEC = positionEC.xyz - shadowMap_lightPositionEC.xyz;
float distance = length(directionEC);
directionEC = normalize(directionEC);
float radius = shadowMap_lightPositionEC.w;
// Stop early if the fragment is beyond the point light radius
if (distance > radius)
{
return;
}
vec3 directionWC = czm_inverseViewRotation * directionEC;
shadowParameters.depth = distance / radius;
shadowParameters.nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);
shadowParameters.texCoords = directionWC;
float visibility = czm_shadowVisibility(shadowMap_textureCube, shadowParameters);
`:p?S+=` vec3 directionEC = normalize(positionEC.xyz - shadowMap_lightPositionEC.xyz);
float nDotL = clamp(dot(normalEC, -directionEC), 0.0, 1.0);
applyNormalOffset(positionEC, normalEC, nDotL);
vec4 shadowPosition = shadowMap_matrix * positionEC;
// Spot light uses a perspective projection, so perform the perspective divide
shadowPosition /= shadowPosition.w;
// Stop early if the fragment is not in the shadow bounds
if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0))))
{
return;
}
shadowParameters.texCoords = shadowPosition.xy;
shadowParameters.depth = shadowPosition.z;
shadowParameters.nDotL = nDotL;
float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
`:g?S+=` float maxDepth = shadowMap_cascadeSplits[1].w;
// Stop early if the eye depth exceeds the last cascade
if (depth > maxDepth)
{
return;
}
// Get the cascade based on the eye-space depth
vec4 weights = czm_cascadeWeights(depth);
// Apply normal offset
float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0);
applyNormalOffset(positionEC, normalEC, nDotL);
// Transform position into the cascade
vec4 shadowPosition = czm_cascadeMatrix(weights) * positionEC;
// Get visibility
shadowParameters.texCoords = shadowPosition.xy;
shadowParameters.depth = shadowPosition.z;
shadowParameters.nDotL = nDotL;
float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
// Fade out shadows that are far away
float shadowMapMaximumDistance = shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness.z;
float fade = max((depth - shadowMapMaximumDistance * 0.8) / (shadowMapMaximumDistance * 0.2), 0.0);
visibility = mix(visibility, 1.0, fade);
${m?` // Draw cascade colors for debugging
out_FragColor *= czm_cascadeColor(weights);
`:""}`:S+=` float nDotL = clamp(dot(normalEC, shadowMap_lightDirectionEC), 0.0, 1.0);
applyNormalOffset(positionEC, normalEC, nDotL);
vec4 shadowPosition = shadowMap_matrix * positionEC;
// Stop early if the fragment is not in the shadow bounds
if (any(lessThan(shadowPosition.xyz, vec3(0.0))) || any(greaterThan(shadowPosition.xyz, vec3(1.0))))
{
return;
}
shadowParameters.texCoords = shadowPosition.xy;
shadowParameters.depth = shadowPosition.z;
shadowParameters.nDotL = nDotL;
float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters);
`,S+=` out_FragColor.rgb *= visibility;
}
`,A.push(S),new He({defines:x,sources:A})};var S_=Sx;function jm(e){e=e??W.EMPTY_OBJECT;let t=e.context;if(!c(t))throw new C("context is required.");if(!c(e.lightCamera))throw new C("lightCamera is required.");if(c(e.numberOfCascades)&&e.numberOfCascades!==1&&e.numberOfCascades!==4)throw new C("Only one or four cascades are supported.");this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(zt.isInternetExplorer()||zt.isEdge()||(zt.isChrome()||zt.isFirefox())&&zt.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new F,this._shadowMapTexture=void 0,this._lightDirectionEC=new d,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new d4,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new le,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new z,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new jo:c(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new F,new F,new F,new F],this._cascadeDistances=new se;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new xht(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,UX(this),this._clearCommand=new ti({depth:1,color:new G}),this._clearPassState=new Cc(t),this._size=e.size??2048,this.size=this._size}jm.MAXIMUM_DISTANCE=2e4;function xht(e){this.camera=new d4,this.passState=new Cc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function kX(e,t){return ze.fromCache({cull:{enabled:!0,face:Ti.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function UX(e){let t=!e._usesDepthTexture;e._primitiveRenderState=kX(t,e._primitiveBias),e._terrainRenderState=kX(t,e._terrainBias),e._pointRenderState=kX(t,e._pointBias)}jm.prototype.debugCreateRenderStates=function(){UX(this)};Object.defineProperties(jm.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){wht(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function VX(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;c(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function Tht(e,t){let n=new tf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Ec.DEPTH_COMPONENT16}),i=new Rt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Qt.NEAREST}),o=new Wr({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function Aht(e,t){let n=new Rt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Qt.NEAREST}),i=new Wr({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function Cht(e,t){let n=new tf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Ec.DEPTH_COMPONENT16}),i=new Go({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Qt.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new Wr({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function v0e(e,t){e._isPointLight?Cht(e,t):e._usesDepthTexture?Aht(e,t):Tht(e,t)}function Eht(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ne.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,UX(e),VX(e),v0e(e,t))}function Sht(e,t){(!c(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(VX(e),v0e(e,t),Eht(e,t),D0e(e,t))}function D0e(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function wht(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=ut.maximumCubeMapSize>=t?t:ut.maximumCubeMapSize,o.x=t,o.y=t;let r=new Ke(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=ut.maximumTextureSize>=t?t:ut.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new Ke(0,0,t,t)):i===4&&(t=ut.maximumTextureSize>=t*2?t:ut.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new Ke(0,0,t,t),n[1].passState.viewport=new Ke(t,0,t,t),n[2].passState.viewport=new Ke(0,t,t,t),n[3].passState.viewport=new Ke(t,t,t,t));e._clearPassState.viewport=new Ke(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,l=a.x/o.x,u=a.y/o.y,f=a.width/o.x,h=a.height/o.y;s.textureOffsets=new F(f,0,0,l,0,h,0,u,0,0,1,0,0,0,0,1)}}var vht=new Ke;function Dht(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube;
in vec2 v_textureCoordinates;
void main()
{
vec2 uv = v_textureCoordinates;
vec3 dir;
if (uv.y < 0.5)
{
if (uv.x < 0.333)
{
dir.x = -1.0;
dir.y = uv.x * 6.0 - 1.0;
dir.z = uv.y * 4.0 - 1.0;
}
else if (uv.x < 0.666)
{
dir.y = -1.0;
dir.x = uv.x * 6.0 - 3.0;
dir.z = uv.y * 4.0 - 1.0;
}
else
{
dir.z = -1.0;
dir.x = uv.x * 6.0 - 5.0;
dir.y = uv.y * 4.0 - 1.0;
}
}
else
{
if (uv.x < 0.333)
{
dir.x = 1.0;
dir.y = uv.x * 6.0 - 1.0;
dir.z = uv.y * 4.0 - 3.0;
}
else if (uv.x < 0.666)
{
dir.y = 1.0;
dir.x = uv.x * 6.0 - 3.0;
dir.z = uv.y * 4.0 - 3.0;
}
else
{
dir.z = 1.0;
dir.x = uv.x * 6.0 - 5.0;
dir.y = uv.y * 4.0 - 3.0;
}
}
float shadow = czm_unpackDepth(czm_textureCube(shadowMap_textureCube, dir));
out_FragColor = vec4(vec3(shadow), 1.0);
}
`:n=`uniform sampler2D shadowMap_texture;
in vec2 v_textureCoordinates;
void main()
{
${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCoordinates).r;
`:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates));
`} out_FragColor = vec4(vec3(shadow), 1.0);
}
`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=De.OVERLAY,i}function Pht(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=vht;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;c(a)||(a=Dht(e,n),e._debugShadowViewCommand=a),(!c(a.renderState)||!Ke.equals(a.renderState.viewport,s))&&(a.renderState=ze.fromCache({viewport:Ke.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var Wm=new Array(8);Wm[0]=new se(-1,-1,-1,1);Wm[1]=new se(1,-1,-1,1);Wm[2]=new se(1,1,-1,1);Wm[3]=new se(-1,1,-1,1);Wm[4]=new se(-1,-1,1,1);Wm[5]=new se(1,-1,1,1);Wm[6]=new se(1,1,1,1);Wm[7]=new se(-1,1,1,1);var n0=new F,zX=new Array(8);for(let e=0;e<8;++e)zX[e]=new se;function Iht(e,t){let n=new St({geometry:new Mh({minimum:new d(-.5,-.5,-.5),maximum:new d(.5,.5,.5)}),attributes:{color:jt.fromColor(t)}}),i=new St({geometry:new Jg({radius:.5}),attributes:{color:jt.fromColor(t)}});return new In({geometryInstances:[n,i],appearance:new rn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Oht=[G.RED,G.GREEN,G.BLUE,G.MAGENTA],Rht=new d;function Mht(e,t){Pht(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new T_({camera:e._sceneCamera,color:G.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new T_({camera:e._shadowMapCamera,color:G.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new T_({camera:e._passes[i].camera,color:Oht[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!c(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Le.IDENTITY,r=e._pointLightRadius*2,s=d.fromElements(r,r,r,Rht),a=F.fromTranslationQuaternionRotationScale(i,o,s,n0);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=Iht(a,G.YELLOW)}e._debugLightFrustum.update(t)}else(!c(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new T_({camera:e._shadowMapCamera,color:G.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function d4(){this.viewMatrix=new F,this.inverseViewMatrix=new F,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new d,this.directionWC=d.clone(d.UNIT_Z),this.upWC=d.clone(d.UNIT_Y),this.rightWC=d.clone(d.UNIT_X),this.viewProjectionMatrix=new F}d4.prototype.clone=function(e){F.clone(e.viewMatrix,this.viewMatrix),F.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),d.clone(e.positionWC,this.positionWC),d.clone(e.directionWC,this.directionWC),d.clone(e.upWC,this.upWC),d.clone(e.rightWC,this.rightWC)};var Lht=new F(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);d4.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return F.multiply(t,e,this.viewProjectionMatrix),F.multiply(Lht,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Nht=new Array(5),Fht=new wi,Bht=new Array(4),P0e=new d,I0e=new d;function kht(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,l=r-o,u=r/o,f=.9,h=!1;t.shadowState.closestObjectSize<200&&(h=!0,f=.9);let p=Bht,g=Nht;for(g[0]=o,g[s]=r,a=0;a<s;++a){let B=(a+1)/s,_=o*Math.pow(u,B),w=o+l*B,D=O.lerp(w,_,f);g[a+1]=D,p[a]=D-g[a]}if(h){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let B=g[0];for(a=0;a<s-1;++a)B+=p[a],g[a+1]=B}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let m=n.frustum,y=m.left,b=m.right,x=m.bottom,A=m.top,E=m.near,S=m.far,v=n.positionWC,P=n.directionWC,M=n.upWC,R=i.frustum.clone(Fht),L=n.getViewProjection();for(a=0;a<s;++a){R.near=g[a],R.far=g[a+1];let B=F.multiply(R.projectionMatrix,i.viewMatrix,n0),_=F.inverse(B,n0),w=F.multiply(L,_,n0),D=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,P0e),I=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,I0e);for(let j=0;j<8;++j){let U=se.clone(Wm[j],zX[j]);F.multiplyByVector(w,U,U),d.divideByScalar(U,U.w,U),d.minimumByComponent(U,D,D),d.maximumByComponent(U,I,I)}D.x=Math.max(D.x,0),D.y=Math.max(D.y,0),D.z=0,I.x=Math.min(I.x,1),I.y=Math.min(I.y,1),I.z=Math.min(I.z,1);let N=e._passes[a],k=N.camera;k.clone(n);let H=k.frustum;H.left=y+D.x*(b-y),H.right=y+I.x*(b-y),H.bottom=x+D.y*(A-x),H.top=x+I.y*(A-x),H.near=E+D.z*(S-E),H.far=E+I.z*(S-E),N.cullingVolume=k.frustum.computeCullingVolume(v,P,M);let V=e._cascadeMatrices[a];F.multiply(k.getViewProjection(),i.inverseViewMatrix,V),F.multiply(N.textureOffsets,V,V)}}var Uht=new F,Vht=new d,zht=new d,S0e=new d;function Hht(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=F.multiply(i.frustum.projectionMatrix,i.viewMatrix,n0),r=F.inverse(o,n0),s=n.directionWC,a=i.directionWC;d.equalsEpsilon(s,a,O.EPSILON10)&&(a=i.upWC);let l=d.cross(s,a,Vht);a=d.cross(l,s,zht),d.normalize(a,a),d.normalize(l,l);let u=d.fromElements(0,0,0,S0e),f=F.computeView(u,s,a,l,Uht),h=F.multiply(f,r,n0),p=d.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,P0e),g=d.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,I0e);for(let S=0;S<8;++S){let v=se.clone(Wm[S],zX[S]);F.multiplyByVector(h,v,v),d.divideByScalar(v,v.w,v),d.minimumByComponent(v,p,p),d.maximumByComponent(v,g,g)}g.z+=1e3,p.z-=10;let m=S0e;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=F.fromTranslation(m,n0);f=F.multiply(y,f,f);let b=.5*(g.x-p.x),x=.5*(g.y-p.y),A=g.z-p.z,E=n.frustum;E.left=-b,E.right=b,E.bottom=-x,E.top=x,E.near=.01,E.far=A,F.clone(f,n.viewMatrix),F.inverse(f,n.inverseViewMatrix),F.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),d.clone(s,n.directionWC),d.clone(a,n.upWC),d.clone(l,n.rightWC)}var Ght=[new d(-1,0,0),new d(0,-1,0),new d(0,0,-1),new d(1,0,0),new d(0,1,0),new d(0,0,1)],jht=[new d(0,-1,0),new d(0,0,-1),new d(0,-1,0),new d(0,-1,0),new d(0,0,1),new d(0,-1,0)],Wht=[new d(0,0,1),new d(1,0,0),new d(-1,0,0),new d(0,0,-1),new d(1,0,0),new d(1,0,0)];function qht(e,t){let n=new wi;n.fov=O.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=Ght[i],o.upWC=jht[i],o.rightWC=Wht[i],F.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),F.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var Yht=new d,Xht=new d,O0e=new le,w0e=O0e.center;function Kht(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=O0e;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Yht),s=d.negate(i.directionWC,Xht),a=d.dot(r,s);if(e.fadingEnabled){let l=O.clamp(a/.1,0,1);e._darkness=O.lerp(1,e.darkness,l)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===Wt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=d.add(i.positionWC,d.multiplyByScalar(i.directionWC,r,w0e),w0e);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===Wt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),le.clone(o,e._boundingSphere)}}function $ht(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?d.clone(i.directionWC,r.directionWC):e._isPointLight?d.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;F.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),d.normalize(s,s),d.negate(s,s),F.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,l;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),l=Math.min(t.shadowState.farPlane,e.maximumDistance),l=Math.max(l,a+1)):(a=n.frustum.near,l=e.maximumDistance),e._sceneCamera=ro.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=l,e._distance=l-a,Kht(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}jm.prototype.update=function(e){if($ht(this,e),this._needsUpdate)if(Sht(this,e.context),this._isPointLight&&qht(this,e),this._cascadesEnabled&&(Hht(this,e),this._numberOfCascades>1&&kht(this,e)),this._isPointLight)this._shadowMapCullingVolume=ys.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;F.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&Mht(this,e)};jm.prototype.updatePass=function(e,t){D0e(this,e,t)};var Zht=new z;function R0e(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let r=Zht;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,se.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return se.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new se,combinedUniforms2:new se};return xt(t,o,!1)}function Qht(e,t,n,i,o,r){let s,a,l;if(c(r)&&(s=r.shaderProgram,a=r.renderState,l=r.uniformMap),r=Je.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!c(s)||o!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===De.GLOBE,h=n.pass!==De.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,m=S_.getShadowCastShaderKeyword(p,f,g,h);if(s=i.shaderCache.getDerivedShaderProgram(u,m),!c(s)){let b=u.vertexShaderSource,x=u.fragmentShaderSource,A=S_.createShadowCastVertexShader(b,p,f),E=S_.createShadowCastFragmentShader(x,p,g,h);s=i.shaderCache.createDerivedShaderProgram(u,m,{vertexShaderSource:A,fragmentShaderSource:E,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=We(a,!1),a.cull=We(a.cull,!1),a.cull.enabled=!1,a=ze.fromCache(a)),l=R0e(e,n.uniformMap,f)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=l,r}jm.createReceiveDerivedCommand=function(e,t,n,i,o){c(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,l=s.fragmentShaderSource,u=t.pass===De.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let h,p;c(o.receiveCommand)&&(h=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=Je.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let g=o.receiveShaderCastShadows!==t.castShadows,m=o.receiveShaderProgramId!==t.shaderProgram.id;if(!c(h)||m||n||g){let y=S_.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(h=i.shaderCache.getDerivedShaderProgram(s,y),!c(h)){let b=S_.createShadowReceiveVertexShader(a,u,f),x=S_.createShadowReceiveFragmentShader(l,e[0],t.castShadows,u,f);h=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:s._attributeLocations})}p=R0e(e[0],t.uniformMap,u)}o.receiveCommand.shaderProgram=h,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};jm.createCastDerivedCommand=function(e,t,n,i,o){if(c(o)||(o={}),t.castShadows){let r=o.castCommands;c(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let l=0;l<a;++l)r[l]=Qht(e[l],n,t,i,s,r[l]);o.castShaderProgramId=t.shaderProgram.id}return o};jm.prototype.isDestroyed=function(){return!1};jm.prototype.destroy=function(){VX(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return de(this)};var i0=jm;var $E=`uniform sampler2D colorTexture;
#ifdef DEBUG_SHOW_DEPTH
uniform sampler2D u_packedTranslucentDepth;
#endif
in vec2 v_textureCoordinates;
void main()
{
#ifdef DEBUG_SHOW_DEPTH
if (v_textureCoordinates.x < 0.5)
{
out_FragColor.rgb = vec3(czm_unpackDepth(texture(u_packedTranslucentDepth, v_textureCoordinates)));
out_FragColor.a = 1.0;
}
#else
vec4 color = texture(colorTexture, v_textureCoordinates);
#ifdef PICK
if (color == vec4(0.0))
{
discard;
}
#else
color.rgb /= color.a;
#endif
out_FragColor = color;
#endif
}
`;var Jht=!1;function o0(e){this._drawClassificationFBO=new pi({createDepthAttachments:!1}),this._accumulationFBO=new pi({createDepthAttachments:!1}),this._packFBO=new pi,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ti({color:new G(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ti({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new Ke,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(o0.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function M0e(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function L0e(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function emt(e,t,n,i){M0e(e),e._translucentDepthStencilTexture=new Rt({context:t,width:n,height:i,pixelFormat:ke.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Qt.NEAREST})}function tmt(e,t,n,i){L0e(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function nmt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&(emt(e,t,o,r),tmt(e,t,o,r));let s,a;if(c(e._packDepthCommand)||(s=new He({sources:[dV]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!c(e._compositeCommand)){s=new He({sources:[$E]}),a={colorTexture:function(){return e._textureToComposite}},Jht&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,h=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(h,"pick",{vertexShaderSource:h.vertexShaderSource,fragmentShaderSource:new He({sources:s.sources,defines:["PICK"]}),attributeLocations:h._attributeLocations}),g=Je.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}c(e._copyCommand)||(s=new He({sources:[$E]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),c(e._accumulateCommand)||(s=new He({sources:[$E]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let l=!Ke.equals(e._viewport,n.viewport),u=l!==e._useScissorTest;e._useScissorTest=l,Ke.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=Ke.clone(n.viewport,e._scissorRectangle),u=!0),(!c(e._rsDepth)||!Ke.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),c(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!c(e._rsAccumulate)||!Ke.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:Vn.EQUAL,reference:kt.CESIUM_3D_TILE_MASK}})),c(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!c(e._rsComp)||!Ke.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:un.ALPHA_BLEND})),c(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}o0.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let l=0;l<i.length;++l){let u=i[l];if(u=r?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){nmt(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let l=0;l<i.length;++l){let u=i[l];if(u=r?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};o0.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(De.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let l=i.commands[De.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[De.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(l[f],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};o0.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),imt(this,e,t)};function imt(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}o0.prototype.isSupported=function(){return this._supported};o0.prototype.isDestroyed=function(){return!1};o0.prototype.destroy=function(){return M0e(this),L0e(this),c(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),c(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),de(this)};var h4=o0;function omt(){this.command=void 0,this.near=void 0,this.far=void 0}function m4(e,t,n){let i=e.context,o;i.depthTexture&&(o=new a4);let r;e._useOIT&&i.depthTexture&&(r=new l4(i));let s=new Cc(i);s.viewport=Ke.clone(n),this.camera=t,this._cameraClone=ro.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new f4(i),this.pickDepthFramebuffer=new u4,this.sceneFramebuffer=new KE,this.globeDepth=o,this.globeTranslucencyFramebuffer=new c4,this.oit=r,this.translucentTileClassification=new h4(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var HX=new d,GX=new d;function rmt(e,t,n){let i=Math.max(d.maximumComponent(d.abs(e.position,HX)),d.maximumComponent(d.abs(t.position,GX))),o=1/Math.max(1,i);return d.multiplyByScalar(e.position,o,HX),d.multiplyByScalar(t.position,o,GX),d.equalsEpsilon(HX,GX,n)&&d.equalsEpsilon(e.direction,t.direction,n)&&d.equalsEpsilon(e.up,t.up,n)&&d.equalsEpsilon(e.right,t.right,n)&&F.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}m4.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return rmt(t,n,O.EPSILON15)?(this._cameraStartFired&&Ei()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Ei(),ro.clone(t,n),!0)};function smt(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,l=t.mode===oe.SCENE2D,u=t.nearToFarDistance2D;i*=1+O.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let f;l?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:h}=e;h.length=f;for(let p=0;p<f;++p){let g,m;l?(g=Math.min(i-u,n+p*u),m=Math.min(i,g+u)):(g=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*g));let y=h[p];c(y)?(y.near=g,y.far=m):y=h[p]=new s4(g,m)}}function amt(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let l=s[a];if(o>l.far)continue;if(r<l.near)break;let u=i.pass,f=l.indices[u]++;if(l.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:l}=i,u=a.commandsInFrustums;u[l]=c(u[l])?u[l]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var N0e=new ys,cmt=new $a;m4.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,l=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let L=0;L<f.length;++L)for(let B=0;B<De.NUMBER_OF_PASSES;++B)f[L].indices[B]=0;l.length=0,u.length=0;let h=this._commandExtents,p=h.length,g=0,m=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:b}=o,x=+Number.MAX_VALUE,A=-Number.MAX_VALUE,E=Number.MAX_VALUE,S=t.mode===oe.SCENE3D?t.occluder:void 0,{cullingVolume:v}=t,P=N0e.planes;for(let L=0;L<5;++L)P[L]=v.planes[L];v=N0e;for(let L=0;L<i.length;++L){let B=i[L],{pass:_,boundingVolume:w}=B;if(_===De.COMPUTE)l.push(B);else if(_===De.OVERLAY)u.push(B);else{let D,I;if(c(w)){if(!e.isVisible(v,B,S))continue;let k=w.computePlaneDistances(r,s,cmt);if(D=k.start,I=k.stop,m=Math.min(m,D),y=Math.max(y,I),b&&B.receiveShadows&&D<i0.MAXIMUM_DISTANCE&&!(_===De.GLOBE&&D<-100&&I>100)){let H=I-D;_!==De.GLOBE&&D<100&&(E=Math.min(E,H)),x=Math.min(x,D),A=Math.max(A,I)}}else B instanceof ti?(D=a.near,I=a.far):(D=a.near,I=a.far,m=Math.min(m,D),y=Math.max(y,I));let N=h[g];c(N)||(N=h[g]=new omt),N.command=B,N.near=D,N.far=I,g++}}b&&(x=Math.min(Math.max(x,a.near),a.far),A=Math.max(Math.min(A,a.far),x),o.nearPlane=x,o.farPlane=A,o.closestObjectSize=E),smt(this,e,m,y);for(let L=0;L<g;L++)amt(this,e,h[L]);if(g<p)for(let L=g;L<p;L++){let B=h[L];if(!c(B.command))break;B.command=void 0}let M=f.length,{frustumSplits:R}=t;R.length=M+1;for(let L=0;L<M;++L)R[L]=f[L].near,L===M-1&&(R[L+1]=f[L].far)};m4.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var ZE=m4;var B0e=.1,lmt=new lh({pass:Uo.MOST_DETAILED_PRELOAD}),umt=new lh({pass:Uo.MOST_DETAILED_PICK}),mI=new lh({pass:Uo.PICK});function Ys(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new Ke(0,0,1,1),n=new ro(e);n.frustum=new on({width:B0e,aspectRatio:1,near:.1}),this._pickOffscreenView=new ZE(e,n,t)}Ys.prototype.update=function(){this._pickPositionCacheDirty=!0};Ys.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return c(i)||(i=new r4,n[t]=i),i};var fmt=new jo,dmt=new d,p4=new d,hmt=new z,mmt=new F;function pmt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;c(a)&&(s=a);let l=2*(t.x-o.x)/o.width-1;l*=(s.right-s.left)*.5;let u=2*(o.height-t.y-o.y)/o.height-1;u*=(s.top-s.bottom)*.5;let f=F.clone(r.transform,mmt);r._setTransform(F.IDENTITY);let h=d.clone(r.position,dmt);d.multiplyByScalar(r.right,l,p4),d.add(p4,h,h),d.multiplyByScalar(r.up,u,p4),d.add(p4,h,h),r._setTransform(f),e.mode===oe.SCENE2D&&d.fromElements(h.z,h.x,h.y,h);let p=s.getPixelDimensions(o.width,o.height,1,1,hmt),g=fmt;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(h,r.directionWC,r.upWC)}var _mt=new zl,gmt=new z;function ymt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,l=Math.tan(s.fovy*.5),u=s.aspectRatio*l,f=2*(t.x-o.x)/o.width-1,h=2*(o.height-t.y-o.y)/o.height-1,p=f*a*u,g=h*a*l,m=s.getPixelDimensions(o.width,o.height,1,1,gmt),y=m.x*n*.5,b=m.y*i*.5,x=_mt;return x.top=g+b,x.bottom=g-b,x.right=p+y,x.left=p-y,x.near=a,x.far=s.far,x.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function _4(e,t,n,i,o){let r=e.camera.frustum;return r instanceof on||r instanceof jo?pmt(e,t,n,i,o):ymt(e,t,n,i,o)}var g4=new Ke(0,0,3,3),y4=new z,pI=new G(0,0,0,0);function jX(e,t,n,i,o){return o.width=n??3,o.height=i??o.width,o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}Ys.prototype.pick=function(e,t,n,i){T.defined("windowPosition",t);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:l}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=Ke.clone(a,u.viewport);let f=Hi.transformWindowToDrawingBuffer(e,t,y4),h=jX(o.drawingBufferHeight,f,n,i,g4);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=_4(e,f,h.width,h.height,a),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=mI,o.uniformState.update(r),e.updateEnvironment(),u=l.begin(h,a),e.updateAndExecuteCommands(u,pI),e.resolveFramebuffers(u);let p=l.end(h);return o.endFrame(),p};Ys.prototype.pickVoxelCoordinate=function(e,t,n,i){T.defined("windowPosition",t);let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:l}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let u=s.passState;u.viewport=Ke.clone(a,u.viewport);let f=Hi.transformWindowToDrawingBuffer(e,t,y4),h=jX(o.drawingBufferHeight,f,n,i,g4);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=_4(e,f,h.width,h.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=mI,o.uniformState.update(r),e.updateEnvironment(),u=l.begin(h,a),e.updateAndExecuteCommands(u,pI),e.resolveFramebuffers(u);let p=l.readCenterPixel(h);return o.endFrame(),p};Ys.prototype.pickMetadata=function(e,t,n){T.typeOf.object("windowPosition",t),T.typeOf.object("pickedMetadataInfo",n);let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let l=r.passState;l.viewport=Ke.clone(s,l.viewport);let u=Hi.transformWindowToDrawingBuffer(e,t,y4),f=jX(i.drawingBufferHeight,u,1,1,g4);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=_4(e,u,f.width,f.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=mI,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),l=a.begin(f,s),e.updateAndExecuteCommands(l,pI);let h=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(l),e._environmentState.useOIT=h;let p=a.readCenterPixel(f);return i.endFrame(),o.pickingMetadata=!1,o4.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function bmt(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let l=n.passState;l.viewport=Ke.clone(s,l.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=_4(e,t,1,1,s),o.tilesetPassState=mI,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,l=a.update(i,t,s),e.updateAndExecuteCommands(l,pI),e.resolveFramebuffers(l),i.endFrame()}var xmt=new wi,Tmt=new zl,Amt=new on,Cmt=new jo;Ys.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;if(T.defined("windowPosition",t),!e.context.depthTexture)throw new C("Picking from the depth buffer is not supported. Check pickPositionSupported.");let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return d.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:l}=o;e.view=a;let u=Hi.transformWindowToDrawingBuffer(e,t,y4);e.pickTranslucentDepth?bmt(e,u):(e.updateFrameState(),l.update(r),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;c(s.frustum.fov)?f=s.frustum.clone(xmt):c(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(Tmt):c(s.frustum.width)?f=s.frustum.clone(Amt):f=s.frustum.clone(Cmt);let{frustumCommandsList:h}=a,p=h.length;for(let g=0;g<p;++g){let y=this.getPickDepth(e,g).getDepth(o,u.x,u.y);if(c(y)&&y>0&&y<1){let b=h[g],x;return e.mode===oe.SCENE2D?(x=s.position.z,s.position.z=x-b.near+1,f.far=Math.max(1,b.far-b.near),f.near=1,l.update(r),l.updateFrustum(f)):(f.near=b.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=b.far,l.updateFrustum(f)),n=Hi.drawingBufferToWorldCoordinates(e,u,y,n),e.mode===oe.SCENE2D&&(s.position.z=x,l.update(r)),this._pickPositionCache[i]=d.clone(n),n}}this._pickPositionCache[i]=void 0};var Emt=new he;Ys.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),c(n)&&e.mode!==oe.SCENE3D){d.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,Emt);o.cartographicToCartesian(r,n)}return n};function k0e(e,t){let n,i,o=[],r=[],s=[],a=[];c(e)||(e=Number.MAX_VALUE);let l=t();for(;c(l);){let u=l.object,f=l.position,h=l.exclude;if(c(f)&&!c(u)){o.push(l);break}if(!c(u)||!c(u.primitive)||!h&&(o.push(l),0>=--e))break;let p=u.primitive,g=!1;typeof p.getGeometryInstanceAttributes=="function"&&c(u.id)&&(i=p.getGeometryInstanceAttributes(u.id),c(i)&&c(i.show)&&(g=!0,i.show=xn.toValue(!1,i.show),s.push(i))),u instanceof ta&&(g=!0,u.show=!1,a.push(u)),g||(p.show=!1,r.push(p)),l=t()}for(n=0;n<r.length;++n)r[n].show=!0;for(n=0;n<s.length;++n)i=s[n],i.show=xn.toValue(!0,i.show);for(n=0;n<a.length;++n)a[n].show=!0;return o}Ys.prototype.drillPick=function(e,t,n,i,o){let r=this;return k0e(n,function(){let l=r.pick(e,t,i,o);if(c(l))return{object:l,position:void 0,exclude:!1}}).map(function(l){return l.object})};var F0e=new d,Smt=new d;function wmt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function U0e(e,t,n,i){let o=t.direction,r=d.mostOrthogonalAxis(o,F0e),s=d.cross(o,r,F0e),a=d.cross(o,s,Smt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??B0e,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function vmt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,l=U0e(e,o,r,a),u=lmt;u.camera=a,u.cullingVolume=l;let f=!0,h=s.length;for(let p=0;p<h;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}Ys.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)vmt(this,e,t[n])&&t.splice(n--,1)};function V0e(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(c(o.isCesium3DTileset)?(!c(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof Ol&&V0e(o,t,n))}}function b4(e,t,n,i,o,r){let s=[];if(V0e(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new wmt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function Dmt(e,t){return!c(e)||!c(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function Pmt(e,t,n,i,o,r,s){let{context:a,frameState:l}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,U0e(e,n,o,f.camera);let h=Ke.clone(f.viewport,g4),p=f.pickFramebuffer.begin(h,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),l.invertClassification=!1,l.passes.pick=!0,l.passes.offscreen=!0,s?l.tilesetPassState=umt:l.tilesetPassState=mI,u.update(l),t.updateEnvironment(),t.updateAndExecuteCommands(p,pI),t.resolveFramebuffers(p);let g,m=f.pickFramebuffer.end(h);if(t.context.depthTexture){let{frustumCommandsList:y}=f,b=y.length;for(let x=0;x<b;++x){let E=e.getPickDepth(t,x).getDepth(a,0,0);if(c(E)&&E>0&&E<1){let S=y[x],v=S.near*(x!==0?t.opaqueFrustumNearOffset:1),P=S.far,M=v+E*(P-v);g=_n.getPoint(n,M);break}}}if(t.view=t.defaultView,a.endFrame(),c(m)||c(g))return{object:m,position:g,exclude:!c(g)&&r||Dmt(m,i)}}function z0e(e,t,n,i,o,r,s,a){return k0e(i,function(){return Pmt(e,t,n,o,r,s,a)})}function QE(e,t,n,i,o,r,s){let a=z0e(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function H0e(e,t,n,i,o,r,s,a){return z0e(e,t,n,i,o,r,s,a)}function x4(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}Ys.prototype.pickFromRay=function(e,t,n,i){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new C("Ray intersections are only supported in 3D mode.");return QE(this,e,t,n,i,!1,!1)};Ys.prototype.drillPickFromRay=function(e,t,n,i,o){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new C("Ray intersections are only supported in 3D mode.");return H0e(this,e,t,n,i,o,!1,!1)};Ys.prototype.pickFromRayMostDetailed=function(e,t,n,i){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new C("Ray intersections are only supported in 3D mode.");let o=this;return t=_n.clone(t),n=c(n)?n.slice():n,x4(e,b4(o,e,t,n,i,function(){return QE(o,e,t,n,i,!1,!0)}))};Ys.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){if(T.defined("ray",t),e.mode!==oe.SCENE3D)throw new C("Ray intersections are only supported in 3D mode.");let r=this;return t=_n.clone(t),i=c(i)?i.slice():i,x4(e,b4(r,e,t,i,o,function(){return H0e(r,e,t,n,i,o,!1,!0)}))};var Imt=new d,Omt=new d,Rmt=new _n,G0e=new he;function WX(e,t){let n=e.ellipsoid,i=fi._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,Omt),r=he.toCartesian(t,n,Imt),s=Rmt;s.origin=r,s.direction=o;let a=new _n;return _n.getPoint(s,i,a.origin),d.negate(o,a.direction),a}function j0e(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,G0e);return WX(e,i)}function W0e(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,G0e).height}function Mmt(e,t,n,i,o){let r=WX(t,n);return b4(e,t,r,i,o,function(){let s=QE(e,t,r,i,o,!0,!0);if(c(s))return W0e(t,s.position)})}function Lmt(e,t,n,i,o,r){let s=j0e(t,n);return b4(e,t,s,i,o,function(){let a=QE(e,t,s,i,o,!0,!0);if(c(a))return d.clone(a.position,r)})}Ys.prototype.sampleHeight=function(e,t,n,i){if(T.defined("position",t),e.mode!==oe.SCENE3D)throw new C("sampleHeight is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new C("sampleHeight requires depth texture support. Check sampleHeightSupported.");let o=WX(e,t),r=QE(this,e,o,n,i,!0,!1);if(c(r))return W0e(e,r.position)};Ys.prototype.clampToHeight=function(e,t,n,i,o){if(T.defined("cartesian",t),e.mode!==oe.SCENE3D)throw new C("clampToHeight is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new C("clampToHeight requires depth texture support. Check clampToHeightSupported.");let r=j0e(e,t),s=QE(this,e,r,n,i,!0,!1);if(c(s))return d.clone(s.position,o)};Ys.prototype.sampleHeightMostDetailed=function(e,t,n,i){if(T.defined("positions",t),e.mode!==oe.SCENE3D)throw new C("sampleHeightMostDetailed is only supported in 3D mode.");if(!e.sampleHeightSupported)throw new C("sampleHeightMostDetailed requires depth texture support. Check sampleHeightSupported.");n=c(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Mmt(this,e,t[s],n,i);return x4(e,Promise.all(r).then(function(s){let a=s.length;for(let l=0;l<a;++l)t[l].height=s[l];return t}))};Ys.prototype.clampToHeightMostDetailed=function(e,t,n,i){if(T.defined("cartesians",t),e.mode!==oe.SCENE3D)throw new C("clampToHeightMostDetailed is only supported in 3D mode.");if(!e.clampToHeightSupported)throw new C("clampToHeightMostDetailed requires depth texture support. Check clampToHeightSupported.");n=c(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=Lmt(this,e,t[s],n,i,t[s]);return x4(e,Promise.all(r).then(function(s){let a=s.length;for(let l=0;l<a;++l)t[l]=s[l];return t}))};Ys.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var T4=Ys;var A4=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif
void main()
{
vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
color /= texture(autoExposure, vec2(0.5)).r;
#else
color *= vec3(exposure);
#endif
color = czm_acesTonemapping(color);
color = czm_inverseGamma(color);
out_FragColor = vec4(color, fragmentColor.a);
}
`;var C4=`precision highp float;
uniform sampler2D randomTexture;
uniform sampler2D depthTexture;
uniform float intensity;
uniform float bias;
uniform float lengthCap;
uniform int stepCount;
uniform int directionCount;
vec4 pixelToEye(vec2 screenCoordinate)
{
vec2 uv = screenCoordinate / czm_viewport.zw;
float depth = czm_readDepth(depthTexture, uv);
vec2 xy = 2.0 * uv - vec2(1.0);
vec4 posEC = czm_inverseProjection * vec4(xy, depth, 1.0);
posEC = posEC / posEC.w;
if (depth >= 1.0) {
posEC.z = czm_currentFrustum.y;
}
return posEC;
}
vec3 getNormalXEdge(vec3 positionEC)
{
vec2 centerCoord = gl_FragCoord.xy;
vec3 positionLeft = pixelToEye(centerCoord + vec2(-1.0, 0.0)).xyz;
vec3 positionRight = pixelToEye(centerCoord + vec2(1.0, 0.0)).xyz;
vec3 positionUp = pixelToEye(centerCoord + vec2(0.0, 1.0)).xyz;
vec3 positionDown = pixelToEye(centerCoord + vec2(0.0, -1.0)).xyz;
vec3 dx0 = positionEC - positionLeft;
vec3 dx1 = positionRight - positionEC;
vec3 dy0 = positionEC - positionDown;
vec3 dy1 = positionUp - positionEC;
vec3 dx = length(dx0) < length(dx1) ? dx0 : dx1;
vec3 dy = length(dy0) < length(dy1) ? dy0 : dy1;
return normalize(cross(dx, dy));
}
const float sqrtTwoPi = sqrt(czm_twoPi);
float gaussian(float x, float standardDeviation) {
float argument = x / standardDeviation;
return exp(-0.5 * argument * argument) / (sqrtTwoPi * standardDeviation);
}
void main(void)
{
vec4 positionEC = pixelToEye(gl_FragCoord.xy);
float maxValidDepth = czm_currentFrustum.y - lengthCap;
if (-positionEC.z > maxValidDepth)
{
out_FragColor = vec4(1.0);
return;
}
vec3 normalEC = getNormalXEdge(positionEC.xyz);
float gaussianVariance = lengthCap * sqrt(-positionEC.z);
float stepLength = 3.0 * gaussianVariance / (float(stepCount) + 1.0);
float metersPerPixel = czm_metersPerPixel(positionEC, 1.0);
float pixelsPerStep = max(stepLength / metersPerPixel, 1.0);
stepLength = pixelsPerStep * metersPerPixel;
float angleStepScale = 1.0 / float(directionCount);
float angleStep = angleStepScale * czm_twoPi;
float cosStep = cos(angleStep);
float sinStep = sin(angleStep);
mat2 rotateStep = mat2(cosStep, sinStep, -sinStep, cosStep);
const float randomTextureSize = 255.0;
vec2 randomTexCoord = fract(gl_FragCoord.xy / randomTextureSize);
float randomVal = texture(randomTexture, randomTexCoord).x;
vec2 sampleDirection = vec2(cos(angleStep * randomVal), sin(angleStep * randomVal));
float ao = 0.0;
#if __VERSION__ == 300
for (int i = 0; i < directionCount; i++)
{
#else
for (int i = 0; i < 16; i++)
{
if (i >= directionCount) {
break;
}
#endif
sampleDirection = rotateStep * sampleDirection;
float localAO = 0.0;
vec2 radialStep = pixelsPerStep * sampleDirection;
#if __VERSION__ == 300
for (int j = 0; j < stepCount; j++)
{
#else
for (int j = 0; j < 64; j++)
{
if (j >= stepCount) {
break;
}
#endif
vec2 samplePixel = floor(gl_FragCoord.xy + float(j + 1) * radialStep) + vec2(0.5);
if (clamp(samplePixel, vec2(0.0), czm_viewport.zw) != samplePixel) {
break;
}
vec4 samplePositionEC = pixelToEye(samplePixel);
vec3 stepVector = samplePositionEC.xyz - positionEC.xyz;
float dotVal = clamp(dot(normalEC, normalize(stepVector)), 0.0, 1.0);
dotVal = czm_branchFreeTernary(dotVal > bias, dotVal, 0.0);
dotVal = czm_branchFreeTernary(-samplePositionEC.z <= maxValidDepth, dotVal, 0.0);
float sampleDistance = length(stepVector);
float weight = gaussian(sampleDistance, gaussianVariance);
localAO += weight * dotVal;
}
ao += localAO;
}
ao *= angleStepScale * stepLength;
ao = 1.0 - clamp(ao, 0.0, 1.0);
ao = pow(ao, intensity);
out_FragColor = vec4(vec3(ao), 1.0);
}
`;var E4=`uniform sampler2D colorTexture;
uniform sampler2D ambientOcclusionTexture;
uniform bool ambientOcclusionOnly;
in vec2 v_textureCoordinates;
void main(void)
{
vec4 color = texture(colorTexture, v_textureCoordinates);
vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates);
out_FragColor = ambientOcclusionOnly ? ao : ao * color;
}
`;var S4=`uniform sampler2D colorTexture;
uniform float gradations;
in vec2 v_textureCoordinates;
void main(void)
{
vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
#ifdef CZM_SELECTED_FEATURE
if (czm_selected()) {
out_FragColor = vec4(rgb, 1.0);
return;
}
#endif
float luminance = czm_luminance(rgb);
float darkness = luminance * gradations;
darkness = (darkness - fract(darkness)) / gradations;
out_FragColor = vec4(vec3(darkness), 1.0);
}
`;var w4=`uniform sampler2D colorTexture;
uniform sampler2D bloomTexture;
uniform bool glowOnly;
in vec2 v_textureCoordinates;
void main(void)
{
vec4 color = texture(colorTexture, v_textureCoordinates);
#ifdef CZM_SELECTED_FEATURE
if (czm_selected()) {
out_FragColor = color;
return;
}
#endif
vec4 bloom = texture(bloomTexture, v_textureCoordinates);
out_FragColor = glowOnly ? bloom : bloom + color;
}
`;var v4=`uniform sampler2D colorTexture;
uniform float brightness;
in vec2 v_textureCoordinates;
void main(void)
{
vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
vec3 target = vec3(0.0);
out_FragColor = vec4(mix(target, rgb, brightness), 1.0);
}
`;var D4=`uniform sampler2D colorTexture;
uniform float contrast;
uniform float brightness;
in vec2 v_textureCoordinates;
void main(void)
{
vec3 sceneColor = texture(colorTexture, v_textureCoordinates).xyz;
sceneColor = czm_RGBToHSB(sceneColor);
sceneColor.z += brightness;
sceneColor = czm_HSBToRGB(sceneColor);
float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast));
sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5);
out_FragColor = vec4(sceneColor, 1.0);
}
`;var P4=`uniform sampler2D colorTexture;
uniform sampler2D blurTexture;
uniform sampler2D depthTexture;
uniform float focalDistance;
in vec2 v_textureCoordinates;
vec4 toEye(vec2 uv, float depth)
{
vec2 xy = vec2((uv.x * 2.0 - 1.0), ((1.0 - uv.y) * 2.0 - 1.0));
vec4 posInCamera = czm_inverseProjection * vec4(xy, depth, 1.0);
posInCamera = posInCamera / posInCamera.w;
return posInCamera;
}
float computeDepthBlur(float depth)
{
float f;
if (depth < focalDistance)
{
f = (focalDistance - depth) / (focalDistance - czm_currentFrustum.x);
}
else
{
f = (depth - focalDistance) / (czm_currentFrustum.y - focalDistance);
f = pow(f, 0.1);
}
f *= f;
f = clamp(f, 0.0, 1.0);
return pow(f, 0.5);
}
void main(void)
{
float depth = czm_readDepth(depthTexture, v_textureCoordinates);
vec4 posInCamera = toEye(v_textureCoordinates, depth);
float d = computeDepthBlur(-posInCamera.z);
out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d);
}
`;var I4=`uniform sampler2D depthTexture;
in vec2 v_textureCoordinates;
void main(void)
{
float depth = czm_readDepth(depthTexture, v_textureCoordinates);
out_FragColor = vec4(vec3(depth), 1.0);
}
`;var O4=`uniform sampler2D depthTexture;
uniform float length;
uniform vec4 color;
in vec2 v_textureCoordinates;
void main(void)
{
float directions[3];
directions[0] = -1.0;
directions[1] = 0.0;
directions[2] = 1.0;
float scalars[3];
scalars[0] = 3.0;
scalars[1] = 10.0;
scalars[2] = 3.0;
float padx = czm_pixelRatio / czm_viewport.z;
float pady = czm_pixelRatio / czm_viewport.w;
#ifdef CZM_SELECTED_FEATURE
bool selected = false;
for (int i = 0; i < 3; ++i)
{
float dir = directions[i];
selected = selected || czm_selected(vec2(-padx, dir * pady));
selected = selected || czm_selected(vec2(padx, dir * pady));
selected = selected || czm_selected(vec2(dir * padx, -pady));
selected = selected || czm_selected(vec2(dir * padx, pady));
if (selected)
{
break;
}
}
if (!selected)
{
out_FragColor = vec4(color.rgb, 0.0);
return;
}
#endif
float horizEdge = 0.0;
float vertEdge = 0.0;
for (int i = 0; i < 3; ++i)
{
float dir = directions[i];
float scale = scalars[i];
horizEdge -= texture(depthTexture, v_textureCoordinates + vec2(-padx, dir * pady)).x * scale;
horizEdge += texture(depthTexture, v_textureCoordinates + vec2(padx, dir * pady)).x * scale;
vertEdge -= texture(depthTexture, v_textureCoordinates + vec2(dir * padx, -pady)).x * scale;
vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)).x * scale;
}
float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge);
out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0);
}
`;var R4=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif
void main()
{
vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
float exposure = texture(autoExposure, vec2(0.5)).r;
color /= exposure;
#else
color *= vec3(exposure);
#endif
const float A = 0.22;
const float B = 0.30;
const float C = 0.10;
const float D = 0.20;
const float E = 0.01;
const float F = 0.30;
const float white = 11.2;
vec3 c = ((color * (A * color + C * B) + D * E) / (color * ( A * color + B) + D * F)) - E / F;
float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D * F)) - E / F;
c = czm_inverseGamma(c / w);
out_FragColor = vec4(c, fragmentColor.a);
}
`;var M4=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif
void main()
{
vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
color /= texture(autoExposure, vec2(0.5)).r;
#else
color *= vec3(exposure);
#endif
color = czm_pbrNeutralTonemapping(color);
color = czm_inverseGamma(color);
out_FragColor = vec4(color, fragmentColor.a);
}
`;var L4=`in vec2 v_textureCoordinates;
uniform sampler2D colorTexture;
const float fxaaQualitySubpix = 0.5;
const float fxaaQualityEdgeThreshold = 0.125;
const float fxaaQualityEdgeThresholdMin = 0.0833;
void main()
{
vec2 fxaaQualityRcpFrame = vec2(1.0) / czm_viewport.zw;
vec4 color = FxaaPixelShader(
v_textureCoordinates,
colorTexture,
fxaaQualityRcpFrame,
fxaaQualitySubpix,
fxaaQualityEdgeThreshold,
fxaaQualityEdgeThresholdMin);
float alpha = texture(colorTexture, v_textureCoordinates).a;
out_FragColor = vec4(color.rgb, alpha);
}
`;var wx=`#define SAMPLES 8
uniform float delta;
uniform float sigma;
uniform float direction;
uniform sampler2D colorTexture;
#ifdef USE_STEP_SIZE
uniform float stepSize;
#else
uniform vec2 step;
#endif
in vec2 v_textureCoordinates;
void main()
{
vec2 st = v_textureCoordinates;
vec2 dir = vec2(1.0 - direction, direction);
#ifdef USE_STEP_SIZE
vec2 step = vec2(stepSize * (czm_pixelRatio / czm_viewport.zw));
#else
vec2 step = step;
#endif
vec3 g;
g.x = 1.0 / (sqrt(czm_twoPi) * sigma);
g.y = exp((-0.5 * delta * delta) / (sigma * sigma));
g.z = g.y * g.y;
vec4 result = texture(colorTexture, st) * g.x;
for (int i = 1; i < SAMPLES; ++i)
{
g.xy *= g.yz;
vec2 offset = float(i) * dir * step;
result += texture(colorTexture, st - offset) * g.x;
result += texture(colorTexture, st + offset) * g.x;
}
out_FragColor = result;
}
`;var N4=`uniform sampler2D colorTexture;
uniform sampler2D dirtTexture;
uniform sampler2D starTexture;
uniform vec2 dirtTextureDimensions;
uniform float distortion;
uniform float ghostDispersal;
uniform float haloWidth;
uniform float dirtAmount;
uniform float earthRadius;
uniform float intensity;
in vec2 v_textureCoordinates;
#define DISTANCE_TO_SPACE 6500000.0
vec4 getNDCFromWC(vec3 WC, float earthRadius)
{
vec4 positionEC = czm_view * vec4(WC, 1.0);
positionEC = vec4(positionEC.x + earthRadius, positionEC.y, positionEC.z, 1.0);
vec4 positionWC = czm_eyeToWindowCoordinates(positionEC);
return czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);
}
float isInEarth(vec2 texcoord, vec2 sceneSize)
{
vec2 NDC = texcoord * 2.0 - 1.0;
vec4 earthPosSC = getNDCFromWC(vec3(0.0), 0.0);
vec4 earthPosSCEdge = getNDCFromWC(vec3(0.0), earthRadius * 1.5);
NDC.xy -= earthPosSC.xy;
float X = abs(NDC.x) * sceneSize.x;
float Y = abs(NDC.y) * sceneSize.y;
return clamp(0.0, 1.0, max(sqrt(X * X + Y * Y) / max(abs(earthPosSCEdge.x * sceneSize.x), 1.0) - 0.8 , 0.0));
}
vec4 textureDistorted(sampler2D tex, vec2 texcoord, vec2 direction, vec3 distortion, bool isSpace)
{
vec2 sceneSize = czm_viewport.zw;
vec3 color;
if(isSpace)
{
color.r = isInEarth(texcoord + direction * distortion.r, sceneSize) * texture(tex, texcoord + direction * distortion.r).r;
color.g = isInEarth(texcoord + direction * distortion.g, sceneSize) * texture(tex, texcoord + direction * distortion.g).g;
color.b = isInEarth(texcoord + direction * distortion.b, sceneSize) * texture(tex, texcoord + direction * distortion.b).b;
}
else
{
color.r = texture(tex, texcoord + direction * distortion.r).r;
color.g = texture(tex, texcoord + direction * distortion.g).g;
color.b = texture(tex, texcoord + direction * distortion.b).b;
}
return vec4(clamp(color, 0.0, 1.0), 0.0);
}
void main(void)
{
vec4 originalColor = texture(colorTexture, v_textureCoordinates);
vec3 rgb = originalColor.rgb;
bool isSpace = length(czm_viewerPositionWC.xyz) > DISTANCE_TO_SPACE;
vec4 sunPos = czm_morphTime == 1.0 ? vec4(czm_sunPositionWC, 1.0) : vec4(czm_sunPositionColumbusView.zxy, 1.0);
vec4 sunPositionEC = czm_view * sunPos;
vec4 sunPositionWC = czm_eyeToWindowCoordinates(sunPositionEC);
sunPos = czm_viewportOrthographic * vec4(sunPositionWC.xy, -sunPositionWC.z, 1.0);
if(!isSpace || !((sunPos.x >= -1.1 && sunPos.x <= 1.1) && (sunPos.y >= -1.1 && sunPos.y <= 1.1)))
{
out_FragColor = originalColor;
return;
}
vec2 texcoord = vec2(1.0) - v_textureCoordinates;
vec2 pixelSize = czm_pixelRatio / czm_viewport.zw;
vec2 invPixelSize = 1.0 / pixelSize;
vec3 distortionVec = pixelSize.x * vec3(-distortion, 0.0, distortion);
vec2 ghostVec = (vec2(0.5) - texcoord) * ghostDispersal;
vec3 direction = normalize(vec3(ghostVec, 0.0));
vec4 result = vec4(0.0);
vec4 ghost = vec4(0.0);
for (int i = 0; i < 4; ++i)
{
vec2 offset = fract(texcoord + ghostVec * float(i));
ghost += textureDistorted(colorTexture, offset, direction.xy, distortionVec, isSpace);
}
result += ghost;
vec2 haloVec = normalize(ghostVec) * haloWidth;
float weightForHalo = length(vec2(0.5) - fract(texcoord + haloVec)) / length(vec2(0.5));
weightForHalo = pow(1.0 - weightForHalo, 5.0);
result += textureDistorted(colorTexture, texcoord + haloVec, direction.xy, distortionVec, isSpace) * weightForHalo * 1.5;
vec2 dirtTexCoords = (v_textureCoordinates * invPixelSize) / dirtTextureDimensions;
if (dirtTexCoords.x > 1.0)
{
dirtTexCoords.x = mod(floor(dirtTexCoords.x), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.x) : fract(dirtTexCoords.x);
}
if (dirtTexCoords.y > 1.0)
{
dirtTexCoords.y = mod(floor(dirtTexCoords.y), 2.0) == 1.0 ? 1.0 - fract(dirtTexCoords.y) : fract(dirtTexCoords.y);
}
result += dirtAmount * texture(dirtTexture, dirtTexCoords);
float camrot = czm_view[0].z + czm_view[1].y;
float cosValue = cos(camrot);
float sinValue = sin(camrot);
mat3 rotation = mat3(
cosValue, -sinValue, 0.0,
sinValue, cosValue, 0.0,
0.0, 0.0, 1.0
);
vec3 st1 = vec3(v_textureCoordinates * 2.0 - vec2(1.0), 1.0);
vec3 st2 = vec3((rotation * st1).xy, 1.0);
vec3 st3 = st2 * 0.5 + vec3(0.5);
vec2 lensStarTexcoord = st3.xy;
float weightForLensFlare = length(vec3(sunPos.xy, 0.0));
float oneMinusWeightForLensFlare = max(1.0 - weightForLensFlare, 0.0);
if (!isSpace)
{
result *= oneMinusWeightForLensFlare * intensity * 0.2;
}
else
{
result *= oneMinusWeightForLensFlare * intensity;
result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) * max((1.0 - length(vec3(st1.xy, 0.0))), 0.0) * 2.0;
}
result += texture(colorTexture, v_textureCoordinates);
out_FragColor = result;
}
`;var F4=`uniform sampler2D colorTexture;
uniform vec3 white;
in vec2 v_textureCoordinates;
#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif
void main()
{
vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
float exposure = texture(autoExposure, vec2(0.5)).r;
color /= exposure;
#else
color *= vec3(exposure);
#endif
color = (color * (1.0 + color / white)) / (1.0 + color);
color = czm_inverseGamma(color);
out_FragColor = vec4(color, fragmentColor.a);
}
`;var B4=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
float rand(vec2 co)
{
return fract(sin(dot(co.xy ,vec2(12.9898, 78.233))) * 43758.5453);
}
void main(void)
{
float noiseValue = rand(v_textureCoordinates + sin(czm_frameNumber)) * 0.1;
vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb;
vec3 green = vec3(0.0, 1.0, 0.0);
out_FragColor = vec4((noiseValue + rgb) * green, 1.0);
}
`;var k4=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
#ifdef AUTO_EXPOSURE
uniform sampler2D autoExposure;
#else
uniform float exposure;
#endif
void main()
{
vec4 fragmentColor = texture(colorTexture, v_textureCoordinates);
vec3 color = fragmentColor.rgb;
#ifdef AUTO_EXPOSURE
float exposure = texture(autoExposure, vec2(0.5)).r;
color /= exposure;
#else
color *= vec3(exposure);
#endif
color = color / (1.0 + color);
color = czm_inverseGamma(color);
out_FragColor = vec4(color, fragmentColor.a);
}
`;var U4=`uniform sampler2D colorTexture;
uniform sampler2D silhouetteTexture;
in vec2 v_textureCoordinates;
void main(void)
{
vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates);
vec4 color = texture(colorTexture, v_textureCoordinates);
out_FragColor = mix(color, silhouetteColor, silhouetteColor.a);
}
`;function vx(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new pi,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new z,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(vx.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(c(e))return e[e.length-1].getColorTexture(0)}}});function q0e(e){let t=e._framebuffers;if(!c(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function Nmt(e,t){q0e(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let l=0;l<r;++l)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[l]=new pi,s[l].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function Y0e(e){let t=e._commands;if(!c(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function Fmt(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function Bmt(e,t){let n=`uniform sampler2D colorTexture;
in vec2 v_textureCoordinates;
float sampleTexture(vec2 offset) {
`;return e===0?n+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset);
return czm_luminance(color.rgb);
`:n+=` return texture(colorTexture, v_textureCoordinates + offset).r;
`,n+=`}
`,n+=`uniform vec2 colorTextureDimensions;
uniform vec2 minMaxLuminance;
uniform sampler2D previousLuminance;
void main() {
float color = 0.0;
float xStep = 1.0 / colorTextureDimensions.x;
float yStep = 1.0 / colorTextureDimensions.y;
int count = 0;
for (int i = 0; i < 3; ++i) {
for (int j = 0; j < 3; ++j) {
vec2 offset;
offset.x = -xStep + float(i) * xStep;
offset.y = -yStep + float(j) * yStep;
if (offset.x < 0.0 || offset.x > 1.0 || offset.y < 0.0 || offset.y > 1.0) {
continue;
}
color += sampleTexture(offset);
++count;
}
}
if (count > 0) {
color /= float(count);
}
`,e===t-1&&(n+=` float previous = texture(previousLuminance, vec2(0.5)).r;
color = clamp(color, minMaxLuminance.x, minMaxLuminance.y);
color = previous + (color - previous) / (60.0 * 1.5);
color = clamp(color, minMaxLuminance.x, minMaxLuminance.y);
`),n+=` out_FragColor = vec4(color);
}
`,n}function kmt(e,t){Y0e(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(Bmt(r,i),{framebuffer:n[r].framebuffer,uniformMap:Fmt(e,r)});e._commands=o}vx.prototype.clear=function(e){let t=this._framebuffers;if(!c(t))return;let n=this._clearCommand;c(n)||(n=this._clearCommand=new ti({color:new G(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};vx.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,Nmt(this,e),kmt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};vx.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!c(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};vx.prototype.isDestroyed=function(){return!1};vx.prototype.destroy=function(){return q0e(this),Y0e(this),de(this)};var V4=vx;var Umt={NEAREST:0,LINEAR:1},Xf=Umt;function Dx(e){e=e??W.EMPTY_OBJECT;let{name:t=jn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=Xf.NEAREST,pixelFormat:a=ke.RGBA,pixelDatatype:l=Ue.UNSIGNED_BYTE,clearColor:u=G.BLACK,scissorRectangle:f}=e;if(T.typeOf.string("options.fragmentShader",n),T.typeOf.number.greaterThan("options.textureScale",o,0),T.typeOf.number.lessThanOrEquals("options.textureScale",o,1),!ke.isColorFormat(a))throw new C("options.pixelFormat must be a color format.");this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=l,this._clearColor=u,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let h=new Cc;h.scissorTest={enabled:!0,rectangle:c(f)?Ke.clone(f):new Ke},this._passState=h,this._ready=!1,this._name=t,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(Dx.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(c(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(c(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var Vmt=/uniform\s+sampler2D\s+depthTexture/g;Dx.prototype._isSupported=function(e){return!Vmt.test(this._fragmentShader)||e.depthTexture};function zmt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];c(a)&&a!==r&&a instanceof Rt&&!c(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof Rt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function Hmt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function Gmt(e,t){return function(){let n=e[t]();if(c(n))return n.dimensions}}function jmt(e){if(c(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;typeof i[r]!="function"?(t[r]=Hmt(e,r),n[r]=zmt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof Rt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=Gmt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=xt(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function Wmt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE
uniform sampler2D czm_idTexture;
uniform sampler2D czm_selectedIdTexture;
uniform float czm_selectedIdTextureStep;
in vec2 v_textureCoordinates;
bool czm_selected(vec2 offset)
{
bool selected = false;
vec4 id = texture(czm_idTexture, v_textureCoordinates + offset);
for (int i = 0; i < ${t}; ++i)
{
vec4 selectedId = texture(czm_selectedIdTexture, vec2((float(i) + 0.5) * czm_selectedIdTextureStep, 0.5));
if (all(equal(id, selectedId)))
{
return true;
}
}
return false;
}
bool czm_selected()
{
return czm_selected(vec2(0.0));
}
${e}`}function qmt(e,t){if(c(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(c(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=Wmt(n,o)}let i=new He({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function Ymt(e){let t=e._sampleMode,n,i;t===Xf.LINEAR?(n=Yt.LINEAR,i=ui.LINEAR):(n=Yt.NEAREST,i=ui.NEAREST);let o=e._sampler;(!c(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function Xmt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function Kmt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function $mt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let l=n[a];l=l&&l.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:l,source:u}=i[a];e._actualUniforms[l]=new Rt({context:t,source:u})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!c(e._texturePromise)){e._ready=!0;return}if(o.length===0||c(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let l=o[a],u=r[l],f=e._textureCache.getStageByName(u);if(c(f))e._actualUniforms[l]=Kmt(e,u);else if(typeof u=="string"){let h=new we({url:u});s.push(h.fetchImage().then(Xmt(e,l)))}else e._texturesToCreate.push({name:l,source:u})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function X0e(e){c(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!c(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;let r=i[o];r instanceof Rt&&(c(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function Zmt(e){let t=c(e._selected)?e._selected.length:0,n=c(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(c(e._selected)&&c(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):c(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&c(e._combinedSelected)){if(!c(e._combinedSelectedShadow))return!0;for(let o=0;o<e._combinedSelected.length;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function Qmt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!c(n))return;let i=0;for(let s=0;s<n.length;++s){let a=n[s];c(a.pickIds)?i+=a.pickIds.length:c(a.pickId)&&++i}if(n.length===0||i===0){let s=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:s,width:1,height:1},sampler:Qt.NEAREST});return}let o=0,r=new Uint8Array(i*4);for(let s=0;s<n.length;++s){let a=n[s];if(c(a.pickIds)){let l=a.pickIds,u=l.length;for(let f=0;f<u;++f){let h=l[f].color;r[o]=G.floatToByte(h.red),r[o+1]=G.floatToByte(h.green),r[o+2]=G.floatToByte(h.blue),r[o+3]=G.floatToByte(h.alpha),o+=4}}else if(c(a.pickId)){let l=a.pickId.color;r[o]=G.floatToByte(l.red),r[o+1]=G.floatToByte(l.green),r[o+2]=G.floatToByte(l.blue),r[o+3]=G.floatToByte(l.alpha),o+=4}}e._selectedIdTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:r,width:i,height:1},sampler:Qt.NEAREST})}Dx.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&X0e(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=Zmt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=c(this._selected)?this._selected.length:0,this._parentSelectedLength=c(this._parentSelected)?this._parentSelected.length:0,Qmt(this,e),jmt(this),$mt(this,e),qmt(this,e),Ymt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!c(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!c(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=ze.fromCache({viewport:new Ke(0,0,i.width,i.height)}))),this._command.renderState=o};Dx.prototype.execute=function(e,t,n,i){if(!c(this._command)||!c(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,Qt.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;c(o)&&(o.context=e),this._command.execute(e,o)};Dx.prototype.isDestroyed=function(){return!1};Dx.prototype.destroy=function(){return X0e(this),de(this)};var fo=Dx;function Px(e){e=e??W.EMPTY_OBJECT,T.defined("options.stages",e.stages),T.typeOf.number.greaterThan("options.stages.length",e.stages.length,0),this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;c(t)||(t=jn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(Px.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});Px.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};Px.prototype.get=function(e){return T.typeOf.number.greaterThanOrEquals("index",e,0),T.typeOf.number.lessThan("index",e,this.length),this._stages[e]};function Jmt(e){let t=c(e._selected)?e._selected.length:0,n=c(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,c(e._selected)&&c(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):c(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&c(e._combinedSelected)){if(!c(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}Px.prototype.update=function(e,t){this._selectedDirty=Jmt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=c(this._selected)?this._selected.length:0,this._parentSelectedLength=c(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};Px.prototype.isDestroyed=function(){return!1};Px.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return de(this)};var Ou=Px;var wr={};function qX(e){let o=`#define USE_STEP_SIZE
${wx}`,r=new fo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Xf.LINEAR}),s=new fo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Xf.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(l){let u=r.uniforms,f=s.uniforms;u.delta=f.delta=l}},sigma:{get:function(){return r.uniforms.sigma},set:function(l){let u=r.uniforms,f=s.uniforms;u.sigma=f.sigma=l}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(l){let u=r.uniforms,f=s.uniforms;u.stepSize=f.stepSize=l}}}),new Ou({name:e,stages:[r,s],uniforms:a})}wr.createBlurStage=function(){return qX("czm_blur")};wr.createDepthOfFieldStage=function(){let e=qX("czm_depth_of_field_blur"),t=new fo({name:"czm_depth_of_field_composite",fragmentShader:P4,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new Ou({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};wr.isDepthOfFieldSupported=function(e){return e.context.depthTexture};wr.createEdgeDetectionStage=function(){let e=jn();return new fo({name:`czm_edge_detection_${e}`,fragmentShader:O4,uniforms:{length:.25,color:G.clone(G.BLACK)}})};wr.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function ept(e){if(!c(e))return wr.createEdgeDetectionStage();let t=new Ou({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a};
`,o+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates);
if (edge${a}.a > 0.0)
{
color = edge${a};
break;
}
`,n[`edgeTexture${a}`]=e[a].name;let r=`${i}in vec2 v_textureCoordinates;
void main() {
vec4 color = vec4(0.0);
for (int i = 0; i < ${e.length}; i++)
{
${o} }
out_FragColor = color;
}
`,s=new fo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new Ou({name:"czm_edge_detection_composite",stages:[t,s]})}wr.createSilhouetteStage=function(e){let t=ept(e),n=new fo({name:"czm_silhouette_color_edges",fragmentShader:U4,uniforms:{silhouetteTexture:t.name}});return new Ou({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};wr.isSilhouetteSupported=function(e){return e.context.depthTexture};wr.createBloomStage=function(){let e=new fo({name:"czm_bloom_contrast_bias",fragmentShader:D4,uniforms:{contrast:128,brightness:-.3}}),t=qX("czm_bloom_blur"),n=new Ou({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new fo({name:"czm_bloom_generate_composite",fragmentShader:w4,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new Ou({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};wr.createAmbientOcclusionStage=function(){let e=new fo({name:"czm_ambient_occlusion_generate",fragmentShader:C4,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new fo({name:"czm_ambient_occlusion_composite",fragmentShader:E4,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new Ou({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};wr.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var tpt=`#define FXAA_QUALITY_PRESET 39
${_V}
${L4}`;wr.createFXAAStage=function(){return new fo({name:"czm_FXAA",fragmentShader:tpt,sampleMode:Xf.LINEAR})};wr.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=A4,new fo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};wr.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=R4,new fo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};wr.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=M4,new fo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};wr.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=k4,new fo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};wr.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE
`:"";return t+=F4,new fo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:G.WHITE,autoExposure:void 0,exposure:1}})};wr.createAutoExposureStage=function(){return new V4};wr.createBlackAndWhiteStage=function(){return new fo({name:"czm_black_and_white",fragmentShader:S4,uniforms:{gradations:5}})};wr.createBrightnessStage=function(){return new fo({name:"czm_brightness",fragmentShader:v4,uniforms:{brightness:.5}})};wr.createNightVisionStage=function(){return new fo({name:"czm_night_vision",fragmentShader:B4})};wr.createDepthViewStage=function(){return new fo({name:"czm_depth_view",fragmentShader:I4})};wr.createLensFlareStage=function(){return new fo({name:"czm_lens_flare",fragmentShader:N4,uniforms:{dirtTexture:tn("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:tn("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ie.WGS84.maximumRadius}})};var Kf=wr;function w_(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function gI(e){for(;c(e.length);)e=e.get(e.length-1);return e.name}function YX(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(c(o)){let a=e.getStageByName(o);r[gI(a)]=!0}let s=i.uniforms;if(c(s)){let a=Object.getOwnPropertyNames(s),l=a.length;for(let u=0;u<l;++u){let f=s[a[u]];if(typeof f=="string"){let h=e.getStageByName(f);c(h)&&(r[gI(h)]=!0)}}}return i.name}function _I(e,t,n,i,o){if(c(i.enabled)&&!i.enabled||c(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!c(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,l=i.length;for(let h=0;h<l;++h){let p=i.get(h);c(p.length)?a=_I(e,t,n,p,o):a=YX(e,t,n,p,o),s&&(o=a)}let u,f;if(s)for(u=1;u<l;++u)f=gI(i.get(u)),c(n[f])||(n[f]={}),n[f][r]=!0;else for(u=1;u<l;++u){f=gI(i.get(u));let h=n[f];for(let p=0;p<u;++p)h[gI(i.get(p))]=!0}return a}function npt(e,t){let n={};if(c(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=_I(e,t,n,i,void 0);a=_I(e,t,n,o,a),a=YX(e,t,n,r,a),a=_I(e,t,n,e,a),YX(e,t,n,s,a)}else _I(e,t,n,e,void 0);return n}function ipt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,l=o._pixelDatatype,u=o._clearColor,f,h,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(h=p[f],r!==h.textureScale||s!==h.forcePowerOfTwo||a!==h.pixelFormat||l!==h.pixelDatatype||!G.equals(u,h.clearColor))continue;let m=h.stages,y=m.length,b=!1;for(let x=0;x<y;++x)if(n[m[x]]){b=!0;break}if(!b)break}return c(h)&&f<g?(h.stages.push(t),h):(h={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:l,clearColor:u,stages:[t],buffer:new pi({pixelFormat:a,pixelDatatype:l}),clear:void 0},p.push(h),h)}function opt(e,t){let n=npt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=ipt(e,i,n[i]))}function XX(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function rpt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],l=a.textureScale,u=Math.ceil(n*l),f=Math.ceil(i*l),h=Math.min(u,f);a.forcePowerOfTwo&&(O.isPowerOfTwo(h)||(h=O.nextPowerOfTwo(h)),u=h,f=h),a.buffer.update(t,u,f),a.clear=new ti({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}w_.prototype.updateDependencies=function(){this._updateDependencies=!0};w_.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=c(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=c(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=c(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=c(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!c(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(XX(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&opt(this,e);let l=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==l||this._height!==u;!n&&!f||(this._width=l,this._height=u,this._updateDependencies=!1,XX(this),rpt(this,e))};w_.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};w_.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};w_.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};w_.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(c(t))return t.buffer.framebuffer};w_.prototype.isDestroyed=function(){return!1};w_.prototype.destroy=function(){return XX(this),de(this)};var JE=w_;var eS={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};function K0e(e){return e===eS.REINHARD||e===eS.MODIFIED_REINHARD||e===eS.FILMIC||e===eS.ACES||e===eS.PBR_NEUTRAL}var r0=Object.freeze(eS);var KX=[];function Jc(){let e=Kf.createFXAAStage(),t=Kf.createAmbientOcclusionStage(),n=Kf.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Kf.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=r0.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new JE(this),r={},s=KX;for(s.push(e,t,n,i);s.length>0;){let l=s.pop();r[l.name]=l,l._textureCache=o;let u=l.length;if(c(u))for(let f=0;f<u;++f)s.push(l.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(Jc.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let l=t[a];e=e||l.ready&&l.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return $X(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(c(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!c(t))continue;if(c(t.selected))return!0;let n=t.length;if(c(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;if(!K0e(e))throw new C("tonemapper was set to an invalid value.");c(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case r0.REINHARD:n=Kf.createReinhardTonemappingStage(t);break;case r0.MODIFIED_REINHARD:n=Kf.createModifiedReinhardTonemappingStage(t);break;case r0.FILMIC:n=Kf.createFilmicTonemappingStage(t);break;case r0.PBR_NEUTRAL:n=Kf.createPbrNeutralTonemappingStage(t);break;default:n=Kf.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,c(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function $X(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,o=0;i<n.length;++i){let r=n[i];r&&(r._index=o++,t.push(r))}e._stages=t}Jc.prototype.add=function(e){T.typeOf.object("stage",e);let t=this._stageNames,n=KX;for(n.push(e);n.length>0;){let o=n.pop();if(c(t[o.name]))throw new C(`${o.name} has already been added to the collection or does not have a unique name.`);t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(c(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};Jc.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=KX;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(c(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};Jc.prototype.contains=function(e){return c(e)&&c(e._index)&&e._textureCache===this._textureCache};Jc.prototype.get=function(e){$X(this);let t=this._stages,n=t.length;return T.typeOf.number.greaterThanOrEquals("stages length",n,0),T.typeOf.number.greaterThanOrEquals("index",e,0),T.typeOf.number.lessThan("index",e,n),t[e]};Jc.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Jc.prototype.getStageByName=function(e){return this._stageNames[e]};Jc.prototype.update=function(e,t,n){$X(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let s=0;for(let x=0;x<r.length;++x){let A=r[x];A.ready&&A.enabled&&A._isSupported(e)&&(o[s++]=A)}o.length=s;let a=s!==i.length;if(!a){for(let x=0;x<s;++x)if(o[x]!==i[x]){a=!0;break}}let l=this._ao,u=this._bloom,f=this._autoExposure,h=this._tonemapping,p=this._fxaa;h.enabled=n;let g=l.enabled&&l._isSupported(e),m=u.enabled&&u._isSupported(e),y=h.enabled&&h._isSupported(e),b=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||m!==this._bloomEnabled||y!==this._tonemappingEnabled||b!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=m,this._tonemappingEnabled=y,this._fxaaEnabled=b,this._textureCacheDirty=!1),c(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!c(this._randomTexture)&&g){let A=new Uint8Array(196608);for(let E=0;E<196608;E+=3)A[E]=Math.floor(Math.random()*255);this._randomTexture=new Rt({context:e,pixelFormat:ke.RGB,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:A,width:256,height:256},sampler:new Qt({wrapS:gn.REPEAT,wrapT:gn.REPEAT,minificationFilter:Yt.NEAREST,magnificationFilter:ui.NEAREST})})}this._textureCache.update(e),p.update(e,t),l.update(e,t),u.update(e,t),h.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let x=0;x<r.length;++x)r[x].update(e,t);s=0;for(let x=0;x<r.length;++x){let A=r[x];A.ready&&A.enabled&&A._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};Jc.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function Ix(e){for(;c(e.length);)e=e.get(e.length-1);return e.outputTexture}Jc.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(c(t))return Ix(t)};function qm(e,t,n,i,o){if(c(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){qm(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)qm(e.get(r),t,Ix(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)qm(e.get(r),t,n,i,o)}Jc.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,l=this._bloom,u=this._autoExposure,f=this._tonemapping,h=a.enabled&&a._isSupported(e),p=l.enabled&&l._isSupported(e),g=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!h&&!p&&!m&&r===0)return;let b=t;h&&a.ready&&(qm(a,e,b,n,i),b=Ix(a)),p&&l.ready&&(qm(l,e,b,n,i),b=Ix(l)),g&&u.ready&&qm(u,e,b,n,i),m&&f.ready&&(qm(f,e,b,n,i),b=Ix(f));let x=b;if(r>0){qm(o[0],e,b,n,i);for(let A=1;A<r;++A)qm(o[A],e,Ix(o[A-1]),n,i);x=Ix(o[r-1])}y&&s.ready&&qm(s,e,x,n,i)};Jc.prototype.copy=function(e,t){if(!c(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Iu,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Jc.prototype.isDestroyed=function(){return!1};Jc.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),de(this)};var z4=Jc;var spt={SHIFT:0,CTRL:1,ALT:2},ba=Object.freeze(spt);var apt={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19},Cn=Object.freeze(apt);function s0(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function nK(e,t){let n=e;return c(t)&&(n+=`+${t}`),n}function Ox(e){if(e.shiftKey)return ba.SHIFT;if(e.ctrlKey)return ba.CTRL;if(e.altKey)return ba.ALT}var Ps={LEFT:0,MIDDLE:1,RIGHT:2};function Ru(e,t,n,i){function o(r){i(e,r)}zt.isInternetExplorer()?n.addEventListener(t,o,!1):n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function cpt(e){let t=e._element,n=c(t.disableRootEvents)?t:document;zt.supportsPointerEvents()?(Ru(e,"pointerdown",t,mpt),Ru(e,"pointerup",t,rbe),Ru(e,"pointermove",t,ppt),Ru(e,"pointercancel",t,rbe)):(Ru(e,"mousedown",t,sbe),Ru(e,"mouseup",n,abe),Ru(e,"mousemove",n,cbe),Ru(e,"touchstart",t,dpt),Ru(e,"touchend",n,ebe),Ru(e,"touchmove",n,hpt),Ru(e,"touchcancel",n,ebe)),Ru(e,"dblclick",t,upt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Ru(e,i,t,fpt)}function lpt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var $0e={position:new z};function iK(e){e._lastSeenTouchEvent=Ei()}function oK(e){return Ei()-e._lastSeenTouchEvent>fh.mouseEmulationIgnoreMilliseconds}function tK(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function sbe(e,t){if(!oK(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Ps.LEFT)i=Cn.LEFT_DOWN;else if(n===Ps.MIDDLE)i=Cn.MIDDLE_DOWN;else if(n===Ps.RIGHT)i=Cn.RIGHT_DOWN;else return;let o=s0(e,t,e._primaryPosition);z.clone(o,e._primaryStartPosition),z.clone(o,e._primaryPreviousPosition);let r=Ox(t),s=e.getInputAction(i,r);c(s)&&(z.clone(o,$0e.position),s($0e),t.preventDefault())}var Z0e={position:new z},Q0e={position:new z};function ZX(e,t,n,i){let o=Ox(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(c(r)||c(s)){let a=s0(e,i,e._primaryPosition);if(c(r)&&(z.clone(a,Z0e.position),r(Z0e)),c(s)){let l=e._primaryStartPosition;tK(l,a,e._clickPixelTolerance)&&(z.clone(a,Q0e.position),s(Q0e))}}}function abe(e,t){if(!oK(e))return;let n=t.button;n!==Ps.LEFT&&n!==Ps.MIDDLE&&n!==Ps.RIGHT||(e._buttonDown[Ps.LEFT]&&(ZX(e,Cn.LEFT_UP,Cn.LEFT_CLICK,t),e._buttonDown[Ps.LEFT]=!1),e._buttonDown[Ps.MIDDLE]&&(ZX(e,Cn.MIDDLE_UP,Cn.MIDDLE_CLICK,t),e._buttonDown[Ps.MIDDLE]=!1),e._buttonDown[Ps.RIGHT]&&(ZX(e,Cn.RIGHT_UP,Cn.RIGHT_CLICK,t),e._buttonDown[Ps.RIGHT]=!1))}var QX={startPosition:new z,endPosition:new z};function cbe(e,t){if(!oK(e))return;let n=Ox(t),i=s0(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(Cn.MOUSE_MOVE,n);c(r)&&(z.clone(o,QX.startPosition),z.clone(i,QX.endPosition),r(QX)),z.clone(i,o),(e._buttonDown[Ps.LEFT]||e._buttonDown[Ps.MIDDLE]||e._buttonDown[Ps.RIGHT])&&t.preventDefault()}var J0e={position:new z};function upt(e,t){let n=t.button,i;if(n===Ps.LEFT)i=Cn.LEFT_DOUBLE_CLICK;else return;let o=Ox(t),r=e.getInputAction(i,o);c(r)&&(s0(e,t,J0e.position),r(J0e))}function fpt(e,t){let n;if(c(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!c(n))return;let i=Ox(t),o=e.getInputAction(Cn.WHEEL,i);c(o)&&(o(n),t.preventDefault())}function dpt(e,t){iK(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,s0(e,r,new z));H4(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,l.set(s,z.clone(a.get(s)))}function ebe(e,t){iK(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);H4(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,l.remove(s)}var tbe={position:new z},JX={position1:new z,position2:new z},nbe={position:new z},ibe={position:new z},obe={position:new z};function H4(e,t){let n=Ox(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Ps.LEFT]){if(e._buttonDown[Ps.LEFT]=!1,c(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(Cn.LEFT_UP,n),c(r)&&(z.clone(e._primaryPosition,nbe.position),r(nbe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(Cn.LEFT_CLICK,n),c(s))){let l=e._primaryStartPosition,u=e._previousPositions.values[0];tK(l,u,e._clickPixelTolerance)&&(z.clone(e._primaryPosition,ibe.position),s(ibe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(Cn.PINCH_END,n),c(r)&&r()),o===1&&!a){let l=i.values[0];z.clone(l,e._primaryPosition),z.clone(l,e._primaryStartPosition),z.clone(l,e._primaryPreviousPosition),e._buttonDown[Ps.LEFT]=!0,r=e.getInputAction(Cn.LEFT_DOWN,n),c(r)&&(z.clone(l,tbe.position),r(tbe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(Cn.RIGHT_CLICK,n),c(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];tK(u,f,e._holdPixelTolerance)&&(z.clone(e._primaryPosition,obe.position),s(obe))}},fh.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(Cn.PINCH_START,n),c(r)&&(z.clone(i.values[0],JX.position1),z.clone(i.values[1],JX.position2),r(JX),t.preventDefault()))}function hpt(e,t){iK(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let u=a.get(s);c(u)&&s0(e,r,u)}lbe(e,t);let l=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,z.clone(a.get(s),l.get(s))}var eK={startPosition:new z,endPosition:new z},yI={distance:{startPosition:new z,endPosition:new z},angleAndHeight:{startPosition:new z,endPosition:new z}};function lbe(e,t){let n=Ox(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Ps.LEFT]){let a=i.values[0];z.clone(a,e._primaryPosition);let l=e._primaryPreviousPosition;s=e.getInputAction(Cn.MOUSE_MOVE,n),c(s)&&(z.clone(l,eK.startPosition),z.clone(a,eK.endPosition),s(eK)),z.clone(a,l),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(Cn.PINCH_MOVE,n),c(s))){let a=i.values[0],l=i.values[1],u=o.values[0],f=o.values[1],h=l.x-a.x,p=l.y-a.y,g=Math.sqrt(h*h+p*p)*.25,m=f.x-u.x,y=f.y-u.y,b=Math.sqrt(m*m+y*y)*.25,x=(l.y+a.y)*.125,A=(f.y+u.y)*.125,E=Math.atan2(p,h),S=Math.atan2(y,m);z.fromElements(0,b,yI.distance.startPosition),z.fromElements(0,g,yI.distance.endPosition),z.fromElements(S,A,yI.angleAndHeight.startPosition),z.fromElements(E,x,yI.angleAndHeight.endPosition),s(yI)}}function mpt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,s0(e,t,new z)),H4(e,t),e._previousPositions.set(i,z.clone(n.get(i)))}else sbe(e,t)}function rbe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),H4(e,t),e._previousPositions.remove(i)}else abe(e,t)}function ppt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!c(o))return;s0(e,t,o),lbe(e,t);let r=e._previousPositions;z.clone(n.get(i),r.get(i))}else cbe(e,t)}function fh(e){this._inputEvents={},this._buttonDown={LEFT:!1,MIDDLE:!1,RIGHT:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-fh.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new z,this._primaryPosition=new z,this._primaryPreviousPosition=new z,this._positions=new Et,this._previousPositions=new Et,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,cpt(this)}fh.prototype.setInputAction=function(e,t,n){if(!c(e))throw new C("action is required.");if(!c(t))throw new C("type is required.");let i=nK(t,n);this._inputEvents[i]=e};fh.prototype.getInputAction=function(e,t){if(!c(e))throw new C("type is required.");let n=nK(e,t);return this._inputEvents[n]};fh.prototype.removeInputAction=function(e,t){if(!c(e))throw new C("type is required.");let n=nK(e,t);delete this._inputEvents[n]};fh.prototype.isDestroyed=function(){return!1};fh.prototype.destroy=function(){return lpt(this),de(this)};fh.mouseEmulationIgnoreMilliseconds=800;fh.touchHoldDelayMilliseconds=1500;var $f=fh;function Rx(e){T.typeOf.object("scene",e),this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}Rx.prototype.completeMorph=function(){c(this._completeMorph)&&this._completeMorph()};Rx.prototype.morphTo2D=function(e,t){c(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof on,!(this._previousMode===oe.SCENE2D||this._previousMode===oe.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE2D,!0),n._mode=oe.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===oe.COLUMBUS_VIEW?Xpt(this,e):t_t(this,e,t),e===0&&c(this._completeMorph)&&this._completeMorph())};var _pt=new d,gpt=new d,ypt=new d,bpt=new d,xpt=new d,Tpt=new d,Apt=new d,Cpt=new he,Ept=new F,Spt=new wi,wpt=new on,vpt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};Rx.prototype.morphToColumbusView=function(e,t){c(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===oe.COLUMBUS_VIEW||this._previousMode===oe.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,oe.COLUMBUS_VIEW,!0),n.camera._setTransform(F.IDENTITY);let i=_pt,o=gpt,r=ypt;if(e>0)i.x=0,i.y=-1,i.z=1,i=d.multiplyByScalar(d.normalize(i,i),5*t.maximumRadius,i),d.negate(d.normalize(i,o),o),d.cross(d.UNIT_X,o,r);else{let u=n.camera;if(this._previousMode===oe.SCENE2D)d.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,d.negate(d.UNIT_Z,o),d.clone(d.UNIT_Y,r);else{d.clone(u.positionWC,i),d.clone(u.directionWC,o),d.clone(u.upWC,r);let f=t.scaleToGeodeticSurface(i,Apt),h=Ot.eastNorthUpToFixedFrame(f,t,Ept);F.inverseTransformation(h,h),n.mapProjection.project(t.cartesianToCartographic(i,Cpt),i),F.multiplyByPointAsVector(h,o,o),F.multiplyByPointAsVector(h,r,r)}}let s;this._morphToOrthographic?(s=wpt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=Spt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=O.toRadians(60));let a=vpt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let l=i_t(a);bI(this,l),this._previousMode===oe.SCENE2D?n_t(this,e,a,l):(a.position2D=F.multiplyByPoint(ro.TRANSFORM_2D,i,bpt),a.direction2D=F.multiplyByPointAsVector(ro.TRANSFORM_2D,o,xpt),a.up2D=F.multiplyByPointAsVector(ro.TRANSFORM_2D,r,Tpt),n._mode=oe.MORPHING,xbe(this,e,a,l)),e===0&&c(this._completeMorph)&&this._completeMorph()};var aK={position:new d,direction:new d,up:new d,frustum:void 0},fbe=new wi;Rx.prototype.morphTo3D=function(e,t){c(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===oe.SCENE3D||this._previousMode===oe.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,oe.SCENE3D,!0),n._mode=oe.MORPHING,n.camera._setTransform(F.IDENTITY),this._previousMode===oe.SCENE2D)kpt(this,e,t);else{let i;e>0?(i=aK,d.fromDegrees(0,0,5*t.maximumRadius,t,i.position),d.negate(i.position,i.direction),d.normalize(i.direction,i.direction),d.clone(d.UNIT_Z,i.up)):i=dbe(this,t);let o,r=n.camera;r.frustum instanceof on?o=r.frustum.clone():(o=fbe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=O.toRadians(60)),i.frustum=o;let s=Abe(i);bI(this,s),sK(this,e,i,s)}e===0&&c(this._completeMorph)&&this._completeMorph()}};Rx.prototype.isDestroyed=function(){return!1};Rx.prototype.destroy=function(){return G4(this),de(this)};function bI(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new $f(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,Cn.LEFT_DOWN),e._morphHandler.setInputAction(n,Cn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,Cn.RIGHT_DOWN),e._morphHandler.setInputAction(n,Cn.WHEEL)}}function G4(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var Dpt=new he,Ppt=new d,Ipt=new F;function dbe(e,t){let n=e._scene,i=n.camera,o=aK,r=o.position,s=o.direction,a=o.up,l=n.mapProjection.unproject(i.position,Dpt);t.cartographicToCartesian(l,r);let u=t.scaleToGeodeticSurface(r,Ppt),f=Ot.eastNorthUpToFixedFrame(u,t,Ipt);return F.multiplyByPointAsVector(f,i.direction,s),F.multiplyByPointAsVector(f,i.up,a),o}var Opt=new d,Rpt=new d,Mpt=new d,Lpt=new d,Npt=new d,Fpt=new d;function sK(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=d.clone(r.position,Opt),a=d.clone(r.direction,Rpt),l=d.clone(r.up,Mpt),u=F.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,n.position,Lpt),f=F.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.direction,Npt),h=F.multiplyByPointAsVector(ro.TRANSFORM_2D_INVERSE,n.up,Fpt);function p(m){Zf(s,u,m.time,r.position),Zf(a,f,m.time,r.direction),Zf(l,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let g=o.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Tbe(e,o,0,1,t,i)}});e._currentTweens.push(g)}var Bpt=new on,hbe=new d,mbe=new d,pbe=new d,cK=new d,_be=new d,gbe=new d;function kpt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=aK,d.fromDegrees(0,0,5*n.maximumRadius,n,r.position),d.negate(r.position,r.direction),d.normalize(r.direction,r.direction),d.clone(d.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=dbe(e,n));let s;e._morphToOrthographic?(s=Bpt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=fbe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=O.toRadians(60)),r.frustum=s;let a=Abe(r);bI(e,a);let l;e._morphToOrthographic?l=function(){sK(e,t,r,a)}:l=function(){bbe(e,t,r,function(){sK(e,t,r,a)})},t>0?(i._mode=oe.SCENE2D,o.flyTo({duration:t,destination:d.fromDegrees(0,0,5*n.maximumRadius,n,cK),complete:function(){i._mode=oe.MORPHING,l()}})):l()}function Zf(e,t,n,i){return d.lerp(e,t,n,i)}function ybe(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof on)return;let a=s.frustum.fov,l=O.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(l*.5)+1e7;function f(p){s.frustum.fov=O.lerp(a,l,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let h=r.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(h)}var Upt=new d,Vpt=new d,zpt=new d,rK=new d,Hpt=new d,Gpt=new d,jpt=new jo,Wpt=new _n,qpt=new d,Ypt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function Xpt(e,t){t*=.5;let n=e._scene,i=n.camera,o=d.clone(i.position,Upt),r=d.clone(i.direction,Vpt),s=d.clone(i.up,zpt),a=d.negate(d.UNIT_Z,Hpt),l=d.clone(d.UNIT_Y,Gpt),u=rK;if(t>0)d.clone(d.ZERO,rK),u.z=5*n.ellipsoid.maximumRadius;else{d.clone(o,rK);let b=Wpt;F.multiplyByPoint(ro.TRANSFORM_2D,o,b.origin),F.multiplyByPointAsVector(ro.TRANSFORM_2D,r,b.direction);let x=n.globe;if(c(x)){let A=x.pickWorldCoordinates(b,n,!0,qpt);c(A)&&(F.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,A,u),u.z+=d.distance(o,u))}}let f=jpt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let h=Ypt;h.position=u,h.direction=a,h.up=l,h.frustum=f;let p=Cbe(h);bI(e,p);function g(b){Zf(o,u,b.time,i.position),Zf(r,a,b.time,i.direction),Zf(s,l,b.time,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(b,x){b.position.z=x}let y=n.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){ybe(e,t,h,m,p)}});e._currentTweens.push(y)}var ube=new he,Kpt={position:new d,direction:new d,up:new d,position2D:new d,direction2D:new d,up2D:new d,frustum:new jo},$pt={position:new d,direction:new d,up:new d,frustum:void 0},Zpt=new d,Qpt=new _n,Jpt=new F,e_t=new d;function t_t(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=Kpt;if(t>0)d.clone(d.ZERO,r.position),r.position.z=5*n.maximumRadius,d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,ube),i.mapProjection.project(ube,r.position),d.negate(d.UNIT_Z,r.direction),d.clone(d.UNIT_Y,r.up);let h=Qpt;d.clone(r.position2D,h.origin);let p=d.clone(o.directionWC,h.direction),g=n.scaleToGeodeticSurface(o.positionWC,e_t),m=Ot.eastNorthUpToFixedFrame(g,n,Jpt);F.inverseTransformation(m,m),F.multiplyByPointAsVector(m,p,p),F.multiplyByPointAsVector(ro.TRANSFORM_2D,p,p);let y=i.globe;if(c(y)){let b=y.pickWorldCoordinates(h,i,!0,Zpt);if(c(b)){let x=d.distance(r.position2D,b);b.x+=x,d.clone(b,r.position2D)}}}function s(h,p){h.position.x=p}F.multiplyByPoint(ro.TRANSFORM_2D,r.position,r.position2D),F.multiplyByPointAsVector(ro.TRANSFORM_2D,r.direction,r.direction2D),F.multiplyByPointAsVector(ro.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let l=$pt;F.multiplyByPoint(ro.TRANSFORM_2D_INVERSE,r.position2D,l.position),d.clone(r.direction,l.direction),d.clone(r.up,l.up),l.frustum=a;let u=Cbe(l);bI(e,u);function f(){ybe(e,t,r,s,u)}xbe(e,t,r,f)}function bbe(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,l=O.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);r.frustum.far=u/Math.tan(l*.5)+1e7,r.frustum.fov=l;function f(p){r.frustum.fov=O.lerp(l,a,p.time),r.position.z=u/Math.tan(r.frustum.fov*.5)}let h=o.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(h)}function n_t(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=d.clone(n.position,cK),a=d.clone(n.direction,_be),l=d.clone(n.up,gbe);o._mode=oe.MORPHING;function u(){r.frustum=n.frustum.clone();let f=d.clone(r.position,hbe),h=d.clone(r.direction,mbe),p=d.clone(r.up,pbe);f.z=s.z;function g(y){Zf(f,s,y.time,r.position),Zf(h,a,y.time,r.direction),Zf(p,l,y.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right)}let m=o.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():bbe(e,0,n,u)}function xbe(e,t,n,i){let o=e._scene,r=o.camera,s=d.clone(r.position,hbe),a=d.clone(r.direction,mbe),l=d.clone(r.up,pbe),u=d.clone(n.position2D,cK),f=d.clone(n.direction2D,_be),h=d.clone(n.up2D,gbe);function p(m){Zf(s,u,m.time,r.position),Zf(a,f,m.time,r.direction),Zf(l,h,m.time,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let g=o.tweens.add({duration:t,easingFunction:Qr.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){Tbe(e,o,1,0,t,i)}});e._currentTweens.push(g)}function Tbe(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:Qr.QUARTIC_OUT};c(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function Abe(e){return function(t){let n=t._scene;n._mode=oe.SCENE3D,n.morphTime=oe.getMorphTime(oe.SCENE3D),G4(t);let i=n.camera;(t._previousMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE3D,r)}}function Cbe(e){return function(t){let n=t._scene;n._mode=oe.SCENE2D,n.morphTime=oe.getMorphTime(oe.SCENE2D),G4(t);let i=n.camera;d.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.SCENE2D,o)}}function i_t(e){return function(t){let n=t._scene;n._mode=oe.COLUMBUS_VIEW,n.morphTime=oe.getMorphTime(oe.COLUMBUS_VIEW),G4(t);let i=n.camera;(t._previousModeMode!==oe.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,d.clone(e.position,i.position),d.clone(e.direction,i.direction),d.clone(e.up,i.up),d.cross(i.direction,i.up,i.right),d.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=c(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,oe.COLUMBUS_VIEW,r)}}var j4=Rx;var o_t={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4},Vi=Object.freeze(o_t);function Xs(e,t){let n=`${e}`;return c(t)&&(n+=`+${t}`),n}function r_t(e,t){z.clone(e.distance.startPosition,t.distance.startPosition),z.clone(e.distance.endPosition,t.distance.endPosition),z.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),z.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function Ebe(e,t,n){let i=Xs(Vi.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,l=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new z;let u=e._movement[i];c(u)||(u=e._movement[i]={}),u.distance={startPosition:new z,endPosition:new z},u.angleAndHeight={startPosition:new z,endPosition:new z},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,r[i]=!0,a[i]=new Date,z.lerp(f.position1,f.position2,.5,s[i])},Cn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,l[i]=new Date},Cn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(r[i]){o[i]?(r_t(f,u),o[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(z.clone(f.distance.endPosition,u.distance.endPosition),z.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let h=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;h>=p+Math.PI;)h-=g;for(;h<p-Math.PI;)h+=g;u.angleAndHeight.endPosition.x=-h*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},Cn.PINCH_MOVE,t)}function Sbe(e,t){let n=Xs(Vi.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];c(s)||(s=e._movement[n]={});let a=e._lastMovement[n];c(a)||(a=e._lastMovement[n]={startPosition:new z,endPosition:new z,valid:!1}),s.startPosition=new z,z.clone(z.ZERO,s.startPosition),s.endPosition=new z,e._eventHandler.setInputAction(function(l){let u=7.5*O.toRadians(l);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,z.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},Cn.WHEEL,t)}function tS(e,t,n){let i=Xs(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new z;let a=e._lastMovement[i];c(a)||(a=e._lastMovement[i]={startPosition:new z,endPosition:new z,valid:!1});let l,u;n===Vi.LEFT_DRAG?(l=Cn.LEFT_DOWN,u=Cn.LEFT_UP):n===Vi.RIGHT_DRAG?(l=Cn.RIGHT_DOWN,u=Cn.RIGHT_UP):n===Vi.MIDDLE_DRAG&&(l=Cn.MIDDLE_DOWN,u=Cn.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,z.clone(f.position,r[i])},l,t),e._eventHandler.setInputAction(function(){lK(Xs(n,void 0),e);for(let f of Object.values(ba)){let h=Xs(n,f);lK(h,e)}},u,t)}function lK(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function wbe(e,t){z.clone(e.startPosition,t.startPosition),z.clone(e.endPosition,t.endPosition)}function s_t(e,t,n){let i=n._isDown,o=!1,r=Xs(e,t);for(let[l,u]of Object.entries(i))l.startsWith(e)&&u&&l!==r&&(o=!0,lK(l,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];c(a)||(a=n._lastMovement[r]={startPosition:new z,endPosition:new z,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function vbe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in Vi)if(Vi.hasOwnProperty(s)){let a=Vi[s];if(c(a)){let l=Xs(a,t);n[l]=!0,c(e._lastMovement[l])||(e._lastMovement[l]={startPosition:new z,endPosition:new z,valid:!1}),c(e._movement[l])||(e._movement[l]={startPosition:new z,endPosition:new z})}}e._eventHandler.setInputAction(function(s){for(let a in Vi)if(Vi.hasOwnProperty(a)){let l=Vi[a];if(c(l)){let u=Xs(l,t);s_t(l,t,e),r[u]&&(n[u]?(wbe(i[u],o[u]),o[u].valid=!0,wbe(s,i[u]),n[u]=!1):z.clone(s.endPosition,i[u].endPosition))}}z.clone(s.endPosition,e._currentMousePosition)},Cn.MOUSE_MOVE,t)}function Qf(e){if(!c(e))throw new C("canvas is required.");this._eventHandler=new $f(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new z,Sbe(this,void 0),Ebe(this,void 0,e),tS(this,void 0,Vi.LEFT_DRAG),tS(this,void 0,Vi.RIGHT_DRAG),tS(this,void 0,Vi.MIDDLE_DRAG),vbe(this,void 0);for(let t in ba)if(ba.hasOwnProperty(t)){let n=ba[t];c(n)&&(Sbe(this,n),Ebe(this,n,e),tS(this,n,Vi.LEFT_DRAG),tS(this,n,Vi.RIGHT_DRAG),tS(this,n,Vi.MIDDLE_DRAG),vbe(this,n))}}Object.defineProperties(Qf.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Xs(Vi.WHEEL)]||!this._update[Xs(Vi.WHEEL,ba.SHIFT)]||!this._update[Xs(Vi.WHEEL,ba.CTRL)]||!this._update[Xs(Vi.WHEEL,ba.ALT)];return this._buttonsDown>0||e}}});Qf.prototype.isMoving=function(e,t){if(!c(e))throw new C("type is required.");let n=Xs(e,t);return!this._update[n]};Qf.prototype.getMovement=function(e,t){if(!c(e))throw new C("type is required.");let n=Xs(e,t);return this._movement[n]};Qf.prototype.getLastMovement=function(e,t){if(!c(e))throw new C("type is required.");let n=Xs(e,t),i=this._lastMovement[n];if(i.valid)return i};Qf.prototype.isButtonDown=function(e,t){if(!c(e))throw new C("type is required.");let n=Xs(e,t);return this._isDown[n]};Qf.prototype.getStartMousePosition=function(e,t){if(!c(e))throw new C("type is required.");if(e===Vi.WHEEL)return this._currentMousePosition;let n=Xs(e,t);return this._eventStartPosition[n]};Qf.prototype.getButtonPressTime=function(e,t){if(!c(e))throw new C("type is required.");let n=Xs(e,t);return this._pressTime[n]};Qf.prototype.getButtonReleaseTime=function(e,t){if(!c(e))throw new C("type is required.");let n=Xs(e,t);return this._releaseTime[n]};Qf.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Qf.prototype.isDestroyed=function(){return!1};Qf.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),de(this)};var W4=Qf;function q4(e,t,n,i,o,r,s,a,l,u){this._tweens=e,this._tweenjs=t,this._startObject=We(n),this._stopObject=We(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=l,this.cancel=u,this.needsStart=!0}Object.defineProperties(q4.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});q4.prototype.cancelTween=function(){this._tweens.remove(this)};function dh(){this._tweens=[]}Object.defineProperties(dh.prototype,{length:{get:function(){return this._tweens.length}}});dh.prototype.add=function(e){if(e=e??W.EMPTY_OBJECT,!c(e.startObject)||!c(e.stopObject))throw new C("options.startObject and options.stopObject are required.");if(!c(e.duration)||e.duration<0)throw new C("options.duration is required and must be positive.");if(e.duration===0)return c(e.complete)&&e.complete(),new q4(this);let t=e.duration/qn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/qn.SECONDS_PER_MILLISECOND,o=e.easingFunction??Qr.LINEAR_NONE,r=e.startObject,s=new x_e(r);s.to(We(e.stopObject),t),s.delay(i),s.easing(o),c(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new q4(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};dh.prototype.addProperty=function(e){e=e??W.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;if(!c(t)||!c(e.property))throw new C("options.object and options.property are required.");if(!c(t[n]))throw new C("options.object must have the specified property.");if(!c(i)||!c(o))throw new C("options.startValue and options.stopValue are required.");function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};dh.prototype.addAlpha=function(e){e=e??W.EMPTY_OBJECT;let t=e.material;if(!c(t))throw new C("options.material is required.");let n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&c(t.uniforms[o])&&c(t.uniforms[o].alpha)&&n.push(o);if(n.length===0)throw new C("material has no properties with alpha components.");function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};dh.prototype.addOffsetIncrement=function(e){e=e??W.EMPTY_OBJECT;let t=e.material;if(!c(t))throw new C("material is required.");if(!c(t.uniforms.offset))throw new C("material.uniforms must have an offset property.");let n=t.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};dh.prototype.remove=function(e){if(!c(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),c(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};dh.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),c(n.cancel)&&n.cancel()}e.length=0};dh.prototype.contains=function(e){return c(e)&&this._tweens.indexOf(e)!==-1};dh.prototype.get=function(e){if(!c(e))throw new C("index is required.");return this._tweens[e]};dh.prototype.update=function(e){let t=this._tweens,n=0;for(e=c(e)?e/qn.SECONDS_PER_MILLISECOND:Ei();n<t.length;){let i=t[n],o=i.tweenjs;i.needsStart?(i.needsStart=!1,o.start(e)):o.update(e)?n++:(o.stop(),t.splice(n,1))}};var nS=dh;function TI(e){if(!c(e))throw new C("scene is required.");this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=Vi.LEFT_DRAG,this.zoomEventTypes=[Vi.RIGHT_DRAG,Vi.WHEEL,Vi.PINCH],this.rotateEventTypes=Vi.LEFT_DRAG,this.tiltEventTypes=[Vi.MIDDLE_DRAG,Vi.PINCH,{eventType:Vi.LEFT_DRAG,modifier:ba.CTRL},{eventType:Vi.RIGHT_DRAG,modifier:ba.CTRL}],this.lookEventTypes={eventType:Vi.LEFT_DRAG,modifier:ba.SHIFT};let t=e.ellipsoid??ie.default;this.minimumPickingTerrainHeight=ie.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ie.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ie.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ie.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new W4(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new nS,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new z(-1,-1),this._tiltCenter=new d,this._rotateMousePosition=new z(-1,-1),this._rotateStartPosition=new d,this._strafeStartPosition=new d,this._strafeMousePosition=new z,this._strafeEndMousePosition=new z,this._zoomMouseStart=new z(-1,-1),this._zoomWorldPosition=new d,this._useZoomWorldPosition=!1,this._panLastMousePosition=new z,this._panLastWorldPosition=new d,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new he(Math.PI,O.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function a_t(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function c_t(e){return z.equalsEpsilon(e.startPosition,e.endPosition,O.EPSILON14)}var l_t=.4;function u_t(e,t,n,i,o,r,s){let a=r[s];c(a)||(a=r[s]={startPosition:new z,endPosition:new z,motion:new z,inertiaEnabled:!0});let l=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=l&&u&&(u.getTime()-l.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(l&&u&&f<l_t){let g=a_t(p,i),m=e.getLastMovement(t,n);if(!c(m)||c_t(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=z.clone(m.startPosition,a.startPosition),a.endPosition=z.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=z.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||z.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);o(r,y,a)}}}function f_t(e,t){if(c(t)){let n=e[t];c(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(c(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],c(n)&&(n.inertiaEnabled=!1)}}}var Dbe=[];function el(e,t,n,i,o,r){if(!c(n))return;let s=e._aggregator;Array.isArray(n)||(Dbe[0]=n,n=Dbe);let a=n.length;for(let l=0;l<a;++l){let u=n[l],f=c(u.eventType)?u.eventType:u,h=u.modifier,p=s.isMoving(f,h)&&s.getMovement(f,h),g=s.getStartMousePosition(f,h);e.enableInputs&&t&&(p?(i(e,g,p),f_t(e,r)):o<1&&u_t(s,f,h,o,i,e,r))}}var Y4=new _n,d_t=new d,h_t=new z,m_t=new d,p_t=new z,__t=new d,g_t=new d,y_t=new d,b_t=new d,Vbe=new d,x_t=new d,T_t=new d,A_t=new d,C_t=new d,E_t=new d,S_t=new d,w_t=new d,v_t=new d,D_t=new d,P_t=new d,Mx=new d,Pbe=new d,Ibe=new d,uK={orientation:new Xa};function yK(e,t,n,i,o,r){let s=1;c(r)&&(s=O.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,h=o-u,p=i*h;p=O.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let m=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!c(e._globe)){if(m>0&&Math.abs(o-u)<1||m<0&&Math.abs(o-f)<1)return;o-m<u?m=o-u-1:o-m>f&&(m=o-f)}let y=e._scene,b=y.camera,x=y.mode,A=uK.orientation;A.heading=b.heading,A.pitch=b.pitch,A.roll=b.roll;let E=n.inertiaEnabled??z.equals(t,e._zoomMouseStart),S=e._zoomingOnVector,v=e._rotatingZoom,P;if(E||(e._zoomMouseStart=z.clone(t,e._zoomMouseStart),c(e._globe)&&x===oe.SCENE2D?(P=b.getPickRay(t,Y4).origin,P=d.fromElements(P.y,P.z,P.x)):c(e._globe)&&(P=v_(e,t,d_t)),c(P)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=d.clone(P,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,S=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){b.zoomIn(m);return}let M=x===oe.COLUMBUS_VIEW;if(b.positionCartographic.height<2e6&&(v=!0),!E||v){if(x===oe.SCENE2D){let R=e._zoomWorldPosition,L=b.position;if(!d.equals(R,L)&&b.positionCartographic.height<e._maxCoord.x*2){let B=b.position.x,_=d.subtract(R,L,m_t);d.normalize(_,_);let w=d.distance(R,L)*m/(b.getMagnitude()*.5);b.move(_,w*.5),(b.position.x<0&&B>0||b.position.x>0&&B<0)&&(P=b.getPickRay(t,Y4).origin,P=d.fromElements(P.y,P.z,P.x),e._zoomWorldPosition=d.clone(P,e._zoomWorldPosition))}}else if(x===oe.SCENE3D){let R=d.normalize(b.position,Vbe);if(e._cameraUnderground||e._zoomingUnderground||b.positionCartographic.height<3e3&&Math.abs(d.dot(b.direction,R))<.6)M=!0;else{let L=y.canvas,B=p_t;B.x=L.clientWidth/2,B.y=L.clientHeight/2;let _=v_(e,B,__t);if(!c(_))M=!0;else if(b.positionCartographic.height<1e6)if(d.dot(b.direction,R)>=-.5)M=!0;else{let w=T_t;d.clone(b.position,w);let D=e._zoomWorldPosition,I=x_t;if(I=d.normalize(D,I),d.dot(I,R)<0)return;let N=P_t,k=E_t;d.clone(b.direction,k),d.add(w,d.multiplyByScalar(k,1e3,Mx),N);let H=S_t,V=w_t;d.subtract(D,w,H),d.normalize(H,V);let j=d.dot(R,V);if(j>=0){e._zoomMouseStart.x=-1;return}let U=Math.acos(-j),q=d.magnitude(w),X=d.magnitude(D),te=q-m,K=d.magnitude(H),Z=Math.asin(O.clamp(K/X*Math.sin(U),-1,1)),ee=Math.asin(O.clamp(te/X*Math.sin(U),-1,1)),me=Z-ee+U,xe=A_t;d.normalize(w,xe);let ue=C_t;ue=d.cross(V,xe,ue),ue=d.normalize(ue,ue),d.normalize(d.cross(xe,ue,Mx),k),d.multiplyByScalar(d.normalize(N,Mx),d.magnitude(N)-m,N),d.normalize(w,w),d.multiplyByScalar(w,te,w);let ye=v_t;d.multiplyByScalar(d.add(d.multiplyByScalar(xe,Math.cos(me)-1,Pbe),d.multiplyByScalar(k,Math.sin(me),Ibe),Mx),te,ye),d.add(w,ye,w),d.normalize(N,xe),d.normalize(d.cross(xe,ue,Mx),k);let Ae=D_t;d.multiplyByScalar(d.add(d.multiplyByScalar(xe,Math.cos(me)-1,Pbe),d.multiplyByScalar(k,Math.sin(me),Ibe),Mx),d.magnitude(N),Ae),d.add(N,Ae,N),d.clone(w,b.position),d.normalize(d.subtract(N,w,Mx),b.direction),d.clone(b.direction,b.direction),d.cross(b.direction,b.up,b.right),d.cross(b.right,b.direction,b.up),b.setView(uK);return}else{let w=d.normalize(_,g_t),D=d.normalize(e._zoomWorldPosition,y_t),I=d.dot(D,w);if(I>0&&I<1){let N=O.acosClamped(I),k=d.cross(D,w,b_t),H=Math.abs(N)>O.toRadians(20)?b.positionCartographic.height*.75:b.positionCartographic.height-m,V=m/H;b.rotate(k,N*V)}}}}e._rotatingZoom=!M}if(!E&&M||S){let R,L=Hi.worldToWindowCoordinates(y,e._zoomWorldPosition,h_t);x!==oe.COLUMBUS_VIEW&&z.equals(t,e._zoomMouseStart)&&c(L)?R=b.getPickRay(L,Y4):R=b.getPickRay(t,Y4);let B=R.direction;(x===oe.COLUMBUS_VIEW||x===oe.SCENE2D)&&d.fromElements(B.y,B.z,B.x,B),b.move(B,m),e._zoomingOnVector=!0}else b.zoomIn(m);e._cameraUnderground||b.setView(uK)}var I_t=new _n,O_t=new _n,R_t=new d;function M_t(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,I_t).origin,s=o.getPickRay(n.endPosition,O_t).origin;r=d.fromElements(r.y,r.z,r.x,r),s=d.fromElements(s.y,s.z,s.x,s);let a=d.subtract(r,s,R_t),l=d.magnitude(a);l>0&&(d.normalize(a,a),o.move(a,l))}function Obe(e,t,n){c(n.distance)&&(n=n.distance);let o=e._scene.camera;yK(e,t,n,e.zoomFactor,o.getMagnitude())}var L_t=new z,N_t=new z;function Rbe(e,t,n){if(c(n.angleAndHeight)){F_t(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,l=L_t;l.x=2/s*n.startPosition.x-1,l.y=2/a*(a-n.startPosition.y)-1,l=z.normalize(l,l);let u=N_t;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=z.normalize(u,u);let f=O.acosClamped(l.x);l.y<0&&(f=O.TWO_PI-f);let h=O.acosClamped(u.x);u.y<0&&(h=O.TWO_PI-h);let p=h-f;o.twistRight(p)}function F_t(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let l=i*a*Math.PI*4;r.twistRight(l)}function B_t(e){let t=e._scene.mapMode2D===Pu.ROTATE;F.equals(F.IDENTITY,e._scene.camera.transform)?(el(e,e.enableTranslate,e.translateEventTypes,M_t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),el(e,e.enableZoom,e.zoomEventTypes,Obe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&el(e,e.enableRotate,e.tiltEventTypes,Rbe,e.inertiaSpin,"_lastInertiaTiltMovement")):(el(e,e.enableZoom,e.zoomEventTypes,Obe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&el(e,e.enableRotate,e.translateEventTypes,Rbe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var zbe=new _n,k_t=new d,U_t=new d;function v_(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,k_t)),!c(o))return d.clone(s,n);let a=!e._cameraUnderground,l=r.getPickRay(t,zbe),u=o.pickWorldCoordinates(l,i,a,U_t),f=c(s)?d.distance(s,r.positionWC):Number.POSITIVE_INFINITY,h=c(u)?d.distance(u,r.positionWC):Number.POSITIVE_INFINITY;return f<h?d.clone(s,n):d.clone(u,n)}var V_t=new he;function e8(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===oe.SCENE3D){let l=t.cartesianToCartographic(i.position,V_t);c(l)&&(r=l.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var z_t=new d;function Hbe(e,t){let n=t.origin,i=t.direction,o=e8(e),r=d.normalize(n,z_t),s=Math.abs(d.dot(r,i));return s=Math.max(s,.5)*2,o*s}function Gbe(e,t,n,i){let o=d.distance(t.origin,n),r=e8(e),s=O.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),_n.getPoint(t,o,i)}function jbe(e,t,n,i){let o;return c(n)?(o=d.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=e8(e))):o=e8(e),_n.getPoint(t,o,i)}var H_t=new z;function Wbe(e,t){let n=t.endPosition,i=z.subtract(t.endPosition,t.startPosition,H_t),o=e._strafeEndMousePosition;z.add(o,i,o),t.endPosition=o,bK(e,t,e._strafeStartPosition),t.endPosition=n}var Mbe=new _n,G_t=new _n,fK=new d,j_t=new d,W_t=new d,q_t=new d,Y_t=new sn(d.UNIT_X,0),X_t=new z,K_t=new z;function $_t(e,t,n){if(d.equals(t,e._translateMousePosition)||(e._looking=!1),d.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Lu(e,t,n);return}if(e._strafing){Wbe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=z.clone(n.startPosition,X_t),a=z.clone(n.endPosition,K_t),l=o.getPickRay(s,Mbe),u=d.clone(d.ZERO,q_t),f=d.UNIT_X,h;if(o.position.z<e._minimumPickingTerrainHeight&&(h=v_(e,s,fK),c(h)&&(u.x=h.x)),r||u.x>o.position.z&&c(h)){let E=h;r&&(E=jbe(e,l,h,fK)),z.clone(t,e._strafeMousePosition),z.clone(t,e._strafeEndMousePosition),d.clone(E,e._strafeStartPosition),e._strafing=!0,bK(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(u,f,Y_t);l=o.getPickRay(s,Mbe);let g=Qn.rayPlane(l,p,fK),m=o.getPickRay(a,G_t),y=Qn.rayPlane(m,p,j_t);if(!c(g)||!c(y)){e._looking=!0,Lu(e,t,n),z.clone(t,e._translateMousePosition);return}let b=d.subtract(g,y,W_t),x=b.x;b.x=b.y,b.y=b.z,b.z=x;let A=d.magnitude(b);A>O.EPSILON6&&(d.normalize(b,b),o.move(b,A))}var qbe=new z,$4=new _n,Z4=new d,Z_t=new d,Ybe=new F,Q_t=new F,J_t=new d,egt=new sn(d.UNIT_X,0),dK=new d,pK=new he,Xbe=new F,tgt=new Le,ngt=new J,Q4=new d;function igt(e,t,n){if(c(n.angleAndHeight)&&(n=n.angleAndHeight),z.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Lu(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,ogt(e,t,n)):rgt(e,t,n)}function ogt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=qbe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,$4),l=d.UNIT_X,u=a.origin,f=a.direction,h,p=d.dot(l,f);if(Math.abs(p)>O.EPSILON6&&(h=-d.dot(l,u)/p),!c(h)||h<=0){e._looking=!0,Lu(e,t,n),z.clone(t,e._tiltCenterMousePosition);return}let g=d.multiplyByScalar(f,h,Z4);d.add(u,g,g);let m=i.mapProjection,y=m.ellipsoid;d.fromElements(g.y,g.z,g.x,g);let b=m.unproject(g,pK);y.cartographicToCartesian(b,g);let x=Ot.eastNorthUpToFixedFrame(g,y,Ybe),A=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let S=F.clone(o.transform,Xbe);o._setTransform(x),Mu(e,t,n,d.UNIT_Z),o._setTransform(S),e._globe=A,e._ellipsoid=E;let v=E.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function rgt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,l=d.UNIT_X;if(z.equals(t,e._tiltCenterMousePosition))s=d.clone(e._tiltCenter,Z4);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=v_(e,t,Z4)),!c(s)){a=o.getPickRay(t,$4);let _=a.origin,w=a.direction,D,I=d.dot(l,w);if(Math.abs(I)>O.EPSILON6&&(D=-d.dot(l,_)/I),!c(D)||D<=0){e._looking=!0,Lu(e,t,n),z.clone(t,e._tiltCenterMousePosition);return}s=d.multiplyByScalar(w,D,Z4),d.add(_,s,s)}r&&(c(a)||(a=o.getPickRay(t,$4)),Gbe(e,a,s,s)),z.clone(t,e._tiltCenterMousePosition),d.clone(s,e._tiltCenter)}let u=i.canvas,f=qbe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=o.getPickRay(f,$4);let h=d.clone(d.ZERO,J_t);h.x=s.x;let p=sn.fromPointNormal(h,l,egt),g=Qn.rayPlane(a,p,Z_t),m=o._projection,y=m.ellipsoid;d.fromElements(s.y,s.z,s.x,s);let b=m.unproject(s,pK);y.cartographicToCartesian(b,s);let x=Ot.eastNorthUpToFixedFrame(s,y,Ybe),A;c(g)?(d.fromElements(g.y,g.z,g.x,g),b=m.unproject(g,pK),y.cartographicToCartesian(b,g),A=Ot.eastNorthUpToFixedFrame(g,y,Q_t)):A=x;let E=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=d.UNIT_Z,P=F.clone(o.transform,Xbe);o._setTransform(x);let M=d.cross(d.UNIT_Z,d.normalize(o.position,dK),dK),R=d.dot(o.right,M);if(Mu(e,t,n,v,!1,!0),o._setTransform(A),R<0){let _=n.startPosition.y-n.endPosition.y;(r&&_<0||!r&&_>0)&&(v=void 0);let w=o.constrainedAxis;o.constrainedAxis=void 0,Mu(e,t,n,v,!0,!1),o.constrainedAxis=w}else Mu(e,t,n,v,!0,!1);if(c(o.constrainedAxis)){let _=d.cross(o.direction,o.constrainedAxis,Q4);d.equalsEpsilon(_,d.ZERO,O.EPSILON6)||(d.dot(_,o.right)<0&&d.negate(_,_),d.cross(_,o.direction,o.up),d.cross(o.direction,o.up,o.right),d.normalize(o.up,o.up),d.normalize(o.right,o.right))}o._setTransform(P),e._globe=E,e._ellipsoid=S;let L=S.maximumRadius;e._rotateFactor=1/L,e._rotateRateRangeAdjustment=L;let B=d.clone(o.positionWC,dK);if(e.enableCollisionDetection&&AK(e,!0),!d.equals(o.positionWC,B)){o._setTransform(A),o.worldToCameraCoordinatesPoint(B,B);let _=d.magnitudeSquared(B);d.magnitudeSquared(o.position)>_&&(d.normalize(o.position,o.position),d.multiplyByScalar(o.position,Math.sqrt(_),o.position));let w=d.angleBetween(B,o.position),D=d.cross(B,o.position,B);d.normalize(D,D);let I=Le.fromAxisAngle(D,w,tgt),N=J.fromQuaternion(I,ngt);J.multiplyByVector(N,o.direction,o.direction),J.multiplyByVector(N,o.up,o.up),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up),o._setTransform(P)}}var Kbe=new z,$be=new _n,Zbe=new d;function sgt(e,t,n){c(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=Kbe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let l=o.getPickRay(a,$be),u=l.origin,f=l.direction,h=o.position.z,p;h<e._minimumPickingTerrainHeight&&(p=v_(e,a,Zbe));let g;if(c(p)&&(g=d.distance(u,p)),s){let m=Hbe(e,l,h);c(g)?g=Math.min(g,m):g=m}if(!c(g)){let m=d.UNIT_X;g=-d.dot(m,u)/d.dot(m,f)}yK(e,t,n,e.zoomFactor,g)}function agt(e){let n=e._scene.camera;if(!F.equals(F.IDENTITY,n.transform))el(e,e.enableRotate,e.rotateEventTypes,Mu,e.inertiaSpin,"_lastInertiaSpinMovement"),el(e,e.enableZoom,e.zoomEventTypes,Jbe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),el(e,e.enableTilt,e.tiltEventTypes,igt,e.inertiaSpin,"_lastInertiaTiltMovement"),el(e,e.enableTranslate,e.translateEventTypes,$_t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),el(e,e.enableZoom,e.zoomEventTypes,sgt,e.inertiaZoom,"_lastInertiaZoomMovement"),el(e,e.enableLook,e.lookEventTypes,Lu),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);c(o)&&(e._tween=i.add(o))}i.update()}}var cgt=new _n,lgt=new sn(d.UNIT_X,0),ugt=new d,fgt=new d;function bK(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,cgt),s=d.clone(o.direction,fgt);i.mode===oe.COLUMBUS_VIEW&&d.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,lgt),l=Qn.rayPlane(r,a,ugt);c(l)&&(s=d.subtract(n,l,s),i.mode===oe.COLUMBUS_VIEW&&d.fromElements(s.y,s.z,s.x,s),d.add(o.position,s,o.position))}var Lbe=new d,Qbe=new he,_K=new d,gK=new ie,dgt=new d,hgt=new d,mgt=new d;function pgt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!F.equals(o.transform,F.IDENTITY)){Mu(e,t,n);return}let a,l,u=s.geodeticSurfaceNormal(o.position,dgt);if(z.equals(t,e._rotateMousePosition)){if(e._looking)Lu(e,t,n,u);else if(e._rotating)Mu(e,t,n);else if(e._strafing)Wbe(e,n);else{if(d.magnitude(o.position)<d.magnitude(e._rotateStartPosition))return;a=d.magnitude(e._rotateStartPosition),l=_K,l.x=l.y=l.z=a,s=ie.fromCartesian3(l,gK),mK(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(o.positionWC,Qbe).height,h=e._globe;if(c(h)&&f<e._minimumPickingTerrainHeight){let p=v_(e,n.startPosition,mgt);if(c(p)){let g=!1,m=o.getPickRay(n.startPosition,zbe);if(r)g=!0,jbe(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,hgt);Math.abs(d.dot(m.direction,y))<.05?g=!0:g=d.magnitude(o.position)<d.magnitude(p)}g?(z.clone(t,e._strafeEndMousePosition),d.clone(p,e._strafeStartPosition),e._strafing=!0,bK(e,n,e._strafeStartPosition)):(a=d.magnitude(p),l=_K,l.x=l.y=l.z=a,s=ie.fromCartesian3(l,gK),mK(e,t,n,s),d.clone(p,e._rotateStartPosition))}else e._looking=!0,Lu(e,t,n,u)}else c(o.pickEllipsoid(n.startPosition,e._ellipsoid,Lbe))?(mK(e,t,n,e._ellipsoid),d.clone(Lbe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Mu(e,t,n)):(e._looking=!0,Lu(e,t,n,u));z.clone(t,e._rotateMousePosition)}function Mu(e,t,n,i,o,r){o=o??!1,r=r??!1;let s=e._scene,a=s.camera,l=s.canvas,u=a.constrainedAxis;c(i)&&(a.constrainedAxis=i);let f=d.magnitude(a.position),h=e._rotateFactor*(f-e._rotateRateRangeAdjustment);h>e._maximumRotateRate&&(h=e._maximumRotateRate),h<e._minimumRotateRate&&(h=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/l.clientWidth,g=(n.startPosition.y-n.endPosition.y)/l.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let m=h*p*Math.PI*2,y=h*g*Math.PI;if(c(i)&&c(e.maximumTiltAngle)){let b=e.maximumTiltAngle,x=d.dot(a.direction,i),A=Math.PI-Math.acos(x)+y;A>b&&(y-=A-b)}o||a.rotateRight(m),r||a.rotateUp(y),a.constrainedAxis=u}var hK=se.clone(se.UNIT_W),Nbe=se.clone(se.UNIT_W),X4=new d,iS=new d,K4=new d,Fbe=new d,_gt=new z,ggt=new z,ygt=new z,bgt=new z,xgt=new _n;function mK(e,t,n,i){let o=e._scene,r=o.camera,s=z.clone(n.startPosition,_gt),a=z.clone(n.endPosition,ggt),l=i.cartesianToCartographic(r.positionWC,Qbe).height,u,f;if(!n.inertiaEnabled&&l<e._minimumPickingTerrainHeight&&(u=d.clone(e._panLastWorldPosition,hK),!c(e._globe)&&!z.equalsEpsilon(s,e._panLastMousePosition)&&(u=v_(e,s,hK)),!c(e._globe)&&c(u))){let h=d.subtract(u,r.positionWC,iS),p=d.multiplyByScalar(r.directionWC,d.dot(r.directionWC,h),iS),g=d.magnitude(p),m=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,g,o.pixelRatio,bgt),y=z.subtract(a,s,ygt),b=d.multiplyByScalar(r.rightWC,y.x*m.x,iS),x=d.normalize(r.positionWC,Vbe),A=r.getPickRay(a,xgt).direction,E=d.subtract(A,d.projectVector(A,r.rightWC,K4),K4),S=d.angleBetween(E,r.directionWC),v=1;c(r.frustum.fov)&&(v=Math.max(Math.tan(S),.1));let P=Math.abs(d.dot(r.directionWC,x)),M=-y.y*m.y*2/Math.sqrt(v)*(1-P),R=d.multiplyByScalar(A,M,K4);P=Math.abs(d.dot(r.upWC,x));let L=d.multiplyByScalar(r.upWC,-y.y*(1-P)*m.y,Fbe);f=d.add(u,b,Nbe),f=d.add(f,R,f),f=d.add(f,L,f),d.clone(f,e._panLastWorldPosition),z.clone(a,e._panLastMousePosition)}if((!c(u)||!c(f))&&(u=r.pickEllipsoid(s,i,hK),f=r.pickEllipsoid(a,i,Nbe)),!c(u)||!c(f)){e._rotating=!0,Mu(e,t,n);return}if(u=r.worldToCameraCoordinates(u,u),f=r.worldToCameraCoordinates(f,f),c(r.constrainedAxis)){let h=r.constrainedAxis,p=d.mostOrthogonalAxis(h,X4);d.cross(p,h,p),d.normalize(p,p);let g=d.cross(h,p,iS),m=d.magnitude(u),y=d.dot(h,u),b=Math.acos(y/m),x=d.multiplyByScalar(h,y,K4);d.subtract(u,x,x),d.normalize(x,x);let A=d.magnitude(f),E=d.dot(h,f),S=Math.acos(E/A),v=d.multiplyByScalar(h,E,Fbe);d.subtract(f,v,v),d.normalize(v,v);let P=Math.acos(d.dot(x,p));d.dot(x,g)<0&&(P=O.TWO_PI-P);let M=Math.acos(d.dot(v,p));d.dot(v,g)<0&&(M=O.TWO_PI-M);let R=P-M,L;d.equalsEpsilon(h,r.position,O.EPSILON2)?L=r.right:L=d.cross(h,r.position,X4);let B=d.cross(h,L,X4),_=d.dot(B,d.subtract(u,h,iS)),w=d.dot(B,d.subtract(f,h,iS)),D;_>0&&w>0?D=S-b:_>0&&w<=0?d.dot(r.position,h)>0?D=-b-S:D=b+S:D=b-S,r.rotateRight(R),r.rotateUp(D)}else{d.normalize(u,u),d.normalize(f,f);let h=d.dot(u,f),p=d.cross(u,f,X4);if(h<1&&!d.equalsEpsilon(p,d.ZERO,O.EPSILON14)){let g=Math.acos(h);r.rotate(p,g)}}}var Tgt=new d,Agt=new he,Bbe=0;function Jbe(e,t,n){c(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,l=e._cameraUnderground,u;l?u=t:(u=Kbe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,$be),h,p=o.cartesianToCartographic(s.position,Agt).height,g=Math.abs(Bbe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(h=v_(e,u,Zbe));let y;if(c(h)&&(y=d.distance(f.origin,h),Bbe=y),l){let x=Hbe(e,f,p);c(y)?y=Math.min(y,x):y=x}c(y)||(y=p);let b=d.normalize(s.position,Tgt);yK(e,t,n,e.zoomFactor,y,d.dot(b,s.direction))}var exe=new z,J4=new _n,xI=new d,Cgt=new d,txe=new F,Egt=new F,nxe=new F,Sgt=new Le,wgt=new J,xK=new he,TK=new d;function vgt(e,t,n){let o=e._scene.camera;if(!F.equals(o.transform,F.IDENTITY))return;if(c(n.angleAndHeight)&&(n=n.angleAndHeight),z.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,TK);Lu(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,xK);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,Pgt(e,t,n)):Igt(e,t,n)}var Dgt=new he;function Pgt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,Dgt).height;if(a-s-1<O.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let l=o.canvas,u=exe;u.x=l.clientWidth/2,u.y=l.clientHeight/2;let f=r.getPickRay(u,J4),h,p=Qn.rayEllipsoid(f,i);if(c(p))h=_n.getPoint(f,p.start,xI);else if(a>e._minimumTrackBallHeight){let A=Qn.grazingAltitudeLocation(f,i);if(!c(A))return;let E=i.cartesianToCartographic(A,xK);E.height=0,h=i.cartographicToCartesian(E,xI)}else{e._looking=!0;let A=e._ellipsoid.geodeticSurfaceNormal(r.position,TK);Lu(e,t,n,A),z.clone(t,e._tiltCenterMousePosition);return}let g=Ot.eastNorthUpToFixedFrame(h,i,txe),m=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let b=F.clone(r.transform,nxe);r._setTransform(g),Mu(e,t,n,d.UNIT_Z),r._setTransform(b),e._globe=m,e._ellipsoid=y;let x=y.maximumRadius;e._rotateFactor=1/x,e._rotateRateRangeAdjustment=x}function Igt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,l,u;if(z.equals(t,e._tiltCenterMousePosition))a=d.clone(e._tiltCenter,xI);else{if(a=v_(e,t,xI),!c(a)){if(l=r.getPickRay(t,J4),u=Qn.rayEllipsoid(l,i),!c(u)){if(i.cartesianToCartographic(r.position,xK).height<=e._minimumTrackBallHeight){e._looking=!0;let w=e._ellipsoid.geodeticSurfaceNormal(r.position,TK);Lu(e,t,n,w),z.clone(t,e._tiltCenterMousePosition)}return}a=_n.getPoint(l,u.start,xI)}s&&(c(l)||(l=r.getPickRay(t,J4)),Gbe(e,l,a,a)),z.clone(t,e._tiltCenterMousePosition),d.clone(a,e._tiltCenter)}let f=o.canvas,h=exe;h.x=f.clientWidth/2,h.y=e._tiltCenterMousePosition.y,l=r.getPickRay(h,J4);let p=d.magnitude(a),g=d.fromElements(p,p,p,_K),m=ie.fromCartesian3(g,gK);if(u=Qn.rayEllipsoid(l,m),!c(u))return;let y=d.magnitude(l.origin)>p?u.start:u.stop,b=_n.getPoint(l,y,Cgt),x=Ot.eastNorthUpToFixedFrame(a,i,txe),A=Ot.eastNorthUpToFixedFrame(b,m,Egt),E=e._globe,S=e._ellipsoid;e._globe=void 0,e._ellipsoid=ie.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=d.UNIT_Z,P=F.clone(r.transform,nxe);r._setTransform(A);let M=d.cross(b,r.positionWC,Q4);if(d.dot(r.rightWC,M)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(v=void 0);let w=r.constrainedAxis;r.constrainedAxis=void 0,Mu(e,t,n,v,!0,!1),r.constrainedAxis=w}else Mu(e,t,n,v,!0,!1);if(r._setTransform(x),Mu(e,t,n,v,!1,!0),c(r.constrainedAxis)){let _=d.cross(r.direction,r.constrainedAxis,Q4);d.equalsEpsilon(_,d.ZERO,O.EPSILON6)||(d.dot(_,r.right)<0&&d.negate(_,_),d.cross(_,r.direction,r.up),d.cross(r.direction,r.up,r.right),d.normalize(r.up,r.up),d.normalize(r.right,r.right))}r._setTransform(P),e._globe=E,e._ellipsoid=S;let L=S.maximumRadius;e._rotateFactor=1/L,e._rotateRateRangeAdjustment=L;let B=d.clone(r.positionWC,Q4);if(e.enableCollisionDetection&&AK(e,!0),!d.equals(r.positionWC,B)){r._setTransform(A),r.worldToCameraCoordinatesPoint(B,B);let _=d.magnitudeSquared(B);d.magnitudeSquared(r.position)>_&&(d.normalize(r.position,r.position),d.multiplyByScalar(r.position,Math.sqrt(_),r.position));let w=d.angleBetween(B,r.position),D=d.cross(B,r.position,B);d.normalize(D,D);let I=Le.fromAxisAngle(D,w,Sgt),N=J.fromQuaternion(I,wgt);J.multiplyByVector(N,r.direction,r.direction),J.multiplyByVector(N,r.up,r.up),d.cross(r.direction,r.up,r.right),d.cross(r.right,r.direction,r.up),r._setTransform(P)}}var Ogt=new z,Rgt=new z,kbe=new _n,Ube=new _n,Mgt=new d,Lgt=new d;function Lu(e,t,n,i){let r=e._scene.camera,s=Ogt;s.x=n.startPosition.x,s.y=0;let a=Rgt;a.x=n.endPosition.x,a.y=0;let l=r.getPickRay(s,kbe),u=r.getPickRay(a,Ube),f=0,h,p;r.frustum instanceof on?(h=l.origin,p=u.origin,d.add(r.direction,h,h),d.add(r.direction,p,p),d.subtract(h,r.position,h),d.subtract(p,r.position,p),d.normalize(h,h),d.normalize(p,p)):(h=l.direction,p=u.direction);let g=d.dot(h,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(c(i)?r.look(i,-f):c(m)?r.look(m,-f):r.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,l=r.getPickRay(s,kbe),u=r.getPickRay(a,Ube),f=0,r.frustum instanceof on?(h=l.origin,p=u.origin,d.add(r.direction,h,h),d.add(r.direction,p,p),d.subtract(h,r.position,h),d.subtract(p,r.position,p),d.normalize(h,h),d.normalize(p,p)):(h=l.direction,p=u.direction),g=d.dot(h,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,c(i)){let y=r.direction,b=d.negate(i,Mgt),x=d.equalsEpsilon(y,i,O.EPSILON2),A=d.equalsEpsilon(y,b,O.EPSILON2);if(!x&&!A){g=d.dot(y,i);let E=O.acosClamped(g);f>0&&f>E&&(f=E-O.EPSILON4),g=d.dot(y,b),E=O.acosClamped(g),f<0&&-f>E&&(f=-E+O.EPSILON4);let S=d.cross(i,y,Lgt);r.look(S,f)}else(x&&f<0||A&&f>0)&&r.look(r.right,-f)}else r.lookUp(f)}function Ngt(e){el(e,e.enableRotate,e.rotateEventTypes,pgt,e.inertiaSpin,"_lastInertiaSpinMovement"),el(e,e.enableZoom,e.zoomEventTypes,Jbe,e.inertiaZoom,"_lastInertiaZoomMovement"),el(e,e.enableTilt,e.tiltEventTypes,vgt,e.inertiaSpin,"_lastInertiaTiltMovement"),el(e,e.enableLook,e.lookEventTypes,Lu)}var Fgt=new F,Bgt=new he;function AK(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===oe.SCENE2D||i===oe.MORPHING)return;let o=n.camera,r=n.ellipsoid??ie.WGS84,s=n.mapProjection,a,l;F.equals(o.transform,F.IDENTITY)||(a=F.clone(o.transform,Fgt),l=d.magnitude(o.position),o._setTransform(F.IDENTITY));let u=Bgt;i===oe.SCENE3D?r.cartesianToCartographic(o.position,u):s.unproject(o.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let h=e._scene.globeHeight;if(c(h)){let p=h+e.minimumZoomDistance,g=h-e._lastGlobeHeight,m=g/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===oe.SCENE3D?r.cartographicToCartesian(u,o.position):s.project(u,o.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=h:e._lastGlobeHeight+=g*.1}}c(a)&&(o._setTransform(a),f&&(d.normalize(o.position,o.position),d.negate(o.position,o.direction),d.multiplyByScalar(o.position,Math.max(l,e.minimumZoomDistance),o.position),d.normalize(o.direction,o.direction),d.cross(o.direction,o.up,o.right),d.cross(o.right,o.direction,o.up)))}TI.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===oe.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var kgt=new d,Ugt=new d;TI.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;F.equals(t.transform,F.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??ie.default):(this._globe=void 0,this._ellipsoid=ie.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=Rr.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=Rr.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=Rr.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&c(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=d.clone(t.positionWC,kgt),l=d.clone(t.directionWC,Ugt);if(i===oe.SCENE2D?B_t(this):i===oe.COLUMBUS_VIEW?(this._horizontalRotationAxis=d.UNIT_Z,agt(this)):i===oe.SCENE3D&&(this._horizontalRotationAxis=void 0,Ngt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!d.equals(a,t.positionWC)||!d.equals(l,t.directionWC);AK(this,u)}this._aggregator.reset()};TI.prototype.isDestroyed=function(){return!1};TI.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),de(this)};var t8=TI;var n8=`uniform sampler2D colorTexture;
uniform sampler2D colorTexture2;
uniform vec2 center;
uniform float radius;
in vec2 v_textureCoordinates;
void main()
{
vec4 color0 = texture(colorTexture, v_textureCoordinates);
vec4 color1 = texture(colorTexture2, v_textureCoordinates);
float x = length(gl_FragCoord.xy - center) / radius;
float t = smoothstep(0.5, 0.8, x);
out_FragColor = mix(color0 + color1, color1, t);
}
`;var i8=`uniform sampler2D colorTexture;
uniform float avgLuminance;
uniform float threshold;
uniform float offset;
in vec2 v_textureCoordinates;
float key(float avg)
{
float guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));
return max(0.0, guess) + 0.1;
}
void main()
{
vec4 color = texture(colorTexture, v_textureCoordinates);
vec3 xyz = czm_RGBToXYZ(color.rgb);
float luminance = xyz.r;
float scaledLum = key(avgLuminance) * luminance / avgLuminance;
float brightLum = max(scaledLum - threshold, 0.0);
float brightness = brightLum / (offset + brightLum);
xyz.r = brightness;
out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);
}
`;function D_(){this._sceneFramebuffer=new KE;let e=.125,t=new Array(6);t[0]=new fo({fragmentShader:Iu,textureScale:e,forcePowerOfTwo:!0,sampleMode:Xf.LINEAR});let n=t[1]=new fo({fragmentShader:i8,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new z,t[2]=new fo({fragmentShader:wx,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new fo({fragmentShader:wx,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new fo({fragmentShader:Iu,sampleMode:Xf.LINEAR}),this._uCenter=new z,this._uRadius=void 0,t[5]=new fo({fragmentShader:n8,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Ou({stages:t});let o=new JE(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}D_.prototype.get=function(e){return this._stages.get(e)};D_.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var Vgt=new se,ixe=new z,zgt=new z,oxe=new F;function Hgt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,l=F.computeViewportTransformation(n,0,1,oxe),u=F.multiplyByPoint(r,o,Vgt),f=Ot.pointToGLWindowCoordinates(s,l,o,ixe);u.x+=O.SOLAR_RADIUS;let h=Ot.pointToGLWindowCoordinates(a,l,u,u),p=z.magnitude(z.subtract(h,f,h))*30*2,g=zgt;g.x=p,g.y=p,e._uCenter=z.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,y=t.drawingBufferHeight,b=e._stages,x=b.get(0),A=x.outputTexture.width,E=x.outputTexture.height,S=new Ke;S.width=A,S.height=E,l=F.computeViewportTransformation(S,0,1,oxe),f=Ot.pointToGLWindowCoordinates(s,l,o,ixe),g.x*=A/m,g.y*=E/y;let v=x.scissorRectangle;v.x=Math.max(f.x-g.x*.5,0),v.y=Math.max(f.y-g.y*.5,0),v.width=Math.min(g.x,m),v.height=Math.min(g.y,y);for(let P=1;P<4;++P)Ke.clone(v,b.get(P).scissorRectangle)}D_.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};D_.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),Hgt(this,t,n),o};D_.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};D_.prototype.copy=function(e,t){if(!c(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Iu,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};D_.prototype.isDestroyed=function(){return!1};D_.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),de(this)};var o8=D_;function rxe(){this._cachedShowFrustumsShaders={}}function Ggt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function jgt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(f){f=He.replaceMain(f,"czm_Debug_main");let h=/out_FragData_(\d+)/g,p;for(;(p=h.exec(f))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return f});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor;
`,a+=`uniform vec3 debugShowFrustumsColor;
`,a+=`void main()
{
czm_Debug_main();
`;let l;if(s>0)for(l=0;l<s;++l)a+=` out_FragData_${r[l]}.rgb *= debugShowCommandsColor;
`,a+=` out_FragData_${r[l]}.rgb *= debugShowFrustumsColor;
`;else a+=` out_FragColor.rgb *= debugShowCommandsColor;
`,a+=` out_FragColor.rgb *= debugShowFrustumsColor;
`;a+="}",o.sources.push(a);let u=Ggt(i);return en.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:u})}var AI=new G;function Wgt(e,t){let n;return c(t.uniformMap)?n=t.uniformMap:n={},c(n.debugShowCommandsColor)||c(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(c(t._debugColor)||(t._debugColor=G.fromRandom()),t._debugColor):G.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(AI.red=t.debugOverlappingFrustums&1?1:0,AI.green=t.debugOverlappingFrustums&2?1:0,AI.blue=t.debugOverlappingFrustums&4?1:0,AI.alpha=1,AI):G.WHITE}),n}var qgt=new Je;rxe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];c(o)||(o=jgt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=Je.shallowClone(t,qgt);r.shaderProgram=o,r.uniformMap=Wgt(e,t),r.execute(e.context,n)};var r8=rxe;function Lx(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new Pn}Lx.fromKeyframeNode=function(e,t,n,i){T.typeOf.object("primitive",e),T.typeOf.number("tileIndex",t),T.typeOf.number("sampleIndex",n),T.typeOf.object("keyframeNode",i);let o=new Lx(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=Ygt(e,s,n),o._orientedBoundingBox=Kgt(e,r,n,o._orientedBoundingBox),o};function Ygt(e,t,n){if(!c(t)||!c(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,s={};for(let a=0;a<i.length;a++){let l=i[a],u=at.getComponentCount(o[a]),f=r[a].slice(n*u,(n+1)*u);s[l]=f}return s}var sxe=new d,Xgt=new d;function Kgt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,l=Math.floor(a/o.x),u=a-l*o.x,f=d.fromElements(u,l,s,sxe),h=d.divideComponents(d.subtract(f,e._paddingBefore,sxe),e.dimensions,Xgt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,h,i)}Object.defineProperties(Lx.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});Lx.prototype.hasProperty=function(e){return c(this._metadata[e])};Lx.prototype.getNames=function(){return Object.keys(this._metadata)};Lx.prototype.getProperty=function(e){return this._metadata[e]};var s8=Lx;var a8=`struct Ray {
vec3 pos;
vec3 dir;
vec3 rawDir;
};
#if defined(JITTER)
float hash(vec2 p)
{
vec3 p3 = fract(vec3(p.xyx) * 50.0);
p3 += dot(p3, p3.yzx + 19.19);
return fract((p3.x + p3.y) * p3.z);
}
#endif
float minComponent(in vec3 v) {
return min(min(v.x, v.y), v.z);
}
float maxComponent(in vec3 v) {
return max(max(v.x, v.y), v.z);
}
struct PointJacobianT {
vec3 point;
mat3 jacobianT;
};
`;var c8=`#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops
#if defined(PICKING_VOXEL)
#define ALPHA_ACCUM_MAX 0.1
#else
#define ALPHA_ACCUM_MAX 0.98 // Must be > 0.0 and <= 1.0
#endif
uniform mat3 u_transformDirectionViewToLocal;
uniform vec3 u_cameraPositionUv;
uniform float u_stepSize;
#if defined(PICKING)
uniform vec4 u_pickColor;
#endif
vec3 getSampleSize(in int level) {
vec3 sampleCount = exp2(float(level)) * vec3(u_dimensions);
vec3 sampleSizeUv = 1.0 / sampleCount;
return scaleShapeUvToShapeSpace(sampleSizeUv);
}
#define MINIMUM_STEP_SCALAR (0.02)
#define SHIFT_FRACTION (0.001)
RayShapeIntersection getVoxelIntersection(in vec3 tileUv, in vec3 sampleSizeAlongRay) {
vec3 voxelCoord = tileUv * vec3(u_dimensions);
vec3 directions = sign(sampleSizeAlongRay);
vec3 positiveDirections = max(directions, 0.0);
vec3 entryCoord = mix(ceil(voxelCoord), floor(voxelCoord), positiveDirections);
vec3 exitCoord = entryCoord + directions;
vec3 distanceFromEntry = -abs((entryCoord - voxelCoord) * sampleSizeAlongRay);
float lastEntry = maxComponent(distanceFromEntry);
bvec3 isLastEntry = equal(distanceFromEntry, vec3(lastEntry));
vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;
vec4 entry = vec4(entryNormal, lastEntry);
vec3 distanceToExit = abs((exitCoord - voxelCoord) * sampleSizeAlongRay);
float firstExit = minComponent(distanceToExit);
bvec3 isFirstExit = equal(distanceToExit, vec3(firstExit));
vec3 exitNormal = vec3(isFirstExit) * directions;
vec4 exit = vec4(exitNormal, firstExit);
return RayShapeIntersection(entry, exit);
}
vec4 getStepSize(in SampleData sampleData, in Ray viewRay, in RayShapeIntersection shapeIntersection, in mat3 jacobianT, in float currentT) {
vec3 gradient = 2.0 * viewRay.rawDir * jacobianT;
vec3 sampleSizeAlongRay = getSampleSize(sampleData.tileCoords.w) / gradient;
RayShapeIntersection voxelIntersection = getVoxelIntersection(sampleData.tileUv, sampleSizeAlongRay);
vec3 voxelNormal = normalize(jacobianT * voxelIntersection.entry.xyz);
vec4 voxelEntry = vec4(voxelNormal, currentT + voxelIntersection.entry.w);
vec4 entry = intersectionMax(shapeIntersection.entry, voxelEntry);
float fixedStep = minComponent(abs(sampleSizeAlongRay)) * u_stepSize;
float shift = fixedStep * SHIFT_FRACTION;
float dt = voxelIntersection.exit.w + shift;
if ((currentT + dt) > shapeIntersection.exit.w) {
dt = shapeIntersection.exit.w - currentT + shift;
}
float stepSize = clamp(dt, fixedStep * MINIMUM_STEP_SCALAR, fixedStep + shift);
return vec4(entry.xyz, stepSize);
}
vec2 packIntToVec2(int value) {
float shifted = float(value) / 255.0;
float lowBits = fract(shifted);
float highBits = floor(shifted) / 255.0;
return vec2(highBits, lowBits);
}
vec2 packFloatToVec2(float value) {
float lowBits = fract(value);
float highBits = floor(value) / 255.0;
return vec2(highBits, lowBits);
}
int getSampleIndex(in SampleData sampleData) {
vec3 maxCoordinate = vec3(u_inputDimensions) - vec3(0.5);
vec3 inputCoordinate = clamp(sampleData.inputCoordinate, vec3(0.0), maxCoordinate);
ivec3 sampleIndex = ivec3(floor(inputCoordinate));
return sampleIndex.x + u_inputDimensions.x * (sampleIndex.y + u_inputDimensions.y * sampleIndex.z);
}
void main()
{
vec4 fragCoord = gl_FragCoord;
vec2 screenCoord = (fragCoord.xy - czm_viewport.xy) / czm_viewport.zw;
vec3 eyeDirection = normalize(czm_windowToEyeCoordinates(fragCoord).xyz);
vec3 viewDirWorld = normalize(czm_inverseViewRotation * eyeDirection);
vec3 viewDirUv = normalize(u_transformDirectionViewToLocal * eyeDirection);
vec3 viewPosUv = u_cameraPositionUv;
#if defined(SHAPE_ELLIPSOID)
vec3 rawDir = viewDirUv * u_ellipsoidRadiiUv;
Ray viewRayUv = Ray(viewPosUv, viewDirUv, rawDir);
#else
Ray viewRayUv = Ray(viewPosUv, viewDirUv, viewDirUv);
#endif
Intersections ix;
RayShapeIntersection shapeIntersection = intersectScene(screenCoord, viewRayUv, ix);
if (shapeIntersection.entry.w == NO_HIT) {
discard;
}
float currentT = shapeIntersection.entry.w;
float endT = shapeIntersection.exit.w;
vec3 positionUv = viewPosUv + currentT * viewDirUv;
PointJacobianT pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv);
TraversalData traversalData;
SampleData sampleDatas[SAMPLE_COUNT];
traverseOctreeFromBeginning(pointJacobian.point, traversalData, sampleDatas);
vec4 step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT);
#if defined(JITTER)
float noise = hash(screenCoord);
currentT += noise * step.w;
positionUv += noise * step.w * viewDirUv;
#endif
FragmentInput fragmentInput;
#if defined(STATISTICS)
setStatistics(fragmentInput.metadata.statistics);
#endif
vec4 colorAccum = vec4(0.0);
for (int stepCount = 0; stepCount < STEP_COUNT_MAX; ++stepCount) {
Properties properties = accumulatePropertiesFromMegatexture(sampleDatas);
copyPropertiesToMetadata(properties, fragmentInput.metadata);
fragmentInput.voxel.positionUv = positionUv;
fragmentInput.voxel.positionShapeUv = pointJacobian.point;
fragmentInput.voxel.positionUvLocal = sampleDatas[0].tileUv;
fragmentInput.voxel.viewDirUv = viewDirUv;
fragmentInput.voxel.viewDirWorld = viewDirWorld;
fragmentInput.voxel.surfaceNormal = step.xyz;
fragmentInput.voxel.travelDistance = step.w;
fragmentInput.voxel.stepCount = stepCount;
fragmentInput.voxel.tileIndex = sampleDatas[0].megatextureIndex;
fragmentInput.voxel.sampleIndex = getSampleIndex(sampleDatas[0]);
czm_modelMaterial materialOutput;
fragmentMain(fragmentInput, materialOutput);
vec4 color = vec4(materialOutput.diffuse, materialOutput.alpha);
color.rgb = max(color.rgb, vec3(0.0));
color.a = clamp(color.a, 0.0, 1.0);
colorAccum += (1.0 - colorAccum.a) * vec4(color.rgb * color.a, color.a);
if (colorAccum.a > ALPHA_ACCUM_MAX) {
colorAccum.a = ALPHA_ACCUM_MAX;
break;
}
if (step.w == 0.0) {
step.w == 0.00001;
}
currentT += step.w;
positionUv = viewPosUv + currentT * viewDirUv;
if (currentT > endT) {
#if (INTERSECTION_COUNT == 1)
break;
#else
shapeIntersection = nextIntersection(ix);
if (shapeIntersection.entry.w == NO_HIT) {
break;
} else {
currentT = shapeIntersection.entry.w;
endT = shapeIntersection.exit.w;
positionUv = viewPosUv + currentT * viewDirUv;
}
#endif
}
pointJacobian = convertUvToShapeUvSpaceDerivative(positionUv);
traverseOctreeFromExisting(pointJacobian.point, traversalData, sampleDatas);
step = getStepSize(sampleDatas[0], viewRayUv, shapeIntersection, pointJacobian.jacobianT, currentT);
}
colorAccum.a /= ALPHA_ACCUM_MAX;
#if defined(PICKING)
if (colorAccum.a == 0.0) {
discard;
}
out_FragColor = u_pickColor;
#elif defined(PICKING_VOXEL)
if (colorAccum.a == 0.0) {
discard;
}
vec2 megatextureId = packIntToVec2(sampleDatas[0].megatextureIndex);
vec2 sampleIndex = packIntToVec2(getSampleIndex(sampleDatas[0]));
out_FragColor = vec4(megatextureId, sampleIndex);
#else
out_FragColor = colorAccum;
#endif
}
`;var l8=`in vec2 position;
uniform vec4 u_ndcSpaceAxisAlignedBoundingBox;
void main() {
vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy;
vec2 aabbMax = u_ndcSpaceAxisAlignedBoundingBox.zw;
vec2 translation = 0.5 * (aabbMax + aabbMin);
vec2 scale = 0.5 * (aabbMax - aabbMin);
gl_Position = vec4(position * scale + translation, 0.0, 1.0);
}
`;var u8=`#define NO_HIT (-czm_infinity)
#define INF_HIT (czm_infinity * 0.5)
struct RayShapeIntersection {
vec4 entry;
vec4 exit;
};
vec4 intersectionMin(in vec4 intersect0, in vec4 intersect1)
{
if (intersect0.w == NO_HIT) {
return intersect1;
} else if (intersect1.w == NO_HIT) {
return intersect0;
}
return (intersect0.w <= intersect1.w) ? intersect0 : intersect1;
}
vec4 intersectionMax(in vec4 intersect0, in vec4 intersect1)
{
return (intersect0.w >= intersect1.w) ? intersect0 : intersect1;
}
RayShapeIntersection intersectIntersections(in Ray ray, in RayShapeIntersection intersect0, in RayShapeIntersection intersect1)
{
bool missed = (intersect0.entry.w == NO_HIT) ||
(intersect1.entry.w == NO_HIT) ||
(intersect0.exit.w < intersect1.entry.w) ||
(intersect0.entry.w > intersect1.exit.w);
if (missed) {
vec4 miss = vec4(normalize(ray.dir), NO_HIT);
return RayShapeIntersection(miss, miss);
}
vec4 entry = intersectionMax(intersect0.entry, intersect1.entry);
vec4 exit = intersectionMin(intersect0.exit, intersect1.exit);
return RayShapeIntersection(entry, exit);
}
struct Intersections {
vec4 intersections[INTERSECTION_COUNT * 2];
#if (INTERSECTION_COUNT > 1)
int index;
int surroundCount;
bool surroundIsPositive;
#endif
};
RayShapeIntersection getFirstIntersection(in Intersections ix)
{
return RayShapeIntersection(ix.intersections[0], ix.intersections[1]);
}
vec4 encodeIntersectionType(vec4 intersection, int index, bool entry)
{
float scale = float(index > 0) * 2.0 + float(!entry) + 1.0;
return vec4(intersection.xyz * scale, intersection.w);
}
#define setIntersection(/*inout Intersections*/ ix, /*int*/ index, /*float*/ t, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = vec4(0.0, float(!positive) * 2.0 + float(!enter) + 1.0, 0.0, (t))
#define setIntersectionPair(/*inout Intersections*/ ix, /*int*/ index, /*vec2*/ entryExit) (ix).intersections[(index) * 2 + 0] = vec4(0.0, float((index) > 0) * 2.0 + 1.0, 0.0, (entryExit).x); (ix).intersections[(index) * 2 + 1] = vec4(0.0, float((index) > 0) * 2.0 + 2.0, 0.0, (entryExit).y)
#define setSurfaceIntersection(/*inout Intersections*/ ix, /*int*/ index, /*vec4*/ intersection, /*bool*/ positive, /*bool*/ enter) (ix).intersections[(index)] = encodeIntersectionType((intersection), int(!positive), (enter))
#define setShapeIntersection(/*inout Intersections*/ ix, /*int*/ index, /*RayShapeIntersection*/ intersection) (ix).intersections[(index) * 2 + 0] = encodeIntersectionType((intersection).entry, (index), true); (ix).intersections[(index) * 2 + 1] = encodeIntersectionType((intersection).exit, (index), false)
#if (INTERSECTION_COUNT > 1)
void initializeIntersections(inout Intersections ix) {
const int sortPasses = INTERSECTION_COUNT * 2 - 1;
for (int n = sortPasses; n > 0; --n) {
for (int i = 0; i < sortPasses; ++i) {
if (i >= n) { break; }
vec4 intersect0 = ix.intersections[i + 0];
vec4 intersect1 = ix.intersections[i + 1];
bool inOrder = intersect0.w <= intersect1.w;
ix.intersections[i + 0] = inOrder ? intersect0 : intersect1;
ix.intersections[i + 1] = inOrder ? intersect1 : intersect0;
}
}
ix.index = 0;
ix.surroundCount = 0;
ix.surroundIsPositive = false;
}
#endif
#if (INTERSECTION_COUNT > 1)
RayShapeIntersection nextIntersection(inout Intersections ix) {
vec4 surfaceIntersection = vec4(0.0, 0.0, 0.0, NO_HIT);
RayShapeIntersection shapeIntersection = RayShapeIntersection(surfaceIntersection, surfaceIntersection);
const int passCount = INTERSECTION_COUNT * 2;
if (ix.index == passCount) {
return shapeIntersection;
}
for (int i = 0; i < passCount; ++i) {
if (i < ix.index) {
continue;
}
ix.index = i + 1;
surfaceIntersection = ix.intersections[i];
int intersectionType = int(length(surfaceIntersection.xyz) - 0.5);
bool currShapeIsPositive = intersectionType < 2;
bool enter = intMod(intersectionType, 2) == 0;
ix.surroundCount += enter ? +1 : -1;
ix.surroundIsPositive = currShapeIsPositive ? enter : ix.surroundIsPositive;
if (ix.surroundCount == 1 && ix.surroundIsPositive && enter == currShapeIsPositive) {
shapeIntersection.entry = surfaceIntersection;
}
bool exitPositive = !enter && currShapeIsPositive && ix.surroundCount == 0;
bool enterNegativeFromPositive = enter && !currShapeIsPositive && ix.surroundCount == 2 && ix.surroundIsPositive;
if (exitPositive || enterNegativeFromPositive) {
shapeIntersection.exit = surfaceIntersection;
if (exitPositive) {
ix.index = passCount;
}
break;
}
}
return shapeIntersection;
}
#endif
`;var f8=`uniform mat4 u_transformPositionViewToUv;
void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) {
float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord));
if (logDepthOrDepth != 0.0) {
vec4 eyeCoordinateDepth = czm_screenToEyeCoordinates(screenCoord, logDepthOrDepth);
eyeCoordinateDepth /= eyeCoordinateDepth.w;
vec3 depthPositionUv = vec3(u_transformPositionViewToUv * eyeCoordinateDepth);
float t = dot(depthPositionUv - ray.pos, ray.dir);
setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(t, +INF_HIT));
} else {
setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(NO_HIT));
}
}
`;var d8=`uniform sampler2D u_clippingPlanesTexture;
uniform mat4 u_clippingPlanesMatrix;
vec4 intersectPlane(in Ray ray, in vec4 plane) {
vec3 n = plane.xyz;
float w = plane.w;
float a = dot(ray.pos, n);
float b = dot(ray.dir, n);
float t = -(w + a) / b;
return vec4(n, t);
}
void intersectClippingPlanes(in Ray ray, inout Intersections ix) {
vec4 backSide = vec4(-ray.dir, -INF_HIT);
vec4 farSide = vec4(ray.dir, +INF_HIT);
RayShapeIntersection clippingVolume;
#if (CLIPPING_PLANES_COUNT == 1)
vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, 0, u_clippingPlanesMatrix);
vec4 intersection = intersectPlane(ray, planeUv);
bool reflects = dot(ray.dir, intersection.xyz) < 0.0;
clippingVolume.entry = reflects ? backSide : intersection;
clippingVolume.exit = reflects ? intersection : farSide;
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
#elif defined(CLIPPING_PLANES_UNION)
vec4 firstTransmission = vec4(ray.dir, +INF_HIT);
vec4 lastReflection = vec4(-ray.dir, -INF_HIT);
for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);
vec4 intersection = intersectPlane(ray, planeUv);
if (dot(ray.dir, planeUv.xyz) > 0.0) {
firstTransmission = intersection.w <= firstTransmission.w ? intersection : firstTransmission;
} else {
lastReflection = intersection.w >= lastReflection.w ? intersection : lastReflection;
}
}
clippingVolume.entry = backSide;
clippingVolume.exit = lastReflection;
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 0, clippingVolume);
clippingVolume.entry = firstTransmission;
clippingVolume.exit = farSide;
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX + 1, clippingVolume);
#else // intersection
vec4 lastTransmission = vec4(ray.dir, -INF_HIT);
vec4 firstReflection = vec4(-ray.dir, +INF_HIT);
for (int i = 0; i < CLIPPING_PLANES_COUNT; i++) {
vec4 planeUv = getClippingPlane(u_clippingPlanesTexture, i, u_clippingPlanesMatrix);
vec4 intersection = intersectPlane(ray, planeUv);
if (dot(ray.dir, planeUv.xyz) > 0.0) {
lastTransmission = intersection.w > lastTransmission.w ? intersection : lastTransmission;
} else {
firstReflection = intersection.w < firstReflection.w ? intersection: firstReflection;
}
}
if (lastTransmission.w < firstReflection.w) {
clippingVolume.entry = lastTransmission;
clippingVolume.exit = firstReflection;
} else {
clippingVolume.entry = vec4(-ray.dir, NO_HIT);
clippingVolume.exit = vec4(ray.dir, NO_HIT);
}
setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume);
#endif
}
`;var CI=`vec4 intersectLongitude(in Ray ray, in float angle, in bool positiveNormal) {
float normalSign = positiveNormal ? 1.0 : -1.0;
vec2 planeNormal = vec2(-sin(angle), cos(angle)) * normalSign;
vec2 position = ray.pos.xy;
vec2 direction = ray.dir.xy;
float approachRate = dot(direction, planeNormal);
float distance = -dot(position, planeNormal);
float t = (approachRate == 0.0)
? NO_HIT
: distance / approachRate;
return vec4(planeNormal, 0.0, t);
}
RayShapeIntersection intersectHalfSpace(in Ray ray, in float angle, in bool positiveNormal)
{
vec4 intersection = intersectLongitude(ray, angle, positiveNormal);
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
bool hitFront = (intersection.w > 0.0) == (dot(ray.pos.xy, intersection.xy) > 0.0);
if (!hitFront) {
return RayShapeIntersection(intersection, farSide);
} else {
return RayShapeIntersection(-1.0 * farSide, intersection);
}
}
void intersectFlippedWedge(in Ray ray, in vec2 minMaxAngle, out RayShapeIntersection intersections[2])
{
intersections[0] = intersectHalfSpace(ray, minMaxAngle.x, false);
intersections[1] = intersectHalfSpace(ray, minMaxAngle.y, true);
}
bool hitPositiveHalfPlane(in Ray ray, in vec4 intersection, in bool positiveNormal) {
float normalSign = positiveNormal ? 1.0 : -1.0;
vec2 planeDirection = vec2(intersection.y, -intersection.x) * normalSign;
vec2 hit = ray.pos.xy + intersection.w * ray.dir.xy;
return dot(hit, planeDirection) > 0.0;
}
void intersectHalfPlane(in Ray ray, in float angle, out RayShapeIntersection intersections[2]) {
vec4 intersection = intersectLongitude(ray, angle, true);
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
if (hitPositiveHalfPlane(ray, intersection, true)) {
intersections[0].entry = -1.0 * farSide;
intersections[0].exit = vec4(-1.0 * intersection.xy, 0.0, intersection.w);
intersections[1].entry = intersection;
intersections[1].exit = farSide;
} else {
vec4 miss = vec4(normalize(ray.dir), NO_HIT);
intersections[0].entry = -1.0 * farSide;
intersections[0].exit = farSide;
intersections[1].entry = miss;
intersections[1].exit = miss;
}
}
RayShapeIntersection intersectRegularWedge(in Ray ray, in vec2 minMaxAngle)
{
vec4 intersect1 = intersectLongitude(ray, minMaxAngle.x, false);
vec4 intersect2 = intersectLongitude(ray, minMaxAngle.y, true);
bool inOrder = intersect1.w <= intersect2.w;
vec4 first = inOrder ? intersect1 : intersect2;
vec4 last = inOrder ? intersect2 : intersect1;
bool firstIsAhead = first.w >= 0.0;
bool startedInsideFirst = dot(ray.pos.xy, first.xy) < 0.0;
bool exitFromInside = firstIsAhead == startedInsideFirst;
bool lastIsAhead = last.w > 0.0;
bool startedOutsideLast = dot(ray.pos.xy, last.xy) >= 0.0;
bool enterFromOutside = lastIsAhead == startedOutsideLast;
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
vec4 miss = vec4(normalize(ray.dir), NO_HIT);
if (exitFromInside && enterFromOutside) {
return RayShapeIntersection(first, last);
} else if (!exitFromInside && enterFromOutside) {
return RayShapeIntersection(-1.0 * farSide, first);
} else if (exitFromInside && !enterFromOutside) {
return RayShapeIntersection(last, farSide);
} else {
return RayShapeIntersection(miss, miss);
}
}
`;var h8=`uniform vec3 u_renderMinBounds;
uniform vec3 u_renderMaxBounds;
RayShapeIntersection intersectBox(in Ray ray, in vec3 minBound, in vec3 maxBound)
{
vec3 t0 = (minBound - ray.pos) / ray.dir;
vec3 t1 = (maxBound - ray.pos) / ray.dir;
vec3 entries = min(t0, t1);
vec3 exits = max(t0, t1);
vec3 directions = sign(ray.dir);
float lastEntry = maxComponent(entries);
bvec3 isLastEntry = equal(entries, vec3(lastEntry));
vec3 entryNormal = -1.0 * vec3(isLastEntry) * directions;
vec4 entry = vec4(entryNormal, lastEntry);
float firstExit = minComponent(exits);
bvec3 isFirstExit = equal(exits, vec3(firstExit));
vec3 exitNormal = vec3(isLastEntry) * directions;
vec4 exit = vec4(exitNormal, firstExit);
if (entry.w > exit.w) {
entry.w = NO_HIT;
exit.w = NO_HIT;
}
return RayShapeIntersection(entry, exit);
}
void intersectShape(in Ray ray, inout Intersections ix)
{
RayShapeIntersection intersection = intersectBox(ray, u_renderMinBounds, u_renderMaxBounds);
setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection);
}
`;var m8=`uniform vec2 u_cylinderRenderRadiusMinMax;
uniform vec2 u_cylinderRenderHeightMinMax;
#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE)
uniform vec2 u_cylinderRenderAngleMinMax;
#endif
RayShapeIntersection intersectHeightBounds(in Ray ray, in vec2 minMaxHeight, in bool convex)
{
float zPosition = ray.pos.z;
float zDirection = ray.dir.z;
float tmin = (minMaxHeight.x - zPosition) / zDirection;
float tmax = (minMaxHeight.y - zPosition) / zDirection;
float signFlip = convex ? 1.0 : -1.0;
vec4 intersectMin = vec4(0.0, 0.0, -1.0 * signFlip, tmin);
vec4 intersectMax = vec4(0.0, 0.0, 1.0 * signFlip, tmax);
bool topEntry = zDirection < 0.0;
vec4 entry = topEntry ? intersectMax : intersectMin;
vec4 exit = topEntry ? intersectMin : intersectMax;
return RayShapeIntersection(entry, exit);
}
RayShapeIntersection intersectCylinder(in Ray ray, in float radius, in bool convex)
{
vec2 position = ray.pos.xy;
vec2 direction = ray.dir.xy;
float a = dot(direction, direction);
float b = dot(position, direction);
float c = dot(position, position) - radius * radius;
float determinant = b * b - a * c;
if (determinant < 0.0) {
vec4 miss = vec4(normalize(ray.dir), NO_HIT);
return RayShapeIntersection(miss, miss);
}
determinant = sqrt(determinant);
float t1 = (-b - determinant) / a;
float t2 = (-b + determinant) / a;
float signFlip = convex ? 1.0 : -1.0;
vec4 intersect1 = vec4(normalize(position + t1 * direction) * signFlip, 0.0, t1);
vec4 intersect2 = vec4(normalize(position + t2 * direction) * signFlip, 0.0, t2);
return RayShapeIntersection(intersect1, intersect2);
}
RayShapeIntersection intersectBoundedCylinder(in Ray ray, in float radius, in vec2 minMaxHeight)
{
RayShapeIntersection cylinderIntersection = intersectCylinder(ray, radius, true);
RayShapeIntersection heightBoundsIntersection = intersectHeightBounds(ray, minMaxHeight, true);
return intersectIntersections(ray, cylinderIntersection, heightBoundsIntersection);
}
void intersectShape(Ray ray, inout Intersections ix)
{
ray.pos = ray.pos * 2.0 - 1.0;
ray.dir *= 2.0;
RayShapeIntersection outerIntersect = intersectBoundedCylinder(ray, u_cylinderRenderRadiusMinMax.y, u_cylinderRenderHeightMinMax);
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MAX, outerIntersect);
if (outerIntersect.entry.w == NO_HIT) {
return;
}
#if defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT)
RayShapeIntersection innerIntersect = intersectCylinder(ray, 1.0, false);
setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true);
setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true);
setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false);
setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false);
#elif defined(CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN)
RayShapeIntersection innerIntersect = intersectCylinder(ray, u_cylinderRenderRadiusMinMax.x, false);
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_RADIUS_MIN, innerIntersect);
#endif
#if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF)
RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_cylinderRenderAngleMinMax);
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE, wedgeIntersect);
#elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF)
RayShapeIntersection wedgeIntersects[2];
intersectFlippedWedge(ray, u_cylinderRenderAngleMinMax, wedgeIntersects);
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);
#elif defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO)
RayShapeIntersection wedgeIntersects[2];
intersectHalfPlane(ray, u_cylinderRenderAngleMinMax.x, wedgeIntersects);
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[0]);
setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]);
#endif
}
`;var p8=`#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE)
uniform vec2 u_ellipsoidRenderLongitudeMinMax;
#endif
uniform float u_eccentricitySquared;
uniform vec2 u_ellipsoidRenderLatitudeSinMinMax;
uniform vec2 u_clipMinMaxHeight;
RayShapeIntersection intersectZPlane(in Ray ray, in float z) {
float t = -ray.pos.z / ray.dir.z;
bool startsOutside = sign(ray.pos.z) == sign(z);
bool entry = (t >= 0.0) != startsOutside;
vec4 intersect = vec4(0.0, 0.0, z, t);
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
if (entry) {
return RayShapeIntersection(intersect, farSide);
} else {
return RayShapeIntersection(-1.0 * farSide, intersect);
}
}
RayShapeIntersection intersectHeight(in Ray ray, in float relativeHeight, in bool convex)
{
vec3 radiiCorrection = u_ellipsoidRadiiUv / (u_ellipsoidRadiiUv + relativeHeight);
vec3 position = ray.pos * radiiCorrection;
vec3 direction = ray.dir * radiiCorrection;
float a = dot(direction, direction);
float b = dot(direction, position);
float c = dot(position, position) - 1.0;
float determinant = b * b - a * c;
if (determinant < 0.0) {
vec4 miss = vec4(normalize(direction), NO_HIT);
return RayShapeIntersection(miss, miss);
}
determinant = sqrt(determinant);
float signB = b < 0.0 ? -1.0 : 1.0;
float t1 = (-b - signB * determinant) / a;
float t2 = c / (a * t1);
float tmin = min(t1, t2);
float tmax = max(t1, t2);
float directionScale = convex ? 1.0 : -1.0;
vec3 d1 = directionScale * normalize(position + tmin * direction);
vec3 d2 = directionScale * normalize(position + tmax * direction);
return RayShapeIntersection(vec4(d1, tmin), vec4(d2, tmax));
}
vec2 intersectDoubleEndedCone(in Ray ray, in float cosSqrHalfAngle)
{
vec3 o = ray.pos;
vec3 d = ray.dir;
float sinSqrHalfAngle = 1.0 - cosSqrHalfAngle;
float aSin = d.z * d.z * sinSqrHalfAngle;
float aCos = -dot(d.xy, d.xy) * cosSqrHalfAngle;
float a = aSin + aCos;
float bSin = d.z * o.z * sinSqrHalfAngle;
float bCos = -dot(o.xy, d.xy) * cosSqrHalfAngle;
float b = bSin + bCos;
float cSin = o.z * o.z * sinSqrHalfAngle;
float cCos = -dot(o.xy, o.xy) * cosSqrHalfAngle;
float c = cSin + cCos;
float determinant = 2.0 * bSin * bCos + bCos * bCos - aSin * cCos - aCos * cSin - aCos * cCos;
if (determinant < 0.0) {
return vec2(NO_HIT);
} else if (a == 0.0) {
return (b == 0.0)
? vec2(NO_HIT)
: vec2(-0.5 * c / b, NO_HIT);
}
determinant = sqrt(determinant);
float signB = b < 0.0 ? -1.0 : 1.0;
float t1 = (-b - signB * determinant) / a;
float t2 = c / (a * t1);
float tmin = min(t1, t2);
float tmax = max(t1, t2);
return vec2(tmin, tmax);
}
vec3 getConeNormal(in vec3 p, in bool convex) {
vec2 radial = -abs(p.z) * normalize(p.xy);
float zSign = (p.z < 0.0) ? -1.0 : 1.0;
float z = length(p.xy) * zSign;
float flip = (convex) ? -1.0 : 1.0;
return normalize(vec3(radial, z) * flip);
}
float getLatitudeConeShift(in float sinLatitude) {
float x2 = u_eccentricitySquared * sinLatitude * sinLatitude;
float primeVerticalRadius = inversesqrt(1.0 - x2);
return primeVerticalRadius * u_eccentricitySquared * sinLatitude;
}
void intersectFlippedCone(in Ray ray, in float cosHalfAngle, out RayShapeIntersection intersections[2]) {
ray.pos = ray.pos * u_ellipsoidRadiiUv;
ray.dir = ray.dir * u_ellipsoidRadiiUv;
ray.pos.z += getLatitudeConeShift(cosHalfAngle);
float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);
vec4 miss = vec4(normalize(ray.dir), NO_HIT);
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
intersections[0].entry = -1.0 * farSide;
intersections[0].exit = farSide;
intersections[1].entry = miss;
intersections[1].exit = miss;
if (intersect.x == NO_HIT) {
return;
}
float tmin = intersect.x;
float tmax = intersect.y;
vec3 p0 = ray.pos + tmin * ray.dir;
vec3 p1 = ray.pos + tmax * ray.dir;
vec4 intersect0 = vec4(getConeNormal(p0, true), tmin);
vec4 intersect1 = vec4(getConeNormal(p1, true), tmax);
bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);
if (p0InShadowCone && p1InShadowCone) {
} else if (p0InShadowCone) {
intersections[0].exit = intersect1;
} else if (p1InShadowCone) {
intersections[0].entry = intersect0;
} else {
intersections[0].exit = intersect0;
intersections[1].entry = intersect1;
intersections[1].exit = farSide;
}
}
RayShapeIntersection intersectRegularCone(in Ray ray, in float cosHalfAngle, in bool convex) {
ray.pos = ray.pos * u_ellipsoidRadiiUv;
ray.dir = ray.dir * u_ellipsoidRadiiUv;
ray.pos.z += getLatitudeConeShift(cosHalfAngle);
float cosSqrHalfAngle = cosHalfAngle * cosHalfAngle;
vec2 intersect = intersectDoubleEndedCone(ray, cosSqrHalfAngle);
vec4 miss = vec4(normalize(ray.dir), NO_HIT);
vec4 farSide = vec4(normalize(ray.dir), INF_HIT);
if (intersect.x == NO_HIT) {
return RayShapeIntersection(miss, miss);
}
float tmin = intersect.x;
float tmax = intersect.y;
vec3 p0 = ray.pos + tmin * ray.dir;
vec3 p1 = ray.pos + tmax * ray.dir;
vec4 intersect0 = vec4(getConeNormal(p0, convex), tmin);
vec4 intersect1 = vec4(getConeNormal(p1, convex), tmax);
bool p0InShadowCone = sign(p0.z) != sign(cosHalfAngle);
bool p1InShadowCone = sign(p1.z) != sign(cosHalfAngle);
if (p0InShadowCone && p1InShadowCone) {
return RayShapeIntersection(miss, miss);
} else if (p0InShadowCone) {
return RayShapeIntersection(intersect1, farSide);
} else if (p1InShadowCone) {
return RayShapeIntersection(-1.0 * farSide, intersect0);
} else {
return RayShapeIntersection(intersect0, intersect1);
}
}
void intersectShape(in Ray ray, inout Intersections ix) {
ray.pos = ray.pos * 2.0 - 1.0;
ray.dir *= 2.0;
RayShapeIntersection outerIntersect = intersectHeight(ray, u_clipMinMaxHeight.y, true);
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX, outerIntersect);
if (outerIntersect.entry.w == NO_HIT) {
return;
}
RayShapeIntersection innerIntersect = intersectHeight(ray, u_clipMinMaxHeight.x, false);
if (innerIntersect.entry.w == NO_HIT) {
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN, innerIntersect);
} else {
innerIntersect.entry.w = max(innerIntersect.entry.w, outerIntersect.entry.w);
innerIntersect.exit.w = min(innerIntersect.exit.w, outerIntersect.exit.w);
setSurfaceIntersection(ix, 0, outerIntersect.entry, true, true);
setSurfaceIntersection(ix, 1, innerIntersect.entry, false, true);
setSurfaceIntersection(ix, 2, innerIntersect.exit, false, false);
setSurfaceIntersection(ix, 3, outerIntersect.exit, true, false);
}
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF)
RayShapeIntersection bottomConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, false);
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF)
RayShapeIntersection bottomConeIntersection = intersectZPlane(ray, -1.0);
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN, bottomConeIntersection);
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF)
RayShapeIntersection bottomConeIntersections[2];
intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.x, bottomConeIntersections);
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 0, bottomConeIntersections[0]);
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN + 1, bottomConeIntersections[1]);
#endif
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF)
RayShapeIntersection topConeIntersections[2];
intersectFlippedCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, topConeIntersections);
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 0, topConeIntersections[0]);
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX + 1, topConeIntersections[1]);
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF)
RayShapeIntersection topConeIntersection = intersectZPlane(ray, 1.0);
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF)
RayShapeIntersection topConeIntersection = intersectRegularCone(ray, u_ellipsoidRenderLatitudeSinMinMax.y, false);
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX, topConeIntersection);
#endif
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO)
RayShapeIntersection wedgeIntersects[2];
intersectHalfPlane(ray, u_ellipsoidRenderLongitudeMinMax.x, wedgeIntersects);
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF)
RayShapeIntersection wedgeIntersect = intersectRegularWedge(ray, u_ellipsoidRenderLongitudeMinMax);
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE, wedgeIntersect);
#elif defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF)
RayShapeIntersection wedgeIntersects[2];
intersectFlippedWedge(ray, u_ellipsoidRenderLongitudeMinMax, wedgeIntersects);
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeIntersects[0]);
setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]);
#endif
}
`;var oS=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, out Intersections ix) {
intersectShape(ray, ix);
RayShapeIntersection intersection = getFirstIntersection(ix);
if (intersection.entry.w == NO_HIT) {
return intersection;
}
#if defined(CLIPPING_PLANES)
intersectClippingPlanes(ray, ix);
#endif
#if defined(DEPTH_TEST)
intersectDepth(screenCoord, ray, ix);
#endif
#if (INTERSECTION_COUNT > 1)
initializeIntersections(ix);
for (int i = 0; i < INTERSECTION_COUNT; ++i) {
intersection = nextIntersection(ix);
if (intersection.exit.w > 0.0) {
intersection.entry.w = max(intersection.entry.w, 0.0);
break;
}
}
#else
intersection.entry.w = max(intersection.entry.w, 0.0);
#endif
return intersection;
}
`;var _8=`#if defined(BOX_HAS_SHAPE_BOUNDS)
uniform vec3 u_boxUvToShapeUvScale;
uniform vec3 u_boxUvToShapeUvTranslate;
#endif
PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
return PointJacobianT(positionUv, mat3(0.5));
}
vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
return positionShape * u_boxUvToShapeUvScale + u_boxUvToShapeUvTranslate;
#else
return positionShape;
#endif
}
PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
return pointJacobian;
}
vec3 convertShapeUvToUvSpace(in vec3 shapeUv) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
return (shapeUv - u_boxUvToShapeUvTranslate) / u_boxUvToShapeUvScale;
#else
return shapeUv;
#endif
}
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
#if defined(BOX_HAS_SHAPE_BOUNDS)
return shapeUv / u_boxUvToShapeUvScale;
#else
return shapeUv;
#endif
}
`;var g8=`#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
uniform vec2 u_cylinderUvToShapeUvRadius;
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
uniform vec2 u_cylinderUvToShapeUvHeight;
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
uniform vec2 u_cylinderUvToShapeUvAngle;
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)
uniform vec2 u_cylinderShapeUvAngleMinMax;
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY) || defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)
uniform float u_cylinderShapeUvAngleRangeZeroMid;
#endif
PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
vec3 position = positionUv * 2.0 - 1.0;
float radius = length(position.xy);
vec3 radial = normalize(vec3(position.xy, 0.0));
float height = positionUv.z;
vec3 z = vec3(0.0, 0.0, 1.0);
float angle = atan(position.y, position.x);
vec3 east = normalize(vec3(-position.y, position.x, 0.0));
vec3 point = vec3(radius, angle, height);
mat3 jacobianT = mat3(radial, z, east / length(position.xy));
return PointJacobianT(point, jacobianT);
}
vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
float radius = positionShape.x;
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
radius = radius * u_cylinderUvToShapeUvRadius.x + u_cylinderUvToShapeUvRadius.y;
#endif
float angle = (positionShape.y + czm_pi) / czm_twoPi;
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED)
angle += float(angle < u_cylinderShapeUvAngleRangeZeroMid);
#endif
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY)
angle = angle > u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.x : angle;
#elif defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY)
angle = angle < u_cylinderShapeUvAngleRangeZeroMid ? u_cylinderShapeUvAngleMinMax.y : angle;
#endif
angle = angle * u_cylinderUvToShapeUvAngle.x + u_cylinderUvToShapeUvAngle.y;
#endif
float height = positionShape.z;
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
height = height * u_cylinderUvToShapeUvHeight.x + u_cylinderUvToShapeUvHeight.y;
#endif
return vec3(radius, angle, height);
}
PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
return pointJacobian;
}
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
float radius = shapeUv.x;
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_RADIUS)
radius /= u_cylinderUvToShapeUvRadius.x;
#endif
float angle = shapeUv.y * czm_twoPi;
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE)
angle /= u_cylinderUvToShapeUvAngle.x;
#endif
float height = shapeUv.z;
#if defined(CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT)
height /= u_cylinderUvToShapeUvHeight.x;
#endif
return vec3(radius, angle, height);
}
`;var y8=`uniform vec3 u_ellipsoidRadiiUv;
uniform vec2 u_evoluteScale;
uniform vec3 u_ellipsoidInverseRadiiSquaredUv;
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY) || defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY) || defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
uniform vec3 u_ellipsoidShapeUvLongitudeMinMaxMid;
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
uniform vec2 u_ellipsoidUvToShapeUvLongitude;
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
uniform vec2 u_ellipsoidUvToShapeUvLatitude;
#endif
uniform float u_ellipsoidInverseHeightDifferenceUv;
vec3 nearestPointAndRadiusOnEllipse(vec2 pos, vec2 radii) {
vec2 p = abs(pos);
vec2 inverseRadii = 1.0 / radii;
vec2 tTrigs = vec2(0.7071067811865476);
vec2 v = radii * tTrigs;
vec2 evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;
const int iterations = 3;
for (int i = 0; i < iterations; ++i) {
vec2 q = normalize(p - evolute) * length(v - evolute);
tTrigs = (q + evolute) * inverseRadii;
tTrigs = normalize(clamp(tTrigs, 0.0, 1.0));
v = radii * tTrigs;
evolute = u_evoluteScale * tTrigs * tTrigs * tTrigs;
}
return vec3(v * sign(pos), length(v - evolute));
}
PointJacobianT convertUvToShapeSpaceDerivative(in vec3 positionUv) {
vec3 position = positionUv * 2.0 - 1.0;
position = position * u_ellipsoidRadiiUv;
float longitude = atan(position.y, position.x);
vec3 east = normalize(vec3(-position.y, position.x, 0.0));
float distanceFromZAxis = length(position.xy);
vec2 posEllipse = vec2(distanceFromZAxis, position.z);
vec3 surfacePointAndRadius = nearestPointAndRadiusOnEllipse(posEllipse, u_ellipsoidRadiiUv.xz);
vec2 surfacePoint = surfacePointAndRadius.xy;
vec2 normal2d = normalize(surfacePoint * u_ellipsoidInverseRadiiSquaredUv.xz);
float latitude = atan(normal2d.y, normal2d.x);
vec3 north = vec3(-normal2d.y * normalize(position.xy), abs(normal2d.x));
float heightSign = length(posEllipse) < length(surfacePoint) ? -1.0 : 1.0;
float height = heightSign * length(posEllipse - surfacePoint);
vec3 up = normalize(cross(east, north));
vec3 point = vec3(longitude, latitude, height);
mat3 jacobianT = mat3(east / distanceFromZAxis, north / (surfacePointAndRadius.z + height), up);
return PointJacobianT(point, jacobianT);
}
vec3 convertShapeToShapeUvSpace(in vec3 positionShape) {
float longitude = (positionShape.x + czm_pi) / czm_twoPi;
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED)
longitude += float(longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z);
#endif
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY)
longitude = longitude > u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.x : longitude;
#endif
#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY)
longitude = longitude < u_ellipsoidShapeUvLongitudeMinMaxMid.z ? u_ellipsoidShapeUvLongitudeMinMaxMid.y : longitude;
#endif
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
longitude = longitude * u_ellipsoidUvToShapeUvLongitude.x + u_ellipsoidUvToShapeUvLongitude.y;
#endif
float latitude = (positionShape.y + czm_piOverTwo) / czm_pi;
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
latitude = latitude * u_ellipsoidUvToShapeUvLatitude.x + u_ellipsoidUvToShapeUvLatitude.y;
#endif
float height = 1.0 + positionShape.z * u_ellipsoidInverseHeightDifferenceUv;
return vec3(longitude, latitude, height);
}
PointJacobianT convertUvToShapeUvSpaceDerivative(in vec3 positionUv) {
PointJacobianT pointJacobian = convertUvToShapeSpaceDerivative(positionUv);
pointJacobian.point = convertShapeToShapeUvSpace(pointJacobian.point);
return pointJacobian;
}
vec3 scaleShapeUvToShapeSpace(in vec3 shapeUv) {
float longitude = shapeUv.x * czm_twoPi;
#if defined (ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE)
longitude /= u_ellipsoidUvToShapeUvLongitude.x;
#endif
float latitude = shapeUv.y * czm_pi;
#if defined(ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE)
latitude /= u_ellipsoidUvToShapeUvLatitude.x;
#endif
float height = shapeUv.z / u_ellipsoidInverseHeightDifferenceUv;
return vec3(longitude, latitude, height);
}
`;var b8=`#define OCTREE_FLAG_INTERNAL 0
#define OCTREE_FLAG_LEAF 1
#define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2
#define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops
uniform sampler2D u_octreeInternalNodeTexture;
uniform vec2 u_octreeInternalNodeTexelSizeUv;
uniform int u_octreeInternalNodeTilesPerRow;
#if (SAMPLE_COUNT > 1)
uniform sampler2D u_octreeLeafNodeTexture;
uniform vec2 u_octreeLeafNodeTexelSizeUv;
uniform int u_octreeLeafNodeTilesPerRow;
#endif
uniform ivec3 u_dimensions;
uniform ivec3 u_inputDimensions;
#if defined(PADDING)
uniform ivec3 u_paddingBefore;
#endif
struct OctreeNodeData {
int data;
int flag;
};
struct TraversalData {
ivec4 octreeCoords;
int parentOctreeIndex;
};
struct SampleData {
int megatextureIndex;
ivec4 tileCoords;
vec3 tileUv;
vec3 inputCoordinate;
#if (SAMPLE_COUNT > 1)
float weight;
#endif
};
int intMod(in int a, in int b) {
return a - (b * (a / b));
}
int normU8_toInt(in float value) {
return int(value * 255.0);
}
int normU8x2_toInt(in vec2 value) {
return int(value.x * 255.0) + 256 * int(value.y * 255.0);
}
float normU8x2_toFloat(in vec2 value) {
return float(normU8x2_toInt(value)) / 65535.0;
}
OctreeNodeData getOctreeNodeData(in vec2 octreeUv) {
vec4 texData = texture(u_octreeInternalNodeTexture, octreeUv);
OctreeNodeData data;
data.data = normU8x2_toInt(texData.xy);
data.flag = normU8x2_toInt(texData.zw);
return data;
}
OctreeNodeData getOctreeChildData(in int parentOctreeIndex, in ivec3 childCoord) {
int childIndex = childCoord.z * 4 + childCoord.y * 2 + childCoord.x;
int octreeCoordX = intMod(parentOctreeIndex, u_octreeInternalNodeTilesPerRow) * 9 + 1 + childIndex;
int octreeCoordY = parentOctreeIndex / u_octreeInternalNodeTilesPerRow;
vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
return getOctreeNodeData(octreeUv);
}
int getOctreeParentIndex(in int octreeIndex) {
int octreeCoordX = intMod(octreeIndex, u_octreeInternalNodeTilesPerRow) * 9;
int octreeCoordY = octreeIndex / u_octreeInternalNodeTilesPerRow;
vec2 octreeUv = u_octreeInternalNodeTexelSizeUv * vec2(float(octreeCoordX) + 0.5, float(octreeCoordY) + 0.5);
vec4 parentData = texture(u_octreeInternalNodeTexture, octreeUv);
int parentOctreeIndex = normU8x2_toInt(parentData.xy);
return parentOctreeIndex;
}
vec3 getTileUv(in vec3 shapePosition, in ivec4 octreeCoords) {
float dimAtLevel = exp2(float(octreeCoords.w));
return shapePosition * dimAtLevel - vec3(octreeCoords.xyz);
}
vec3 getClampedTileUv(in vec3 shapePosition, in ivec4 octreeCoords) {
vec3 tileUv = getTileUv(shapePosition, octreeCoords);
return clamp(tileUv, vec3(0.0), vec3(1.0));
}
void addSampleCoordinates(in vec3 shapePosition, inout SampleData sampleData) {
vec3 tileUv = getClampedTileUv(shapePosition, sampleData.tileCoords);
vec3 inputCoordinate = tileUv * vec3(u_dimensions);
#if defined(PADDING)
inputCoordinate += vec3(u_paddingBefore);
#endif
#if defined(Y_UP_METADATA_ORDER)
#if defined(SHAPE_BOX)
float inputY = inputCoordinate.y;
inputCoordinate.y = float(u_inputDimensions.y) - inputCoordinate.z;
inputCoordinate.z = inputY;
#elif defined(SHAPE_CYLINDER)
float angle = inputCoordinate.y;
float height = inputCoordinate.z;
#if (!defined(CYLINDER_HAS_SHAPE_BOUNDS_ANGLE))
if (sampleData.tileCoords.w == 0) {
float angleCount = float(u_inputDimensions.z);
angle = mod(angle + angleCount / 2.0, angleCount);
}
#endif
inputCoordinate.y = height;
inputCoordinate.z = angle;
#endif
#endif
sampleData.tileUv = tileUv;
sampleData.inputCoordinate = inputCoordinate;
}
void getOctreeLeafSampleData(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleData) {
sampleData.megatextureIndex = data.data;
sampleData.tileCoords = (data.flag == OCTREE_FLAG_PACKED_LEAF_FROM_PARENT)
? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
: octreeCoords;
}
#if (SAMPLE_COUNT > 1)
void getOctreeLeafSampleDatas(in OctreeNodeData data, in ivec4 octreeCoords, out SampleData sampleDatas[SAMPLE_COUNT]) {
int leafIndex = data.data;
int leafNodeTexelCount = 2;
float leafCoordXStart = float(intMod(leafIndex, u_octreeLeafNodeTilesPerRow) * leafNodeTexelCount) + 0.5;
float leafCoordY = float(leafIndex / u_octreeLeafNodeTilesPerRow) + 0.5;
vec2 leafUv0 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 0.0, leafCoordY);
vec4 leafData0 = texture(u_octreeLeafNodeTexture, leafUv0);
float lerp = normU8x2_toFloat(leafData0.xy);
sampleDatas[0].weight = 1.0 - lerp;
sampleDatas[1].weight = lerp;
sampleDatas[0].tileCoords = (normU8_toInt(leafData0.z) == 1)
? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
: octreeCoords;
sampleDatas[1].tileCoords = (normU8_toInt(leafData0.w) == 1)
? ivec4(octreeCoords.xyz / 2, octreeCoords.w - 1)
: octreeCoords;
vec2 leafUv1 = u_octreeLeafNodeTexelSizeUv * vec2(leafCoordXStart + 1.0, leafCoordY);
vec4 leafData1 = texture(u_octreeLeafNodeTexture, leafUv1);
sampleDatas[0].megatextureIndex = normU8x2_toInt(leafData1.xy);
sampleDatas[1].megatextureIndex = normU8x2_toInt(leafData1.zw);
}
#endif
OctreeNodeData traverseOctreeDownwards(in vec3 shapePosition, inout TraversalData traversalData) {
float sizeAtLevel = exp2(-1.0 * float(traversalData.octreeCoords.w));
vec3 start = vec3(traversalData.octreeCoords.xyz) * sizeAtLevel;
vec3 end = start + vec3(sizeAtLevel);
OctreeNodeData childData;
for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
vec3 center = 0.5 * (start + end);
vec3 childCoord = step(center, shapePosition);
ivec4 octreeCoords = traversalData.octreeCoords;
traversalData.octreeCoords = ivec4(octreeCoords.xyz * 2 + ivec3(childCoord), octreeCoords.w + 1);
childData = getOctreeChildData(traversalData.parentOctreeIndex, ivec3(childCoord));
if (childData.flag != OCTREE_FLAG_INTERNAL) {
break;
}
start = mix(start, center, childCoord);
end = mix(center, end, childCoord);
traversalData.parentOctreeIndex = childData.data;
}
return childData;
}
void traverseOctreeFromBeginning(in vec3 shapePosition, out TraversalData traversalData, out SampleData sampleDatas[SAMPLE_COUNT]) {
traversalData.octreeCoords = ivec4(0);
traversalData.parentOctreeIndex = 0;
OctreeNodeData nodeData = getOctreeNodeData(vec2(0.0));
if (nodeData.flag != OCTREE_FLAG_LEAF) {
nodeData = traverseOctreeDownwards(shapePosition, traversalData);
}
#if (SAMPLE_COUNT == 1)
getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
addSampleCoordinates(shapePosition, sampleDatas[0]);
#else
getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
addSampleCoordinates(shapePosition, sampleDatas[0]);
addSampleCoordinates(shapePosition, sampleDatas[1]);
#endif
}
bool inRange(in vec3 v, in vec3 minVal, in vec3 maxVal) {
return clamp(v, minVal, maxVal) == v;
}
bool insideTile(in vec3 shapePosition, in ivec4 octreeCoords) {
vec3 tileUv = getTileUv(shapePosition, octreeCoords);
bool inside = inRange(tileUv, vec3(0.0), vec3(1.0));
return inside || octreeCoords.w == 0;
}
void traverseOctreeFromExisting(in vec3 shapePosition, inout TraversalData traversalData, inout SampleData sampleDatas[SAMPLE_COUNT]) {
if (insideTile(shapePosition, traversalData.octreeCoords)) {
for (int i = 0; i < SAMPLE_COUNT; i++) {
addSampleCoordinates(shapePosition, sampleDatas[i]);
}
return;
}
for (int i = 0; i < OCTREE_MAX_LEVELS; ++i) {
traversalData.octreeCoords.xyz /= 2;
traversalData.octreeCoords.w -= 1;
if (insideTile(shapePosition, traversalData.octreeCoords)) {
break;
}
traversalData.parentOctreeIndex = getOctreeParentIndex(traversalData.parentOctreeIndex);
}
OctreeNodeData nodeData = traverseOctreeDownwards(shapePosition, traversalData);
#if (SAMPLE_COUNT == 1)
getOctreeLeafSampleData(nodeData, traversalData.octreeCoords, sampleDatas[0]);
addSampleCoordinates(shapePosition, sampleDatas[0]);
#else
getOctreeLeafSampleDatas(nodeData, traversalData.octreeCoords, sampleDatas);
addSampleCoordinates(shapePosition, sampleDatas[0]);
addSampleCoordinates(shapePosition, sampleDatas[1]);
#endif
}
`;var x8=`uniform ivec2 u_megatextureSliceDimensions;
uniform ivec2 u_megatextureTileDimensions;
uniform vec2 u_megatextureVoxelSizeUv;
uniform vec2 u_megatextureSliceSizeUv;
uniform vec2 u_megatextureTileSizeUv;
int intMin(int a, int b) {
return a <= b ? a : b;
}
int intMax(int a, int b) {
return a >= b ? a : b;
}
int intClamp(int v, int minVal, int maxVal) {
return intMin(intMax(v, minVal), maxVal);
}
vec2 index1DTo2DTexcoord(int index, ivec2 dimensions, vec2 uvScale)
{
int indexX = intMod(index, dimensions.x);
int indexY = index / dimensions.x;
return vec2(indexX, indexY) * uvScale;
}
Properties getPropertiesFromMegatexture(in SampleData sampleData) {
int tileIndex = sampleData.megatextureIndex;
vec3 voxelCoord = sampleData.inputCoordinate;
#if defined(NEAREST_SAMPLING)
voxelCoord = floor(voxelCoord) + vec3(0.5);
#endif
vec2 tileUvOffset = index1DTo2DTexcoord(tileIndex, u_megatextureTileDimensions, u_megatextureTileSizeUv);
float slice = voxelCoord.z - 0.5;
int sliceIndex = int(floor(slice));
int sliceIndex0 = intClamp(sliceIndex, 0, u_inputDimensions.z - 1);
vec2 sliceUvOffset0 = index1DTo2DTexcoord(sliceIndex0, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);
vec2 voxelUvOffset = clamp(voxelCoord.xy, vec2(0.5), vec2(u_inputDimensions.xy) - vec2(0.5)) * u_megatextureVoxelSizeUv;
vec2 uv0 = tileUvOffset + sliceUvOffset0 + voxelUvOffset;
#if defined(NEAREST_SAMPLING)
return getPropertiesFromMegatextureAtUv(uv0);
#else
float sliceLerp = fract(slice);
int sliceIndex1 = intMin(sliceIndex + 1, u_inputDimensions.z - 1);
vec2 sliceUvOffset1 = index1DTo2DTexcoord(sliceIndex1, u_megatextureSliceDimensions, u_megatextureSliceSizeUv);
vec2 uv1 = tileUvOffset + sliceUvOffset1 + voxelUvOffset;
Properties properties0 = getPropertiesFromMegatextureAtUv(uv0);
Properties properties1 = getPropertiesFromMegatextureAtUv(uv1);
return mixProperties(properties0, properties1, sliceLerp);
#endif
}
Properties accumulatePropertiesFromMegatexture(in SampleData sampleDatas[SAMPLE_COUNT]) {
#if (SAMPLE_COUNT == 1)
return getPropertiesFromMegatexture(sampleDatas[0]);
#else
Properties properties = clearProperties();
for (int i = 0; i < SAMPLE_COUNT; ++i) {
float weight = sampleDatas[i].weight;
if (weight > 0.0) {
Properties tempProperties = getPropertiesFromMegatexture(sampleDatas[i]);
tempProperties = scaleProperties(tempProperties, weight);
properties = sumProperties(properties, tempProperties);
}
}
return properties;
#endif
}
`;var $gt={Z_UP:0,Y_UP:1},hh=Object.freeze($gt);function Zgt(e){let t=new MT;this.shaderBuilder=t;let n=e._customShader,i=xt(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let p in o)if(o.hasOwnProperty(p)){let g=o[p];t.addUniform(g.type,p,ge.FRAGMENT)}t.addUniform("sampler2D","u_megatextureTextures[METADATA_COUNT]",ge.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=c(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s,t.addVertexLines([l8]),e.provider.metadataOrder===hh.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,ge.FRAGMENT);let a=e._provider.shape;a==="BOX"?t.addDefine("SHAPE_BOX",void 0,ge.FRAGMENT):a==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,ge.FRAGMENT):a==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,ge.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",b8,a8,u8,x8]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,ge.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,ge.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,ge.FRAGMENT),t.addFragmentLines([d8])),e._depthTest&&(t.addDefine("DEPTH_TEST",void 0,ge.FRAGMENT),t.addFragmentLines([f8])),a==="BOX"?t.addFragmentLines([_8,h8,oS]):a==="CYLINDER"?t.addFragmentLines([g8,CI,m8,oS]):a==="ELLIPSOID"&&t.addFragmentLines([y8,CI,p8,oS]),t.addFragmentLines([c8]);let l=e._shape,u=l.shaderDefines;for(let p in u)if(u.hasOwnProperty(p)){let g=u[p];c(g)&&(g=g===!0?void 0:g,t.addDefine(p,g,ge.FRAGMENT))}let f=l.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",f,ge.FRAGMENT),s===1?f+=1:r.unionClippingRegions?f+=2:f+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",f,ge.FRAGMENT),f+=1),t.addDefine("INTERSECTION_COUNT",f,ge.FRAGMENT),(!d.equals(e.paddingBefore,d.ZERO)||!d.equals(e.paddingAfter,d.ZERO))&&t.addDefine("PADDING",void 0,ge.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,ge.FRAGMENT),e._nearestSampling&&t.addDefine("NEAREST_SAMPLING",void 0,ge.FRAGMENT);let h=e._traversal;t.addDefine("SAMPLE_COUNT",`${h._sampleCount}`,ge.FRAGMENT)}var T8=Zgt;function Qgt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,l=o.length,u=c(s)&&c(a);n.addDefine("METADATA_COUNT",l,ge.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],B=o[R],_=`PropertyStatistics_${L}`,w=`PropertyStatistics_${L}`;n.addStruct(_,w,ge.FRAGMENT);let D=A8(B);n.addStructField(_,D,"min"),n.addStructField(_,D,"max")}let f="Statistics",h="Statistics",p="statistics";n.addStruct(f,h,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],B=`PropertyStatistics_${L}`,_=L;n.addStructField(f,B,_)}let g="Metadata",m="Metadata",y="metadata";n.addStruct(g,m,ge.FRAGMENT),n.addStructField(g,h,p);for(let R=0;R<l;R++){let L=i[R],B=o[R],_=A8(B);n.addStructField(g,_,L)}for(let R=0;R<l;R++){let L=i[R],B=o[R],_=eyt(B),w=`VoxelProperty_${L}`,D=`VoxelProperty_${L}`;n.addStruct(w,D,ge.FRAGMENT),n.addStructField(w,_,"partialDerivativeLocal"),n.addStructField(w,_,"partialDerivativeWorld"),n.addStructField(w,_,"partialDerivativeView"),n.addStructField(w,_,"partialDerivativeValid")}let b="Voxel",x="Voxel",A="voxel";n.addStruct(b,x,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],B=`VoxelProperty_${L}`;n.addStructField(b,B,L)}n.addStructField(b,"vec3","positionEC"),n.addStructField(b,"vec3","positionUv"),n.addStructField(b,"vec3","positionShapeUv"),n.addStructField(b,"vec3","positionUvLocal"),n.addStructField(b,"vec3","viewDirUv"),n.addStructField(b,"vec3","viewDirWorld"),n.addStructField(b,"vec3","surfaceNormal"),n.addStructField(b,"float","travelDistance"),n.addStructField(b,"int","stepCount"),n.addStructField(b,"int","tileIndex"),n.addStructField(b,"int","sampleIndex");let E="FragmentInput";n.addStruct(E,"FragmentInput",ge.FRAGMENT),n.addStructField(E,m,y),n.addStructField(E,x,A);let v="Properties",P="Properties",M="properties";n.addStruct(v,P,ge.FRAGMENT);for(let R=0;R<l;R++){let L=i[R],B=o[R],_=A8(B);n.addStructField(v,_,L)}{let R="clearProperties";n.addFunction(R,`${P} clearProperties()`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let B=i[L],_=o[L],w=r[L],D=A8(_,w);n.addFunctionLines(R,[`${M}.${B} = ${D}(0.0);`])}n.addFunctionLines(R,[`return ${M};`])}{let R="sumProperties";n.addFunction(R,`${P} sumProperties(${P} propertiesA, ${P} propertiesB)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let B=i[L];n.addFunctionLines(R,[`${M}.${B} = propertiesA.${B} + propertiesB.${B};`])}n.addFunctionLines(R,[`return ${M};`])}{let R="scaleProperties";n.addFunction(R,`${P} scaleProperties(${P} ${M}, float scale)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} scaledProperties = ${M};`]);for(let L=0;L<l;L++){let B=i[L];n.addFunctionLines(R,[`scaledProperties.${B} *= scale;`])}n.addFunctionLines(R,["return scaledProperties;"])}{let R="mixProperties";n.addFunction(R,`${P} mixProperties(${P} propertiesA, ${P} propertiesB, float mixFactor)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let B=i[L];n.addFunctionLines(R,[`${M}.${B} = mix(propertiesA.${B}, propertiesB.${B}, mixFactor);`])}n.addFunctionLines(R,[`return ${M};`])}{let R="copyPropertiesToMetadata";n.addFunction(R,`void copyPropertiesToMetadata(in ${P} ${M}, inout ${m} ${y})`,ge.FRAGMENT);for(let L=0;L<l;L++){let B=i[L];n.addFunctionLines(R,[`${y}.${B} = ${M}.${B};`])}}if(u){let R="setStatistics";n.addFunction(R,`void setStatistics(inout ${h} ${p})`,ge.FRAGMENT);for(let L=0;L<l;L++){let B=i[L],_=o[L],w=at.getComponentCount(_);for(let D=0;D<w;D++){let I=tyt(_,D),N=s[L][D],k=a[L][D];!c(N)||!c(k)||n.addFunctionLines(R,[`${p}.${B}.min${I} = ${axe(N)};`,`${p}.${B}.max${I} = ${axe(k)};`])}}}{let R="getPropertiesFromMegatextureAtUv";n.addFunction(R,`${P} getPropertiesFromMegatextureAtUv(vec2 texcoord)`,ge.FRAGMENT),n.addFunctionLines(R,[`${P} ${M};`]);for(let L=0;L<l;L++){let B=i[L],_=o[L],w=r[L],D=Jgt(_,w);n.addFunctionLines(R,[`properties.${B} = texture(u_megatextureTextures[${L}], texcoord)${D};`])}n.addFunctionLines(R,[`return ${M};`])}}function A8(e){if(e===at.SCALAR)return"float";if(e===at.VEC2)return"vec2";if(e===at.VEC3)return"vec3";if(e===at.VEC4)return"vec4"}function Jgt(e){if(e===at.SCALAR)return".r";if(e===at.VEC2)return".ra";if(e===at.VEC3)return".rgb";if(e===at.VEC4)return""}function eyt(e){if(e===at.SCALAR)return"vec3";if(e===at.VEC2)return"mat2";if(e===at.VEC3)return"mat3";if(e===at.VEC4)return"mat4"}function axe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function tyt(e,t){return e===at.SCALAR?"":`[${t}]`}var C8=Qgt;function nyt(e,t){let n=new T8(e);C8(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r}=n;if(r>0){let x="getClippingPlane",A=jy(o,t),E=0,S=A.indexOf(")")+1,v=A.indexOf("{",S)+1,P=A.indexOf("}",v),M=A.slice(E,S),R=A.slice(v,P);i.addFunction(x,M,ge.FRAGMENT),i.addFunctionLines(x,[R])}let s=i.clone();s.addDefine("PICKING",void 0,ge.FRAGMENT);let a=i.clone();a.addDefine("PICKING_VOXEL",void 0,ge.FRAGMENT);let l=i.buildShaderProgram(t),u=s.buildShaderProgram(t),f=a.buildShaderProgram(t),h=ze.fromCache({cull:{enabled:!0,face:Ti.BACK},depthTest:{enabled:!1},depthMask:!1,blending:un.PRE_MULTIPLIED_ALPHA_BLEND}),p=t.getViewportQuadVertexArray(),g=e._depthTest,m=new Je({vertexArray:p,primitiveType:Me.TRIANGLES,renderState:h,shaderProgram:l,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:De.VOXELS,executeInClosestFrustum:!0,owner:this,cull:g,occlude:g}),y=Je.shallowClone(m,new Je);y.shaderProgram=u,y.pickOnly=!0;let b=Je.shallowClone(m,new Je);if(b.shaderProgram=f,b.pickOnly=!0,c(e._drawCommand)){let x=e._drawCommand;x.shaderProgram=x.shaderProgram&&x.shaderProgram.destroy()}if(c(e._drawCommandPick)){let x=e._drawCommandPick;x.shaderProgram=x.shaderProgram&&x.shaderProgram.destroy()}if(c(e._drawCommandPickVoxel)){let x=e._drawCommandPickVoxel;x.shaderProgram=x.shaderProgram&&x.shaderProgram.destroy()}e._drawCommand=m,e._drawCommandPick=y,e._drawCommandPickVoxel=b}var E8=nyt;var iyt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"},rS=Object.freeze(iyt);function oyt(e,t,n){let i=new Uint8ClampedArray(e.buffer),o=new ImageData(i,t,n),r=document.createElement("canvas");return r.width=t,r.height=n,r.getContext("2d").putImageData(o,0,0),r}var S8=oyt;function sS(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}sS.prototype.getTexture=function(e){return this._textures[e]};function ryt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];c(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}sS.prototype.loadTexture2D=function(e,t){c(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):ryt(this,e,t)};function syt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?w8(o,r,n):ayt(o,r,n),a=e._textures[i];c(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function w8(e,t,n){let{typedArray:i,sampler:o}=e,r=c(i)?lxe(e,n):new Rt({context:n,source:t,sampler:o});return cxe(o)&&r.generateMipmap(),r}function ayt(e,t,n){let{typedArray:i,sampler:o}=e,r=cxe(o),s=o.wrapS===gn.REPEAT||o.wrapS===gn.MIRRORED_REPEAT||o.wrapT===gn.REPEAT||o.wrapT===gn.MIRRORED_REPEAT,{width:a,height:l}=c(i)?e:t,u=[a,l].every(O.isPowerOfTwo);if((r||s)&&!u)if(c(i)){if(e.pixelDatatype===Ue.UNSIGNED_BYTE){let h=S8(i,a,l),p=db(h);return w8({sampler:o},p,n)}}else{let h=db(t);return w8(e,h,n)}else return w8(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),lxe(e,n)}function cxe(e){return[Yt.NEAREST_MIPMAP_NEAREST,Yt.NEAREST_MIPMAP_LINEAR,Yt.LINEAR_MIPMAP_NEAREST,Yt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function lxe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new Rt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}sS.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];syt(this,o,t)}n.length=0};sS.prototype.isDestroyed=function(){return!1};sS.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return de(this)};var v8=sS;function EI(e){e=e??W.EMPTY_OBJECT,this.mode=e.mode??zg.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??W.EMPTY_OBJECT,this.varyings=e.varyings??W.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??Eb.INHERIT,this._textureManager=new v8,this._defaultTexture=void 0,this.uniformMap=cyt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},fyt(this),dyt(this)}function cyt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i],r=o.type;if(r===rS.SAMPLER_CUBE)throw new C("CustomShader does not support samplerCube uniforms");r===rS.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=lyt(e,i)):n[i]=uyt(e,i)}return n}function lyt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function uyt(e,t){return function(){return e.uniforms[t].value}}function Nx(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function fyt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.metadata.(\w+)/g,o,r=e.vertexShaderText;c(r)&&(o=e.usedVariablesVertex.attributeSet,Nx(r,t,o),o=e.usedVariablesVertex.featureIdSet,Nx(r,n,o),o=e.usedVariablesVertex.metadataSet,Nx(r,i,o));let s=e.fragmentShaderText;if(c(s)){o=e.usedVariablesFragment.attributeSet,Nx(s,t,o),o=e.usedVariablesFragment.featureIdSet,Nx(s,n,o),o=e.usedVariablesFragment.metadataSet,Nx(s,i,o);let a=/material\.(\w+)/g,l=e.usedVariablesFragment.materialSet;Nx(s,a,l)}}function uxe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function yc(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${uxe(t)} is not available in the ${i} shader. Did you mean ${uxe(n)} instead?`;throw new C(o)}}function dyt(e){let t=e.usedVariablesVertex.attributeSet;yc(t,"position","positionMC","vertex"),yc(t,"normal","normalMC","vertex"),yc(t,"tangent","tangentMC","vertex"),yc(t,"bitangent","bitangentMC","vertex"),yc(t,"positionWC","positionMC","vertex"),yc(t,"positionEC","positionMC","vertex"),yc(t,"normalEC","normalMC","vertex"),yc(t,"tangentEC","tangentMC","vertex"),yc(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;yc(n,"position","positionEC","fragment"),yc(n,"normal","normalEC","fragment"),yc(n,"tangent","tangentEC","fragment"),yc(n,"bitangent","bitangentEC","fragment"),yc(n,"normalMC","normalEC","fragment"),yc(n,"tangentMC","tangentEC","fragment"),yc(n,"bitangentMC","bitangentEC","fragment")}EI.prototype.setUniform=function(e,t){if(T.typeOf.string("uniformName",e),T.defined("value",t),!c(this.uniforms[e]))throw new C(`Uniform ${e} must be declared in the CustomShader constructor.`);let n=this.uniforms[e];n.type===rS.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):c(t.clone)?n.value=t.clone(n.value):n.value=t};EI.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};EI.prototype.isDestroyed=function(){return!1};EI.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),de(this)};var aS=EI;function P_(e){if(T.typeOf.object("options",e),!c(e.loader)){if(!c(e.metadata))throw new C("One of loader and metadata must be defined.");if(!Array.isArray(e.metadata))throw new C("metadata must be an array of TypedArrays.")}let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(P_.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});P_.fromMetadataArray=function(e){if(T.typeOf.object("metadata",e),!Array.isArray(e))throw new C("metadata must be an array of TypedArrays.");return new P_({metadata:e})};P_.fromGltf=async function(e){T.typeOf.object("resource",e);let t=new em({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new P_({loader:t})};P_.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!c(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:o}=n.components,{attributes:r}=o.nodes[0].primitives[0];this._metadata=hyt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function hyt(e,t,n){let{className:i,names:o,types:r,componentTypes:s}=n.provider,a=t.propertyAttributes.find(f=>f.class.id===i),{properties:l}=a,u=new Array(o.length);for(let f=0;f<e.length;f++){let h=l[o[f]].attribute,p=e.find(b=>b.name===h);if(!c(p))continue;let g=Nt.toComponentDatatype(s[f]),m=at.getComponentCount(r[f]),y=p.count*m;u[f]=$.createArrayBufferView(g,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return u}P_.prototype.isDestroyed=function(){return!1};P_.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),de(this)};var cS=P_;function Ym(){this.orientedBoundingBox=new Pn,this.boundingSphere=new le,this.boundTransform=new F,this.shapeTransform=new F,this._minBounds=Ym.DefaultMinBounds.clone(),this._maxBounds=Ym.DefaultMaxBounds.clone(),this.shaderUniforms={renderMinBounds:new d,renderMaxBounds:new d,boxUvToShapeUvScale:new d,boxUvToShapeUvTranslate:new d},this.shaderDefines={BOX_INTERSECTION_INDEX:void 0,BOX_HAS_SHAPE_BOUNDS:void 0},this.shaderMaximumIntersectionsLength=0}var myt=new d,CK=new d,pyt=new J,_yt=new d,gyt=new d,yyt=new d,byt=new d,fxe=F.fromRotationTranslation(J.fromUniformScale(.5,new J),new d(.5,.5,.5),new F);Ym.prototype.update=function(e,t,n,i,o){T.typeOf.object("modelMatrix",e),T.typeOf.object("minBounds",t),T.typeOf.object("maxBounds",n),i=i??t.clone(_yt),o=o??n.clone(gyt),t=d.clone(t,this._minBounds),n=d.clone(n,this._maxBounds);let r=d.clamp(t,i,o,yyt),s=d.clamp(n,i,o,byt),a=F.getScale(e,CK);if(r.x>s.x||r.y>s.y||r.z>s.z||(r.x===s.x)+(r.y===s.y)+(r.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=SK(r,s,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let{shaderUniforms:l,shaderDefines:u}=this;for(let g in u)u.hasOwnProperty(g)&&(u[g]=void 0);let f=0;u.BOX_INTERSECTION_INDEX=f,f+=1,l.renderMinBounds=F.multiplyByPoint(fxe,r,l.renderMinBounds),l.renderMaxBounds=F.multiplyByPoint(fxe,s,l.renderMaxBounds),u.BOX_HAS_SHAPE_BOUNDS=!0;let h=t,p=n;return l.boxUvToShapeUvScale=d.fromElements(2/(h.x===p.x?1:p.x-h.x),2/(h.y===p.y?1:p.y-h.y),2/(h.z===p.z?1:p.z-h.z),l.boxUvToShapeUvScale),l.boxUvToShapeUvTranslate=d.fromElements(-l.boxUvToShapeUvScale.x*(h.x*.5+.5),-l.boxUvToShapeUvScale.y*(h.y*.5+.5),-l.boxUvToShapeUvScale.z*(h.z*.5+.5),l.boxUvToShapeUvTranslate),this.shaderMaximumIntersectionsLength=f,!0};var D8=new d,EK=new d;Ym.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){T.typeOf.number("tileLevel",e),T.typeOf.number("tileX",t),T.typeOf.number("tileY",n),T.typeOf.number("tileZ",i),T.typeOf.object("result",o);let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),l=d.fromElements(O.lerp(r.x,s.x,a*t),O.lerp(r.y,s.y,a*n),O.lerp(r.z,s.z,a*i),D8),u=d.fromElements(O.lerp(r.x,s.x,a*(t+1)),O.lerp(r.y,s.y,a*(n+1)),O.lerp(r.z,s.z,a*(i+1)),EK);return SK(l,u,this.shapeTransform,o)};var dxe=new d;Ym.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){T.typeOf.object("spatialNode",e),T.typeOf.object("tileDimensions",t),T.typeOf.object("tileUv",n),T.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,dxe),s=d.multiplyByScalar(r,o,dxe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,D8),o,D8),l=d.add(a,s,EK),u=this._minBounds,f=this._maxBounds,h=d.fromElements(O.lerp(u.x,f.x,a.x),O.lerp(u.y,f.y,a.y),O.lerp(u.z,f.z,a.z),D8),p=d.fromElements(O.lerp(u.x,f.x,l.x),O.lerp(u.y,f.y,l.y),O.lerp(u.z,f.z,l.z),EK);return SK(h,p,this.shapeTransform,i)};Ym.DefaultMinBounds=Object.freeze(new d(-1,-1,-1));Ym.DefaultMaxBounds=Object.freeze(new d(1,1,1));function SK(e,t,n,i){let o=Ym.DefaultMinBounds,r=Ym.DefaultMaxBounds;if(d.equals(e,o)&&d.equals(t,r))i.center=F.getTranslation(n,i.center),i.halfAxes=F.getMatrix3(n,i.halfAxes);else{let a=F.getScale(n,CK),l=d.midpoint(e,t,myt);i.center=F.multiplyByPoint(n,l,i.center),a=d.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),CK);let u=F.getRotation(n,pyt);i.halfAxes=J.setScale(u,a,i.halfAxes)}return i}var lS=Ym;function I_(){this.orientedBoundingBox=new Pn,this.boundingSphere=new le,this.boundTransform=new F,this.shapeTransform=new F,this._minBounds=I_.DefaultMinBounds.clone(),this._maxBounds=I_.DefaultMaxBounds.clone(),this.shaderUniforms={cylinderRenderRadiusMinMax:new z,cylinderRenderAngleMinMax:new z,cylinderRenderHeightMinMax:new z,cylinderUvToShapeUvRadius:new z,cylinderUvToShapeUvAngle:new z,cylinderUvToShapeUvHeight:new z,cylinderShapeUvAngleMinMax:new z,cylinderShapeUvAngleRangeZeroMid:0},this.shaderDefines={CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_HAS_SHAPE_BOUNDS_RADIUS:void 0,CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY:void 0,CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this.shaderMaximumIntersectionsLength=0}var pxe=new d,xyt=new d,Tyt=new d,Ayt=new d,Cyt=new d;I_.prototype.update=function(e,t,n,i,o){T.typeOf.object("modelMatrix",e),T.typeOf.object("minBounds",t),T.typeOf.object("maxBounds",n),i=i??t.clone(xyt),o=o??n.clone(Tyt),t=d.clone(t,this._minBounds),n=d.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:s}=I_,a=s.y-r.y,l=.5*a,u=O.EPSILON10,f=O.EPSILON3,h=O.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=O.negativePiToPi(t.y),n.y=O.negativePiToPi(n.y),i.y=O.negativePiToPi(i.y),o.y=O.negativePiToPi(o.y);let p=d.maximumByComponent(t,i,Ayt),g=d.minimumByComponent(n,o,Cyt),m=F.getScale(e,pxe);if(g.x===0||p.x>g.x||p.z>g.z||O.equalsEpsilon(m.x,0,void 0,u)||O.equalsEpsilon(m.y,0,void 0,u)||O.equalsEpsilon(m.z,0,void 0,u))return!1;this.shapeTransform=F.clone(e,this.shapeTransform),this.orientedBoundingBox=DK(p,g,this.shapeTransform,this.orientedBoundingBox),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let y=t.x===r.x&&n.x===s.x,b=n.y<t.y,x=n.y-t.y+b*a,A=x>l+h&&x<a-h,E=x<l-h,S=x>=l-h&&x<=l+h,v=A||E||S,P=O.equalsEpsilon(t.y,r.y,void 0,f),M=O.equalsEpsilon(n.y,s.y,void 0,f),R=t.z===r.z&&n.z===s.z,L=p.x===r.x,B=g.y<p.y,_=g.y-p.y+B*a,w=_>=l-h&&_<a-h,D=_>h&&_<l-h,I=_<=h,N=w||D||I,{shaderUniforms:k,shaderDefines:H}=this;for(let j in H)H.hasOwnProperty(j)&&(H[j]=void 0);let V=0;if(H.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=V,V+=1,L||(H.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,H.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=V,V+=1),k.cylinderRenderRadiusMinMax=z.fromElements(p.x,g.x,k.cylinderRenderRadiusMinMax),p.x===g.x&&(H.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0),!y){H.CYLINDER_HAS_SHAPE_BOUNDS_RADIUS=!0;let j=n.x-t.x,U=0,q=1;j!==0&&(U=1/j,q=-t.x/j),k.cylinderUvToShapeUvRadius=z.fromElements(U,q,k.cylinderUvToShapeUvRadius)}if(!R){H.CYLINDER_HAS_SHAPE_BOUNDS_HEIGHT=!0;let j=n.z-t.z,U=0,q=1;j!==0&&(U=2/j,q=-(t.z+1)/j),k.cylinderUvToShapeUvHeight=z.fromElements(U,q,k.cylinderUvToShapeUvHeight)}if(k.cylinderRenderHeightMinMax=z.fromElements(p.z,g.z,k.cylinderRenderHeightMinMax),b&&(H.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_MAX_REVERSED=!0),N&&(H.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,H.CYLINDER_INTERSECTION_INDEX_ANGLE=V,w?(H.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,V+=1):D?(H.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,V+=2):I&&(H.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,V+=2),k.cylinderRenderAngleMinMax=z.fromElements(p.y,g.y,k.cylinderRenderAngleMinMax)),v){H.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0,P&&(H.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MIN_DISCONTINUITY=!0),M&&(H.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE_MAX_DISCONTINUITY=!0);let j=(t.y-r.y)/a,U=(n.y-r.y)/a,q=1-x/a;if(k.cylinderShapeUvAngleMinMax=z.fromElements(j,U,k.cylinderShapeUvAngleMinMax),k.cylinderShapeUvAngleRangeZeroMid=(U+.5*q)%1,x<=h)k.cylinderUvToShapeUvAngle=z.fromElements(0,1,k.cylinderUvToShapeUvAngle);else{let X=a/x,te=-(t.y-r.y)/x;k.cylinderUvToShapeUvAngle=z.fromElements(X,te,k.cylinderUvToShapeUvAngle)}}return this.shaderMaximumIntersectionsLength=V,!0};var P8=new d,vK=new d;I_.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){T.typeOf.number("tileLevel",e),T.typeOf.number("tileX",t),T.typeOf.number("tileY",n),T.typeOf.number("tileZ",i),T.typeOf.object("result",o);let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),l=d.fromElements(O.lerp(r.x,s.x,t*a),O.lerp(r.y,s.y,n*a),O.lerp(r.z,s.z,i*a),P8),u=d.fromElements(O.lerp(r.x,s.x,(t+1)*a),O.lerp(r.y,s.y,(n+1)*a),O.lerp(r.z,s.z,(i+1)*a),vK);return DK(l,u,this.shapeTransform,o)};var hxe=new d;I_.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){T.typeOf.object("spatialNode",e),T.typeOf.object("tileDimensions",t),T.typeOf.object("tileUv",n),T.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,hxe),s=d.multiplyByScalar(r,o,hxe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,P8),o,P8),l=d.add(a,s,vK),u=this._minBounds,f=this._maxBounds,h=d.fromElements(O.lerp(u.x,f.x,a.x),O.lerp(u.y,f.y,a.y),O.lerp(u.z,f.z,a.z),P8),p=d.fromElements(O.lerp(u.x,f.x,l.x),O.lerp(u.y,f.y,l.y),O.lerp(u.z,f.z,l.z),vK);return DK(h,p,this.shapeTransform,i)};I_.DefaultMinBounds=Object.freeze(new d(0,-O.PI,-1));I_.DefaultMaxBounds=Object.freeze(new d(1,+O.PI,1));var Eyt=5,Syt=new Array(Eyt),wyt=new d,vyt=new J,Dyt=new F,Pyt=new F,Iyt=new F,wK=new F,Oyt=new d,Ryt=new d,Myt=new d,_xe=new Array(8);for(let e=0;e<8;e++)_xe[e]=new d;function mxe(e,t,n){return Math.abs(se.dot(e,t))<n}function Lyt(e){let t=F.getColumn(e,0,Oyt),n=F.getColumn(e,1,Ryt),i=F.getColumn(e,2,Myt),o=O.EPSILON4;return mxe(t,n,o)&&mxe(n,i,o)}function Nyt(e,t){let n=_xe;d.fromElements(-.5,-.5,-.5,n[0]),d.fromElements(-.5,-.5,.5,n[1]),d.fromElements(-.5,.5,-.5,n[2]),d.fromElements(-.5,.5,.5,n[3]),d.fromElements(.5,-.5,-.5,n[4]),d.fromElements(.5,-.5,.5,n[5]),d.fromElements(.5,.5,-.5,n[6]),d.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)F.multiplyByPoint(e,n[i],n[i]);return Pn.fromPoints(n,t)}function DK(e,t,n,i){let o=e.x,r=t.x,s=e.y,a=t.y<s?t.y+O.TWO_PI:t.y,l=e.z,u=t.z,f=a-s,h=s+f*.5,p=Syt,g=0;p[g++]=s,p[g++]=a,p[g++]=h,f>O.PI&&(p[g++]=h-O.PI_OVER_TWO,p[g++]=h+O.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(let k=0;k<g;++k){let H=p[k]-h,V=Math.cos(H),j=Math.sin(H),U=V*o,q=j*o,X=V*r,te=j*r;m=Math.min(m,U,X),y=Math.min(y,q,te),b=Math.max(b,U,X),x=Math.max(x,q,te)}let A=b-m,E=x-y,S=u-l,v=(m+b)*.5,P=(y+x)*.5,M=(l+u)*.5,R=d.fromElements(v,P,M,wyt),L=J.fromRotationZ(h,vyt),B=d.fromElements(A,E,S,pxe),_=F.fromScale(B,Iyt),w=F.fromRotation(L,Pyt),D=F.fromTranslation(R,Dyt),I=F.multiplyTransformation(w,F.multiplyTransformation(D,_,wK),wK),N=F.multiplyTransformation(n,I,wK);return Lyt(N)?Pn.fromTransformation(N,i):Nyt(N,i)}var uS=I_;function O_(){this.orientedBoundingBox=new Pn,this.boundingSphere=new le,this.boundTransform=new F,this.shapeTransform=new F,this._rectangle=new ce,this._minimumHeight=O_.DefaultMinBounds.z,this._maximumHeight=O_.DefaultMaxBounds.z,this._ellipsoid=new ie,this._translation=new d,this._rotation=new J,this.shaderUniforms={ellipsoidRadiiUv:new d,eccentricitySquared:0,evoluteScale:new z,ellipsoidInverseRadiiSquaredUv:new d,ellipsoidRenderLongitudeMinMax:new z,ellipsoidShapeUvLongitudeMinMaxMid:new d,ellipsoidUvToShapeUvLongitude:new z,ellipsoidUvToShapeUvLatitude:new z,ellipsoidRenderLatitudeSinMinMax:new z,ellipsoidInverseHeightDifferenceUv:0,clipMinMaxHeight:new z},this.shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this.shaderMaximumIntersectionsLength=0}var Fyt=new d,Byt=new d,kyt=new d,Uyt=new d,Vyt=new d,zyt=new d,Hyt=new d,Gyt=new d,jyt=new J,gxe=new d,yxe=new d,Wyt=new ce;O_.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=O_;i=i??r,o=o??s,T.typeOf.object("modelMatrix",e),T.typeOf.object("minBounds",t),T.typeOf.object("maxBounds",n);let a=O.EPSILON10,l=O.EPSILON3,u=O.EPSILON10,f=O.EPSILON10,h=O.EPSILON3,p=F.getScale(e,Gyt),g=d.clone(r,Fyt);g.z=-d.minimumComponent(p);let m=d.clamp(t,g,s,Byt),y=d.clamp(n,g,s,kyt),b=d.clamp(i,g,s,Uyt),x=d.clamp(o,g,s,Vyt),A=d.maximumByComponent(m,b,zyt),E=d.minimumByComponent(y,x,Hyt),S=d.add(p,d.fromElements(y.z,y.z,y.z,gxe),gxe),v=d.maximumComponent(S),P=d.add(p,d.fromElements(E.z,E.z,E.z,yxe),yxe);if(A.y>E.y||A.y===s.y||E.y===r.y||A.z>E.z||O.equalsEpsilon(P,d.ZERO,void 0,a))return!1;this._rectangle=ce.fromRadians(m.x,m.y,y.x,y.y),this._translation=F.getTranslation(e,this._translation),this._rotation=F.getRotation(e,this._rotation),this._ellipsoid=ie.fromCartesian3(p,this._ellipsoid),this._minimumHeight=m.z,this._maximumHeight=y.z;let M=ce.fromRadians(A.x,A.y,E.x,E.y,Wyt);this.orientedBoundingBox=PK(M,A.z,E.z,this._ellipsoid,this._translation,this._rotation,this.orientedBoundingBox),this.shapeTransform=F.fromRotationTranslation(J.setScale(this._rotation,S,jyt),this._translation,this.shapeTransform),this.boundTransform=F.fromRotationTranslation(this.orientedBoundingBox.halfAxes,this.orientedBoundingBox.center,this.boundTransform),this.boundingSphere=le.fromOrientedBoundingBox(this.orientedBoundingBox,this.boundingSphere);let R=s.x-r.x,L=.5*R,B=E.x<A.x,_=E.x-A.x+B*R,w=_<=u,D=_>=L-u&&_<R-u,I=_>u&&_<L-u,N=w||D||I,k=y.x<m.x,H=y.x-m.x+k*R,V=H>L+u&&H<R-u,j=H>=L-u&&H<=L+u,U=H<L-u,q=V||j||U,X=E.y<-h,te=E.y>=-h&&E.y<=+h,K=E.y>+h&&E.y<s.y-f,Z=X||te||K,ee=A.y>r.y+f&&A.y<-h,me=A.y>=-h&&A.y<=+h,xe=A.y>+h,ue=ee||me||xe,ye=Z||ue,Ae=y.y-m.y,Pe=y.y<-h,Ee=y.y>=-h&&y.y<=+h,Ve=y.y>+h&&y.y<s.y-f,je=Pe||Ee||Ve,it=m.y>r.y+f&&m.y<-h,Dt=m.y>=-h&&m.y<=+h,Gt=m.y>+h,ln=je||(it||Dt||Gt),{shaderUniforms:Vt,shaderDefines:Ct}=this;for(let mt in Ct)Ct.hasOwnProperty(mt)&&(Ct[mt]=void 0);Vt.ellipsoidRadiiUv=d.divideByScalar(S,v,Vt.ellipsoidRadiiUv);let{x:gi,z:an}=Vt.ellipsoidRadiiUv,_e=an/gi;Vt.eccentricitySquared=1-_e*_e,Vt.evoluteScale=z.fromElements((gi*gi-an*an)/gi,(an*an-gi*gi)/an,Vt.evoluteScale),Vt.ellipsoidInverseRadiiSquaredUv=d.divideComponents(d.ONE,d.multiplyComponents(Vt.ellipsoidRadiiUv,Vt.ellipsoidRadiiUv,Vt.ellipsoidInverseRadiiSquaredUv),Vt.ellipsoidInverseRadiiSquaredUv);let Ce=0;Ct.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=Ce,Ce+=1,Ct.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=Ce,Ce+=1,Vt.clipMinMaxHeight=z.fromElements((A.z-y.z)/v,(E.z-y.z)/v,Vt.clipMinMaxHeight);let mn=(y.z-m.z)/v;if(Vt.ellipsoidInverseHeightDifferenceUv=1/mn,m.z===y.z&&(Vt.ellipsoidInverseHeightDifferenceUv=0),N&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Ct.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=Ce,D?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,Ce+=1):I?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,Ce+=2):w&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,Ce+=2),Vt.ellipsoidRenderLongitudeMinMax=z.fromElements(A.x,E.x,Vt.ellipsoidRenderLongitudeMinMax)),q)if(Ct.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0,y.x<m.x&&(Ct.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE_MIN_MAX_REVERSED=!0),H<=u)Vt.ellipsoidUvToShapeUvLongitude=z.fromElements(0,1,Vt.ellipsoidUvToShapeUvLongitude);else{let to=R/H,So=-(m.x-r.x)/H;Vt.ellipsoidUvToShapeUvLongitude=z.fromElements(to,So,Vt.ellipsoidUvToShapeUvLongitude)}if(N){let mt=O.equalsEpsilon(A.x,r.x,void 0,l),to=O.equalsEpsilon(E.x,s.x,void 0,l);mt&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MIN_DISCONTINUITY=!0),to&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_MAX_DISCONTINUITY=!0);let So=(m.x-r.x)/R,Ks=(y.x-r.x)/R,vr=(E.x-r.x)/R,ps=1-_/R,Ne=(vr+.5*ps)%1;Vt.ellipsoidShapeUvLongitudeMinMaxMid=d.fromElements(So,Ks,Ne,Vt.ellipsoidShapeUvLongitudeMinMaxMid)}if(ye&&(ue&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Ct.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=Ce,ee?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,Ce+=1):me?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,Ce+=1):xe&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,Ce+=2)),Z&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Ct.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=Ce,X?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,Ce+=2):te?(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,Ce+=1):K&&(Ct.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,Ce+=1)),Vt.ellipsoidRenderLatitudeSinMinMax=z.fromElements(Math.sin(A.y),Math.sin(E.y),Vt.ellipsoidRenderLatitudeSinMinMax)),ln)if(Ct.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,Ae<f)Vt.ellipsoidUvToShapeUvLatitude=z.fromElements(0,1,Vt.ellipsoidUvToShapeUvLatitude);else{let to=(s.y-r.y)/Ae,So=(r.y-m.y)/Ae;Vt.ellipsoidUvToShapeUvLatitude=z.fromElements(to,So,Vt.ellipsoidUvToShapeUvLatitude)}return this.shaderMaximumIntersectionsLength=Ce,!0};var Txe=new ce;O_.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){T.typeOf.number("tileLevel",e),T.typeOf.number("tileX",t),T.typeOf.number("tileY",n),T.typeOf.number("tileZ",i),T.typeOf.object("result",o);let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,l=n*r,u=(n+1)*r,f=i*r,h=(i+1)*r,p=ce.subsection(this._rectangle,s,l,a,u,Txe),g=O.lerp(this._minimumHeight,this._maximumHeight,f),m=O.lerp(this._minimumHeight,this._maximumHeight,h);return PK(p,g,m,this._ellipsoid,this._translation,this._rotation,o)};var bxe=new d,xxe=new d,qyt=new d;O_.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){T.typeOf.object("spatialNode",e),T.typeOf.object("tileDimensions",t),T.typeOf.object("tileUv",n),T.typeOf.object("result",i);let o=1/Math.pow(2,e.level),r=d.divideComponents(d.ONE,t,bxe),s=d.multiplyByScalar(r,o,bxe),a=d.multiplyByScalar(d.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,xxe),o,xxe),l=d.add(a,s,qyt),u=ce.subsection(this._rectangle,a.x,a.y,l.x,l.y,Txe),f=O.lerp(this._minimumHeight,this._maximumHeight,a.z),h=O.lerp(this._minimumHeight,this._maximumHeight,l.z);return PK(u,f,h,this._ellipsoid,this._translation,this._rotation,i)};function PK(e,t,n,i,o,r,s){return s=Pn.fromRectangle(e,t,n,i,s),s.center=d.add(s.center,o,s.center),s.halfAxes=J.multiply(s.halfAxes,r,s.halfAxes),s}O_.DefaultMinBounds=Object.freeze(new d(-O.PI,-O.PI_OVER_TWO,-ie.WGS84.minimumRadius));O_.DefaultMaxBounds=Object.freeze(new d(O.PI,O.PI_OVER_TWO,10*ie.WGS84.maximumRadius));var fS=O_;var Nu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Nu.getMinBounds=function(e){switch(e){case Nu.BOX:return lS.DefaultMinBounds;case Nu.ELLIPSOID:return fS.DefaultMinBounds;case Nu.CYLINDER:return uS.DefaultMinBounds;default:throw new C(`Invalid shape type ${e}`)}};Nu.getMaxBounds=function(e){switch(e){case Nu.BOX:return lS.DefaultMaxBounds;case Nu.ELLIPSOID:return fS.DefaultMaxBounds;case Nu.CYLINDER:return uS.DefaultMaxBounds;default:throw new C(`Invalid shape type ${e}`)}};Nu.getShapeConstructor=function(e){switch(e){case Nu.BOX:return lS;case Nu.ELLIPSOID:return fS;case Nu.CYLINDER:return uS;default:throw new C(`Invalid shape type ${e}`)}};var Na=Object.freeze(Nu);function mh(e){T.typeOf.object("options",e),T.defined("options.comparator",e.comparator),c(e.maximumLength)&&T.typeOf.number.greaterThanOrEquals("options.maximumLength",e.maximumLength,0),this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=c(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(mh.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(c(e)){for(T.typeOf.number.greaterThanOrEquals("maximumLength",e,0);this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});mh.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new mh({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};mh.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(c(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};mh.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)Axe(this,t)};mh.prototype.insert=function(e){let t,n=this._maximumLength;if(c(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,Axe(this,i),t};mh.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],Cxe(this,0)),this._array[e-1]=void 0,t};mh.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=IK(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&Cxe(this,n)}return this._array[e-1]=void 0,t};mh.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};mh.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[IK(this,1,2)?1:2]};function I8(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function SI(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function IK(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function Axe(e,t){if(t===0)return;let n=Math.floor(O.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=SI(e,t,i);for(o!==n&&(I8(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(SI(e,t,r)!==o)break;I8(e,t,r),t=r}}function Cxe(e,t){let n=e._length,i=Math.floor(O.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){SI(e,s,r)===i&&(r=s);let a=2*o+1,l=Math.max(Math.min(n-a,4),0);for(let u=0;u<l;u++){let f=a+u;SI(e,f,r)===i&&(r=f)}}if(SI(e,r,t)===i&&(I8(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);IK(e,r,a)===i&&I8(e,r,a)}t=r}}var dS=mh;var OK=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function wI(e,t){this.spatialNode=e,this.keyframe=t,this.state=OK.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}wI.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=OK.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};wI.priorityComparator=function(e,t){return e.priority-t.priority};wI.searchComparator=function(e,t){return e.keyframe-t.keyframe};wI.LoadState=OK;var go=wI;function a0(e,t,n,i,o){if(o=Math.min(o??128*1024*1024,536870912),i===Nt.UNSIGNED_SHORT&&(i=Nt.FLOAT32),i===Nt.FLOAT32&&!e.floatingPointTexture)throw new ae("Floating point texture not supported");let s=Yyt(i),a=Xyt(n,e.webgl2),l=Nt.getSizeInBytes(i),u=Kyt(o,n,l),f=Math.ceil(Math.sqrt(t.x)),h=Math.ceil(t.z/f),p=f*t.x,g=h*t.y,m=Math.floor(u/p),y=Math.floor(u/g);if(m===0||y===0)throw new ae("Tileset is too large to fit into megatexture");this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=l*n*u**2,this.voxelCountPerTile=d.clone(t,new d),this.maximumTileCount=m*y,this.regionCountPerMegatexture=new z(m,y),this.voxelCountPerRegion=new z(p,g),this.sliceCountPerRegion=new z(f,h),this.voxelSizeUv=new z(1/u,1/u),this.sliceSizeUv=new z(t.x/u,t.y/u),this.regionSizeUv=new z(p/u,g/u),this.texture=new Rt({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:u,height:u,sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:ui.LINEAR})});let b=Nt.toComponentDatatype(i);this.tileVoxelDataTemp=$.createTypedArray(b,p*g*n),this.nodes=new Array(this.maximumTileCount);for(let x=0;x<this.maximumTileCount;x++)this.nodes[x]=new $yt(x);for(let x=0;x<this.maximumTileCount;x++){let A=this.nodes[x];A.previousNode=x>0?this.nodes[x-1]:void 0,A.nextNode=x<this.maximumTileCount-1?this.nodes[x+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0}function Yyt(e){if(e===Nt.FLOAT32||e===Nt.FLOAT64)return Ue.FLOAT;if(e===Nt.UINT8)return Ue.UNSIGNED_BYTE}function Xyt(e,t){if(e===1)return t?ke.RED:ke.LUMINANCE;if(e===2)return t?ke.RG:ke.LUMINANCE_ALPHA;if(e===3)return ke.RGB;if(e===4)return ke.RGBA}function Kyt(e,t,n){let i=Math.floor(e/(t*n));return Math.min(ut.maximumTextureSize,O.previousPowerOfTwo(Math.floor(Math.sqrt(i))))}function $yt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}a0.prototype.add=function(e){if(this.isFull())throw new C("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,c(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,c(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};a0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new C("Megatexture index out of bounds");let t=this.nodes[e];c(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),c(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,c(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};a0.prototype.isFull=function(){return this.emptyList===void 0};a0.getApproximateTextureMemoryByteLength=function(e,t,n,i){i===Nt.UNSIGNED_SHORT&&(i=Nt.FLOAT32);let o=Nt.getSizeInBytes(i),r=e*t.x*t.y*t.z,s=Math.ceil(Math.sqrt(t.x)),a=Math.ceil(t.z/s),l=s*t.x,u=a*t.y,f=O.previousPowerOfTwo(Math.floor(Math.sqrt(r)));for(;;){let p=Math.floor(f/l),g=Math.floor(f/u);if(p*g>=e)break;f*=2}return f*f*n*o};a0.prototype.writeDataToTexture=function(e,t){let n=t.constructor===Uint16Array?new Float32Array(t):t,{tileVoxelDataTemp:i,voxelCountPerTile:o,sliceCountPerRegion:r,voxelCountPerRegion:s,channelCount:a,regionCountPerMegatexture:l}=this;for(let g=0;g<o.z;g++){let m=g%r.x*o.x,y=Math.floor(g/r.x)*o.y;for(let b=0;b<o.y;b++){let x=Zyt(o,b,g),A=(y+b)*s.x+m;for(let E=0;E<o.x;E++){let S=x+E,v=A+E;for(let P=0;P<a;P++)i[v*a+P]=n[S*a+P]}}}let u=e%l.x*s.x,f=Math.floor(e/l.x)*s.y,p={source:{arrayBufferView:i,width:s.x,height:s.y},xOffset:u,yOffset:f};this.texture.copyFrom(p)};function Zyt(e,t,n){let i=e.y*e.x,o=n,r=t;return o*i+r*e.x}a0.prototype.isDestroyed=function(){return!1};a0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),de(this)};var vI=a0;function Jf(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=d.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new Pn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var Qyt=new d;Jf.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=J.getScale(this.orientedBoundingBox.halfAxes,Qyt),n=2*d.maximumComponent(t);this.approximateVoxelSize=n/d.minimumComponent(this.dimensions)};Jf.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,l=s+1,u=r+1,f=a+1,h=t+1,p=[[h,r,s,a],[h,u,s,a],[h,r,l,a],[h,u,l,a],[h,r,s,f],[h,u,s,f],[h,r,l,f],[h,u,l,f]];this.children=p.map(([g,m,y,b])=>new Jf(g,m,y,b,this,e,this.dimensions))};Jf.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Jf.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,O.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var Exe={keyframe:0};function DI(e,t){return Exe.keyframe=e,Mo(t,Exe,go.searchComparator)}Jf.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,l=+Number.MAX_VALUE;for(;c(t);){let{renderableKeyframeNodes:h}=t;if(h.length>=1){let p=Jyt(i,h),g=h[p],m=o===i||i<g.keyframe?p:Math.min(p+1,h.length-1),y=h[m],b=i-g.keyframe,x=Sxe(n-t.level,b);x<a&&(a=x,r=g);let A=y.keyframe-o,E=Sxe(n-t.level,A);if(E<l&&(l=E,s=y),b===0&&A===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!c(r)||!c(s))return;let u=r.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:O.clamp((e-u)/(f-u),0,1)};function Jyt(e,t){let n=DI(e,t);return n<0?O.clamp(~n-1,0,t.length-1):n}function Sxe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Jf.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Jf.prototype.createKeyframeNode=function(e){let t=DI(e,this.keyframeNodes);if(t<0){t=~t;let n=new go(this,e);this.keyframeNodes.splice(t,0,n)}};Jf.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=DI(n,this.keyframeNodes);if(i<0)throw new C("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=DI(n,this.renderableKeyframeNodes);if(o<0)throw new C("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};Jf.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new C("Keyframe node cannot be added to megatexture");let{metadata:n}=e.content;for(let r=0;r<t.length;r++){let s=t[r];e.megatextureIndex=s.add(n[r])}let i=this.renderableKeyframeNodes,o=DI(e.keyframe,i);if(o>=0)throw new C("Keyframe already renderable");o=~o,i.splice(o,0,e)};Jf.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return c(t)&&c(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var O8=Jf;function c0(e,t,n,i){let{provider:o,dimensions:r,paddingBefore:s,paddingAfter:a}=e,{types:l,componentTypes:u,metadataOrder:f}=o,h=d.add(r,s,new d);if(d.add(h,a,h),f===hh.Y_UP){let E=h.y;h.y=h.z,h.z=E}!c(i)&&c(o.maximumTileCount)&&(i=d0t(o.maximumTileCount,h,l,u)),this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(l.length);for(let E=0;E<l.length;E++){let S=l[E],v=at.getComponentCount(S),P=u[E];this.megatextures[E]=new vI(t,h,v,P,i),this.textureMemoryByteLength+=this.megatextures[E].textureMemoryByteLength}let p=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let g=e._shape;this.rootNode=new O8(0,0,0,0,void 0,g,r),this._priorityQueue=new dS({maximumLength:p,comparator:go.priorityComparator}),this._highPriorityKeyframeNodes=new Array(p),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(p),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let m=this._binaryTreeKeyframeWeighting;m[0]=0,m[n-1]=0,RK(m,1,n-2,0);let y=9,b=2048,x=Math.floor(b/y),A=Math.ceil(p/x);this.internalNodeTexture=new Rt({context:t,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:b,height:A,sampler:new Qt({minificationFilter:Yt.NEAREST,magnificationFilter:ui.NEAREST})}),this.internalNodeTilesPerRow=x,this.internalNodeTexelSizeUv=new z(1/b,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new z}c0.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function RK(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,RK(e,t,o-1,i+1),RK(e,o+1,n,i+1)}c0.simultaneousRequestCountMaximum=50;c0.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,l=o._levelBlendFactor,u=l>0,f=a>1,h=(u?2:1)*(f?2:1);this._sampleCount=h;let p=h>=2;if(p&&!c(this.leafNodeTexture)){let E=Math.floor(512),S=Math.ceil(s/E);this.leafNodeTexture=new Rt({context:r,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:1024,height:S,sampler:new Qt({minificationFilter:Yt.NEAREST,magnificationFilter:ui.NEAREST})}),this.leafNodeTexelSizeUv=z.fromElements(1/1024,1/S,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=E}else!p&&c(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=O.clamp(t,0,a-1),n&&wxe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=Ei();n0t(this,e),i0t(this,e);let m=Ei();c0t(this,h,l);let y=Ei(),b=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||b){let x=m-g,A=y-m,E=y-g;a0t(this,e,x,A,E)}};c0.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};c0.prototype.isDestroyed=function(){return!1};c0.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.textureMemoryByteLength=0,this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),de(this)};function wxe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),c(t.children))for(let n=0;n<8;n++){let i=t.children[n];wxe(e,i)}}function e0t(e,t){if(e._simultaneousRequestCount>=c0.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(c(i.availableLevels)&&r.level>=i.availableLevels)return;function s(f){e._simultaneousRequestCount--,t.content=f,t.state=c(f)?go.LoadState.PROCESSING:go.LoadState.UNAVAILABLE}function a(f){e._simultaneousRequestCount--,t.state=go.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let l={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},u=i.requestData(l);c(u)&&(e._simultaneousRequestCount++,t.state=go.LoadState.RECEIVING,u.then(s).catch(a))}function t0t(e){return e/(1+e)}function n0t(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),vxe(e.rootNode,ys.MASK_INDETERMINATE,e,t);let o=e._highPriorityKeyframeNodes,r=0,s;for(;i.length>0;)s=i.removeMaximum(),s.highPriorityFrameNumber=n,o[r]=s,r++;e._highPriorityKeyframeNodeCount=r}function i0t(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(o0t);let r=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,l=0;for(let u=0;u<s;u++){let f=r[u];if(!(f.state===go.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===go.LoadState.UNLOADED&&e0t(e,f),f.state===go.LoadState.PROCESSING)){let{content:h}=f;if(h.update(e._primitive,t),!h.ready)continue;if(!r0t(h.metadata,e)){f.content=void 0,f.state=go.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p=0;if(n.isFull()){p=i-1-a,a++;let g=o[p];e._primitive.tileUnload.raiseEvent(),g.spatialNode.destroyKeyframeNode(g,e.megatextures)}else p=i+l,l++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=go.LoadState.LOADED,o[p]=f,e._primitive.tileLoad.raiseEvent()}}}function o0t(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function r0t(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let o=0;o<n;o++){let{voxelCountPerTile:r,channelCount:s}=i[o],{x:a,y:l,z:u}=r,f=a*l*u,h=e[o],p=f*s;if(h.length!==p)return!1}return!0}function vxe(e,t,n,i){let{camera:o,context:r,pixelRatio:s,frameNumber:a}=i,{positionWC:l,frustum:u}=o,h=r.drawingBufferHeight/s/u.sseDenominator;if(e.computeScreenSpaceError(l,h),t=e.visibility(i,t),t===ys.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,g=p._shape,m=p.screenSpaceError,y=n._priorityQueue,b=n._keyframeCount,x=O.clamp(Math.floor(n._keyframeLocation),0,b-2),A=x+1;if(b===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==b)for(let M=0;M<b;M++)e.createKeyframeNode(M);let{screenSpaceError:E,keyframeNodes:S}=e,v=t0t(E),P=!1;for(let M=0;M<S.length;M++){let R=S[M];R.priority=10*v+s0t(x,R.keyframe,A,n),R.state!==go.LoadState.UNAVAILABLE&&R.state!==go.LoadState.FAILED&&R.priority!==-Number.MAX_VALUE&&y.insert(R),R.state===go.LoadState.LOADED&&(P=!0)}if(E<m||!P){e.children=void 0;return}c(e.children)||e.constructChildNodes(g);for(let M=0;M<8;M++){let R=e.children[M];vxe(R,t,n,i)}}function s0t(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return O.lerp(a,s,.15+.85*s)}function a0t(e,t,n,i,o){let r=e._keyframeCount,s=e.rootNode,a=Object.keys(go.LoadState).length,l=new Array(a),u=new Array(a),f=0;for(let P=0;P<a;P++){let M=new Array(r).fill(0);l[P]=M,u[P]=0}function h(P){let M=P.keyframeNodes;for(let R=0;R<M.length;R++){let L=M[R],B=L.keyframe,_=L.state;l[_][B]+=1,u[_]+=1,f++}if(c(P.children))for(let R=0;R<8;R++){let L=P.children[R];h(L)}}h(s),e._primitive.statistics.numberOfTilesWithContentReady=u[go.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[go.LoadState.RECEIVING],g=u[go.LoadState.PROCESSING],m=p!==e._primitive.statistics.numberOfPendingRequests||g!==e._primitive.statistics.numberOfTilesProcessing;if(m&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,g),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=g,m&&(p===0&&g===0)&&(t.afterRender.push(function(){return e._primitive.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e._primitive.initialTilesLoaded.raiseEvent(),!0}))),!e._debugPrint)return;let b=`KEYFRAMES: ${l[go.LoadState.LOADED]}`,x=`UNLOADED: ${u[go.LoadState.UNLOADED]} | RECEIVING: ${u[go.LoadState.RECEIVING]} | PROCESSING: ${u[go.LoadState.PROCESSING]} | LOADED: ${u[go.LoadState.LOADED]} | FAILED: ${u[go.LoadState.FAILED]} | UNAVAILABLE: ${u[go.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,A=Math.round(n*100)/100,E=Math.round(i*100)/100,S=Math.round(o*100)/100,v=`LOAD: ${A} | OCT: ${E} | ALL: ${S}`;console.log(`${b} || ${x} || ${v}`)}var R8={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function c0t(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,l=0,u=[],f=[];function h(g,m,y,b,x){let A=!1;if(c(g.children))for(let E=0;E<8;E++){let S=g.children[E];S.computeSurroundingRenderableKeyframeNodes(o),S.isRenderable(r)&&(A=!0)}if(A){u[x]=R8.INTERNAL<<16|m,u[y]=b,a++,b=m,x=b*9+1;for(let E=0;E<8;E++){let S=g.children[E];m=a,y=m*9+0,h(S,m,y,b,x+E)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let E=l*5,S=g.renderableKeyframeNodePrevious,v=g.level-S.spatialNode.level,P=S.spatialNode.parent,M=c(P)?P.renderableKeyframeNodePrevious:S,R=l0t(g,i,n),L=v,B=1,_=S.megatextureIndex,w=M.megatextureIndex;f[E+0]=R,f[E+1]=L,f[E+2]=B,f[E+3]=_,f[E+4]=w,u[x]=R8.LEAF<<16|l}else{let E=g.renderableKeyframeNodePrevious,v=g.level-E.spatialNode.level===0?R8.LEAF:R8.PACKED_LEAF_FROM_PARENT;u[x]=v<<16|E.megatextureIndex}l++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&h(p,0,0,0,0),u0t(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&f0t(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function l0t(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return O.clamp(s,0,1)}function u0t(e,t,n,i){let o=ke.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),l=new Uint8Array(s*a*o);for(let h=0;h<e.length;h++){let p=e[h],g=h*o;for(let m=0;m<o;m++)l[g+m]=p>>>m*8&255}let f={source:{arrayBufferView:l,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function f0t(e,t,n,i){let o=ke.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),l=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*l*o);for(let p=0;p<s;p++){let g=e[p*r+0],m=e[p*r+1],y=e[p*r+2],b=e[p*r+3],x=e[p*r+4],A=O.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=A>>>0&255,u[p*8+1]=A>>>8&255,u[p*8+2]=m&255,u[p*8+3]=y&255,u[p*8+4]=b>>>0&255,u[p*8+5]=b>>>8&255,u[p*8+6]=x>>>0&255,u[p*8+7]=x>>>8&255}let h={source:{arrayBufferView:u,width:a,height:l},xOffset:0,yOffset:0};i.copyFrom(h)}function d0t(e,t,n,i){let o=0,r=n.length;for(let s=0;s<r;s++){let a=n[s],l=i[s],u=at.getComponentCount(a);o+=vI.getApproximateTextureMemoryByteLength(e,t,u,l)}return o}var M8=c0;function Xm(e){e=e??W.EMPTY_OBJECT,this._ready=!1,this._provider=e.provider??Xm.DefaultProvider,this._traversal=void 0,this._statistics=new fm,this._calculateStatistics=e.calculateStatistics??!1,this._shape=void 0,this._shapeVisible=!1,this._dimensions=new d,this._inputDimensions=new d,this._paddingBefore=new d,this._paddingAfter=new d,this._minBounds=new d,this._minBoundsOld=new d,this._maxBounds=new d,this._maxBoundsOld=new d,this._exaggeratedMinBounds=new d,this._exaggeratedMinBoundsOld=new d,this._exaggeratedMaxBounds=new d,this._exaggeratedMaxBoundsOld=new d,this._minClippingBounds=new d,this._minClippingBoundsOld=new d,this._maxClippingBounds=new d,this._maxClippingBoundsOld=new d,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._exaggeratedModelMatrix=F.clone(this._modelMatrix),this._compoundModelMatrix=new F,this._compoundModelMatrixOld=new F,this._customShader=e.customShader??Xm.DefaultCustomShader,this._customShaderCompilationEvent=new pe,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=e.clock,this._transformPositionWorldToUv=new F,this._transformPositionUvToWorld=new F,this._transformDirectionWorldToLocal=new J,this._transformNormalLocalToWorld=new J,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new cm,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1,this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new z,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new z,megatextureTextures:[],megatextureSliceDimensions:new z,megatextureTileDimensions:new z,megatextureVoxelSizeUv:new z,megatextureSliceSizeUv:new z,megatextureTileSizeUv:new z,dimensions:new d,inputDimensions:new d,paddingBefore:new d,paddingAfter:new d,transformPositionViewToUv:new F,transformPositionUvToView:new F,transformDirectionViewToLocal:new J,transformNormalLocalToWorld:new J,cameraPositionUv:new d,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new F,stepSize:0,pickColor:new G},this._shapeDefinesOld={},this._uniformMap={};let t=this._uniforms,n=this._uniformMap;for(let o in t)if(t.hasOwnProperty(o)){let r=`u_${o}`;n[r]=function(){return t[o]}}this.tileLoad=new pe,this.tileVisible=new pe,this.tileFailed=new pe,this.tileUnload=new pe,this.loadProgress=new pe,this.allTilesLoaded=new pe,this.initialTilesLoaded=new pe;let i=this._provider;h0t(this,i)}function h0t(e,t){let{shape:n,minBounds:i=Na.getMinBounds(n),maxBounds:o=Na.getMaxBounds(n)}=t;e.minBounds=i,e.maxBounds=o,e.minClippingBounds=i.clone(),e.maxClippingBounds=o.clone(),e._exaggeratedMinBounds=d.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=d.clone(e._maxBounds,e._exaggeratedMaxBounds),e._exaggeratedModelMatrix=F.clone(e._modelMatrix,e._exaggeratedModelMatrix),Pxe(e,t);let r=Na.getShapeConstructor(n);e._shape=new r,e._shapeVisible=Ixe(e,e._shape,t)}Object.defineProperties(Xm.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){T.typeOf.object("modelMatrix",e),this._modelMatrix=F.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._dimensions}},inputDimensions:{get:function(){return this._inputDimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){T.typeOf.bool("show",e),this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){T.typeOf.bool("disableUpdate",e),this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){T.typeOf.bool("debugDraw",e),this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){T.typeOf.bool("depthTest",e),this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){T.typeOf.bool("nearestSampling",e),this._nearestSampling!==e&&(this._nearestSampling=e,this._shaderDirty=!0)}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){T.typeOf.number("levelBlendFactor",e),this._levelBlendFactor=O.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){T.typeOf.number("screenSpaceError",e),this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){T.typeOf.number("stepSize",e),this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){T.defined("minBounds",e),this._minBounds=d.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){T.defined("maxBounds",e),this._maxBounds=d.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){T.defined("minClippingBounds",e),this._minClippingBounds=d.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){T.defined("maxClippingBounds",e),this._maxClippingBounds=d.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){xs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(this._customShader!==e){let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];c(e)?this._customShader=e:this._customShader=Xm.DefaultCustomShader,this._shaderDirty=!0}}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var m0t=new se,p0t=new se,_0t=new d,g0t=new d,y0t=new J,b0t=new J,x0t=new F,T0t=new F,A0t=new F,C0t=F.fromRotationTranslation(J.fromUniformScale(.5,new J),new d(.5,.5,.5),new F),E0t=F.fromRotationTranslation(J.fromUniformScale(2,new J),new d(-1,-1,-1),new F);Xm.prototype.update=function(e){let t=this._provider;this._customShader.update(e);let n=e.context;if(!this._ready){I0t(this,t,n),e.afterRender.push(()=>(this._ready=!0,!0));return}D0t(this,e);let i=Pxe(this,t),o=this._shape;if(i&&(this._shapeVisible=Ixe(this,o,t),R0t(this,o)&&(this._shaderDirty=!0)),!this._shapeVisible)return;let r=M0t(t.timeIntervalCollection,this._clock),s=this._traversal,a=s._sampleCount;if(s.update(e,r,i,this._disableUpdate),a!==s._sampleCount&&(this._shaderDirty=!0),!s.isRenderable(s.rootNode)||(this._debugDraw&&z0t(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),L0t(this,e)&&(this._shaderDirty=!0);let u=s.leafNodeTexture,f=this._uniforms;c(u)&&(f.octreeLeafNodeTexture=s.leafNodeTexture,f.octreeLeafNodeTexelSizeUv=z.clone(s.leafNodeTexelSizeUv,f.octreeLeafNodeTexelSizeUv),f.octreeLeafNodeTilesPerRow=s.leafNodeTilesPerRow),this._shaderDirty&&(E8(this,n),this._shaderDirty=!1);let h=n.uniformState.viewProjection,p=o.orientedBoundingBox,g=B0t(p,h,p0t);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;f.ndcSpaceAxisAlignedBoundingBox=se.clone(g,f.ndcSpaceAxisAlignedBoundingBox);let y=n.uniformState.inverseView;f.transformPositionViewToUv=F.multiplyTransformation(this._transformPositionWorldToUv,y,f.transformPositionViewToUv);let b=n.uniformState.view;f.transformPositionUvToView=F.multiplyTransformation(b,this._transformPositionUvToWorld,f.transformPositionUvToView);let x=n.uniformState.inverseViewRotation;f.transformDirectionViewToLocal=J.multiply(this._transformDirectionWorldToLocal,x,f.transformDirectionViewToLocal),f.transformNormalLocalToWorld=J.clone(this._transformNormalLocalToWorld,f.transformNormalLocalToWorld);let A=e.camera.positionWC;f.cameraPositionUv=F.multiplyByPoint(this._transformPositionWorldToUv,A,f.cameraPositionUv),f.stepSize=this._stepSizeMultiplier;let E=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;E.boundingVolume=o.boundingSphere,e.commandList.push(E)};var S0t=new d,MK=new d,w0t=new he,v0t=new d;function D0t(e,t){if(e._exaggeratedMinBounds=d.clone(e._minBounds,e._exaggeratedMinBounds),e._exaggeratedMaxBounds=d.clone(e._maxBounds,e._exaggeratedMaxBounds),e.shape===Na.ELLIPSOID){let n=t.verticalExaggerationRelativeHeight,i=t.verticalExaggeration;e._exaggeratedMinBounds.z=(e._minBounds.z-n)*i+n,e._exaggeratedMaxBounds.z=(e._maxBounds.z-n)*i+n}else{let n=d.fromElements(1,1,t.verticalExaggeration,S0t);e._exaggeratedModelMatrix=F.multiplyByScale(e._modelMatrix,n,e._exaggeratedModelMatrix),e._exaggeratedModelMatrix=F.multiplyByTranslation(e._exaggeratedModelMatrix,P0t(e,t),e._exaggeratedModelMatrix)}}function P0t(e,t){let{shapeTransform:n=F.IDENTITY,globalTransform:i=F.IDENTITY}=e._provider,o=F.getTranslation(n,MK),r=F.multiplyByPoint(e._modelMatrix,o,MK),s=F.multiplyByPoint(i,r,MK),l=ie.WGS84.cartesianToCartographic(s,w0t),u=0;c(l)&&(u=l.height);let f=Rr.getHeight(u,t.verticalExaggeration,t.verticalExaggerationRelativeHeight);return d.fromElements(0,0,(f-u)/t.verticalExaggeration,v0t)}function I0t(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=G.clone(e._pickId.color,i.pickColor);let{shaderDefines:o,shaderUniforms:r}=e._shape;e._shapeDefinesOld=We(o,!0);let s=e._uniformMap;for(let l in r)if(r.hasOwnProperty(l)){let u=`u_${l}`;c(s[u])&&dt(`VoxelPrimitive: Uniform name "${u}" is already defined`),s[u]=function(){return r[l]}}if(e._dimensions=d.clone(t.dimensions,e._dimensions),i.dimensions=d.clone(e._dimensions,i.dimensions),e._paddingBefore=d.clone(t.paddingBefore??d.ZERO,e._paddingBefore),i.paddingBefore=d.clone(e._paddingBefore,i.paddingBefore),e._paddingAfter=d.clone(t.paddingAfter??d.ZERO,e._paddingAfter),i.paddingAfter=d.clone(e._paddingAfter,i.paddingAfter),e._inputDimensions=d.add(e._dimensions,e._paddingBefore,e._inputDimensions),e._inputDimensions=d.add(e._inputDimensions,e._paddingAfter,e._inputDimensions),t.metadataOrder===hh.Y_UP){let l=e._inputDimensions.y;e._inputDimensions.y=e._inputDimensions.z,e._inputDimensions.z=l}i.inputDimensions=d.clone(e._inputDimensions,i.inputDimensions);let a=t.keyframeCount??1;e._traversal=new M8(e,n,a),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,O0t(e._traversal,i)}function Pxe(e,t){let n=t.shapeTransform??F.IDENTITY,i=t.globalTransform??F.IDENTITY;return F.multiplyTransformation(i,e._exaggeratedModelMatrix,e._compoundModelMatrix),F.multiplyTransformation(e._compoundModelMatrix,n,e._compoundModelMatrix),Fx(e,"_compoundModelMatrix","_compoundModelMatrixOld")+Fx(e,"_minBounds","_minBoundsOld")+Fx(e,"_maxBounds","_maxBoundsOld")+Fx(e,"_exaggeratedMinBounds","_exaggeratedMinBoundsOld")+Fx(e,"_exaggeratedMaxBounds","_exaggeratedMaxBoundsOld")+Fx(e,"_minClippingBounds","_minClippingBoundsOld")+Fx(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function Fx(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}function Ixe(e,t,n){if(!t.update(e._compoundModelMatrix,e._exaggeratedMinBounds,e._exaggeratedMaxBounds,e.minClippingBounds,e.maxClippingBounds))return!1;let o=t.shapeTransform,r=F.inverse(o,x0t),s=F.getRotation(o,y0t),a=F.getScale(o,_0t),l=d.maximumComponent(a),u=d.divideByScalar(a,l,g0t),f=J.multiplyByScale(s,u,b0t);return e._transformPositionWorldToUv=F.multiplyTransformation(C0t,r,e._transformPositionWorldToUv),e._transformPositionUvToWorld=F.multiplyTransformation(o,E0t,e._transformPositionUvToWorld),e._transformDirectionWorldToLocal=F.getMatrix3(r,e._transformDirectionWorldToLocal),e._transformNormalLocalToWorld=J.inverseTranspose(f,e._transformNormalLocalToWorld),!0}function O0t(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=z.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let n=e.megatextures,i=n[0],o=n.length;t.megatextureTextures=new Array(o);for(let r=0;r<o;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureSliceDimensions=z.clone(i.sliceCountPerRegion,t.megatextureSliceDimensions),t.megatextureTileDimensions=z.clone(i.regionCountPerMegatexture,t.megatextureTileDimensions),t.megatextureVoxelSizeUv=z.clone(i.voxelSizeUv,t.megatextureVoxelSizeUv),t.megatextureSliceSizeUv=z.clone(i.sliceSizeUv,t.megatextureSliceSizeUv),t.megatextureTileSizeUv=z.clone(i.regionSizeUv,t.megatextureTileSizeUv)}function R0t(e,t){let n=t.shaderDefines,i=Object.keys(n).some(o=>n[o]!==e._shapeDefinesOld[o]);return i&&(e._shapeDefinesOld=We(n,!0)),i}function M0t(e,t){if(!c(e)||!c(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=Q.secondsDifference(i.stop,i.start),a=Q.secondsDifference(n,i.start)/r;return o+a}function L0t(e,t){let n=e.clippingPlanes;if(!c(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=F.transpose(F.multiplyTransformation(F.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionUvToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}Xm.prototype.isDestroyed=function(){return!1};Xm.prototype.destroy=function(){let e=this._drawCommand;c(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return c(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this.statistics.texturesByteLength=0,this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),de(this)};var Dxe=new Array(new se(-1,-1,-1,1),new se(1,-1,-1,1),new se(-1,1,-1,1),new se(1,1,-1,1),new se(-1,-1,1,1),new se(1,-1,1,1),new se(-1,1,1,1),new se(1,1,1,1)),N0t=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),F0t=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function B0t(e,t,n){let i=F.fromRotationTranslation(e.halfAxes,e.center,T0t),o=F.multiply(t,i,A0t),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,l=-Number.MAX_VALUE,u,f=F0t,h=Dxe.length;for(u=0;u<h;u++)F.multiplyByVector(o,Dxe[u],f[u]);for(u=0;u<h;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,m=p.y/p.w;r=Math.min(r,g),s=Math.max(s,g),a=Math.min(a,m),l=Math.max(l,m)}else for(let g=0;g<3;g++){let m=N0t[u*3+g],y=f[m];if(y.z>=-y.w){let b=p.z+p.w,x=y.z+y.w,A=b/(b-x),E=se.lerp(p,y,A,m0t),S=E.x/E.w,v=E.y/E.w;r=Math.min(r,S),s=Math.max(s,S),a=Math.min(a,v),l=Math.max(l,v)}}}return r=O.clamp(r,-1,1),a=O.clamp(a,-1,1),s=O.clamp(s,-1,1),l=O.clamp(l,-1,1),n=se.fromElements(r,a,s,l,n),n}var LK=3e7,k0t=new d(LK,0,0),U0t=new d(0,LK,0),V0t=new d(0,0,LK);function z0t(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(l,u,f,h){i.add({positions:[l,u],width:h,material:Xi.fromType("Color",{color:f})})}function r(l,u,f){let h=l.computeCorners();o(h[0],h[1],u,f),o(h[2],h[3],u,f),o(h[4],h[5],u,f),o(h[6],h[7],u,f),o(h[0],h[2],u,f),o(h[4],h[6],u,f),o(h[1],h[3],u,f),o(h[5],h[7],u,f),o(h[0],h[4],u,f),o(h[2],h[6],u,f),o(h[1],h[5],u,f),o(h[3],h[7],u,f)}function s(l){if(!n.isRenderable(l))return;let u=l.level,h=Math.max(1,5/Math.pow(2,u)),g=[G.RED,G.LIME,G.BLUE][u%3];if(r(l.orientedBoundingBox,g,h),c(l.children))for(let m=0;m<8;m++)s(l.children[m])}r(e._shape.orientedBoundingBox,G.WHITE,5),s(n.rootNode);let a=10;o(d.ZERO,k0t,G.RED,a),o(d.ZERO,U0t,G.LIME,a),o(d.ZERO,V0t,G.BLUE,a),i.update(t)}Xm.DefaultCustomShader=new aS({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material)
{
material.diffuse = vec3(1.0);
material.alpha = 1.0;
}`});function Oxe(){this.ready=!0,this.shape=Na.BOX,this.dimensions=new d(1,1,1),this.names=["data"],this.types=[at.SCALAR],this.componentTypes=[Nt.FLOAT32],this.maximumTileCount=1}Oxe.prototype.requestData=function(e){if((c(e)?e.tileLevel??0:0)>=1)return;let n=new cS({metadata:[new Float32Array(1)]});return Promise.resolve(n)};Xm.DefaultProvider=new Oxe;var Bx=Xm;function H0t(e,t,n,i){if(!c(e)||c(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!c(r))return;let a=(r.properties||{})[i];if(c(a))return a}var L8=H0t;function G0t(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var N8=G0t;function j0t(e,t,n){if(!c(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(c(a))return a}}var F8=j0t;var k8=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function ei(e){e=e??W.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=We(e.contextOptions);if(!c(t))throw new C("options and options.canvas are required.");let r=c(n),s=new aL(t,o);r||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),c(i)||(i=t.parentNode),this._id=jn(),this._jobScheduler=new n4,this._frameState=new Jz(s,new jz(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!r,this._creditContainer=n,this._canvas=t,this._context=s,this._computeEngine=new a1(s),this._ellipsoid=e.ellipsoid??ie.default,this._globe=void 0,this._globeTranslucencyState=new e4,this._primitives=new Ol,this._groundPrimitives=new Ol,this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=ei.defaultLogDepthBuffer&&s.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new nS,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new Kz(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ti({color:new G,stencil:0,owner:this}),this._depthClearCommand=new ti({depth:1,owner:this}),this._stencilClearCommand=new ti({stencil:0}),this._classificationStencilClearCommand=new ti({stencil:0,renderState:ze.fromCache({stencilMask:kt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new j4(this),this._preUpdate=new pe,this._postUpdate=new pe,this._renderError=new pe,this._preRender=new pe,this._postRender=new pe,this._minimumDisableDepthTestDistance=0,this._debugInspector=new r8,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new pe,this.morphComplete=new pe,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=G.clone(G.BLACK),this._mode=oe.SCENE3D,this._mapProjection=c(e.mapProjection)?e.mapProjection:new Oi(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new IA,this.fog=new Qz,this.fog.enabled=ie.WGS84.equals(this._ellipsoid),ie.WGS84.equals(this._ellipsoid)||(ro.DEFAULT_VIEW_RECTANGLE=ce.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new ro(this),this.shadowMap=new i0({context:s,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=G.clone(G.WHITE),this._actualInvertClassificationColor=G.clone(this._invertClassificationColor),this._invertClassification=new fI,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new z4,this._brdfLutGenerator=new Mz,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new t8(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??Pu.INFINITE_SCROLL,this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Tc.requestCompletedEvent.addEventListener(k8(this)),this._removeTaskProcessorListenerCallback=bi.taskCompletedEvent.addEventListener(k8(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new Ke(0,0,s.drawingBufferWidth,s.drawingBufferHeight),l=new ro(this);this._logDepthBuffer&&(l.frustum.near=.1,l.frustum.far=1e10),this.preloadFlightCamera=new ro(this),this.preloadFlightCullingVolume=void 0,this._picking=new T4(this),this._defaultView=new ZE(this,l,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new Y_,Fxe(this,0,Q.now()),this.updateFrameState(),this.initializeFrame()}ei.defaultLogDepthBuffer=!0;function W0t(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];c(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(k8(e))),n.push(t.terrainProviderChanged.addEventListener(k8(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(ei.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return ut.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return ut.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return Hh.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,W0t(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(c(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(c(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),c(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(c(this.globe))return this.globe.terrainProviderChanged}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){if(this.scene3DOnly&&e!==oe.SCENE3D)throw new C("Only SceneMode.SCENE3D is valid when scene3DOnly is true.");if(e===oe.SCENE2D)this.morphTo2D(0);else if(e===oe.SCENE3D)this.morphTo3D(0);else if(e===oe.COLUMBUS_VIEW)this.morphToColumbusView(0);else throw new C("value must be a valid SceneMode enumeration.");this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){if(this.camera.frustum instanceof on)throw new C("VR is unsupported with an orthographic projection.");this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new ro(this),c(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new Zz(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){if(!c(e)||e<0)throw new C("minimumDisableDepthTestDistance must be greater than or equal to 0.0.");this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,ut.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});ei.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function q0t(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function Rxe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,l=t.derivedCommands;c(t.pickId)&&(l.picking=A_.createPickDerivedCommand(e,t,o,l.picking)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,c(t.pickedMetadataInfo)&&(l.pickingMetadata=A_.createPickMetadataDerivedCommand(e,t,o,l.pickingMetadata))),t.pickOnly||(l.depth=A_.createDepthOnlyDerivedCommand(e,t,o,l.depth)),l.originalCommand=t,e._hdr&&(l.hdr=A_.createHdrCommand(t,o,l.hdr),t=l.hdr.command,l=t.derivedCommands),a&&t.receiveShadows&&(l.shadows=i0.createReceiveDerivedCommand(s,t,n,o,l.shadows)),t.pass===De.TRANSLUCENT&&c(r)&&r.isSupported()&&(a&&t.receiveShadows?(l.oit=c(l.oit)?l.oit:{},l.oit.shadows=r.createDerivedCommands(l.shadows.receiveCommand,o,l.oit.shadows)):l.oit=r.createDerivedCommands(t,o,l.oit))}ei.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!c(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let l=this._hdr,u=c(t.logDepth),f=c(t.hdr),h=c(t.originalCommand),p=o&&!u,g=l&&!f,m=(!o||!l)&&!h,y=n.pickingMetadata&&q0t(e,n);if(e.dirty=e.dirty||p||g||m||y,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:x}=i;b&&e.castShadows&&(t.shadows=i0.createCastDerivedCommand(x,e,s,r,t.shadows)),(u||p)&&(t.logDepth=A_.createLogDepthCommand(e,r,t.logDepth),Rxe(this,t.logDepth.command,s)),(h||m)&&Rxe(this,e,s)};var Y0t=new lh({pass:Uo.RENDER}),NK=new lh({pass:Uo.PRELOAD}),FK=new lh({pass:Uo.PRELOAD_FLIGHT}),X0t=new lh({pass:Uo.REQUEST_RENDER_MODE_DEFER_CHECK}),Mxe=new le,BK;function K0t(e){if(!(e._mode!==oe.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return Mxe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,BK=Rz.fromBoundingSphere(Mxe,e.camera.positionWC,BK),BK}ei.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function Fxe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=Q.clone(n,i.time)}ei.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=K0t(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof on||this.camera.frustum instanceof jo),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;c(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,c(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=G.clone(this.invertClassificationColor,this._actualInvertClassificationColor),fI.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,c(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};ei.prototype.isVisible=function(e,t,n){if(!c(t))return!1;let{boundingVolume:i}=t;return!c(i)||!t.cull?!0:e.computeVisibility(i)===Wt.OUTSIDE?!1:!c(n)||!t.occlude||!i.isOccluded(n)};var B8=new F(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);B8=F.inverseTransformation(B8,B8);function $0t(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;c(t._debugVolume)&&t._debugVolume.destroy();let a=d.clone(s.center);if(o.mode!==oe.SCENE3D){a=F.multiplyByPoint(B8,a,a);let m=o.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let l,u,{radius:f}=s;c(f)?(l=da.createGeometry(new da({radii:new d(f,f,f),vertexFormat:rn.FLAT_VERTEX_FORMAT})),u=F.fromTranslation(a)):(l=Za.createGeometry(Za.fromDimensions({dimensions:new d(2,2,2),vertexFormat:rn.FLAT_VERTEX_FORMAT})),u=F.fromRotationTranslation(s.halfAxes,a,new F)),t._debugVolume=new In({geometryInstances:new St({geometry:Nn.toWireframe(l),modelMatrix:u,attributes:{color:new jt(1,0,0,1)}}),appearance:new rn({flat:!0,translucent:!1}),asynchronous:!1});let h=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=A_.createLogDepthCommand(e,r).command);let g;c(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(r,n),c(g)&&(n.framebuffer=g),o.commandList=h}function Km(e,t,n,i){let o=t._frameState,r=t._context;if(c(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ti){e.execute(r,n);return}e.debugShowBoundingVolume&&c(e.boundingVolume)&&$0t(e,t,n,i),o.useLogDepth&&c(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&c(e.derivedCommands)&&c(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.pickingMetadata&&c(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&c(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(c(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&c(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function Lxe(e,t,n){let{derivedCommands:i}=e;if(!c(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&c(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:l}=e.derivedCommands;c(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),c(s)?(e=s.pickCommand,e.execute(r,n)):c(l)&&(e=l.depthOnlyCommand,e.execute(r,n))}function Bxe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}function Z0t(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+O.EPSILON12}function Q0t(e,t,n,i,o){Zy(i,Bxe,e.camera.positionWC),c(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function J0t(e,t,n,i,o){Zy(i,Z0t,e.camera.positionWC),c(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function ebt(e,t,n){e.context.uniformState.updatePass(De.VOXELS);let i=n.commands[De.VOXELS];i.length=n.indices[De.VOXELS],Zy(i,Bxe,e.camera.positionWC);for(let o=0;o<i.length;++o)Km(i[o],e,t)}var tbt=new wi,nbt=new zl,ibt=new on,obt=new jo;function rbt(e){let{frustum:t}=e;return c(t.fov)?t.clone(tbt):c(t.infiniteProjectionMatrix)?t.clone(nbt):c(t.width)?t.clone(ibt):t.clone(obt)}function sbt(e){if(e._environmentState.useOIT){if(!c(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?Q0t:J0t}function abt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,l;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(l=e._invertClassification);let u=sbt(e);o.uniformState.updatePass(De.TRANSLUCENT);let f=n.commands[De.TRANSLUCENT];f.length=n.indices[De.TRANSLUCENT],u(e,Km,t,f,l)}function cbt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[De.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[De.TRANSLUCENT];i.executeTranslucentCommands(e,Km,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,Km,t,n)}function UK(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n);let s=rbt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,l=a.pick||a.pickVoxel;l||lbt(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:h,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:m}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:b,sceneFramebuffer:x,frustumCommandsList:A}=e._view,E=A.length,S=e._globeTranslucencyState,v=e._depthClearCommand,P=e._stencilClearCommand,M=e._classificationStencilClearCommand,R=e._depthPlane,L=n.position.z;function B(w,D){r.updatePass(D);let I=w.commands[D],N=w.indices[D];for(let k=0;k<N;++k)Km(I[k],e,t);return N}function _(w,D){r.updatePass(D);let I=w.commands[D],N=w.indices[D];for(let k=0;k<N;++k)Lxe(I[k],e,t)}for(let w=0;w<E;++w){let D=E-w-1,I=A[D];e.mode===oe.SCENE2D?(n.position.z=L-I.near+1,s.far=Math.max(1,I.far-I.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=D!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&P.execute(i,t),S.translucent?(r.updatePass(De.GLOBE),S.executeGlobeCommands(I,Km,b,e,t)):B(I,De.GLOBE),p&&y.executeCopyDepth(i,t),f||(S.translucent?(r.updatePass(De.TERRAIN_CLASSIFICATION),S.executeGlobeClassificationCommands(I,Km,b,e,t)):B(I,De.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),h&&R.execute(i,t));let N;if(!g||l||f)N=B(I,De.CESIUM_3D_TILE),N>0&&(p&&(y.prepareColorTextures(i,u),y.executeUpdateDepth(i,t,y.depthStencilTexture)),f||(N=B(I,De.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let H=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,N=B(I,De.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),N=B(I,De.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=H,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),N>0&&i.stencilBuffer&&M.execute(i,t),N=B(I,De.CESIUM_3D_TILE_CLASSIFICATION)}if(N>0&&i.stencilBuffer&&P.execute(i,t),ebt(e,t,I),B(I,De.OPAQUE),D!==0&&e.mode!==oe.SCENE2D&&(s.near=I.near,r.updateFrustum(s)),abt(e,t,I),cbt(e,t,I),i.depthTexture&&e.useDepthPicking&&(p||f)){let H=e._picking.getPickDepth(e,D);H.update(i,y.depthStencilTexture),H.executeCopyDepth(i,t)}if(l||!m)continue;let k=t.framebuffer;t.framebuffer=x.getIdFramebuffer(),s.near=D!==0?I.near*e.opaqueFrustumNearOffset:I.near,s.far=I.far,r.updateFrustum(s),S.translucent?(r.updatePass(De.GLOBE),S.executeGlobeCommands(I,Lxe,b,e,t)):_(I,De.GLOBE),u&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),u&&h&&R.execute(i,t),_(I,De.CESIUM_3D_TILE),_(I,De.OPAQUE),_(I,De.TRANSLUCENT),t.framebuffer=k}}function lbt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(De.ENVIRONMENT),c(i.skyBoxCommand)&&Km(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&Km(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let r;i.useGlobeDepthFramebuffer?r=o.globeDepth.framebuffer:i.usePostProcess?r=o.sceneFramebuffer.framebuffer:r=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,r),t.framebuffer=r}i.isMoonVisible&&i.moonCommand.execute(n,t)}function kxe(e){e.context.uniformState.updatePass(De.COMPUTE);let t=e._environmentState.sunComputeCommand;c(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function ubt(e,t){e.context.uniformState.updatePass(De.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function fbt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[De.GLOBE,De.CESIUM_3D_TILE,De.OPAQUE,De.TRANSLUCENT];for(let l=0;l<t.length;++l){let u=t[l];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(o)for(let f=0;f<s;++f)r[f].commandList.push(u);else if(s===1)r[0].commandList.push(u);else{let f=!1;for(let h=s-1;h>=0;--h){let p=r[h].cullingVolume;if(e.isVisible(p,u))r[h].commandList.push(u),f=!0;else if(f)break}}}}function Uxe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let l=o[a];if(l.outOfView)continue;let{passes:u}=l;for(let f=0;f<u.length;++f)u[f].commandList.length=0;fbt(e,n,l);for(let f=0;f<u.length;++f){let h=l.passes[f],{camera:p,commandList:g}=h;s.updateCamera(p),l.updatePass(r,f);for(let m=0;m<g.length;++m){let y=g[m];s.updatePass(y.pass);let b=y.derivedCommands.shadows.castCommands[a];Km(b,e,h.passState)}}}}var dbt=new d;ei.prototype.updateAndExecuteCommands=function(e,t){Sbt(this,e,t),this._environmentState.useWebVR?hbt(this,e,t):this._frameState.mode!==oe.SCENE2D||this._mapMode2D===Pu.ROTATE?l0(!0,this,e):Abt(this,e)};function hbt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;Vxe(e),n.createPotentiallyVisibleSet(e),kxe(e),r||Uxe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=ro.clone(i,e._cameraVR);a.frustum=i.frustum;let l=i.frustum.near,u=l*(e.focalLength??5),f=e.eyeSeparation??u/30,h=d.multiplyByScalar(a.right,f*.5,dbt);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*l/u;d.add(a.position,h,i.position),i.frustum.xOffset=p,UK(e,t),s.x=s.width,d.subtract(a.position,h,i.position),i.frustum.xOffset=-p,UK(e,t),ro.clone(a,i)}var mbt=new he(Math.PI,O.PI_OVER_TWO),pbt=new d,_bt=new d,gbt=new F,ybt=new F,bbt=new d,xbt=new d,Tbt=new Ke;function Abt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=Ke.clone(r,Tbt);t.viewport=s;let a=mbt,l=pbt;e.mapProjection.project(a,l);let f=d.clone(i.position,_bt),h=F.clone(i.transform,ybt),p=i.frustum.clone();i._setTransform(F.IDENTITY);let g=F.computeViewportTransformation(s,0,1,gbt),m=i.frustum.projectionMatrix,y=i.positionWC.y,b=d.fromElements(O.sign(y)*l.x-y,0,-i.positionWC.x,bbt),x=Ot.pointToGLWindowCoordinates(m,g,b,xbt);x.x=Math.floor(x.x);let A=s.x,E=s.width;if(y===0||x.x<=A||x.x>=A+E)l0(!0,e,t);else if(Math.abs(A+E*.5-x.x)<1)s.width=x.x-s.x,i.position.x*=O.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),l0(!0,e,t),s.x=x.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),l0(!1,e,t);else if(x.x>A+E*.5){s.width=x.x-A;let S=i.frustum.right;i.frustum.right=l.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),l0(!0,e,t),s.x=x.x,s.width=A+E-x.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=S-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),l0(!1,e,t)}else{s.x=x.x,s.width=A+E-x.x;let S=i.frustum.left;i.frustum.left=-l.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),l0(!0,e,t),s.x=A,s.width=x.x-A,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=S-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),l0(!1,e,t)}i._setTransform(h),d.clone(f,i.position),i.frustum=p.clone(),t.viewport=r}function l0(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),Vxe(t),i.createPotentiallyVisibleSet(t),e&&(kxe(t),o||Uxe(t)),UK(t,n)}var Nxe=new ys;ei.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,s=this.skyAtmosphere,a=this.globe,l=this._globeTranslucencyState;if(!i||this._mode!==oe.SCENE2D&&t.camera.frustum instanceof on||!l.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(c(s)){if(c(a))s.setDynamicLighting(Ig.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let x=r.dynamicLighting;s.setDynamicLighting(x),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),c(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=c(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let b=c(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=c(b)?b.drawCommand:void 0,n.sunComputeCommand=c(b)?b.computeCommand:void 0,n.moonCommand=c(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=c(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===oe.SCENE2D);(n.useDepthPlane=u&&this.mode===oe.SCENE3D&&l.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==oe.SCENE2D&&!o;let h=e.mode===oe.SCENE3D&&!l.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=Nxe.planes;for(let b=0;b<5;++b)g[b]=p.planes[b];p=Nxe,n.isSkyAtmosphereVisible=c(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,h),n.isMoonVisible=this.isVisible(p,n.moonCommand,h);let m=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;c(m)&&y?.url!==m?(y=y&&y.destroy(),this._specularEnvironmentCubeMap=new Hh(m)):!c(m)&&c(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),c(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e)};function Cbt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new T_({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),c(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function Ebt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===oe.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<r;++a)if(o[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<r;++a){let l=o[a];l.update(t),i.shadowMaps.push(l),l.fromLightSource&&(i.lightShadowMaps.push(l),i.lightShadowsEnabled=!0),l.dirty&&(++i.lastDirtyTime,l.dirty=!1)}}}function Vxe(e){let t=e._frameState;e._groundPrimitives.update(t),e._primitives.update(t),Cbt(e),Ebt(e),e._globe&&e._globe.render(t)}function Sbt(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,l=a.pick||a.pickVoxel;c(s.globeDepth)&&(s.globeDepth.picking=l);let u=r.useWebVR;r.originalFramebuffer=t.framebuffer,c(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new o8:c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!c(e.sun)&&c(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;G.clone(n,f.color),f.execute(i,t);let h=r.useGlobeDepthFramebuffer=c(s.globeDepth);h&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=r.useOIT=!l&&c(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let m=e.postProcessStages,y=r.usePostProcess=!l&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);if(r.usePostProcessSelected=!1,y&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,o.useLogDepth,e._hdr),m.clear(i),y=r.usePostProcess=m.ready,r.usePostProcessSelected=y&&m.hasSelected),r.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):h?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),c(t.framebuffer)&&f.execute(i,t),r.useInvertClassification=!l&&c(t.framebuffer)&&e.invertClassification){let x;if(o.invertClassificationColor.alpha===1&&h&&(x=s.globeDepth.framebuffer),c(x)||i.depthTexture){if(e._invertClassification.previousFramebuffer=x,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&g){let A=e._invertClassification.unclassifiedCommand,E=A.derivedCommands;E.oit=p.createDerivedCommands(A,i,E.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}ei.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;c(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:l,originalFramebuffer:u}=n,f=a?o.colorFramebufferManager:void 0,h=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=l?h.framebuffer:u,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),l){i.sceneFramebuffer.prepareColorTextures(t);let g=h;a&&!s&&(g=f);let m=this.postProcessStages,y=g.getColorTexture(0),b=p.getColorTexture(0),x=(f??h).getDepthStencilTexture();m.execute(t,y,x,b),m.copy(t,u)}!s&&!l&&a&&(e.framebuffer=u,o.executeCopyColor(t,e))};function wbt(e){let t=e._frameState.afterRender;for(let n=0;n<t.length;++n)t[n]()&&e.requestRender();t.length=0}function vbt(e){if(e.mode===oe.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function zxe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof Ol){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=zxe(s,t,n);c(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let o=e.getHeight(t,n);if(c(o)&&o>i)return o}return i}ei.prototype.getHeight=function(e,t){if(!c(e))return;let n=t===qe.CLAMP_TO_TERRAIN||t===qe.RELATIVE_TO_TERRAIN,i=t===qe.CLAMP_TO_3D_TILE||t===qe.RELATIVE_TO_3D_TILE;if(!c(e))return;let o=Number.NEGATIVE_INFINITY;if(!n){let s=zxe(this.primitives,e,this);c(s)&&s>o&&(o=s)}let r=this._globe;if(!i&&c(r)&&r.show){let s=r.getHeight(e);s>o&&(o=s)}if(o>Number.NEGATIVE_INFINITY)return o};var kK=new he;ei.prototype.updateHeight=function(e,t,n){T.typeOf.func("callback",t);let i=this._ellipsoid,o=g=>{he.clone(e,kK);let m;c(g)&&(m=g.height),c(m)||(m=this.getHeight(e,n)),c(m)&&(kK.height=m,t(kK))},r=n===qe.CLAMP_TO_TERRAIN||n===qe.RELATIVE_TO_TERRAIN,s=n===qe.CLAMP_TO_3D_TILE||n===qe.RELATIVE_TO_3D_TILE,a;!s&&c(this.globe)&&(a=this.globe._surface.updateHeight(e,o));let l={},u=g=>{if(r||g.isDestroyed()||!g.isCesium3DTileset)return;let m=g.updateHeight(e,o,i);l[g.id]=m};if(!r){let g=this.primitives.length;for(let m=0;m<g;++m){let y=this.primitives.get(m);u(y)}}let f=this.primitives.primitiveAdded.addEventListener(u),h=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(c(l[g.id])&&l[g.id](),delete l[g.id])});return()=>{a=a&&a(),Object.values(l).forEach(g=>g()),l={},f(),h()}};function Dbt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!c(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===oe.SCENE2D||n===oe.MORPHING)return!1;let r=e._globeHeight;return c(r)&&o.height<r}ei.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=vbt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=Dbt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),c(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function Pbt(e,t){if(e.debugShowFramesPerSecond){if(!c(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new t0({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else c(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function Ibt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),c(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function Obt(e){e.primitives.postPassesUpdate(e._frameState),Tc.update()}var Rbt=new G;function Mbt(e){let t=e._frameState,n=e.context,{uniformState:i}=n,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=Y0t;let r=e.backgroundColor??G.BLACK;e._hdr&&(r=G.clone(r,Rbt),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;c(s)&&s.enabled&&(!c(e.light)||e.light instanceof Y_?d.negate(i.sunDirectionWC,e._shadowMapCamera.direction):d.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let l=o.passState;l.framebuffer=void 0,l.blendingEnabled=void 0,l.scissorTest=void 0,l.viewport=Ke.clone(a,l.viewport),c(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(l,r),e.resolveFramebuffers(l),l.framebuffer=void 0,ubt(e,l),c(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function kx(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function Lbt(e){return e._picking.updateMostDetailedRayPicks(e)}ei.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,c(e)||(e=Q.now());let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===oe.MORPHING;if(!i&&c(this.maximumRenderTimeChange)&&c(this._lastRenderTime)){let o=Math.abs(Q.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=Q.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=O.incrementWrap(t.frameNumber,15e6,1);Fxe(this,o,e),t.newFrame=!0}kx(this,Ibt),this.primitives.show&&(kx(this,Lbt),kx(this,Nbt),kx(this,Fbt),i||kx(this,Bbt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),kx(this,Mbt)),Pbt(this,i),kx(this,Obt),wbt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};ei.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};ei.prototype.requestRender=function(){this._renderRequested=!0};ei.prototype.clampLineWidth=function(e){return Math.max(ut.minimumAliasedLineWidth,Math.min(e,ut.maximumAliasedLineWidth))};ei.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n)};ei.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!c(i))return;let o=i.primitive;if(!(o instanceof Bx))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!c(a))return;let l=255*r[2]+r[3];return s8.fromKeyframeNode(o,s,l,a)};ei.prototype.pickMetadata=function(e,t,n,i){T.typeOf.object("windowPosition",e),T.typeOf.string("className",n),T.typeOf.string("propertyName",i);let o=this.pick(e);if(!c(o))return;let r=o.detail?.model?.structuralMetadata;if(!c(r))return;let s=r.schema,a=L8(s,t,n,i);if(!c(a))return;let l=F8(r,n,i);if(!c(l))return;let u=new N8(t,n,i,a,l);return this._picking.pickMetadata(this,e,u)};ei.prototype.pickMetadataSchema=function(e){T.typeOf.object("windowPosition",e);let t=this.pick(e);return c(t)?t.detail?.model?.structuralMetadata?.schema:void 0};ei.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};ei.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};ei.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function Nbt(e){let t=e._frameState;NK.camera=t.camera,NK.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,NK)}function Fbt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;FK.camera=e.preloadFlightCamera,FK.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,FK)}function Bbt(e){e.primitives.updateForPass(e._frameState,X0t)}ei.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};ei.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};ei.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};ei.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};ei.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};ei.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};ei.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};ei.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};ei.prototype.cartesianToCanvasCoordinates=function(e,t){return Hi.worldToWindowCoordinates(this,e,t)};ei.prototype.completeMorph=function(){this._transitioner.completeMorph()};ei.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};ei.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};ei.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function kbt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){c(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{c(e)&&c(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}ei.prototype.setTerrain=function(e){return T.typeOf.object("terrain",e),kbt(this,e),e};ei.prototype.isDestroyed=function(){return!1};ei.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),c(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,c(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),de(this)};var U8=ei;function hS(e){e=e??ie.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=d.multiplyByScalar(e.radii,t,new d);this._scaleMatrix=F.fromScale(n),this._modelMatrix=new F,this._command=new Je({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new d(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new d(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new d;let i=new d;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(hS.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});hS.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var VK=new F;hS.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==oe.SCENE3D&&n!==oe.MORPHING||!e.passes.render)return;let i=F.fromRotationTranslation(e.context.uniformState.inverseViewRotation,d.ZERO,VK),o=F.multiplyTransformation(i,Fo.Y_UP_TO_Z_UP,VK),r=F.multiply(this._scaleMatrix,o,VK);F.clone(r,this._modelMatrix);let s=e.context,a=Ubt(this),l=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||l||!c(t)||!t.show,f=this._command;if(!c(f.vertexArray)){let p=da.createGeometry(new da({radii:new d(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Ie.POSITION_ONLY}));f.vertexArray=ni.fromGeometry({context:s,geometry:p,attributeLocations:Nn.createAttributeLocations(p),bufferUsage:Be.STATIC_DRAW}),f.renderState=ze.fromCache({cull:{enabled:!0,face:Ti.FRONT},blending:un.ALPHA_BLEND,depthMask:!1})}let h=a|u<<2|l<<3;if(h!==this._flags){this._flags=h;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),l&&p.push("GLOBE_TRANSLUCENT");let g=new He({defines:p,sources:[Qh,UP,AV]}),m=new He({defines:p,sources:[Qh,UP,TV]});this._spSkyAtmosphere=en.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function Ubt(e){return!(O.equalsEpsilon(e.hueShift,0,O.EPSILON7)&&O.equalsEpsilon(e.saturationShift,0,O.EPSILON7)&&O.equalsEpsilon(e.brightnessShift,0,O.EPSILON7))}hS.prototype.isDestroyed=function(){return!1};hS.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),de(this)};var V8=hS;function pS(e){this.sources=e.sources,this._sources=void 0,this.show=e.show??!0,this._command=new Je({modelMatrix:F.clone(F.IDENTITY),owner:this}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0}pS.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r}=e;if(!this.show||i!==oe.SCENE3D&&i!==oe.MORPHING||!o.render)return;if(this._hasError){let a=this._error;throw this._hasError=!1,this._error=void 0,a}if(this._sources!==this.sources){this._sources=this.sources;let a=this.sources;if(T.defined("this.sources",a),Object.values(Go.FaceName).some(u=>!c(a[u])))throw new C("this.sources must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties.");let l=typeof a.positiveX;if(Object.values(Go.FaceName).some(u=>typeof a[u]!==l))throw new C("this.sources properties must all be the same type.");typeof a.positiveX=="string"?lL(r,this._sources).then(function(u){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=u}).catch(u=>{this._hasError=!0,this._error=u}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new Go({context:r,source:a}))}let s=this._command;if(!c(s.vertexArray)){s.uniformMap={u_cubeMap:function(){return n._cubeMap}};let a=Za.createGeometry(Za.fromDimensions({dimensions:new d(2,2,2),vertexFormat:Ie.POSITION_ONLY})),l=this._attributeLocations=Nn.createAttributeLocations(a);s.vertexArray=ni.fromGeometry({context:r,geometry:a,attributeLocations:l,bufferUsage:Be.STATIC_DRAW}),s.renderState=ze.fromCache({blending:un.ALPHA_BLEND})}if(!c(s.shaderProgram)||this._useHdr!==t){let a=new He({defines:[t?"HDR":""],sources:[CV]});s.shaderProgram=en.fromCache({context:r,vertexShaderSource:EV,fragmentShaderSource:a,attributeLocations:this._attributeLocations}),this._useHdr=t}if(c(this._cubeMap))return s};pS.prototype.isDestroyed=function(){return!1};pS.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),de(this)};function mS(e){return tn(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}pS.createEarthSkyBox=function(){return new pS({sources:{positiveX:mS("px"),negativeX:mS("mx"),positiveY:mS("py"),negativeY:mS("my"),positiveZ:mS("pz"),negativeZ:mS("mz")}})};var z8=pS;function II(){this.show=!0,this._drawCommand=new Je({primitiveType:Me.TRIANGLES,boundingVolume:new le,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new le,this._boundingVolume2D=new le,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(II.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var Vbt=new z,zbt=new z,Hbt=new se,PI=new se;II.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===oe.SCENE2D||i===oe.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!c(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let S=Math.max(r,s);S=Math.pow(2,Math.ceil(Math.log(S)/Math.log(2))-2),S=Math.max(1,S);let v=n?o.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._texture=new Rt({context:o,width:S,height:S,pixelFormat:ke.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let P=this,M={u_radiusTS:function(){return P._radiusTS}};this._commands.computeCommand=new cl({fragmentShaderSource:wV,outputTexture:this._texture,uniformMap:M,persists:!1,owner:this,postExecute:function(){P._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!c(a.vertexArray)){let S={direction:0},v=new Uint8Array(4*2);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let P=bt.createVertexBuffer({context:o,typedArray:v,usage:Be.STATIC_DRAW}),M=[{index:S.direction,vertexBuffer:P,componentsPerAttribute:2,normalize:!0,componentDatatype:$.UNSIGNED_BYTE}],R=bt.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT});a.vertexArray=new ni({context:o,attributes:M,indexBuffer:R}),a.shaderProgram=en.fromCache({context:o,vertexShaderSource:vV,fragmentShaderSource:SV,attributeLocations:S}),a.renderState=ze.fromCache({blending:un.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let l=o.uniformState.sunPositionWC,u=o.uniformState.sunPositionColumbusView,f=this._boundingVolume,h=this._boundingVolume2D;d.clone(l,f.center),h.center.x=u.z,h.center.y=u.x,h.center.z=u.y,f.radius=O.SOLAR_RADIUS+O.SOLAR_RADIUS*this._glowLengthTS,h.radius=f.radius,i===oe.SCENE3D?le.clone(f,a.boundingVolume):i===oe.COLUMBUS_VIEW&&le.clone(h,a.boundingVolume);let p=Hi.computeActualEllipsoidPosition(e,l,PI),g=d.magnitude(d.subtract(p,e.camera.position,PI)),m=o.uniformState.projection,y=Hbt;y.x=0,y.y=0,y.z=-g,y.w=1;let b=F.multiplyByVector(m,y,PI),x=Hi.clipToGLWindowCoordinates(t.viewport,b,Vbt);y.x=O.SOLAR_RADIUS;let A=F.multiplyByVector(m,y,PI),E=Hi.clipToGLWindowCoordinates(t.viewport,A,zbt);return this._size=z.magnitude(z.subtract(E,x,PI)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};II.prototype.isDestroyed=function(){return!1};II.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),de(this)};var H8=II;var jxe=jr(lO(),1);function Gbt(e,t,n){return T.typeOf.string("samplerUniformName",e),T.typeOf.string("matrixUniformName",t),T.typeOf.string("styleUniformName",n),` float clipDistance = clip(gl_FragCoord, ${e}, ${t});
vec4 clippingPlanesEdgeColor = vec4(1.0);
clippingPlanesEdgeColor.rgb = ${n}.rgb;
float clippingPlanesEdgeWidth = ${n}.a;
if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth)
{
out_FragColor = clippingPlanesEdgeColor;
}
`}var G8=Gbt;var jbt={modifyFragmentShader:function(t){return t=He.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection;
void main()
{
#ifndef SHADOW_MAP
if (czm_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard;
if (czm_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard;
#endif
czm_splitter_main();
}
`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},OI=jbt;var Ux={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function RI(e){T.typeOf.object("options",e),T.typeOf.object("options.arrayBuffer",e.arrayBuffer),this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=G.clone(G.DARKGRAY),this._highlightColor=G.clone(G.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=Ux.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=e.opaquePass??De.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=F.clone(F.IDENTITY),this._modelMatrix=F.clone(F.IDENTITY),this.time=0,this.shadows=Tn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=e.splitDirection??qr.NONE,this._splittingEnabled=!1,this._error=void 0,Wbt(this,e)}Object.defineProperties(RI.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return G.clone(this._highlightColor)},set:function(e){this._highlightColor=G.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(c(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=le.clone(e,this._boundingSphere)}}});function Wbt(e,t){let n=KA.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&c(n.batchTableBinary)&&(n.styleableProperties=cg.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),c(n.draco)){let a=n.draco;e._decodingState=Ux.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;c(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;c(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;c(r)&&(c(r.constantColor)&&(e._constantColor=G.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;c(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var qbt=new d,Ybt=new d,Xbt=new d,Hxe,j8;function Kbt(e){if(!c(j8)){Hxe=new jxe.default(0),j8=new Array(e);for(let t=0;t<e;++t)j8[t]=Hxe.random()}return j8}function $bt(e){let n=e.length/3,i=Math.min(n,20),o=Kbt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=d.fromElements(r,r,r,qbt),l=d.fromElements(s,s,s,Ybt);for(let f=0;f<i;++f){let h=Math.floor(o[f]*n),p=d.unpack(e,h*3,Xbt);d.minimumByComponent(a,p,a),d.maximumByComponent(l,p,l)}let u=le.fromCornerPoints(a,l);return u.radius+=O.EPSILON2,u}function Gxe(e,t){let n=$.fromTypedArray(e);return n===$.INT||n===$.UNSIGNED_INT||n===$.DOUBLE?(dt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var Zbt=new se,Qbt=new se,Jbt=new G,Wxe=0,W8=1,WK=2,qxe=3,ext=4,zK=new F,txt=new F;function nxt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,l=i.batchIds,u=i.styleableProperties,f=c(u),h=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,m=e._isOctEncodedDraco,y=e._quantizedRange,b=e._octEncodedRange,x=e._isRGB565,A=e._isTranslucent,E=e._hasColors,S=e._hasNormals,v=e._hasBatchIds,P,M,R=[],L={};if(e._styleableShaderAttributes=L,f){let V=ext;for(let j in u)if(u.hasOwnProperty(j)){let U=u[j],q=Gxe(U.typedArray,j);P=U.componentCount,M=$.fromTypedArray(q);let X=bt.createVertexBuffer({context:n,typedArray:q,usage:Be.STATIC_DRAW});e._geometryByteLength+=X.sizeInBytes;let te={index:V,vertexBuffer:X,componentsPerAttribute:P,componentDatatype:M,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(te),L[j]={location:V,componentCount:P},++V}}let B=bt.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Be.STATIC_DRAW});e._geometryByteLength+=B.sizeInBytes;let _;E&&(_=bt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Be.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let w;S&&(w=bt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Be.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let D;v&&(l.typedArray=Gxe(l.typedArray,"batchIds"),D=bt.createVertexBuffer({context:n,typedArray:l.typedArray,usage:Be.STATIC_DRAW}),e._geometryByteLength+=D.sizeInBytes);let I=[];if(h?M=$.UNSIGNED_SHORT:p?M=y<=255?$.UNSIGNED_BYTE:$.UNSIGNED_SHORT:M=$.FLOAT,I.push({index:Wxe,vertexBuffer:B,componentsPerAttribute:3,componentDatatype:M,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(h||p?e._boundingSphere=le.fromCornerPoints(d.ZERO,e._quantizedVolumeScale):e._boundingSphere=$bt(r.typedArray)),E)if(x)I.push({index:W8,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:$.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let V=A?4:3;I.push({index:W8,vertexBuffer:_,componentsPerAttribute:V,componentDatatype:$.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}S&&(g?(P=2,M=$.UNSIGNED_BYTE):m?(P=2,M=b<=255?$.UNSIGNED_BYTE:$.UNSIGNED_SHORT):(P=3,M=$.FLOAT),I.push({index:WK,vertexBuffer:w,componentsPerAttribute:P,componentDatatype:M,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&I.push({index:qxe,vertexBuffer:D,componentsPerAttribute:1,componentDatatype:$.fromTypedArray(l.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(I=I.concat(R));let N=new ni({context:n,attributes:I}),k={depthTest:{enabled:!0}},H={depthTest:{enabled:!0},depthMask:!1,blending:un.ALPHA_BLEND};e._opaquePass===De.CESIUM_3D_TILE&&(k.stencilTest=kt.setCesium3DTileBit(),k.stencilMask=kt.CESIUM_3D_TILE_MASK,H.stencilTest=kt.setCesium3DTileBit(),H.stencilMask=kt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=ze.fromCache(k),e._translucentRenderState=ze.fromCache(H),e._drawCommand=new Je({boundingVolume:new le,cull:e._cull,modelMatrix:new F,primitiveType:Me.POINTS,vertexArray:N,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:A?e._translucentRenderState:e._opaqueRenderState,pass:A?De.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function ixt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=Zbt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let l=t.camera.frustum,u;t.mode===oe.SCENE2D||l instanceof on?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!c(a))return G.TRANSPARENT;let l=G.clone(a.edgeColor,Jbt);return l.alpha=a.edgeWidth,l},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!c(a))return F.IDENTITY;let l=e.clippingPlanesOriginMatrix??e._modelMatrix;F.multiply(n.uniformState.view3D,l,zK);let u=F.multiply(zK,a.modelMatrix,zK);return F.inverseTranspose(u,txt)}};OI.addUniforms(e,s),(i||o||r)&&(s=xt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=Qbt;if(c(e._quantizedVolumeScale)){let l=d.clone(e._quantizedVolumeScale,a);d.divideByScalar(l,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),c(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function HK(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function GK(e,t){e=e.slice(e.indexOf(`
`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function jK(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var oxt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function rxt(e,t,n){let i,o,r,s=t.context,a=c(n),l=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,h=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,m=e._hasColors,y=e._hasNormals,b=e._hasBatchIds,x=e._backFaceCulling,A=e._normalShading,E=e._drawCommand.vertexArray,S=e.clippingPlanes,v=e._attenuation,P,M,R,L=g,B=We(oxt),_={},w=e._styleableShaderAttributes;for(o in w)w.hasOwnProperty(o)&&(r=w[o],B[o]=`czm_3dtiles_property_${r.location}`,_[r.location]=r);if(a){let ue={translucent:!1},ye="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";P=n.getColorShaderFunction(`getColorFromStyle${ye}`,B,ue),M=n.getShowShaderFunction(`getShowFromStyle${ye}`,B,ue),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${ye}`,B,ue),c(P)&&ue.translucent&&(L=!0)}e._styleTranslucent=L;let D=c(P),I=c(M),N=c(R),k=e.isClipped,H=[],V=[];D&&(HK(P,H),GK(P,V)),I&&(HK(M,H),GK(M,V)),N&&(HK(R,H),GK(R,V));let j=V.indexOf("COLOR")>=0,U=V.indexOf("NORMAL")>=0;if(U&&!y)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");for(o in w)if(w.hasOwnProperty(o)){r=w[o];let ue=H.indexOf(r.location)>=0,ye=jK(E,r.location);ye.enabled=ue}let q=m&&(!D||j);if(m){let ue=jK(E,W8);ue.enabled=q}let X=y&&(A||x||U);if(y){let ue=jK(E,WK);ue.enabled=X}let te={a_position:Wxe};q&&(te.a_color=W8),X&&(te.a_normal=WK),b&&(te.a_batchId=qxe);let K="",Z=H.length;for(i=0;i<Z;++i){let ue=H[i];r=_[ue];let ye=r.componentCount,Ae=`czm_3dtiles_property_${ue}`,Pe;ye===1?Pe="float":Pe=`vec${ye}`,K+=`in ${Pe} ${Ae};
`,te[Ae]=r.location}ixt(e,t);let ee=`in vec3 a_position;
out vec4 v_color;
uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier;
uniform vec4 u_constantColor;
uniform vec4 u_highlightColor;
`;ee+=`float u_pointSize;
float tiles3d_tileset_time;
`,v&&(ee+=`float u_geometricError;
float u_depthMultiplier;
`),ee+=K,q&&(g?ee+=`in vec4 a_color;
`:p?ee+=`in float a_color;
const float SHIFT_RIGHT_11 = 1.0 / 2048.0;
const float SHIFT_RIGHT_5 = 1.0 / 32.0;
const float SHIFT_LEFT_11 = 2048.0;
const float SHIFT_LEFT_5 = 32.0;
const float NORMALIZE_6 = 1.0 / 64.0;
const float NORMALIZE_5 = 1.0 / 32.0;
`:ee+=`in vec3 a_color;
`),X&&(f||h?ee+=`in vec2 a_normal;
`:ee+=`in vec3 a_normal;
`),b&&(ee+=`in float a_batchId;
`),(l||u||h)&&(ee+=`uniform vec4 u_quantizedVolumeScaleAndOctEncodedRange;
`),D&&(ee+=P),I&&(ee+=M),N&&(ee+=R),ee+=`void main()
{
u_pointSize = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.x;
tiles3d_tileset_time = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.y;
`,v&&(ee+=` u_geometricError = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.z;
u_depthMultiplier = u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier.w;
`),q?g?ee+=` vec4 color = a_color;
`:p?ee+=` float compressed = a_color;
float r = floor(compressed * SHIFT_RIGHT_11);
compressed -= r * SHIFT_LEFT_11;
float g = floor(compressed * SHIFT_RIGHT_5);
compressed -= g * SHIFT_LEFT_5;
float b = compressed;
vec3 rgb = vec3(r * NORMALIZE_5, g * NORMALIZE_6, b * NORMALIZE_5);
vec4 color = vec4(rgb, 1.0);
`:ee+=` vec4 color = vec4(a_color, 1.0);
`:ee+=` vec4 color = u_constantColor;
`,l||u?ee+=` vec3 position = a_position * u_quantizedVolumeScaleAndOctEncodedRange.xyz;
`:ee+=` vec3 position = a_position;
`,ee+=` vec3 position_absolute = vec3(czm_model * vec4(position, 1.0));
`,X?(f?ee+=` vec3 normal = czm_octDecode(a_normal);
`:h?ee+=` vec3 normal = czm_octDecode(a_normal, u_quantizedVolumeScaleAndOctEncodedRange.w).zxy;
`:ee+=` vec3 normal = a_normal;
`,ee+=` vec3 normalEC = czm_normal * normal;
`):ee+=` vec3 normal = vec3(1.0);
`,D&&(ee+=` color = getColorFromStyle(position, position_absolute, color, normal);
`),I&&(ee+=` float show = float(getShowFromStyle(position, position_absolute, color, normal));
`),N?ee+=` gl_PointSize = getPointSizeFromStyle(position, position_absolute, color, normal) * czm_pixelRatio;
`:v?ee+=` vec4 positionEC = czm_modelView * vec4(position, 1.0);
float depth = -positionEC.z;
gl_PointSize = min((u_geometricError / depth) * u_depthMultiplier, u_pointSize);
`:ee+=` gl_PointSize = u_pointSize;
`,ee+=` color = color * u_highlightColor;
`,X&&A&&(ee+=` float diffuseStrength = czm_getLambertDiffuse(czm_lightDirectionEC, normalEC);
diffuseStrength = max(diffuseStrength, 0.4);
color.xyz *= diffuseStrength * czm_lightColor;
`),ee+=` v_color = color;
gl_Position = czm_modelViewProjection * vec4(position, 1.0);
`,X&&x&&(ee+=` float visible = step(-normalEC.z, 0.0);
gl_Position *= visible;
gl_PointSize *= visible;
`),I&&(ee+=` gl_Position.w *= float(show);
gl_PointSize *= float(show);
`),ee+=`}
`;let me=`in vec4 v_color;
`;k&&(me+=`uniform highp sampler2D u_clippingPlanes;
uniform mat4 u_clippingPlanesMatrix;
uniform vec4 u_clippingPlanesEdgeStyle;
`,me+=`
`,me+=jy(S,s),me+=`
`),me+=`void main()
{
out_FragColor = czm_gammaCorrect(v_color);
`,k&&(me+=G8("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),me+=`}
`,e.splitDirection!==qr.NONE&&(me=OI.modifyFragmentShader(me)),c(e._vertexShaderLoaded)&&(ee=e._vertexShaderLoaded(ee)),c(e._fragmentShaderLoaded)&&(me=e._fragmentShaderLoaded(me));let xe=e._drawCommand;c(xe.shaderProgram)&&xe.shaderProgram.destroy(),xe.shaderProgram=en.fromCache({context:s,vertexShaderSource:ee,fragmentShaderSource:me,attributeLocations:te});try{xe.shaderProgram._bind()}catch{throw new ae("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function sxt(e,t){if(e._decodingState===Ux.READY)return!1;if(e._decodingState===Ux.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=yg.decodePointCloud(i,t);c(o)&&(e._decodingState=Ux.DECODING,o.then(function(r){e._decodingState=Ux.READY;let s=c(r.POSITION)?r.POSITION.array:void 0,a=c(r.RGB)?r.RGB.array:void 0,l=c(r.RGBA)?r.RGBA.array:void 0,u=c(r.NORMAL)?r.NORMAL.array:void 0,f=c(r.BATCH_ID)?r.BATCH_ID.array:void 0,h=c(s)&&c(r.POSITION.data.quantization),p=c(u)&&c(r.NORMAL.data.quantization);if(h){let b=r.POSITION.data.quantization,x=b.range;e._quantizedVolumeScale=d.fromElements(x,x,x),e._quantizedVolumeOffset=d.unpack(b.minValues),e._quantizedRange=(1<<b.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,m=i.batchTableProperties;for(let b in m)if(m.hasOwnProperty(b)){let x=r[b];c(g)||(g={}),g[b]={typedArray:x.array,componentCount:x.data.componentsPerAttribute}}c(s)&&(n.positions={typedArray:s});let y=l??a;c(y)&&(n.colors={typedArray:y}),c(u)&&(n.normals={typedArray:u}),c(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(r){e._decodingState=Ux.FAILED,e._error=r}))}return!0}var axt=new se,cxt=new d;RI.prototype.update=function(e){let t=e.context;if(c(this._error)){let u=this._error;throw this._error=void 0,u}if(sxt(this,t))return;let i=!1,o=!F.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),c(this._drawCommand)||(nxt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){F.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(F.clone(this._modelMatrix,u),c(this._rtcCenter)&&F.multiplyByTranslation(u,this._rtcCenter,u),c(this._quantizedVolumeOffset)&&F.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==oe.SCENE3D){let h=e.mapProjection,p=F.getColumn(u,3,axt);se.equals(p,se.UNIT_W)||Ot.basisTo2D(h,u,u)}let f=this._drawCommand.boundingVolume;if(le.clone(this._boundingSphere,f),this._cull){let h=f.center;F.multiplyByPoint(u,h,h);let p=F.getScale(u,cxt);f.radius*=d.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==qr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&rxt(this,e,this._style),this._drawCommand.castShadows=Tn.castShadows(this.shadows),this._drawCommand.receiveShadows=Tn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?De.TRANSLUCENT:this._opaquePass;let a=e.commandList,l=e.passes;(l.render||l.pick)&&a.push(this._drawCommand)};RI.prototype.isDestroyed=function(){return!1};RI.prototype.destroy=function(){let e=this._drawCommand;return c(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),de(this)};var q8=RI;function zx(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.clock",e.clock),T.typeOf.object("options.intervals",e.intervals),this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this.shadows=e.shadows??Tn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new Mp(e.shading),this.style=e.style,this.frameFailed=new pe,this.frameChanged=new pe,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Ng,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(zx.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){xs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(c(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function lxt(e){return`uniform vec4 czm_pickColor;
${e}`}function uxt(e){return function(t){return xt(t,{czm_pickColor:function(){return e._pickId.color}})}}function fxt(){return"czm_pickColor"}zx.prototype.makeStyleDirty=function(){this._styleDirty=!0};zx.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var dxt=new Q;function YK(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function Vx(e,t){return e._intervals.indexOf(t.start)}function hxt(e,t){let n=e._intervals,i=e._clock,o=YK(e);if(o===0)return;let r=e._getAverageLoadTime(),s=Q.addSeconds(i.currentTime,r*o,dxt),a=n.indexOf(s),l=Vx(e,t);return a===l&&(o>=0?++a:--a),n.get(a)}function mxt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function pxt(e,t,n){let i=YK(e),o=Vx(e,t),r=Vx(e,n);return i>=0?o>=r:o<=r}function Xxe(e,t){return function(n){let i=c(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function _xt(e,t,n){let i=Vx(e,t),o=e._frames,r=o[i];if(!c(r)){let s=t.data.transform,a=c(s)?F.fromArray(s):void 0,l=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Ei(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:l},o[i]=r,we.fetchArrayBuffer({url:l}).then(function(u){r.pointCloud=new q8({arrayBuffer:u,cull:!0,fragmentShaderLoaded:lxt,uniformMapLoaded:uxt(e),pickIdLoaded:fxt})}).catch(Xxe(e,l))}return r}function gxt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function yxt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(c(o)&&!t.ready){let r=i.commandList,s=r.length;if(Kxe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Ei()-t.timestamp)/1e3;gxt(e,a)}}t.touchedFrameNumber=i.frameNumber}var bxt=new F;function xxt(e,t){let n=e.shading;return c(n)&&c(n.baseResolution)?n.baseResolution:c(t.boundingSphere)?O.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function Txt(e){let t=e.shading;return c(t)&&c(t.maximumAttenuation)?t.maximumAttenuation:10}var Axt=new Mp;function Kxe(e,t,n,i){let o=e.shading??Axt,r=t.pointCloud,s=t.transform??F.IDENTITY;r.modelMatrix=F.multiplyTransformation(e.modelMatrix,s,bxt),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=xxt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=Txt(e);try{r.update(i)}catch(a){Xxe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function qK(e,t,n,i){let o=_xt(e,t,i);yxt(e,o,n,i)}function Cxt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function $xe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(c(r)&&(!c(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),c(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function Ext(e,t){let n=Vx(e,t),i=e._frames[n];if(c(i)&&i.ready)return i}function Yxe(e,t,n,i,o){return c(n)?n.ready?!0:(qK(e,t,i,o),n.ready):!1}function Sxt(e,t,n,i,o){let r,s,a,l=e._intervals,u=e._frames,f=Vx(e,n),h=Vx(e,t);if(f>=h){for(r=f;r>=h;--r)if(s=l.get(r),a=u[r],Yxe(e,s,a,i,o))return s}else for(r=f;r<=h;++r)if(s=l.get(r),a=u[r],Yxe(e,s,a,i,o))return s;return t}function wxt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];c(s)&&c(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var _S={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};zx.prototype.update=function(e){if(e.mode===oe.MORPHING||!this.show)return;c(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),c(this._loadTimestamp)||(this._loadTimestamp=Q.clone(e.time));let t=Math.max(Q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=c(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&wxt(this,o,s),_S.timeSinceLoad=t,_S.isClipped=r;let a=this.shading,l=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,h=this._previousInterval,p=this._nextInterval,g=mxt(this);if(!c(g))return;let m=!1,y=YK(this),b=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!c(h)||b)&&(h=g),(!c(p)||m||pxt(this,g,p))&&(p=hxt(this,g)),h=Sxt(this,h,g,_S,e);let x=Ext(this,h);c(x)||(qK(this,h,_S,e),x=this._lastRenderedFrame),c(x)&&Kxe(this,x,_S,e),c(p)&&qK(this,p,_S,e);let A=this;c(x)&&!c(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),c(x)&&x!==this._lastRenderedFrame&&A.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return A.frameChanged.raiseEvent(A),!0}),this._previousInterval=h,this._nextInterval=p,this._lastRenderedFrame=x;let E=this._totalMemoryUsageInBytes,S=this.maximumMemoryUsage*1024*1024;E>S&&$xe(this,Cxt(e));let P=u.length-f;c(a)&&a.attenuation&&a.eyeDomeLighting&&P>0&&l.update(e,f,a,this.boundingSphere)};zx.prototype.isDestroyed=function(){return!1};zx.prototype.destroy=function(){return $xe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),de(this)};var MI=zx;function Jxe(e,t){if(c(t)){let n=t.clock;c(n)&&n.getValue(e)}}function vxt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!c(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,o)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function eTe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,c(e._scene)&&(e._scene.pixelRatio=t),t}function tTe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=eTe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function nTe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;c(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Co(e,t){if(!c(e))throw new C("container is required.");e=Rn(e),t=t??W.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=zt.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=zt.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(t.blurActiveElementOnCanvasFocus??!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let l=c(t.creditContainer)?Rn(t.creditContainer):n;l.appendChild(a);let u=c(t.creditViewport)?Rn(t.creditViewport):n,f=t.showRenderLoopErrors??!0,h=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=l,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=h,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new pe,this._allowDataSourcesToSuspendAnimation=!0,this._clock=c(t.clock)?t.clock:new mm,c(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),tTe(this);try{let p=t.ellipsoid??ie.default,g=new U8({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:t.scene3DOnly??!1,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=g,g.camera.constrainedAxis=d.UNIT_Z,eTe(this),nTe(this);let m=t.globe;c(m)||(m=new xz(p)),m!==!1&&(g.globe=m,g.globe.shadows=t.terrainShadows??Tn.RECEIVE_ONLY);let y=t.skyBox;!c(y)&&ie.WGS84.equals(p)&&(y=z8.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new H8,ie.WGS84.equals(p)&&(g.moon=new Dz));let b=t.skyAtmosphere;!c(b)&&ie.WGS84.equals(p)&&(b=new V8(p),b.show=t.globe!==!1&&m.show),b!==!1&&(g.skyAtmosphere=b);let x=t.baseLayer;if(t.globe!==!1&&x!==!1&&(c(x)||(x=mc.fromWorldImagery()),g.imageryLayers.add(x)),c(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),c(t.terrain)&&t.globe!==!1){if(c(t.terrainProvider))throw new C("Specify either options.terrainProvider or options.terrain.");g.setTerrain(t.terrain)}this._screenSpaceEventHandler=new $f(i),c(t.sceneMode)&&(t.sceneMode===oe.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===oe.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let A=this;this._onRenderError=function(R,L){A._useDefaultRenderLoop=!1,A._renderLoopRunning=!1,A._showRenderLoopErrors&&A.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,L)},g.renderError.addEventListener(this._onRenderError);let E=t.dataSources,S=!1;c(E)||(E=new W3,S=!0);let v=new Mk({scene:g,dataSourceCollection:E}),P=new Ar;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=E,this._destroyDataSourceCollection=S,this._dataSourceDisplay=v,this._eventHelper=P,this._canAnimateUpdateCallback=this._updateCanAnimate,P.add(this._clock.onTick,Co.prototype._onTick,this),P.add(g.morphStart,Co.prototype._clearTrackedObject,this),P.add(E.dataSourceAdded,Co.prototype._onDataSourceAdded,this),P.add(E.dataSourceRemoved,Co.prototype._onDataSourceRemoved,this),P.add(g.postRender,Co.prototype._postRender,this);let M=E.length;for(let R=0;R<M;R++)this._dataSourceAdded(E,E.get(R));this._dataSourceAdded(void 0,v.defaultDataSource),P.add(E.dataSourceAdded,Co.prototype._dataSourceAdded,this),P.add(E.dataSourceRemoved,Co.prototype._dataSourceRemoved,this)}catch(p){throw f&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(Co.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){if(e<=0)throw new C("targetFrameRate must be greater than 0, or undefined.");this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&vxt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){if(e<=0)throw new C("resolutionScale must be greater than 0.");this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,XK(this);let t=this.scene,n=t.mode;!c(e)||!c(e.position)?(this._needTrackedEntityUpdate=!1,(n===oe.COLUMBUS_VIEW||n===oe.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===oe.COLUMBUS_VIEW||n===oe.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(F.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,Jxe(this.clock,e))}}});Co.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function l(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}l(),c(window.addEventListener)&&window.addEventListener("resize",l,!1);let u=c(t),f=c(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let m=g_(n);u||(typeof n=="string"&&(n=new Error(n)),t=g_({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e}
${t}
${m}`);let y=document.createElement("div");y.className="cesium-widget-errorPanel-message-details collapsed";let b=document.createElement("span");b.className="cesium-widget-errorPanel-more-details",b.appendChild(document.createTextNode("See more...")),y.appendChild(b),y.onclick=function(x){y.removeChild(b),y.appendChild(document.createTextNode(m)),y.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}g.innerHTML=`<p>${t}</p>`}let h=document.createElement("div");h.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(h);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){c(l)&&c(window.removeEventListener)&&window.removeEventListener("resize",l,!1),i.removeChild(o)},h.appendChild(p),i.appendChild(o)};Co.prototype.isDestroyed=function(){return!1};Co.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),c(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),de(this)};Co.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,tTe(this),nTe(this),this._scene.requestRender())};Co.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Co.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Co.prototype._onEntityCollectionChanged,this)};Co.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Co.prototype._onEntityCollectionChanged,this),c(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Co.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var Dxt=new le;Co.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(c(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!1,i.boundingSphere??Dxt)===lt.DONE&&i.update(t)}};Co.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0)}};Co.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Co.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Jxe(this.clock,e)};Co.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Co.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Co.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};Co.prototype.zoomTo=function(e,t){return iTe(this,e,{offset:t},!1)};Co.prototype.flyTo=function(e,t){return iTe(this,e,t,!0)};function iTe(e,t,n,i){if(!c(t))throw new C("zoomTarget is required.");XK(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof mc){let s;c(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let l=r.readyEvent.addEventListener(()=>{l(),a(r.getImageryRectangle())})}),s.then(function(a){return DE(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof As||r instanceof MI||r instanceof Bx){e._zoomTarget=r;return}if(r.isLoading&&c(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=r.values??r,c(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function LI(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function XK(e){let t=e._zoomPromise;c(t)&&(LI(e),e._completeZoom(!1))}Co.prototype._postRender=function(){Pxt(this),Ixt(this)};var Zxe=new le;function Pxt(e){let t=e._zoomTarget;if(!c(t)||e.scene.mode===oe.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(f){c(o.offset)||(o.offset=new $d(0,-.5,f.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(t.boundingSphere,r):(i.viewBoundingSphere(f,o.offset),i.lookAtTransform(F.IDENTITY),e._completeZoom(!0)),LI(e)}if(t instanceof MI){if(c(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(h){s(h.boundingSphere),f()});return}if(t instanceof As||t instanceof Bx){s(t.boundingSphere);return}if(t instanceof he){r={destination:n.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),LI(e);return}let a=t,l=[];for(let f=0,h=a.length;f<h;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,Zxe);if(p===lt.PENDING)return;p!==lt.FAILED&&l.push(le.clone(Zxe))}if(l.length===0){XK(e);return}e.trackedEntity=void 0;let u=le.fromBoundingSpheres(l);e._zoomIsFlight?(LI(e),i.flyToBoundingSphere(u,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(F.IDENTITY),LI(e),e._completeZoom(!0))}var Qxe=new le;function Ixt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=Y.getValueOrUndefined(t.position,n);if(!c(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,Qxe);if(r===lt.PENDING)return;let s=o.mode;(s===oe.COLUMBUS_VIEW||s===oe.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===oe.COLUMBUS_VIEW||s===oe.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==lt.FAILED?Qxe:void 0;e._entityView=new Fk(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var Y8=Co;function bS(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var Hx=new ce;function Oxt(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}bS.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let g=t;g<=i;++g)Oxt(e,g,p,s)||s.push(new gS(r,void 0,0,g,p));r.tileXYToRectangle(t,n,e,Hx);let a=Hx.west,l=Hx.north;r.tileXYToRectangle(i,o,e,Hx);let u=Hx.east,f=Hx.south,h=new Fxt(e,a,f,u,l);for(let p=0;p<s.length;++p){let g=s[p];KK(g.extent,h)&&Bxt(this._maximumLevel,g,h)}};bS.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(yS(i.extent,e)){t=i;break}}return c(t)?NI(void 0,t,e):-1};var Rxt=[],Mxt=[],Lxt=new ce,Nxt=new ce;bS.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=Rxt;t.length=0,e.east<e.west?(t.push(ce.fromRadians(-Math.PI,e.south,e.east,e.north,Lxt)),t.push(ce.fromRadians(e.west,e.south,Math.PI,e.north,Nxt))):t.push(e);let n=Mxt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)FI(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(c(n[i])&&n[i].length===0)return i;return 0};var oTe=new he;bS.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,Hx);return ce.center(i,oTe),this.computeMaximumLevelAtPosition(oTe)>=e};bS.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function gS(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(gS.prototype,{nw:{get:function(){return this._nw||(this._nw=new gS(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new gS(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new gS(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new gS(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function Fxt(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function KK(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i<r&&n<o}function Bxt(e,t,n){for(;t.level<e;)if(X8(t.nw.extent,n))t=t.nw;else if(X8(t.ne.extent,n))t=t.ne;else if(X8(t.sw.extent,n))t=t.sw;else if(X8(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Mo(t.rectangles,n.level,kxt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function kxt(e,t){return e.level-t}function X8(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function yS(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function NI(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&yS(t._nw.extent,n),s=t._ne&&yS(t._ne.extent,n),a=t._sw&&yS(t._sw.extent,n),l=t._se&&yS(t._se.extent,n);if(r+s+a+l>1){r&&(i=Math.max(i,NI(t,t._nw,n))),s&&(i=Math.max(i,NI(t,t._ne,n))),a&&(i=Math.max(i,NI(t,t._sw,n))),l&&(i=Math.max(i,NI(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:l?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];yS(a,n)&&(i=a.level)}t=t.parent}return i}function FI(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||KK(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=Uxt(e[s.level],s)}FI(e,t._nw,n),FI(e,t._ne,n),FI(e,t._sw,n),FI(e,t._se,n)}function Uxt(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];KK(o,t)?(o.west<t.west&&n.push(new ce(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new ce(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new ce(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new ce(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var $m=bS;var Vxt=15;function rTe(e){this.ellipsoid=e.ellipsoid??ie.default,this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}rTe.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function zxt(e,t){let n=t.copyrightText;c(n)&&(e.credit=new At(n));let i=t.spatialReference,o=i.latestWkid??i.wkid,r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=ce.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new Ki(s);else if(o===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new z(r.xmin,r.ymin),s.rectangleNortheastInMeters=new z(r.xmax,r.ymax),e.tilingScheme=new fs(s)}else throw new ae("Invalid spatial reference");let a=t.tileInfo;if(!c(a))throw new ae("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?ih.LERC:ih.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new $m(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new $m(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=us.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),c(t.minValues)&&c(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function Hxt(e,t,n){try{let i=await t.fetchJson();zxt(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw Io.reportError(void 0,n,c(n)?n._errorEvent:void 0,o),i}}function u0(e){e=e??W.EMPTY_OBJECT,this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new pe}Object.defineProperties(u0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});u0.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT,e=await Promise.resolve(e);let n=we.createIfNeeded(e);n.appendForwardSlash(),c(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new rTe(t);await Hxt(o,i);let r=new u0(t);return o.build(r),r._resource=n,r};u0.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!c($K(this,n+1,e*2,t*2))){let h=sTe(this,n+1,e*2,t*2);s=h.promise,a=h.request}let l=o.fetchArrayBuffer();if(!c(l)||!c(s))return;let u=this,f=this._tilesAvailable;return Promise.all([l,s]).then(function(h){return new dc({buffer:h[0],width:u._width,height:u._height,childTileMask:r?f.computeChildMaskForTile(n,e,t):Vxt,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(h){if(c(a)&&a.state===Zn.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Zn.CANCELLED,Promise.reject(h)}return Promise.reject(h)})};function $K(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}u0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};u0.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=$K(this,n,e,t);if(c(i))return i;sTe(this,n,e,t)};u0.prototype.loadTileDataAvailability=function(e,t,n){};function Gxt(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],l={startX:e.x,startY:e.y,endX:0,endY:0},u=new z(e.x+1,e.y+1),f=!1,h=!1;for(;!(f&&h);){let p=u.x,g=h?u.y+1:u.y;if(!f){for(let m=e.y;m<g;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new z(u.x,e.y)),--u.x,--p,l.endX=u.x):u.x===o?(l.endX=u.x,f=!0):++u.x}if(!h){let m=u.y*t;for(let y=e.x;y<=p;++y)if(i[m+y]!==s){h=!0;break}h?(a.push(new z(e.x,u.y)),--u.y,l.endY=u.y):u.y===r?(l.endY=u.y,h=!0):++u.y}}return{endingIndices:a,range:l,value:s}}function jxt(e,t,n,i,o){let r=[];if(o.every(function(l){return l===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new z(0,0)];for(;a.length>0;){let l=a.pop(),u=Gxt(l,n,i,o);if(u.value===1){let h=u.range;h.startX+=e,h.endX+=e,h.startY+=t,h.endY+=t,r.push(h)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return r}function sTe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,l=e._availableCache;if(c(l[a]))return l[a];let u=new ir({throttle:!1,throttleByServer:!0,type:gs.TERRAIN}),h=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return c(h)?(h=h.then(function(p){let g=jxt(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let m=e._tilesAvailable;for(let y=0;y<g.length;++y){let b=g[y];m.addAvailableTileRange(t,b.startX,b.startY,b.endX,b.endY)}return $K(e,t,n,i)}),l[a]={promise:h,request:u},h=h.finally(function(p){return delete l[a],p}),{promise:h,request:u}):{}}var aTe=u0;var cTe="https://dev.virtualearth.net/REST/v1/Locations";function ZK(e){e=e??W.EMPTY_OBJECT;let t=e.key;if(!c(t))throw new C("options.key is required.");this._key=t;let n={key:t};c(e.culture)&&(n.culture=e.culture),this._resource=new we({url:cTe,queryParameters:n}),this._credit=new At('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(ZK.prototype,{url:{get:function(){return cTe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});ZK.prototype.geocode=async function(e){return T.typeOf.string("query",e),this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],l=r[2],u=r[3];return{displayName:o.name,destination:ce.fromDegrees(a,s,u,l)}})})};var lTe=ZK;function QK(){}Object.defineProperties(QK.prototype,{credit:{get:function(){}}});QK.prototype.geocode=function(e){T.typeOf.string("query",e);let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:d.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var uTe=QK;var Wxt=new se,fTe=new d,xS=new d;function qxt(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,l){c(l)||(l=new d);let u=(a-i)*o;return d.lerp(r,s,u,l)}}return function(i,o){c(o)||(o=new d);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=Wxt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let l,u,f,h,p;return r===0?(l=t[0],u=t[1],f=e.firstTangent,h=d.subtract(t[2],l,fTe),d.multiplyByScalar(h,.5,h),p=F.multiplyByVector(xb.hermiteCoefficientMatrix,a,a)):r===t.length-2?(l=t[r],u=t[r+1],h=e.lastTangent,f=d.subtract(u,t[r-1],fTe),d.multiplyByScalar(f,.5,f),p=F.multiplyByVector(xb.hermiteCoefficientMatrix,a,a)):(l=t[r-1],u=t[r],f=t[r+1],h=t[r+2],p=F.multiplyByVector(f0.catmullRomCoefficientMatrix,a,a)),o=d.multiplyByScalar(l,p.x,o),d.multiplyByScalar(u,p.y,xS),d.add(o,xS,o),d.multiplyByScalar(f,p.z,xS),d.add(o,xS,o),d.multiplyByScalar(h,p.w,xS),d.add(o,xS,o)}}var Yxt=new d,Xxt=new d;function f0(e){e=e??W.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(T.defined("points",t),T.defined("times",n),T.typeOf.number.greaterThanOrEquals("points.length",t.length,2),T.typeOf.number.equals("times.length","points.length",n.length,t.length),t.length>2&&(c(i)||(i=Yxt,d.multiplyByScalar(t[1],2,i),d.subtract(i,t[2],i),d.subtract(i,t[0],i),d.multiplyByScalar(i,.5,i)),!c(o))){let r=t.length-1;o=Xxt,d.multiplyByScalar(t[r-1],2,o),d.subtract(t[r],o,o),d.add(o,t[r-2],o),d.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=d.clone(i),this._lastTangent=d.clone(o),this._evaluateFunction=qxt(this),this._lastTimeIndex=0}Object.defineProperties(f0.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});f0.catmullRomCoefficientMatrix=new F(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);f0.prototype.findTimeInterval=Ni.prototype.findTimeInterval;f0.prototype.wrapTime=Ni.prototype.wrapTime;f0.prototype.clampTime=Ni.prototype.clampTime;f0.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var dTe=f0;var K8={};K8.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){if(!c(e))throw new C("threshold is required.");if(!c(t))throw new C("keepAbove is required.");if(!c(n))throw new C("u0 is required.");if(!c(i))throw new C("u1 is required.");if(!c(o))throw new C("u2 is required.");c(r)?r.length=0:r=[];let s,a,l;t?(s=n<e,a=i<e,l=o<e):(s=n>e,a=i>e,l=o>e);let u=s+a+l,f,h,p,g,m,y;return u===1?s?(f=(e-n)/(i-n),h=(e-n)/(o-n),r.push(1),r.push(2),h!==1&&(r.push(-1),r.push(0),r.push(2),r.push(h)),f!==1&&(r.push(-1),r.push(0),r.push(1),r.push(f))):a?(p=(e-i)/(o-i),g=(e-i)/(n-i),r.push(2),r.push(0),g!==1&&(r.push(-1),r.push(1),r.push(0),r.push(g)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):l&&(m=(e-o)/(n-o),y=(e-o)/(i-o),r.push(0),r.push(1),y!==1&&(r.push(-1),r.push(2),r.push(1),r.push(y)),m!==1&&(r.push(-1),r.push(2),r.push(0),r.push(m))):u===2?!s&&n!==e?(g=(e-i)/(n-i),m=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(g),r.push(-1),r.push(2),r.push(0),r.push(m)):!a&&i!==e?(y=(e-o)/(i-o),f=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(y),r.push(-1),r.push(0),r.push(1),r.push(f)):!l&&o!==e&&(h=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(h),r.push(-1),r.push(1),r.push(2),r.push(p)):u!==3&&(r.push(0),r.push(1),r.push(2)),r};K8.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,l){if(!c(e))throw new C("x is required.");if(!c(t))throw new C("y is required.");if(!c(n))throw new C("x1 is required.");if(!c(i))throw new C("y1 is required.");if(!c(o))throw new C("x2 is required.");if(!c(r))throw new C("y2 is required.");if(!c(s))throw new C("x3 is required.");if(!c(a))throw new C("y3 is required.");let u=n-s,f=s-o,h=r-a,p=i-a,g=1/(h*u+f*p),m=t-a,y=e-s,b=(h*y+f*m)*g,x=(-p*y+u*m)*g,A=1-b-x;return c(l)?(l.x=b,l.y=x,l.z=A,l):new d(b,x,A)};K8.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,l){T.typeOf.number("x00",e),T.typeOf.number("y00",t),T.typeOf.number("x01",n),T.typeOf.number("y01",i),T.typeOf.number("x10",o),T.typeOf.number("y10",r),T.typeOf.number("x11",s),T.typeOf.number("y11",a);let u=(s-o)*(t-r)-(a-r)*(e-o),f=(n-e)*(t-r)-(i-t)*(e-o),h=(a-r)*(n-e)-(s-o)*(i-t);if(h===0)return;let p=u/h,g=f/h;if(p>=0&&p<=1&&g>=0&&g<=1)return c(l)||(l=new z),l.x=e+p*(n-e),l.y=t+p*(i-t),l};var d0=K8;function h0(e){if(!c(e)||!c(e.quantizedVertices))throw new C("options.quantizedVertices is required.");if(!c(e.indices))throw new C("options.indices is required.");if(!c(e.minimumHeight))throw new C("options.minimumHeight is required.");if(!c(e.maximumHeight))throw new C("options.maximumHeight is required.");if(!c(e.maximumHeight))throw new C("options.maximumHeight is required.");if(!c(e.boundingSphere))throw new C("options.boundingSphere is required.");if(!c(e.horizonOcclusionPoint))throw new C("options.horizonOcclusionPoint is required.");if(!c(e.westIndices))throw new C("options.westIndices is required.");if(!c(e.southIndices))throw new C("options.southIndices is required.");if(!c(e.eastIndices))throw new C("options.eastIndices is required.");if(!c(e.northIndices))throw new C("options.northIndices is required.");if(!c(e.westSkirtHeight))throw new C("options.westSkirtHeight is required.");if(!c(e.southSkirtHeight))throw new C("options.southSkirtHeight is required.");if(!c(e.eastSkirtHeight))throw new C("options.eastSkirtHeight is required.");if(!c(e.northSkirtHeight))throw new C("options.northSkirtHeight is required.");this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=Z8(e.westIndices,o,t),this._southIndices=Z8(e.southIndices,r,t),this._eastIndices=Z8(e.eastIndices,o,t),this._northIndices=Z8(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(h0.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return c(this._mesh)}}});var $8=[];function Z8(e,t,n){$8.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)$8[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?($8.sort(t),Fe.createTypedArray(n,$8)):e}var hTe="createVerticesFromQuantizedTerrainMesh",Kxt=new bi(hTe),$xt=new bi(hTe,Fm.maximumAsynchronousTasks);h0.prototype.createMesh=function(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.tilingScheme",e.tilingScheme),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),T.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,l=t.ellipsoid,u=t.tileXYToRectangle(n,i,o),h=(a?$xt:Kxt).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:l,exaggeration:r,exaggerationRelativeHeight:s});if(!c(h))return;let p=this;return Promise.resolve(h).then(function(g){let m=p._quantizedVertices.length/3,y=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,b=Fe.createTypedArray(y,g.indices),x=new Float32Array(g.vertices),A=g.center,E=g.minimumHeight,S=g.maximumHeight,v=p._boundingSphere,P=p._orientedBoundingBox,M=d.clone(g.occludeePointInScaledSpace)??p._horizonOcclusionPoint,R=g.vertexStride,L=Zc.clone(g.encoding);return p._mesh=new oh(A,x,b,g.indexCountWithoutSkirts,m,E,S,v,M,R,P,L,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var Zxt=new bi("upsampleQuantizedTerrainMesh",Fm.maximumAsynchronousTasks);h0.prototype.upsample=function(e,t,n,i,o,r,s){if(!c(e))throw new C("tilingScheme is required.");if(!c(t))throw new C("thisX is required.");if(!c(n))throw new C("thisY is required.");if(!c(i))throw new C("thisLevel is required.");if(!c(o))throw new C("descendantX is required.");if(!c(r))throw new C("descendantY is required.");if(!c(s))throw new C("descendantLevel is required.");if(s-i>1)throw new C("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(this._mesh))return;let u=t*2!==o,f=n*2===r,h=e.ellipsoid,p=e.tileXYToRectangle(o,r,s),g=Zxt.scheduleTask({vertices:l.vertices,vertexCountWithoutSkirts:l.vertexCountWithoutSkirts,indices:l.indices,indexCountWithoutSkirts:l.indexCountWithoutSkirts,encoding:l.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:u,isNorthChild:f,childRectangle:p,ellipsoid:h});if(!c(g))return;let m=Math.min(this._westSkirtHeight,this._eastSkirtHeight);m=Math.min(m,this._southSkirtHeight),m=Math.min(m,this._northSkirtHeight);let y=u?m*.5:this._westSkirtHeight,b=f?m*.5:this._southSkirtHeight,x=u?this._eastSkirtHeight:m*.5,A=f?this._northSkirtHeight:m*.5,E=this._credits;return Promise.resolve(g).then(function(S){let v=new Uint16Array(S.vertices),P=Fe.createTypedArray(v.length/3,S.indices),M;return c(S.encodedNormals)&&(M=new Uint8Array(S.encodedNormals)),new h0({quantizedVertices:v,indices:P,encodedNormals:M,minimumHeight:S.minimumHeight,maximumHeight:S.maximumHeight,boundingSphere:le.clone(S.boundingSphere),orientedBoundingBox:Pn.clone(S.orientedBoundingBox),horizonOcclusionPoint:d.clone(S.horizonOcclusionPoint),westIndices:S.westIndices,southIndices:S.southIndices,eastIndices:S.eastIndices,northIndices:S.northIndices,westSkirtHeight:y,southSkirtHeight:b,eastSkirtHeight:x,northSkirtHeight:A,childTileMask:0,credits:E,createdByUpsampling:!0})})};var JK=32767,mTe=new d;h0.prototype.interpolateHeight=function(e,t,n){let i=O.clamp((t-e.west)/e.width,0,1);i*=JK;let o=O.clamp((n-e.south)/e.height,0,1);return o*=JK,c(this._mesh)?tTt(this,i,o):nTt(this,i,o)};function pTe(e,t,n,i,o,r,s,a){let l=Math.min(n,o,s),u=Math.max(n,o,s),f=Math.min(i,r,a),h=Math.max(i,r,a);return e>=l&&e<=u&&t>=f&&t<=h}var Qxt=new z,Jxt=new z,eTt=new z;function tTt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,l=s.length;a<l;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,u,Qxt),g=r.decodeTextureCoordinates(o,f,Jxt),m=r.decodeTextureCoordinates(o,h,eTt);if(pTe(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let y=d0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,mTe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let b=r.decodeHeight(o,u),x=r.decodeHeight(o,f),A=r.decodeHeight(o,h);return y.x*b+y.y*x+y.z*A}}}}function nTt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,l=s.length;a<l;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=i[u],g=i[f],m=i[h],y=o[u],b=o[f],x=o[h];if(pTe(t,n,p,y,g,b,m,x)){let A=d0.computeBarycentricCoordinates(t,n,p,y,g,b,m,x,mTe);if(A.x>=-1e-15&&A.y>=-1e-15&&A.z>=-1e-15){let E=A.x*r[u]+A.y*r[f]+A.z*r[h];return O.lerp(e._minimumHeight,e._maximumHeight,E/JK)}}}}h0.prototype.isChildAvailable=function(e,t,n,i){if(!c(e))throw new C("thisX is required.");if(!c(t))throw new C("thisY is required.");if(!c(n))throw new C("childX is required.");if(!c(i))throw new C("childY is required.");let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};h0.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var TS=h0;function iTt(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function gTe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??ie.default,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}gTe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=c(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function yTe(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=Io.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=Io.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,c(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let y=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Io.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}let l=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new fs({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Io.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}if(e.levelZeroMaximumGeometricError=us.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let y=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Io.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,y),new ae(y)}let f;c(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:c(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),c(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),c(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let h=t.metadataAvailability,p=t.available,g;if(c(p)&&!c(h)){g=new $m(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let b=p[y],x=e.tilingScheme.getNumberOfYTilesAtLevel(y);c(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let A=0;A<b.length;++A){let E=b[A],S=x-E.endY-1,v=x-E.startY-1;e.overallAvailability[y].push([E.startX,S,E.endX,v]),g.addAvailableTileRange(y,E.startX,S,E.endX,v)}}}else c(h)&&(f=new $m(e.tilingScheme,u),g=new $m(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,c(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new iTt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:l,availability:g,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:h,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return c(m)?c(g)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await n$(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function oTt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(c(t)&&(i+=`
${t.message}`),e.previousError=Io.reportError(e.previousError,n,c(n)?n._errorEvent:void 0,i),e.previousError.retry)return n$(e,n);throw new ae(i)}async function rTt(e,t,n){await yTe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new $m(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let l=s[a];o.addAvailableTileRange(r,l[0],l[1],l[2],l[3])}}}if(e.attribution.length>0){let o=new At(e.attribution);e.tileCredits.push(o)}return!0}async function n$(e,t){try{let n=await e.layerJsonResource.fetchJson();return rTt(e,n,t)}catch(n){return c(n)&&n.statusCode===404?(await yTe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):oTt(e,n,t)}}function ph(e){e=e??W.EMPTY_OBJECT,this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new pe;let t=e.credit;typeof t=="string"&&(t=new At(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var e$={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function _Te(e){return!c(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function sTt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new dc({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function aTt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,l=3,u=l+1,f=Float64Array.BYTES_PER_ELEMENT*l,h=Float64Array.BYTES_PER_ELEMENT*u,g=Uint16Array.BYTES_PER_ELEMENT*3,m=3,y=Uint16Array.BYTES_PER_ELEMENT,b=y*m,x=new DataView(t),A=new d(x.getFloat64(a,!0),x.getFloat64(a+8,!0),x.getFloat64(a+16,!0));a+=f;let E=x.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let S=x.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new le(new d(x.getFloat64(a,!0),x.getFloat64(a+8,!0),x.getFloat64(a+16,!0)),x.getFloat64(a+f,!0));a+=h;let P=new d(x.getFloat64(a,!0),x.getFloat64(a+8,!0),x.getFloat64(a+16,!0));a+=f;let M=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,M*3);a+=M*g,M>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,b=y*m);let L=R.subarray(0,M),B=R.subarray(M,2*M),_=R.subarray(M*2,3*M);Ln.zigZagDeltaDecode(L,B,_),a%y!==0&&(a+=y-a%y);let w=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let D=Fe.createTypedArrayFromArrayBuffer(M,t,a,w*m);a+=w*b;let I=0,N=D.length;for(let ue=0;ue<N;++ue){let ye=D[ue];D[ue]=I-ye,ye===0&&++I}let k=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let H=Fe.createTypedArrayFromArrayBuffer(M,t,a,k);a+=k*y;let V=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let j=Fe.createTypedArrayFromArrayBuffer(M,t,a,V);a+=V*y;let U=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let q=Fe.createTypedArrayFromArrayBuffer(M,t,a,U);a+=U*y;let X=x.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let te=Fe.createTypedArrayFromArrayBuffer(M,t,a,X);a+=X*y;let K,Z;for(;a<x.byteLength;){let ue=x.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let ye=x.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,ue===e$.OCT_VERTEX_NORMALS&&e._requestVertexNormals)K=new Uint8Array(t,a,M*2);else if(ue===e$.WATER_MASK&&e._requestWaterMask)Z=new Uint8Array(t,a,ye);else if(ue===e$.METADATA&&e._requestMetadata){let Ae=x.getUint32(a,!0);if(Ae>0){let Ee=sr(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,Ae).available;if(c(Ee))for(let Ve=0;Ve<Ee.length;++Ve){let je=n+Ve+1,it=Ee[Ve],Dt=e._tilingScheme.getNumberOfYTilesAtLevel(je);for(let Gt=0;Gt<it.length;++Gt){let $e=it[Gt],ln=Dt-$e.endY-1,Vt=Dt-$e.startY-1;e.availability.addAvailableTileRange(je,$e.startX,ln,$e.endX,Vt),r.availability.addAvailableTileRange(je,$e.startX,ln,$e.endX,Vt)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=ye}let ee=e.getLevelMaximumGeometricError(n)*5,me=e._tilingScheme.tileXYToRectangle(i,o,n),xe=Pn.fromRectangle(me,E,S,e._tilingScheme.ellipsoid);return new TS({center:A,minimumHeight:E,maximumHeight:S,boundingSphere:v,orientedBoundingBox:xe,horizonOcclusionPoint:P,quantizedVertices:R,encodedNormals:K,indices:D,westIndices:H,southIndices:j,eastIndices:q,northIndices:te,westSkirtHeight:ee,southSkirtHeight:ee,eastSkirtHeight:ee,northSkirtHeight:ee,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:Z,credits:e._tileCredits})}ph.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,l=Promise.resolve();if(s===1)r=o[0];else for(let u=0;u<s;++u){let f=o[u];if(!c(f.availability)||f.availability.isTileAvailable(n,e,t)){r=f;break}let h=i$(this,e,t,n,f,u===0);h.result&&(a=!0,l=l.then(()=>h.promise))}return!c(r)&&a?l.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):bTe(this,e,t,n,r,i)};function bTe(e,t,n,i,o,r){if(!c(o))return Promise.reject(new ae("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let l=[];e._requestVertexNormals&&o.hasVertexNormals&&l.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&l.push("watermask"),e._requestMetadata&&o.hasMetadata&&l.push("metadata");let u,f,h=s[(t+a+i)%s.length],p=o.resource;c(p._ionEndpoint)&&!c(p._ionEndpoint.externalType)?(l.length!==0&&(f={extensions:l.join("-")}),u=_Te(void 0)):u=_Te(l);let g=p.getDerivedResource({url:h,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:r}).fetchArrayBuffer();if(c(g))return g.then(function(m){return c(m)?c(e._heightmapStructure)?sTt(e,m,i,t,n):aTt(e,m,i,t,n,o):Promise.reject(new ae("Mesh buffer doesn't exist."))})}Object.defineProperties(ph.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});ph.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ph.fromIonAssetId=async function(e,t){T.defined("assetId",e);let n=await uf.fromAssetId(e);return ph.fromUrl(n,t)};ph.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT,e=await Promise.resolve(e);let n=we.createIfNeeded(e);n.appendForwardSlash();let i=new gTe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await n$(i);let o=new ph(t);return i.build(o),o};ph.prototype.getTileDataAvailable=function(e,t,n){if(!c(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(i$(this,e,t,n,i[r],r===0).result)return;return!1};ph.prototype.loadTileDataAvailability=function(e,t,n){if(!c(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=i$(this,e,t,n,i[r],r===0);if(c(s.promise))return s.promise}};function t$(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,l=n/s|0;return{level:r,x:a,y:l}}function i$(e,t,n,i,o,r){if(!c(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},l=o.availabilityTilesLoaded,u=o.availability,f=t$(o,t,n,i);for(;c(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!l.isTileAvailable(f.level,f.x,f.y)){let h;if(!r&&(s=`${f.level}-${f.x}-${f.y}`,h=o.availabilityPromiseCache[s],!c(h))){let p=new ir({throttle:!1,throttleByServer:!0,type:gs.TERRAIN});h=bTe(e,f.x,f.y,f.level,o,p),c(h)&&(o.availabilityPromiseCache[s]=h,h.then(a))}return{result:!0,promise:h}}f=t$(o,f.x,f.y,f.level)}return{result:!1}}ph._getAvailabilityTile=t$;var AS=ph;function R_(e){e=e??W.EMPTY_OBJECT;let t=e.radius;T.typeOf.number("radius",t);let n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new Rl(n),this._workerName="createCircleGeometry"}R_.packedLength=Rl.packedLength;R_.pack=function(e,t,n){return T.typeOf.object("value",e),Rl.pack(e._ellipseGeometry,t,n)};var xTe=new Rl({center:new d,semiMajorAxis:1,semiMinorAxis:1}),Fa={center:new d,radius:void 0,ellipsoid:ie.clone(ie.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Ie,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};R_.unpack=function(e,t,n){let i=Rl.unpack(e,t,xTe);return Fa.center=d.clone(i._center,Fa.center),Fa.ellipsoid=ie.clone(i._ellipsoid,Fa.ellipsoid),Fa.ellipsoid=ie.clone(i._ellipsoid,xTe._ellipsoid),Fa.height=i._height,Fa.extrudedHeight=i._extrudedHeight,Fa.granularity=i._granularity,Fa.vertexFormat=Ie.clone(i._vertexFormat,Fa.vertexFormat),Fa.stRotation=i._stRotation,Fa.shadowVolume=i._shadowVolume,c(n)?(Fa.semiMajorAxis=i._semiMajorAxis,Fa.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Rl(Fa),n):(Fa.radius=i._semiMajorAxis,new R_(Fa))};R_.createGeometry=function(e){return Rl.createGeometry(e._ellipseGeometry)};R_.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new R_({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Ie.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(R_.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var TTe=R_;function CS(e){e=e??W.EMPTY_OBJECT;let t=e.radius;T.typeOf.number("radius",t);let n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new kf(n),this._workerName="createCircleOutlineGeometry"}CS.packedLength=kf.packedLength;CS.pack=function(e,t,n){return T.typeOf.object("value",e),kf.pack(e._ellipseGeometry,t,n)};var cTt=new kf({center:new d,semiMajorAxis:1,semiMinorAxis:1}),Fu={center:new d,radius:void 0,ellipsoid:ie.clone(ie.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};CS.unpack=function(e,t,n){let i=kf.unpack(e,t,cTt);return Fu.center=d.clone(i._center,Fu.center),Fu.ellipsoid=ie.clone(i._ellipsoid,Fu.ellipsoid),Fu.height=i._height,Fu.extrudedHeight=i._extrudedHeight,Fu.granularity=i._granularity,Fu.numberOfVerticalLines=i._numberOfVerticalLines,c(n)?(Fu.semiMajorAxis=i._semiMajorAxis,Fu.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new kf(Fu),n):(Fu.radius=i._semiMajorAxis,new CS(Fu))};CS.createGeometry=function(e){return kf.createGeometry(e._ellipseGeometry)};var ATe=CS;function lTt(e){return e=e??W.EMPTY_OBJECT,AS.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var Q8=lTt;function uTt(e){return e=e??W.EMPTY_OBJECT,AS.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ie.WGS84})}var ES=uTt;function SS(e){e=e??W.EMPTY_OBJECT,T.defined("options.callback",e.callback),T.defined("options.width",e.width),T.defined("options.height",e.height),this._callback=e.callback,this._tilingScheme=e.tilingScheme,c(this._tilingScheme)||(this._tilingScheme=new Ki({ellipsoid:e.ellipsoid??ie.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=us.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new pe;let n=e.credit;typeof n=="string"&&(n=new At(n)),this._credit=n}Object.defineProperties(SS.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});SS.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!c(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let l=a;return Array.isArray(l)&&(l=new Float64Array(l)),new dc({buffer:l,width:r,height:s})})};SS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};SS.prototype.getTileDataAvailable=function(e,t,n){};SS.prototype.loadTileDataAvailability=function(e,t,n){};var CTe=SS;var fTt=1953029805,dTt=2917034100;function o$(e,t){if(o$.passThroughDataForTesting)return t;T.typeOf.object("key",e),T.typeOf.object("data",t);let n=e.byteLength;if(n===0||n%4!==0)throw new ae("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===fTt||o===dTt)return t;let r=new DataView(e),s=0,a=t.byteLength,l=a-a%8,u=n,f,h=8;for(;s<l;)for(h=(h+8)%24,f=h;s<l&&f<u;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(h=(h+8)%24,f=h);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(f)),s++,f++}o$.passThroughDataForTesting=!1;var J8=o$;function ETe(e){this.proxy=e}ETe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var STe=ETe;function wTe(e,t){return Ns("defaultValue","defaultValue has been deprecated and will be removed in Cesium 1.134. Use the nullish coalescing operator instead: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing"),e??t}Object.defineProperty(wTe,"EMPTY_OBJECT",{get:function(){return Ns("defaultValue.EMPTY_OBJECT","defaultValue.EMPTY_OBJECT has been deprecated and will be removed in Cesium 1.134. Use Frozen.EMPTY_OBJECT instead"),W.EMPTY_OBJECT}});var vTe=wTe;function eH(){C.throwInstantiationError()}Object.defineProperties(eH.prototype,{credit:{get:C.throwInstantiationError}});eH.getCreditsFromResult=function(e){if(c(e.attributions))return e.attributions.map(At.getIonCredit)};eH.prototype.geocode=C.throwInstantiationError;var BI=eH;var hTt={SEARCH:0,AUTOCOMPLETE:1},Gx=Object.freeze(hTt);function DTe(){C.throwInstantiationError()}DTe.createGeometry=function(e){C.throwInstantiationError()};var PTe=DTe;var bTt=jr(r$(),1);function mTt(e,t){return(e&t)!==0}var tl=mTt;var pTt=[1,2,4,8],ITe=15,_Tt=16,gTt=64,yTt=128;function Zm(e,t,n,i,o,r){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=o,this.terrainProvider=r,this.ancestorHasTerrain=!1,this.terrainState=void 0}Zm.clone=function(e,t){return c(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new Zm(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};Zm.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};Zm.prototype.hasSubtree=function(){return tl(this._bits,_Tt)};Zm.prototype.hasImagery=function(){return tl(this._bits,gTt)};Zm.prototype.hasTerrain=function(){return tl(this._bits,yTt)};Zm.prototype.hasChildren=function(){return tl(this._bits,ITe)};Zm.prototype.hasChild=function(e){return tl(this._bits,pTt[e])};Zm.prototype.getChildBitmask=function(){return this._bits&ITe};var tH=Zm;function xTt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var TTt=xTt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y
wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB
\f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\xB3\r\v@\xC0\x9F\xD8Q]\xFA".j\xDFI\0\xB9\xA0wU\xC6\xEFj\xBF{GL\x7F\x83\xEE\xDC\xDCF\x85\xA9\xADS\x07+S4\x07\xFF\x94Y\xE48\xE81\x83N\xB9XFk\xCB-#\x86\x92p\x005\x88"\xCF1\xB2&/\xE7\xC3u-6,rt\xB0#G\xB7\xD3\xD1&\x857r\xE2\0\x8CD\xCF\xDA3-\xDE\`\x86i#i*|\xCDKQ\r\x95T9w.)\xEA\x1B\xA6P\xA2j\x8FoP\x99\\>T\xFB\xEFP[\v\x07E\x89m(w7\xDB\x8EJfJo\x99 \xE5p\xE2\xB9q~\fmI-z\xFEr\xC7\xF2Y0\x8F\xBB]s\xE5\xC9 \xEAx\xEC \x90\xF0\x8A\x7FB|G\`\xB0\xBD&\xB7q\xB6\xC7\x9F\xD13\x82=\xD3\xAB\xEEc\x99\xC8+S\xA0D\\q\xC6\xCCD2O<\xCA\xC0)=R\xD3aX\xA9}e\xB4\xDC\xCF\r\xF4=\xF1\b\xA9B\xDA# \xD8\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2
\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1
ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS
>\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88
\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function Bu(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=O.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(Bu.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Bu.fromUrl=async function(e){T.defined("resourceOrUrl",e);let t=e;typeof t!="string"&&!(t instanceof we)&&(T.typeOf.string("resourceOrUrl.url",e.url),t=e.url);let n=we.createIfNeeded(t);n.appendForwardSlash();let i=new Bu;i._resource=n;try{await ATt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${RTe(i,"",1).url}: ${o}`;throw new ae(r)}return i};Bu.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;tl(t,r)?tl(e,r)&&(s|=1):(s|=2,tl(e,r)||(s|=1)),i+=s}return i};Bu.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];tl(s,2)?tl(s,1)||(t|=r):(n|=r,tl(s,1)&&(t|=r))}return{x:t,y:n,level:i}};Bu.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(c(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),c(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var OTe=new bi("decodeGoogleEarthEnterprisePacket");Bu.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=RTe(this,e,t,n).fetchArrayBuffer();if(!c(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return OTe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,h=-1;if(e!==""){h=e.length+1;let m=u[e];f=r[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,y){return m.length-y.length});let g=p.length;for(let m=0;m<g;++m){let y=p[m];if(u[y]!==null){let x=tH.clone(u[y]),A=y.length;if(A===h)x.setParent(f);else if(A>1){let E=r[y.substring(0,y.length-1)];x.setParent(E)}r[y]=x}else r[y]=null}})})};Bu.prototype.populateSubtree=function(e,t,n,i){let o=Bu.tileXYToQuadKey(e,t,n);return c$(this,o,i)};function c$(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(c(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,l=a[o];if(c(l))return l.then(function(){return s=new ir({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),c$(e,t,s)});if(!c(r)||!r.hasSubtree())return Promise.reject(new ae(`Couldn't load metadata for tile ${t}`));if(l=e.getQuadTreePacket(o,r.cnodeVersion,n),!!c(l))return a[o]=l,l.then(function(){return s=new ir({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),c$(e,t,s)}).finally(function(){delete a[o]})}Bu.prototype.getTileInformation=function(e,t,n){let i=Bu.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Bu.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function RTe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var s$,a$;function ATt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!c(a$)){let n=tn("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;a$=dT(n).then(function(){s$=window.cesiumGoogleEarthDbRootParser(bTt),c(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return a$.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=s$.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let l=o.buffer.slice(r,s);return OTe.scheduleTask({buffer:l,type:"DbRoot",key:a},[l])}).then(function(n){let i=s$.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,c(i.endSnippet)&&c(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}c(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let o=e.providers,r=i.providerInfo??[],s=r.length;for(let a=0;a<s;++a){let l=r[a],u=l.copyrightString;c(u)&&(o[l.providerId]=new At(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=TTt})}var m0=Bu;function jx(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.buffer",e.buffer),T.typeOf.number("options.negativeAltitudeExponentBias",e.negativeAltitudeExponentBias),T.typeOf.number("options.negativeElevationThreshold",e.negativeElevationThreshold),this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(jx.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var NTe="createVerticesFromGoogleEarthEnterpriseBuffer",CTt=new bi(NTe),ETt=new bi(NTe,Fm.maximumAsynchronousTasks),MTe=new ce,l$=new ce;jx.prototype.createMesh=function(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.tilingScheme",e.tilingScheme),T.typeOf.number("options.x",e.x),T.typeOf.number("options.y",e.y),T.typeOf.number("options.level",e.level);let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,l=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,MTe),t.tileXYToRectangle(n,i,o,l$);let u=l.cartographicToCartesian(ce.center(l$)),h=40075.16/(1<<o);this._skirtHeight=Math.min(h*8,1e3);let g=(a?ETt:CTt).scheduleTask({buffer:this._buffer,nativeRectangle:MTe,rectangle:l$,relativeToCenter:u,ellipsoid:l,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!c(g))return;let m=this;return g.then(function(y){return m._mesh=new oh(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,le.clone(y.boundingSphere3D),d.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,Pn.clone(y.orientedBoundingBox),Zc.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),m._minimumHeight=y.minimumHeight,m._maximumHeight=y.maximumHeight,m._buffer=void 0,m._mesh})};jx.prototype.interpolateHeight=function(e,t,n){let i=O.clamp((t-e.west)/e.width,0,1),o=O.clamp((n-e.south)/e.height,0,1);return c(this._mesh)?PTt(this,i,o):RTt(this,i,o,e)};var STt=new bi("upsampleQuantizedTerrainMesh",Fm.maximumAsynchronousTasks);jx.prototype.upsample=function(e,t,n,i,o,r,s){if(T.typeOf.object("tilingScheme",e),T.typeOf.number("thisX",t),T.typeOf.number("thisY",n),T.typeOf.number("thisLevel",i),T.typeOf.number("descendantX",o),T.typeOf.number("descendantY",r),T.typeOf.number("descendantLevel",s),s-i>1)throw new C("Upsampling through more than one level at a time is not currently supported.");let l=this._mesh;if(!c(this._mesh))return;let u=t*2!==o,f=n*2===r,h=e.ellipsoid,p=e.tileXYToRectangle(o,r,s),g=STt.scheduleTask({vertices:l.vertices,indices:l.indices,indexCountWithoutSkirts:l.indexCountWithoutSkirts,vertexCountWithoutSkirts:l.vertexCountWithoutSkirts,encoding:l.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:u,isNorthChild:f,childRectangle:p,ellipsoid:h});if(!c(g))return;let m=this;return g.then(function(y){let b=new Uint16Array(y.vertices),x=Fe.createTypedArray(b.length/3,y.indices),A=m._skirtHeight;return new TS({quantizedVertices:b,indices:x,minimumHeight:y.minimumHeight,maximumHeight:y.maximumHeight,boundingSphere:le.clone(y.boundingSphere),orientedBoundingBox:Pn.clone(y.orientedBoundingBox),horizonOcclusionPoint:d.clone(y.horizonOcclusionPoint),westIndices:y.westIndices,southIndices:y.southIndices,eastIndices:y.eastIndices,northIndices:y.northIndices,westSkirtHeight:A,southSkirtHeight:A,eastSkirtHeight:A,northSkirtHeight:A,childTileMask:0,createdByUpsampling:!0,credits:m._credits})})};jx.prototype.isChildAvailable=function(e,t,n,i){T.typeOf.number("thisX",e),T.typeOf.number("thisY",t),T.typeOf.number("childX",n),T.typeOf.number("childY",i);let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};jx.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var wTt=new z,vTt=new z,DTt=new z,FTe=new d;function PTt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,l=s.length;a<l;a+=3){let u=s[a],f=s[a+1],h=s[a+2],p=r.decodeTextureCoordinates(o,u,wTt),g=r.decodeTextureCoordinates(o,f,vTt),m=r.decodeTextureCoordinates(o,h,DTt),y=d0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,FTe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let b=r.decodeHeight(o,u),x=r.decodeHeight(o,f),A=r.decodeHeight(o,h);return y.x*b+y.y*x+y.z*A}}}var ITt=Uint16Array.BYTES_PER_ELEMENT,LTe=Uint32Array.BYTES_PER_ELEMENT,u$=Int32Array.BYTES_PER_ELEMENT,OTt=Float32Array.BYTES_PER_ELEMENT,f$=Float64Array.BYTES_PER_ELEMENT;function RTt(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let l=new DataView(o),u=0;for(let v=0;v<r;++v)u+=l.getUint32(u,!0),u+=LTe;u+=LTe,u+=2*f$;let f=O.toRadians(l.getFloat64(u,!0)*180);u+=f$;let h=O.toRadians(l.getFloat64(u,!0)*180);u+=f$;let p=i.width/f/2,g=i.height/h/2,m=l.getInt32(u,!0);u+=u$;let y=l.getInt32(u,!0)*3;u+=u$,u+=u$;let b=new Array(m),x=new Array(m),A=new Array(m),E;for(E=0;E<m;++E)b[E]=s+l.getUint8(u++)*p,x[E]=a+l.getUint8(u++)*g,A[E]=l.getFloat32(u,!0)*6371010,u+=OTt;let S=new Array(y);for(E=0;E<y;++E)S[E]=l.getUint16(u,!0),u+=ITt;for(E=0;E<y;E+=3){let v=S[E],P=S[E+1],M=S[E+2],R=b[v],L=b[P],B=b[M],_=x[v],w=x[P],D=x[M],I=d0.computeBarycentricCoordinates(t,n,R,_,L,w,B,D,FTe);if(I.x>=-1e-15&&I.y>=-1e-15&&I.z>=-1e-15)return I.x*A[v]+I.y*A[P]+I.z*A[M]}}var kI=jx;var ed={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},nH=new Q;function iH(){this._terrainCache={},this._lastTidy=Q.now()}iH.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:Q.now()}};iH.prototype.get=function(e){let n=this._terrainCache[e];if(c(n))return delete this._terrainCache[e],n.buffer};iH.prototype.tidy=function(){if(Q.now(nH),Q.secondsDifference(nH,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];Q.secondsDifference(nH,r.timestamp)>10&&delete e[o]}Q.clone(nH,this._lastTidy)}};function p0(e){e=e??W.EMPTY_OBJECT,this._tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-O.PI,-O.PI,O.PI,O.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new At(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new iH,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new pe}Object.defineProperties(p0.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});p0.fromMetadata=function(e,t){if(T.defined("metadata",e),!e.terrainPresent)throw new ae(`The server ${e.url} doesn't have terrain`);let n=new p0(t);return n._metadata=e,n};var MTt=new bi("decodeGoogleEarthEnterprisePacket");function BTe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===ed.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());c(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}p0.prototype.requestTileGeometry=function(e,t,n,i){let o=m0.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!c(a))return Promise.reject(new ae("Terrain tile doesn't exist"));let l=a.terrainState;c(l)||(l=a.terrainState=ed.UNKNOWN);let u=r.get(o);if(c(u)){let x=s.providers[a.terrainProvider];return Promise.resolve(new kI({buffer:u,childTileMask:BTe(o,a,s),credits:c(x)?[x]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(l===ed.NONE)return Promise.reject(new ae("Terrain tile doesn't exist"))}else return Promise.resolve(new dc({buffer:new Uint8Array(16*16),width:16,height:16}));let f,h=o,p=-1;switch(l){case ed.SELF:p=a.terrainVersion;break;case ed.PARENT:h=h.substring(0,h.length-1),f=s.getTileInformationFromQuadKey(h),p=f.terrainVersion;break;case ed.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(h=h.substring(0,h.length-1),f=s.getTileInformationFromQuadKey(h),c(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new ae("Terrain tile doesn't exist"));let g=this._terrainPromises,m=this._terrainRequests,y,b;if(c(g[h]))y=g[h],b=m[h];else{b=i;let x=LTt(this,h,p,b).fetchArrayBuffer();if(!c(x))return;y=x.then(function(A){return c(A)?MTt.scheduleTask({buffer:A,type:"Terrain",key:s.key},[A]).then(function(E){let S=s.getTileInformationFromQuadKey(h);S.terrainState=ed.SELF,r.add(h,E[0]);let v=S.terrainProvider,P=E.length-1;for(let M=0;M<P;++M){let R=h+M.toString(),L=s.getTileInformationFromQuadKey(R);c(L)&&(r.add(R,E[M+1]),L.terrainState=ed.PARENT,L.terrainProvider===0&&(L.terrainProvider=v))}}):Promise.reject(new ae("Failed to load terrain."))}),g[h]=y,m[h]=b,y=y.finally(function(){delete g[h],delete m[h]})}return y.then(function(){let x=r.get(o);if(c(x)){let A=s.providers[a.terrainProvider];return new kI({buffer:x,childTileMask:BTe(o,a,s),credits:c(A)?[A]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new ae("Failed to load terrain."))}).catch(function(x){return b.state===Zn.CANCELLED?(i.state=b.state,Promise.reject(x)):(a.terrainState=ed.NONE,Promise.reject(x))})};p0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};p0.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=m0.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(c(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===ed.NONE)return!1;if((!c(s)||s===ed.UNKNOWN)&&(r.terrainState=ed.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!c(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new ir({throttle:!1,throttleByServer:!0,type:gs.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};p0.prototype.loadTileDataAvailability=function(e,t,n){};function LTt(e,t,n,i){return n=c(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var kTe=p0;var NTt="https://maps.googleapis.com/maps/api/geocode/json",UTe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function d$(e){e=e??W.EMPTY_OBJECT;let t=e.key;if(!c(t))throw new C("options.key is required.");this._resource=new we({url:NTt,queryParameters:{key:t}}),this._credit=new At(UTe,!0)}Object.defineProperties(d$.prototype,{credit:{get:function(){return this._credit}}});d$.prototype.geocode=async function(e){T.typeOf.string("query",e);let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new ae(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,s=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:ce.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:UTe,collapsible:!1}}})};var VTe=d$;var oH={};oH.defaultApiKey=void 0;oH.mapTilesApiEndpoint=new we({url:"https://tile.googleapis.com/v1/"});oH.getDefaultCredit=function(){return new At('<img src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align: -5px" alt="Google">',!0)};var wS=oH;var UI={};UI.type=void 0;UI.getRequiredDataPoints=C.throwInstantiationError;UI.interpolateOrderZero=C.throwInstantiationError;UI.interpolate=C.throwInstantiationError;var zTe=UI;var FTt={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"},_0=Object.freeze(FTt);function h$(e){T.defined("url",e),this._url=we.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(h$.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});h$.prototype.geocode=async function(e,t){return T.typeOf.string("query",e),this._url.getDerivedResource({url:t===Gx.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(c(s))r=ce.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],l=o.geometry.coordinates[1];r=d.fromDegrees(a,l)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var rH=h$;function HTe(e){if(!Object.values(_0).some(t=>t===e))throw new C(`Invalid geocodeProviderType: "${e}"`)}var GTe=Object.freeze({[_0.GOOGLE]:"google",[_0.BING]:"bing",[_0.DEFAULT]:void 0});function BTt(e){return GTe[e]}function kTt(e){return Object.entries(GTe).find(t=>t[1]===e)[0]}function m$(e){e=e??W.EMPTY_OBJECT,T.typeOf.object("options.scene",e.scene);let t=e.geocodeProviderType??_0.DEFAULT;HTe(t);let n=e.accessToken??Gh.defaultAccessToken,i=we.createIfNeeded(e.server??Gh.defaultServer);i.appendForwardSlash();let o=Gh.getDefaultTokenCredit(n);c(o)&&e.scene.frameState.creditDisplay.addStaticCredit(At.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});c(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new rH(r),this.geocodeProviderType=t}Object.defineProperties(m$.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return kTt(this._pelias.url.queryParameters.geocoder)},set:function(e){HTe(e);let t={...this._pelias.url.queryParameters,geocoder:BTt(e)};c(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});m$.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var vS=m$;var Eo={};Eo.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});Eo.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});Eo.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});Eo.defaultAccessToken=void 0;Eo.defaultShareKey=void 0;Eo._getAuthorizationHeader=function(){if(!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new C("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");return c(Eo.defaultShareKey)?`Basic ${Eo.defaultShareKey}`:`Bearer ${Eo.defaultAccessToken}`};Eo.apiEndpoint=new we({url:"https://api.bentley.com"});Eo.getExports=async function(e){if(T.typeOf.string("iModelId",e),!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new C("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let t=new we({url:`${Eo.apiEndpoint}mesh-export`,headers:{Authorization:Eo._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:Eo.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&t.appendQueryParameters({clientVersion:CESIUM_VERSION});try{return await t.fetchJson()}catch(n){let i=JSON.parse(n.response);if(n.statusCode===401){let o=i.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(n.statusCode===403)throw console.error(i.error.code,i.error.message),new ae("Not allowed, forbidden");if(n.statusCode===422)throw new ae(`Unprocessable Entity:${i.error.code} ${i.error.message}`);if(n.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${n.statusCode}`)}};Eo.getRealityDataMetadata=async function(e,t){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new C("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let n=new we({url:`${Eo.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:Eo._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ae("Not allowed, forbidden");if(i.statusCode===404)throw new ae(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new ae(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${i.statusCode}`)}};Eo.getRealityDataURL=async function(e,t,n){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),T.typeOf.string("rootDocument",n),!c(Eo.defaultAccessToken)&&!c(Eo.defaultShareKey))throw new C("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let i=new we({url:`${Eo.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:Eo._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,s=new URL(r);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(o){let r=JSON.parse(o.response);if(o.statusCode===401){let s=r.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new ae("Not allowed, forbidden");if(o.statusCode===404)throw new ae(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new ae(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${o.statusCode}`)}};var ds=Eo;function sH(){C.throwInstantiationError()}Object.defineProperties(sH.prototype,{ellipsoid:{get:C.throwInstantiationError}});sH.prototype.project=C.throwInstantiationError;sH.prototype.unproject=C.throwInstantiationError;var jTe=sH;function DS(e){e=e??W.EMPTY_OBJECT;let t=e.weights,n=e.times;if(T.defined("weights",t),T.defined("times",n),T.typeOf.number.greaterThanOrEquals("weights.length",t.length,3),t.length%n.length!==0)throw new C("times.length must be a factor of weights.length.");this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(DS.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});DS.prototype.findTimeInterval=Ni.prototype.findTimeInterval;DS.prototype.wrapTime=Ni.prototype.wrapTime;DS.prototype.clampTime=Ni.prototype.clampTime;DS.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);c(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var WTe=DS;function p$(e,t,n){T.defined("url",e),T.defined("apiKey",t),c(n)&&T.typeOf.object("params",n),e=we.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new At('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(p$.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});p$.prototype.geocode=async function(e){return T.typeOf.string("query",e),this._url.getDerivedResource({url:"json",queryParameters:xt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(c(r))o=ce.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let s=i.geometry.lat,a=i.geometry.lng;o=d.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var qTe=p$;var UTt={packedLength:void 0,pack:C.throwInstantiationError,unpack:C.throwInstantiationError},YTe=UTt;var VTt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:C.throwInstantiationError,unpackInterpolationResult:C.throwInstantiationError},XTe=VTt;var zTt=new d;function HTt(e,t,n,i){let o=CT(e,t,n,i,zTt);return c(o)?o.x>0&&o.y>0&&o.z>0:!1}var KTe=HTt;function $Te(){C.throwInstantiationError()}$Te.prototype.getURL=C.throwInstantiationError;var ZTe=$Te;function GTt(e,t,n,i,o,r,s){let a=Bi.numberOfPoints(e,t,o),l,u=n.red,f=n.green,h=n.blue,p=n.alpha,g=i.red,m=i.green,y=i.blue,b=i.alpha;if(G.equals(n,i)){for(l=0;l<a;l++)r[s++]=G.floatToByte(u),r[s++]=G.floatToByte(f),r[s++]=G.floatToByte(h),r[s++]=G.floatToByte(p);return s}let x=(g-u)/a,A=(m-f)/a,E=(y-h)/a,S=(b-p)/a,v=s;for(l=0;l<a;l++)r[v++]=G.floatToByte(u+l*x),r[v++]=G.floatToByte(f+l*A),r[v++]=G.floatToByte(h+l*E),r[v++]=G.floatToByte(p+l*S);return v}function VI(e){e=e??W.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;if(!c(t)||t.length<2)throw new C("At least two positions are required.");if(c(n)&&(i&&n.length<t.length||!i&&n.length<t.length-1))throw new C("colors has an invalid length.");this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??qt.GEODESIC,this._granularity=e.granularity??O.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??ie.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*d.packedLength;o+=c(n)?1+n.length*G.packedLength:1,this.packedLength=o+ie.packedLength+3}VI.pack=function(e,t,n){if(!c(e))throw new C("value is required");if(!c(t))throw new C("array is required");n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=d.packedLength)d.pack(o[i],t,n);let s=e._colors;for(r=c(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=G.packedLength)G.pack(s[i],t,n);return ie.pack(e._ellipsoid,t,n),n+=ie.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};VI.unpack=function(e,t,n){if(!c(e))throw new C("array is required");t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=d.packedLength)r[i]=d.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=G.packedLength)s[i]=G.unpack(e,t);let a=ie.unpack(e,t);t+=ie.packedLength;let l=e[t++]===1,u=e[t++],f=e[t];return c(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=l,n._arcType=u,n._granularity=f,n):new VI({positions:r,colors:s,ellipsoid:a,colorsPerVertex:l,arcType:u,granularity:f})};var aH=new Array(2),cH=new Array(2),jTt={positions:aH,height:cH,ellipsoid:void 0,minDistance:void 0,granularity:void 0};VI.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=O.chordLength(r,s.maximumRadius),l=c(n)&&!i,u,f=t.length,h,p,g,m,y=0;if(o===qt.GEODESIC||o===qt.RHUMB){let S,v,P;o===qt.GEODESIC?(S=O.chordLength(r,s.maximumRadius),v=Bi.numberOfPoints,P=Bi.generateArc):(S=r,v=Bi.numberOfPointsRhumbLine,P=Bi.generateRhumbArc);let M=Bi.extractHeights(t,s),R=jTt;if(o===qt.GEODESIC?R.minDistance=a:R.granularity=r,R.ellipsoid=s,l){let L=0;for(u=0;u<f-1;u++)L+=v(t[u],t[u+1],S)+1;h=new Float64Array(L*3),g=new Uint8Array(L*4),R.positions=aH,R.height=cH;let B=0;for(u=0;u<f-1;++u){aH[0]=t[u],aH[1]=t[u+1],cH[0]=M[u],cH[1]=M[u+1];let _=P(R);if(c(n)){let w=_.length/3;m=n[u];for(let D=0;D<w;++D)g[B++]=G.floatToByte(m.red),g[B++]=G.floatToByte(m.green),g[B++]=G.floatToByte(m.blue),g[B++]=G.floatToByte(m.alpha)}h.set(_,y),y+=_.length}}else if(R.positions=t,R.height=M,h=new Float64Array(P(R)),c(n)){for(g=new Uint8Array(h.length/3*4),u=0;u<f-1;++u){let B=t[u],_=t[u+1],w=n[u],D=n[u+1];y=GTt(B,_,w,D,a,g,y)}let L=n[f-1];g[y++]=G.floatToByte(L.red),g[y++]=G.floatToByte(L.green),g[y++]=G.floatToByte(L.blue),g[y++]=G.floatToByte(L.alpha)}}else{p=l?f*2-2:f,h=new Float64Array(p*3),g=c(n)?new Uint8Array(p*4):void 0;let S=0,v=0;for(u=0;u<f;++u){let P=t[u];if(l&&u>0&&(d.pack(P,h,S),S+=3,m=n[u-1],g[v++]=G.floatToByte(m.red),g[v++]=G.floatToByte(m.green),g[v++]=G.floatToByte(m.blue),g[v++]=G.floatToByte(m.alpha)),l&&u===f-1)break;d.pack(P,h,S),S+=3,c(n)&&(m=n[u],g[v++]=G.floatToByte(m.red),g[v++]=G.floatToByte(m.green),g[v++]=G.floatToByte(m.blue),g[v++]=G.floatToByte(m.alpha))}}let b=new hn;b.position=new ve({componentDatatype:$.DOUBLE,componentsPerAttribute:3,values:h}),c(n)&&(b.color=new ve({componentDatatype:$.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=h.length/3;let x=(p-1)*2,A=Fe.createTypedArray(p,x),E=0;for(u=0;u<p-1;++u)A[E++]=u,A[E++]=u+1;return new ct({attributes:b,indices:A,primitiveType:Me.LINES,boundingSphere:le.fromPoints(t)})};var QTe=VI;function PS(e){let t=e.radius??1,i={radii:new d(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new da(i),this._workerName="createSphereGeometry"}PS.packedLength=da.packedLength;PS.pack=function(e,t,n){return T.typeOf.object("value",e),da.pack(e._ellipsoidGeometry,t,n)};var WTt=new da,g0={radius:void 0,radii:new d,vertexFormat:new Ie,stackPartitions:void 0,slicePartitions:void 0};PS.unpack=function(e,t,n){let i=da.unpack(e,t,WTt);return g0.vertexFormat=Ie.clone(i._vertexFormat,g0.vertexFormat),g0.stackPartitions=i._stackPartitions,g0.slicePartitions=i._slicePartitions,c(n)?(d.clone(i._radii,g0.radii),n._ellipsoidGeometry=new da(g0),n):(g0.radius=i._radii.x,new PS(g0))};PS.createGeometry=function(e){return da.createGeometry(e._ellipsoidGeometry)};var JTe=PS;function qTt(e){return T.defined("value",e),e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var IS=qTt;function y0(e){throw new C("This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme.")}Object.defineProperties(y0.prototype,{ellipsoid:{get:C.throwInstantiationError},rectangle:{get:C.throwInstantiationError},projection:{get:C.throwInstantiationError}});y0.prototype.getNumberOfXTilesAtLevel=C.throwInstantiationError;y0.prototype.getNumberOfYTilesAtLevel=C.throwInstantiationError;y0.prototype.rectangleToNativeRectangle=C.throwInstantiationError;y0.prototype.tileXYToNativeRectangle=C.throwInstantiationError;y0.prototype.tileXYToRectangle=C.throwInstantiationError;y0.prototype.positionToTileXY=C.throwInstantiationError;var eAe=y0;function Wx(e){e=e??W.EMPTY_OBJECT,this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=e.epoch??Ge.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(Wx.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(c(t)&&(this._clockSubscription(),this._clockSubscription=void 0),c(e)&&(this._clockSubscription=e.onTick.addEventListener(Wx.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(c(t)&&t.removeEventListener("seeked",this._seekFunction,!1),c(e)&&(this._seeking=!1,this._seekFunction=YTt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});Wx.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,de(this)};Wx.prototype.isDestroyed=function(){return!1};Wx.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};Wx.prototype._onTick=function(e){let t=this._element;if(!c(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=this.epoch??Ge.MINIMUM_VALUE,s=Q.secondsDifference(o,r),a=t.duration,l,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),l=s):s>a?l=a:s<0?l=0:l=s;let f=i?this.tolerance??1:.001;Math.abs(l-u)>f&&(this._seeking=!0,t.currentTime=l)};function YTt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var tAe=Wx;function XTt(e,t){this.rectangle=e,this.maxLevel=t}function nAe(e){this.ellipsoid=e.ellipsoid??ie.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}nAe.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function KTt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Ki({ellipsoid:e.ellipsoid});else throw new ae(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=us.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=O.toRadians(parseFloat(s.getAttribute("minx"))),l=O.toRadians(parseFloat(s.getAttribute("miny"))),u=O.toRadians(parseFloat(s.getAttribute("maxx"))),f=O.toRadians(parseFloat(s.getAttribute("maxy"))),h=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new XTt(new ce(a,l,u,f),h))}}function $Tt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw c(t)&&c(t.message)&&(i=`${i}: ${t.message}`),Io.reportError(void 0,n,c(n)?n._errorEvent:void 0,i),new ae(i)}async function ZTt(e,t,n){try{let i=await t.fetchXML();KTt(e,i)}catch(i){$Tt(t,i,n)}}function b0(e){e=e??W.EMPTY_OBJECT,this._errorEvent=new pe,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new At(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(b0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});b0.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=new nAe(t),i=we.createIfNeeded(e);await ZTt(n,i);let o=new b0(t);return n.build(o),o._resource=i,o};b0.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!c(s))return;let a=this;return Promise.resolve(s).then(function(l){return new dc({buffer:Ah(l),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:QTt(a,e,t,n),structure:a._terrainDataStructure})})};b0.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var iAe=new ce;function QTt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let l=0;l<r.length&&a!==15;++l){let u=r[l];if(u.maxLevel<=i)continue;let f=u.rectangle,h=ce.intersection(f,s,iAe);c(h)&&(lH(o,f,t*2,n*2,i+1)&&(a|=4),lH(o,f,t*2+1,n*2,i+1)&&(a|=8),lH(o,f,t*2,n*2+1,i+1)&&(a|=1),lH(o,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function lH(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return c(ce.intersection(r,t,iAe))}b0.prototype.getTileDataAvailable=function(e,t,n){};b0.prototype.loadTileDataAvailability=function(e,t,n){};var oAe=b0;var JTt={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033},rAe=Object.freeze(JTt);function eAt(e){switch(e){case ne.FLOAT:return"float";case ne.FLOAT_VEC2:return"vec2";case ne.FLOAT_VEC3:return"vec3";case ne.FLOAT_VEC4:return"vec4";case ne.FLOAT_MAT2:return"mat2";case ne.FLOAT_MAT3:return"mat3";case ne.FLOAT_MAT4:return"mat4";case ne.SAMPLER_2D:return"sampler2D";case ne.BOOL:return"bool"}}var sAe=eAt;function tAt(e,t,n){if(typeof t!="function")throw new C("oldFunction is required to be a function.");if(typeof n!="function")throw new C("oldFunction is required to be a function.");return function(){n.apply(e,arguments),t.apply(e,arguments)}}var uH=tAt;var nAt=new d(1,1,1);function _$(e){e=e??nAt,T.defined("dimensions",e),T.typeOf.number.greaterThanOrEquals("dimensions.x",e.x,0),T.typeOf.number.greaterThanOrEquals("dimensions.y",e.y,0),T.typeOf.number.greaterThanOrEquals("dimensions.z",e.z,0),this._dimensions=d.clone(e)}Object.defineProperties(_$.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){T.defined("value",e),T.typeOf.number.greaterThanOrEquals("value.x",e.x,0),T.typeOf.number.greaterThanOrEquals("value.y",e.y,0),T.typeOf.number.greaterThanOrEquals("value.z",e.z,0),d.clone(e,this._dimensions)}}});var iAt=new d;_$.prototype.emit=function(e){let t=this._dimensions,n=d.multiplyByScalar(t,.5,iAt),i=O.randomBetween(-n.x,n.x),o=O.randomBetween(-n.y,n.y),r=O.randomBetween(-n.z,n.z);e.position=d.fromElements(i,o,r,e.position),e.velocity=d.normalize(e.position,e.velocity)};var aAe=_$;function Qm(){this.featurePropertiesDirty=!1}Object.defineProperties(Qm.prototype,{featuresLength:{get:function(){C.throwInstantiationError()}},pointsLength:{get:function(){C.throwInstantiationError()}},trianglesLength:{get:function(){C.throwInstantiationError()}},geometryByteLength:{get:function(){C.throwInstantiationError()}},texturesByteLength:{get:function(){C.throwInstantiationError()}},batchTableByteLength:{get:function(){C.throwInstantiationError()}},innerContents:{get:function(){C.throwInstantiationError()}},ready:{get:function(){C.throwInstantiationError()}},tileset:{get:function(){C.throwInstantiationError()}},tile:{get:function(){C.throwInstantiationError()}},url:{get:function(){C.throwInstantiationError()}},batchTable:{get:function(){C.throwInstantiationError()}},metadata:{get:function(){C.throwInstantiationError()},set:function(e){C.throwInstantiationError()}},group:{get:function(){C.throwInstantiationError()},set:function(e){C.throwInstantiationError()}}});Qm.prototype.hasProperty=function(e,t){C.throwInstantiationError()};Qm.prototype.getFeature=function(e){C.throwInstantiationError()};Qm.prototype.applyDebugSettings=function(e,t){C.throwInstantiationError()};Qm.prototype.applyStyle=function(e){C.throwInstantiationError()};Qm.prototype.update=function(e,t){C.throwInstantiationError()};Qm.prototype.pick=function(e,t,n){C.throwInstantiationError()};Qm.prototype.isDestroyed=function(){C.throwInstantiationError()};Qm.prototype.destroy=function(){C.throwInstantiationError()};var cAe=Qm;function OS(e,t){this._conditionsExpression=We(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,rAt(this,t)}Object.defineProperties(OS.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function oAt(e,t){this.condition=e,this.expression=t}function rAt(e,t){let n=[],i=e._conditions;if(!c(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),l=String(s[1]);n.push(new oAt(new bd(a,t),new bd(l,t)))}e._runtimeConditions=n}OS.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!c(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};OS.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!c(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};OS.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!c(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let l=o[a],u=l.condition.getShaderExpression(t,n),f=l.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${u})
{
return ${f};
}
`}return r=`${i} ${e}
{
${r} return ${i}(1.0);
}
`,r};OS.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!c(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];e.push.apply(e,o.condition.getVariables()),e.push.apply(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var fH=OS;function x0(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,sAt(this,e)}function sAt(e,t){t=We(t,!0)??e._style,e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin;let n={};if(c(t.meta)){let i=t.defines,o=t.meta??W.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new bd(o[r],i))}e._meta=n,e._ready=!0}function tr(e,t){let n=(e._style??W.EMPTY_OBJECT).defines;if(c(t)){if(typeof t=="boolean"||typeof t=="number")return new bd(String(t));if(typeof t=="string")return new bd(t,n);if(c(t.conditions))return new fH(t,n)}else return;return t}function nr(e){if(c(e)){if(c(e.expression))return e.expression;if(c(e.conditionsExpression))return We(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(x0.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=tr(this,e),this._style.show=nr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=tr(this,e),this._style.color=nr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=tr(this,e),this._style.pointSize=nr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=tr(this,e),this._style.pointOutlineColor=nr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=tr(this,e),this._style.pointOutlineWidth=nr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=tr(this,e),this._style.labelColor=nr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=tr(this,e),this._style.labelOutlineColor=nr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=tr(this,e),this._style.labelOutlineWidth=nr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=tr(this,e),this._style.font=nr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=tr(this,e),this._style.labelStyle=nr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=tr(this,e),this._style.labelText=nr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=tr(this,e),this._style.backgroundColor=nr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=tr(this,e),this._style.backgroundPadding=nr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=tr(this,e),this._style.backgroundEnabled=nr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=tr(this,e),this._style.scaleByDistance=nr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=tr(this,e),this._style.translucencyByDistance=nr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=tr(this,e),this._style.distanceDisplayCondition=nr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=tr(this,e),this._style.heightOffset=nr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=tr(this,e),this._style.anchorLineEnabled=nr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=tr(this,e),this._style.anchorLineColor=nr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=tr(this,e),this._style.image=nr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=tr(this,e),this._style.disableDepthTestDistance=nr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=tr(this,e),this._style.horizontalOrigin=nr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=tr(this,e),this._style.verticalOrigin=nr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=tr(this,e),this._style.labelHorizontalOrigin=nr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=tr(this,e),this._style.labelVerticalOrigin=nr(this._labelVerticalOrigin)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});x0.fromUrl=function(e){if(!c(e))throw new C("url is required");return we.createIfNeeded(e).fetchJson(e).then(function(n){return new x0(n)})};x0.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,c(this.color)&&c(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};x0.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,c(this.show)&&c(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};x0.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,c(this.pointSize)&&c(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};x0.prototype.getVariables=function(){let e=[];return c(this.color)&&c(this.color.getVariables)&&e.push.apply(e,this.color.getVariables()),c(this.show)&&c(this.show.getVariables)&&e.push.apply(e,this.show.getVariables()),c(this.pointSize)&&c(this.pointSize.getVariables)&&e.push.apply(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var RS=x0;function zI(e){e=e??W.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new dS({comparator:zI.comparator})}zI.prototype.addSubtree=function(e){let t=new aAt(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates();if(this.find(i)===void 0)throw new C("parent node needs to exist")}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};zI.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};zI.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function aAt(e,t){this.subtree=e,this.stamp=t}var dH=zI;function HI(e){e=e??W.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:s,paddingBefore:a=d.ZERO.clone(),paddingAfter:l=d.ZERO.clone(),globalTransform:u=F.IDENTITY.clone(),shapeTransform:f=F.IDENTITY.clone(),minBounds:h,maxBounds:p,minimumValues:g,maximumValues:m,maximumTileCount:y}=e;T.typeOf.string("className",t),T.typeOf.object("names",n),T.typeOf.object("types",i),T.typeOf.object("componentTypes",o),T.typeOf.string("shape",r),T.typeOf.object("dimensions",s),this._shapeTransform=f,this._globalTransform=u,this._shape=r,this._minBounds=h,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=l,this._className=t,this._names=n,this._types=i,this._componentTypes=o,this._metadataOrder=r===Na.ELLIPSOID?hh.Z_UP:hh.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new dH}Object.defineProperties(HI.prototype,{globalTransform:{get:function(){return this._globalTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shape:{get:function(){return this._shape}},minBounds:{get:function(){return this._minBounds}},maxBounds:{get:function(){return this._maxBounds}},dimensions:{get:function(){return this._dimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},className:{get:function(){return this._className}},names:{get:function(){return this._names}},types:{get:function(){return this._types}},componentTypes:{get:function(){return this._componentTypes}},metadataOrder:{get:function(){return this._metadataOrder}},minimumValues:{get:function(){return this._minimumValues}},maximumValues:{get:function(){return this._maximumValues}},maximumTileCount:{get:function(){return this._maximumTileCount}},availableLevels:{get:function(){return this._availableLevels}}});HI.fromUrl=async function(e){T.defined("url",e);let t=we.createIfNeeded(e),n=await t.fetchJson();lAt(n);let i=_At(n,t);await i.load();let{root:o}=n,r=ri(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new _C({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],l=a.class,u=gAt(s,l);Object.assign(u,uAt(o)),c(o.transform)?u.globalTransform=F.unpack(o.transform):u.globalTransform=F.clone(F.IDENTITY),u.dimensions=d.unpack(a.dimensions),u.maximumTileCount=cAt(s),c(a.padding)&&(u.paddingBefore=d.unpack(a.padding.before),u.paddingAfter=d.unpack(a.padding.after));let f=new HI(u),h=new yC(t,o,i.schema);return f._implicitTileset=h,f._availableLevels=h.availableLevels,Di.unload(i),f};function cAt(e){if(c(e.tileset))return e.tileset.getPropertyBySemantic(AA.TILESET_TILE_COUNT)}function lAt(e){let t=e.root;if(!c(t.content))throw new ae("Root must have content");if(!ri(t.content,"3DTILES_content_voxels"))throw new ae("Root tile content must have 3DTILES_content_voxels extension");if(!ri(t,"3DTILES_implicit_tiling")&&!c(t.implicitTiling))throw new ae("Root tile must have implicit tiling");if(!c(e.schema)&&!c(e.schemaUri)&&!ri(e,"3DTILES_metadata"))throw new ae("Tileset must have a metadata schema")}function uAt(e){let t=e.boundingVolume;if(c(t.box))return mAt(t.box);if(c(t.region))return fAt(t.region);if(ri(t,"3DTILES_bounding_volume_cylinder"))return pAt(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new ae("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function fAt(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=F.fromScale(ie.WGS84.radii),l=new d(t,n,r),u=new d(i,o,s);return{shape:Na.ELLIPSOID,minBounds:l,maxBounds:u,shapeTransform:a}}var dAt=new d,hAt=new J;function mAt(e){let t=Pn.unpack(e),n=J.getScale(t.halfAxes,dAt),i=J.getRotation(t.halfAxes,hAt);return{shape:Na.BOX,minBounds:d.negate(n,new d),maxBounds:d.clone(n),shapeTransform:F.fromRotationTranslation(i,t.center)}}function pAt(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-O.PI,maxAngle:r=O.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e;T.typeOf.number("minRadius",t),T.typeOf.number("maxRadius",n),T.typeOf.number("height",i),T.typeOf.number("minAngle",o),T.typeOf.number("maxAngle",r),T.typeOf.object("translation",s),T.typeOf.object("rotation",a);let l=-.5*i+s[2],u=.5*i+s[2],f=F.fromTranslationQuaternionRotationScale(d.unpack(s),Le.unpack(a),d.ONE);return{shape:Na.CYLINDER,minBounds:d.fromElements(t,o,l),maxBounds:d.fromElements(n,r,u),shapeTransform:f}}function _At(e,t){let{schemaUri:n,schema:i}=e;return c(n)?Di.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Di.getSchemaLoader({schema:i})}function gAt(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,s=Object.entries(r).map(([g,m])=>{let{type:y,componentType:b}=m,x=o?.properties[g].min,A=o?.properties[g].max,E=at.getComponentCount(y),S=lAe(x,E),v=lAe(A,E);return{id:g,type:y,componentType:b,minValue:S,maxValue:v}}),a=s.map(g=>g.id),l=s.map(g=>g.type),u=s.map(g=>g.componentType),f=s.map(g=>g.minValue),h=s.map(g=>g.maxValue),p=f.some(c);return{className:t,names:a,types:l,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?h:void 0}}function lAe(e,t){if(!c(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function yAt(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(c(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),c(o))return o;let l=$g(a);return o=await TA.fromSubtreeJson(s,l.jsonPayload,l.binaryPayload,n,t),i.addSubtree(o),o}HI.prototype.requestData=async function(e){e=e??W.EMPTY_OBJECT;let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:o=0,keyframe:r=0}=e;if(r!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let s=this._implicitTileset,a=new bC({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),l=a.isSubtreeRoot()&&a.level>0,u=l?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),h=await yAt(this,u);if(!(l?h.childSubtreeIsAvailableAtCoordinates:h.tileIsAvailableAtCoordinates).call(h,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${o}.`);let{contentUriTemplates:m,baseResource:y}=s,b=m[0].getDerivedResource({templateValues:a.getTemplateValues()}),x=y.getDerivedResource({url:b.url});return cS.fromGltf(x)};var uAe=HI;function g$(e){e=e??1,T.typeOf.number.greaterThan("radius",e,0),this._radius=e??1}Object.defineProperties(g$.prototype,{radius:{get:function(){return this._radius},set:function(e){T.typeOf.number.greaterThan("value",e,0),this._radius=e}}});g$.prototype.emit=function(e){let t=O.randomBetween(0,O.TWO_PI),n=O.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=d.fromElements(i,o,r,e.position),e.velocity=d.clone(d.UNIT_Z,e.velocity)};var hH=g$;var y$={CUMULUS:0};y$.validate=function(e){return e===y$.CUMULUS};var MS=Object.freeze(y$);function _h(e,t){if(e=e??W.EMPTY_OBJECT,this._show=e.show??!0,this._position=d.clone(e.position??d.ZERO),!c(e.scale)&&c(e.maximumSize))this._maximumSize=d.clone(e.maximumSize),this._scale=new z(this._maximumSize.x,this._maximumSize.y);else{this._scale=z.clone(e.scale??new z(20,12));let n=new d(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=d.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=G.clone(e.color??G.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var bAt=_h.SHOW_INDEX=0,xAt=_h.POSITION_INDEX=1,TAt=_h.SCALE_INDEX=2,AAt=_h.MAXIMUM_SIZE_INDEX=3,CAt=_h.SLICE_INDEX=4,EAt=_h.BRIGHTNESS_INDEX=5,SAt=_h.COLOR_INDEX=6;_h.NUMBER_OF_PROPERTIES=7;function qx(e,t){let n=e._cloudCollection;c(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(_h.prototype,{show:{get:function(){return this._show},set:function(e){T.typeOf.bool("value",e),this._show!==e&&(this._show=e,qx(this,bAt))}},position:{get:function(){return this._position},set:function(e){T.typeOf.object("value",e);let t=this._position;d.equals(t,e)||(d.clone(e,t),qx(this,xAt))}},scale:{get:function(){return this._scale},set:function(e){T.typeOf.object("value",e);let t=this._scale;z.equals(t,e)||(z.clone(e,t),qx(this,TAt))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){T.typeOf.object("value",e);let t=this._maximumSize;d.equals(t,e)||(d.clone(e,t),qx(this,AAt))}},color:{get:function(){return this._color},set:function(e){T.typeOf.object("value",e);let t=this._color;G.equals(t,e)||(G.clone(e,t),qx(this,SAt))}},slice:{get:function(){return this._slice},set:function(e){T.typeOf.number("value",e),this._slice!==e&&(this._slice=e,qx(this,CAt))}},brightness:{get:function(){return this._brightness},set:function(e){T.typeOf.number("value",e),this._brightness!==e&&(this._brightness=e,qx(this,EAt))}}});_h.prototype._destroy=function(){this._cloudCollection=void 0};var td=_h;var ku,mH=new d,wAt={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},vAt={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},DAt=td.SHOW_INDEX,PAt=td.POSITION_INDEX,IAt=td.SCALE_INDEX,OAt=td.MAXIMUM_SIZE_INDEX,RAt=td.SLICE_INDEX,MAt=td.BRIGHTNESS_INDEX,LAt=td.NUMBER_OF_PROPERTIES,NAt=td.COLOR_INDEX;function gh(e){e=e??W.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(LAt),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=d.clone(e.noiseOffset??d.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:fAe(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function fAe(e){return function(){return mH.x=e._textureSliceWidth,mH.y=e._noiseTextureRows,mH.z=1/e._noiseTextureRows,mH}}Object.defineProperties(gh.prototype,{length:{get:function(){return x$(this),this._clouds.length}}});function dAe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}gh.prototype.add=function(e){e=e??W.EMPTY_OBJECT;let t=e.cloudType??MS.CUMULUS;if(!MS.validate(t))throw new C("invalid cloud type");let n;return t===MS.CUMULUS&&(n=new td(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};gh.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};gh.prototype.removeAll=function(){dAe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function x$(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];c(s)&&(n._index=r++,t.push(s))}e._clouds=t}}gh.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};gh.prototype.contains=function(e){return c(e)&&e._cloudCollection===this};gh.prototype.get=function(e){return T.typeOf.number("index",e),x$(this),this._clouds[e]};var FAt=new Float32Array([-1,-1,1,-1,1,1,-1,1]),BAt=new Uint16Array([0,1,2,0,2,3]);function kAt(e){let t=bt.createVertexBuffer({context:e,typedArray:FAt,usage:Be.STATIC_DRAW}),n=bt.createIndexBuffer({context:e,typedArray:BAt,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:$.FLOAT}];return new ni({context:e,attributes:i,indexBuffer:n})}var T$;function UAt(e){let n=e.cache.cloudCollection_indexBufferBatched;if(c(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=bt.createIndexBuffer({context:e,typedArray:o,usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function VAt(e){let t=e.cache.cloudCollection_indexBufferInstanced;return c(t)||(t=bt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Be.STATIC_DRAW,indexDatatype:Fe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function zAt(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return c(t)||(t=bt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Be.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function HAt(e,t,n){let i=[{index:ku.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ku.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ku.packedAttribute0,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ku.packedAttribute1,componentsPerAttribute:4,componentDatatype:$.FLOAT,usage:Be.STATIC_DRAW},{index:ku.color,componentsPerAttribute:4,componentDatatype:$.UNSIGNED_BYTE,normalize:!0,usage:Be.STATIC_DRAW}];n&&i.push({index:ku.direction,componentsPerAttribute:2,componentDatatype:$.FLOAT,vertexBuffer:zAt(e)});let o=n?t:4*t;return new X_(e,i,o,n)}var b$=new Hn;function hAe(e,t,n,i){let o,r=n[ku.positionHighAndScaleX],s=n[ku.positionLowAndScaleY],a=i.position;Hn.fromCartesian(a,b$);let l=i.scale,u=b$.high,f=b$.low;e._instanced?(o=i._index,r(o,u.x,u.y,u.z,l.x),s(o,f.x,f.y,f.z,l.y)):(o=i._index*4,r(o+0,u.x,u.y,u.z,l.x),r(o+1,u.x,u.y,u.z,l.x),r(o+2,u.x,u.y,u.z,l.x),r(o+3,u.x,u.y,u.z,l.x),s(o+0,f.x,f.y,f.z,l.y),s(o+1,f.x,f.y,f.z,l.y),s(o+2,f.x,f.y,f.z,l.y),s(o+3,f.x,f.y,f.z,l.y))}function mAe(e,t,n,i){let o,r=n[ku.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function pAe(e,t,n,i){let o,r=n[ku.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function _Ae(e,t,n,i){let o,r=n[ku.color],s=i.color,a=G.floatToByte(s.red),l=G.floatToByte(s.green),u=G.floatToByte(s.blue),f=G.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,l,u,f)):(o=i._index*4,r(o+0,a,l,u,f),r(o+1,a,l,u,f),r(o+2,a,l,u,f),r(o+3,a,l,u,f))}function GAt(e,t,n,i){hAe(e,t,n,i),mAe(e,t,n,i),pAe(e,t,n,i),_Ae(e,t,n,i)}function jAt(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows;if(r/s<1||r%s!==0)throw new C("noiseTextureRows must evenly divide textureSliceWidth");let a=t.context;o._vaNoise=kAt(a),o._spNoise=en.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let l=o.noiseDetail,u=o.noiseOffset;o._noiseTexture=new Rt({context:a,width:r*r/s,height:r*s,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:ke.RGBA,sampler:new Qt({wrapS:gn.REPEAT,wrapT:gn.REPEAT,minificationFilter:Yt.NEAREST,magnificationFilter:ui.NEAREST})});let f=new cl({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:fAe(o),u_noiseDetail:function(){return l},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(h){o._ready=!0,o._loading=!1}});t.commandList.push(f),o._loading=!0}function WAt(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=HAt(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let l=o[a];GAt(e,t,s,l)}n._vaf.commit(T$(i))}}var qAt=[];function YAt(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,l=i._propertiesChanged,u=qAt;u.length=0,(l[PAt]||l[IAt])&&u.push(hAe),(l[DAt]||l[MAt])&&u.push(mAe),(l[OAt]||l[RAt])&&u.push(pAe),l[NAt]&&u.push(_Ae);let f=u.length,h=i._vaf.writers,p,g,m;if(a/r>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,h,g);i._vaf.commit(T$(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,h,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function XAt(e,t,n,i){let o=t.context,r=e,s=new He({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new He({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=en.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:ku}),r._rs=ze.fromCache({depthTest:{enabled:!0,func:ne.LESS},depthMask:!1,blending:un.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function KAt(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,l=a.length;s.length=l;for(let u=0;u<l;u++){let f=s[u];c(f)||(f=s[u]=new Je),f.pass=De.TRANSLUCENT,f.owner=e,f.uniformMap=o,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),r.push(f)}}}gh.prototype.update=function(e){if(x$(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:c(this._noiseTexture),!this._ready&&!this._loading&&!t&&jAt(this,e,fV,uV),this._instanced=e.context.instancedArrays,ku=this._instanced?vAt:wAt,T$=this._instanced?VAt:UAt;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?WAt(this,e):r>0&&YAt(this,e),r>i*1.5&&(o.length=i),!(!c(this._vaf)||!c(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&XAt(this,e,lV,cV),KAt(this,e))};gh.prototype.isDestroyed=function(){return!1};gh.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),dAe(this._clouds),de(this)};var gAe=gh;var $At=O.toRadians(30);function A$(e){this._angle=e??$At}Object.defineProperties(A$.prototype,{angle:{get:function(){return this._angle},set:function(e){T.typeOf.number("value",e),this._angle=e}}});A$.prototype.emit=function(e){let t=Math.tan(this._angle),n=O.randomBetween(0,O.TWO_PI),i=O.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=d.fromElements(o,r,s,e.velocity),d.normalize(e.velocity,e.velocity),e.position=d.clone(d.ZERO,e.position)};var yAe=A$;var ZAt=new G,QAt=new G,JAt=new G,eCt=new G,bAe=new se,GI=new Uint8Array(4);function xAe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return G.lerp(t.color,n.color,o,i)}function pH(e,t){return{height:e,color:G.clone(t)}}function TAe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?G.equals(t.color,i[n-1].color):!1,a=r?G.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?G.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function tCt(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length;if(!Array.isArray(s)||a===0)throw new C("entries must be an array with size > 0.");let l=[];for(n=0;n<a;n++){let g=s[n];if(!c(g.height))throw new C("entry requires a height.");if(!c(g.color))throw new C("entry requires a color.");let m=O.clamp(g.height,Gl._minimumHeight,Gl._maximumHeight),y=G.clone(g.color,ZAt);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,l.push(pH(m,y))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=l[n+0],m=l[n+1];u=u&&g.height<=m.height,f=f&&g.height>=m.height}f?l=l.reverse():u||Zy(l,function(g,m){return O.sign(g.height-m.height)});let h=r.extendDownwards??!1,p=r.extendUpwards??!1;l.length===1&&!h&&!p&&(h=!0,p=!0),h&&l.splice(0,0,pH(Gl._minimumHeight,l[0].color)),p&&l.splice(l.length,0,pH(Gl._maximumHeight,l[l.length-1].color)),l=TAe(l),i.push(l)}return i}function nCt(e){let t=tCt(e),n=[],i=[],o;function r(u,f){n.push(pH(u,f))}function s(u,f,h){let p=G.multiplyByScalar(h,1-f.alpha,eCt);p=G.add(p,f,p),r(u,p)}let a=t.length;for(o=0;o<a;o++){let u=t[o],f=0,h=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||h<g;){let m=f<p?u[f]:void 0,y=f>0?u[f-1]:void 0,b=f<p-1?u[f+1]:void 0,x=h<g?i[h]:void 0,A=h>0?i[h-1]:void 0,E=h<g-1?i[h+1]:void 0;if(c(m)&&c(x)&&m.height===x.height){let S=c(E)&&x.height===E.height,v=!c(A),P=!c(E),M=c(b)&&m.height===b.height,R=!c(y),L=!c(b);S?M?(s(m.height,m.color,x.color),s(m.height,b.color,E.color)):R?(r(m.height,x.color),s(m.height,m.color,E.color)):L?(s(m.height,m.color,x.color),r(m.height,E.color)):(s(m.height,m.color,x.color),s(m.height,m.color,E.color)):v?M?(r(m.height,m.color),s(m.height,b.color,x.color)):L?(r(m.height,m.color),r(m.height,x.color)):(R||r(m.height,m.color),s(m.height,m.color,x.color)):P?M?(s(m.height,m.color,x.color),r(m.height,b.color)):R?(r(m.height,x.color),r(m.height,m.color)):L?s(m.height,m.color,x.color):(s(m.height,m.color,x.color),r(m.height,m.color)):M?(s(m.height,m.color,x.color),s(m.height,b.color,x.color)):R?(r(m.height,x.color),s(m.height,m.color,x.color)):L?(s(m.height,m.color,x.color),r(m.height,x.color)):s(m.height,m.color,x.color),f+=M?2:1,h+=S?2:1}else if(c(m)&&c(x)&&c(A)&&m.height<x.height){let S=xAe(m.height,A,x,JAt);c(y)?c(b)?s(m.height,m.color,S):(s(m.height,m.color,S),r(m.height,S)):(r(m.height,S),s(m.height,m.color,S)),f++}else if(c(x)&&c(m)&&c(y)&&x.height<m.height){let S=xAe(x.height,y,m,QAt);c(A)?c(E)?s(x.height,S,x.color):(s(x.height,S,x.color),r(x.height,S)):(r(x.height,S),s(x.height,S,x.color)),h++}else c(m)&&(!c(x)||m.height<x.height)?(c(x)&&!c(A)&&!c(b)?(r(m.height,m.color),r(m.height,Gl._emptyColor),r(x.height,Gl._emptyColor)):(!c(x)&&c(A)&&!c(y)&&(r(A.height,Gl._emptyColor),r(m.height,Gl._emptyColor)),r(m.height,m.color)),f++):c(x)&&(!c(m)||x.height<m.height)&&(r(x.height,x.color),h++)}}return TAe(n)}function Gl(e){let{scene:t,layers:n}=e??W.EMPTY_OBJECT;T.typeOf.object("options.scene",t),T.defined("options.layers",n),T.typeOf.number.greaterThan("options.layers.length",n.length,0);let{context:i}=t,o=nCt(n),r=o.length,s,a,l;if(!Gl._useFloatTexture(i)){a=Ue.UNSIGNED_BYTE,l=ke.RGBA,s=new Uint8Array(r*4);for(let g=0;g<r;g++)se.packFloat(o[g].height,bAe),se.pack(bAe,s,g*4)}else{a=Ue.FLOAT,l=i.webgl2?ke.RED:ke.LUMINANCE,s=new Float32Array(r);for(let g=0;g<r;g++)s[g]=o[g].height}let f=Rt.create({context:i,pixelFormat:l,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.NEAREST,magnificationFilter:ui.NEAREST})}),h=new Uint8Array(r*4);for(let g=0;g<r;g++)o[g].color.toBytes(GI),h[g*4+0]=GI[0],h[g*4+1]=GI[1],h[g*4+2]=GI[2],h[g*4+3]=GI[3];let p=Rt.create({context:i,pixelFormat:ke.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:h,width:r,height:1},sampler:new Qt({wrapS:gn.CLAMP_TO_EDGE,wrapT:gn.CLAMP_TO_EDGE,minificationFilter:Yt.LINEAR,magnificationFilter:ui.LINEAR})});return Xi.fromType("ElevationBand",{heights:f,colors:p})}Gl._useFloatTexture=function(e){return e.floatingPointTexture};Gl._maximumHeight=5906376425472;Gl._minimumHeight=-5906376425472;Gl._emptyColor=new G(0,0,0,0);var AAe=Gl;async function iCt(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??W.EMPTY_OBJECT,T.typeOf.object("apiOptions",e),e.onlyUsingWithGoogleGeocoder||dt("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=e.key??wS.defaultApiKey;if(!c(n))return oCt(t);let i,o=wS.getDefaultCredit();c(o)&&(i=[o]);let r=new we({url:`${wS.mapTilesApiEndpoint}3dtiles/root.json`,queryParameters:{key:n},credits:i});return As.fromUrl(r,t)}var CAe={};async function oCt(e){let i=CAe[2275207];c(i)||(i=uf.fromAssetId(2275207),CAe[2275207]=i);let o=await i;return As.fromUrl(o,e)}var EAe=iCt;async function rCt(e){let t=await As.fromIonAssetId(96188,e);e=e??W.EMPTY_OBJECT;let n=e.style;if(!c(n)){let i=(e.defaultColor??G.WHITE).toCssColorString();n=new RS({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var SAe=rCt;function sCt(e){e=e??W.EMPTY_OBJECT;let t=[],n=e.geometry;if(!c(n))throw new C("options.geometry is required.");(!c(n.attributes)||!c(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=F.clone(e.modelMatrix??F.IDENTITY),r=e.length??1e4;if(c(i.normal)&&t.push(new St({geometry:Nn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new jt(1,0,0,1)},modelMatrix:o})),c(i.tangent)&&t.push(new St({geometry:Nn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new jt(0,1,0,1)},modelMatrix:o})),c(i.bitangent)&&t.push(new St({geometry:Nn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new jt(0,0,1,1)},modelMatrix:o})),t.length>0)return new In({asynchronous:!1,geometryInstances:t,appearance:new rn({flat:!0,translucent:!1})})}var wAe=sCt;function jI(e){e=e??W.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;if(!c(t))throw new C("options.attributeName is required.");c(n)||(n=!1);let i=e.glslDatatype??"vec3",o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); }
`;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); }
`;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); }
`;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); }
`;break;case"vec4":r=`vec4 getColor() { return ${o}; }
`;break;default:throw new C("options.glslDatatype must be float, vec2, vec3, or vec4.")}let s=`in vec3 position3DHigh;
in vec3 position3DLow;
in float batchId;
${n?"":`in ${i} ${t};
`}out ${i} ${o};
void main()
{
vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);
${n?`${o} = czm_batchTable_${t}(batchId);
`:`${o} = ${t};
`}gl_Position = czm_modelViewProjectionRelativeToEye * p;
}`,a=`in ${i} ${o};
${r}
void main()
{
out_FragColor = getColor();
}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=no.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(jI.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});jI.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;jI.prototype.isTranslucent=no.prototype.isTranslucent;jI.prototype.getRenderState=no.prototype.getRenderState;var vAe=jI;function _H(e){e=e??W.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._modelMatrix=new F,this.id=e.id,this._id=void 0,this._primitive=void 0}_H.prototype.update=function(e){if(this.show){if(!c(this._primitive)||!F.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=F.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,c(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new St({geometry:new wy({positions:[d.ZERO,d.UNIT_X],width:this.width,vertexFormat:os.VERTEX_FORMAT,colors:[G.RED,G.RED],arcType:qt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),n=new St({geometry:new wy({positions:[d.ZERO,d.UNIT_Y],width:this.width,vertexFormat:os.VERTEX_FORMAT,colors:[G.GREEN,G.GREEN],arcType:qt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this}),i=new St({geometry:new wy({positions:[d.ZERO,d.UNIT_Z],width:this.width,vertexFormat:os.VERTEX_FORMAT,colors:[G.BLUE,G.BLUE],arcType:qt.NONE}),modelMatrix:F.multiplyByUniformScale(this.modelMatrix,this.length,new F),id:this.id,pickPrimitive:this});this._primitive=new In({geometryInstances:[t,n,i],appearance:new os,asynchronous:!1})}this._primitive.update(e)}};_H.prototype.isDestroyed=function(){return!1};_H.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),de(this)};var gH=_H;function aCt(e){if(T.typeOf.object("options",e),T.typeOf.object("options.direction",e.direction),d.equals(e.direction,d.ZERO))throw new C("options.direction cannot be zero-length");this.direction=d.clone(e.direction),this.color=G.clone(e.color??G.WHITE),this.intensity=e.intensity??1}var DAe=aCt;var yH=`in vec3 v_positionMC;
in vec3 v_positionEC;
in vec2 v_st;
void main()
{
czm_materialInput materialInput;
vec3 normalEC = normalize(czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));
#ifdef FACE_FORWARD
normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC);
#endif
materialInput.s = v_st.s;
materialInput.st = v_st;
materialInput.str = vec3(v_st, 0.0);
materialInput.normalEC = normalEC;
materialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);
vec3 positionToEyeEC = -v_positionEC;
materialInput.positionToEyeEC = positionToEyeEC;
czm_material material = czm_getMaterial(materialInput);
#ifdef FLAT
out_FragColor = vec4(material.diffuse + material.emission, material.alpha);
#else
out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC);
#endif
}
`;var bH=`in vec3 position3DHigh;
in vec3 position3DLow;
in vec2 st;
in float batchId;
out vec3 v_positionMC;
out vec3 v_positionEC;
out vec2 v_st;
void main()
{
vec4 p = czm_computePosition();
v_positionMC = position3DHigh + position3DLow;
v_positionEC = (czm_modelViewRelativeToEye * p).xyz;
v_st = st;
gl_Position = czm_modelViewProjectionRelativeToEye * p;
}
`;function Yx(e){e=e??W.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=c(e.material)?e.material:Xi.fromType(Xi.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??bH,this._fragmentShaderSource=e.fragmentShaderSource??yH,this._renderState=no.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(Yx.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return Yx.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});Yx.VERTEX_FORMAT=Ie.POSITION_AND_ST;Yx.prototype.getFragmentShaderSource=no.prototype.getFragmentShaderSource;Yx.prototype.isTranslucent=no.prototype.isTranslucent;Yx.prototype.getRenderState=no.prototype.getRenderState;var PAe=Yx;function jl(e){if(!c(e)||!c(e.scene))throw new C("options.scene is required.");this._scene=e.scene,this.samplingWindow=e.samplingWindow??jl.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??jl.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??jl.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??jl.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??jl.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new pe,this._nominalFrameRate=new pe,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){cCt(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){lCt(t)}this._visibilityChangeRemoveListener=void 0,c(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}jl.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};jl.fromScene=function(e){if(!c(e))throw new C("scene is required.");return(!c(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new jl({scene:e})),e._frameRateMonitor};Object.defineProperties(jl.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});jl.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};jl.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};jl.prototype.isDestroyed=function(){return!1};jl.prototype.destroy=function(){return this._preUpdateRemoveListener(),c(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),de(this)};function cCt(e,t){if(e._pauseCount>0)return;let n=Ei();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/qn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/qn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/qn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function lCt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var xH=jl;var IAe=jr(r$(),1);function C$(){this._image=new Image}C$.prototype.isReady=function(){return!0};C$.prototype.shouldDiscardImage=function(e){return e===this._image};function Xx(e){e=e??W.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Ki({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ce(-O.PI,-O.PI,O.PI,O.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new At(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,c(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new C$),this._errorEvent=new pe}Object.defineProperties(Xx.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});Xx.fromMetadata=function(e,t){if(T.defined("metadata",e),!e.imageryPresent)throw new ae(`The server ${e.url} doesn't have imagery`);let n=new Xx(t);return n._metadata=e,n};Xx.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(c(o)){let r=i.providers[o.imageryProvider];if(c(r))return[r]}};Xx.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=m0.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!c(a)){if(r.isValid(s)){let u=new ir({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,u);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let l=uCt(this,a,e,t,n,i).fetchArrayBuffer();if(c(l))return l.then(function(u){J8(r.key,u);let f=new Uint8Array(u),h,p=r.protoImagery;if((!c(p)||!p)&&(h=fCt(f)),!c(h)&&(!c(p)||p)){let g=dCt(f);h=g.imageType,f=g.imageData}return!c(h)||!c(f)?o:_A({uint8Array:f,format:h,flipY:!0})})};Xx.prototype.pickFeatures=function(e,t,n,i,o){};function uCt(e,t,n,i,o,r){let s=m0.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=c(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function fCt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function dCt(e){let t=IAe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,c(a)||(a=i.copyrightIds=[]),(s&7)===2){let l=t.uint32()+t.pos;for(;t.pos<l;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(c(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new ae("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return c(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var OAe=Xx;var hCt=new G(1,1,1,.4),mCt=new G(0,1,0,.05),pCt=new G(0,.5,0,.2);function Kx(e){e=e??W.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=c(e.tilingScheme)?e.tilingScheme:new Ki({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??hCt,this._glowColor=e.glowColor??mCt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??pCt,this._errorEvent=new pe,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(Kx.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});Kx.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};Kx.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};Kx.prototype.getTileCredits=function(e,t,n){};Kx.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};Kx.prototype.pickFeatures=function(e,t,n,i,o){};var RAe=Kx;function yh(){}yh._maxDecodingConcurrency=Math.max(zt.hardwareConcurrency-1,1);yh._decodeTaskProcessor=new bi("decodeI3S",yh._maxDecodingConcurrency);yh._promise=void 0;async function _Ct(){if(await yh._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return yh._decodeTaskProcessor;throw new ae("I3S decoder could not be initialized.")}yh.decode=async function(e,t,n,i,o){return T.typeOf.string("url",e),T.defined("defaultGeometrySchema",t),T.defined("geometryData",n),c(yh._promise)||(yh._promise=_Ct()),yh._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,l=0,u=0,f=0;c(s.obb)?(l=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):c(s.mbs)&&(l=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let h=J.fromRotationX(-O.PI_OVER_TWO),p=new J;J.multiply(h,a,p);let g=he.fromDegrees(l,u,f),m=ie.WGS84.cartographicToCartesian(g),y={binaryData:n._data,featureData:c(i)&&c(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ie.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(y)})};var TH=yh;function E$(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,c(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(E$.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});E$.prototype.load=async function(){return this._data=await Jm.loadJson(this._resource),this._data};var AH=E$;function M_(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;c(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(M_.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(c(this._values)){if(c(this._values.attributeValues))return this._values.attributeValues;if(c(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function CH(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function gCt(e){return e==="String"?1:CH(e)}async function yCt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),o=e._getBodyOffset(i);e._validateBody(n,o),e._parseBody(n,o)}M_.prototype.load=function(){return c(this._loadPromise)?this._loadPromise:(this._loadPromise=yCt(this).catch(function(e){console.error(e)}),this._loadPromise)};M_.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};M_.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};M_.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(c(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],l="";for(let u=0;u<a;++u){let f=this._parseValue(e,r.valueType,t);f.value.charCodeAt(0)!==0&&(l+=f.value),t=f.offset}this._values[o].push(l)}}}};M_.prototype._getBodyOffset=function(e){let t=0;return c(this._storageInfo.attributeValues)?t=CH(this._storageInfo.attributeValues.valueType):c(this._storageInfo.objectIds)&&(t=CH(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};M_.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=gCt(i.valueType)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};M_.prototype._validateBody=function(e,t){if(!c(this._header.count))throw new ae(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(c(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=CH(s.valueType);t+=a*this._header.count}else{if(!c(n))throw new ae(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let l=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=l.value,n=l.offset}}else throw new ae(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var EH=M_;function WI(e,t){let n=e._dataProvider,i=e._layer,o;c(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(WI.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});WI.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var bCt=new d,xCt=new d,TCt=new d,ACt=new d,CCt=new d;function S$(e,t,n,i){let o=d.subtract(i,n,bCt),r=d.cross(o,d.subtract(e,n,xCt),ACt),s=d.cross(o,d.subtract(t,n,TCt),CCt);return d.dot(r,s)>=0}var ECt=new d,SCt=new d,wCt=new d,vCt=new d,DCt=new d,PCt=new d,ICt=new d,OCt=new d,RCt=new d,MCt=new d;WI.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(c(this._customAttributes)&&c(this._customAttributes.positions)){let i=new d(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,J.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,l,u=this._customAttributes.positions,f=this._customAttributes.indices,h;c(f)?h=f.length:h=u.length/3;for(let p=0;p<h;p++){let g,m,y;c(f)?(g=f[p],m=f[p+1],y=f[p+2]):(g=p*3,m=p*3+1,y=p*3+2);let b=d.fromElements(u[g*3],u[g*3+1],u[g*3+2],ECt),x=d.fromElements(u[m*3],u[m*3+1],u[m*3+2],SCt),A=new d(u[y*3],u[y*3+1],u[y*3+2],wCt);if(!S$(i,b,x,A)||!S$(i,x,b,A)||!S$(i,A,b,x))continue;let E=d.subtract(x,b,vCt),S=d.subtract(A,b,DCt),v=d.cross(E,S,PCt);if(d.magnitude(v)===0)continue;let P=d.normalize(v,ICt),M=d.subtract(i,b,OCt),R=Math.abs(d.dot(M,P));if(R<o){o=R,r=p;let L=d.magnitudeSquared(d.subtract(i,b,M)),B=d.magnitudeSquared(d.subtract(i,x,RCt)),_=d.magnitudeSquared(d.subtract(i,A,MCt));L<B&&L<_?(a=g,l=b,s=L):B<_?(a=m,l=x,s=B):(a=y,l=A,s=_)}}if(c(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:d.clone(l)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function MAe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(IS(e[i])):t.push(e[i]);return t}WI.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let l={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,h="";if(c(this._parent._data.mesh)&&c(this._layer._data.materialDefinitions)){let E=this._parent._data.mesh.material.definition;if(E>=0&&E<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[E],l=f,c(l.pbrMetallicRoughness)&&c(l.pbrMetallicRoughness.baseColorTexture)){u=!0,l.pbrMetallicRoughness.baseColorTexture.index=0;let S="0";if(c(this._layer._data.textureSetDefinitions))for(let v=0;v<this._layer._data.textureSetDefinitions.length;v++){let P=this._layer._data.textureSetDefinitions[v];for(let M=0;M<P.formats.length;M++){let R=P.formats[M];if(R.format==="jpg"){S=R.name;break}}}c(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(h=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${S}`}).url)}c(l.pbrMetallicRoughness)&&c(l.pbrMetallicRoughness.baseColorFactor)&&(l.pbrMetallicRoughness.baseColorFactor=MAe(l.pbrMetallicRoughness.baseColorFactor)),c(l.emissiveFactor)&&(l.emissiveFactor=MAe(l.emissiveFactor))}}else c(this._parent._data.textureData)&&(u=!0,h=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,l.pbrMetallicRoughness.baseColorTexture={index:0});c(l.alphaMode)&&(l.alphaMode=l.alphaMode.toUpperCase());let p=[],g=[],m=[];u&&(p=[{sampler:0,source:0}],g=[{uri:h}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],b=n.length;for(let A=0;A<b;A++){let E=n[A].primitives,S=E.length;for(let v=0;v<S;v++){let P=E[v];if(c(P.material)){for(;P.material>=y.length;){let R=We(l,!0);y.push(R)}let M=y[P.material];c(P.extra)&&P.extra.isTransparent?c(M.alphaMode)||(M.alphaMode="BLEND"):M.alphaMode==="BLEND"&&(M.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:y,textures:p,images:g,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var qI=WI;function bc(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(bc.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});bc.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new Fd(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!c(this._nodeIndex)){let o=await Jm.loadJson(this._resource);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":c(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),c(i)&&c(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function LAe(e,t){let n=new EH(e,t);return e._fields[t.name]=n,n.load()}bc.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(c(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];c(o)?t.push(o.load()):t.push(LAe(this,i))}return Promise.all(t)};bc.prototype.loadField=function(e){T.defined("name",e);let t=this._fields[e];if(c(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(c(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return LAe(this,o)}return Promise.resolve()};bc.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!c(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};bc.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};bc.prototype._loadChildren=function(){let e=this;if(c(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(c(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new bc(e,i.href??i,!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};bc.prototype._loadGeometryData=function(){let e=[];if(c(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new qI(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(c(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new qI(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};bc.prototype._loadFeatureData=function(){let e=[];if(c(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new AH(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};bc.prototype._clearGeometryData=function(){this._geometryData=[]};bc.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!c(e)&&!c(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(c(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),c(this._dataProvider._geoidDataList)&&c(n))for(let x=0;x<this._dataProvider._geoidDataList.length;x++){let A=this._dataProvider._geoidDataList[x],E=A.projection.project(n);if(E.x>A.nativeExtent.west&&E.x<A.nativeExtent.east&&E.y>A.nativeExtent.south&&E.y<A.nativeExtent.north){n.height+=BCt(E.x,E.y,A);break}}let i={},o,r=0;c(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=ie.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ie.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(c(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let x=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/x}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let x=this._data.lodThreshold;s=r/x}else console.error("Invalid lodSelectionMetricType in Layer");else if(c(this._data.lodSelection))for(let x=0;x<this._data.lodSelection.length;x++)this._data.lodSelection[x].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[x].maxError);s===1/0&&(s=1e5);let a=s*16,l=new Xa(0,0,0),u=Ot.headingPitchRollQuaternion(o,l);c(this._data.obb)&&(u=new Le(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=J.fromQuaternion(u),h=J.inverse(f,new J),p=new F(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,o.x,o.y,o.z,1),g=F.inverse(p,new F),m=F.clone(p);c(this._parent._globalTransform)&&F.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=h;let y=[];for(let x=0;x<this._children.length;x++)y.push(this._children[x]._create3DTileDefinition());return{children:y,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:c(this._resource)?this._resource.url:void 0},geometricError:a}};bc.prototype._loadSymbology=async function(){!c(this._symbologyData)&&c(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};bc.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),c(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await TH.decode(o,r,s,this._featureData[0],this._symbologyData);if(!c(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function LCt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let o=e.loadField(t[i].name);n.push(o)}return await Promise.all(n),t}function NCt(e,t,n){if(!c(n.values)||n.values.length===0)return!1;let i=c(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===o){r=!0;break}return r}async function NAe(e,t){let n=e._tile.content.batchTable;if(c(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await LCt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let s=i[r];if(!NCt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}bc.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(c(this._geometryData)&&this._geometryData.length>0&&c(t)&&t.ready){t.show=!1;let n=NAe(this,t);e.push(n)}return Promise.all(e)};Fd.prototype._hookedRequestContent=Fd.prototype.requestContent;Fd.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!c(t)){e._isLoading=!1;return}return e._contentResource=new we({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return c(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&c(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{NAe(e._i3sNode,n)})),e._isLoading=!1,t})}};function FCt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function SH(e,t,n,i){let o=e+t*n;return i[o]}function BCt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let l=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=SH(s,a,n.width,n.buffer),h=SH(l,a,n.width,n.buffer),p=SH(s,u,n.width,n.buffer),g=SH(l,u,n.width,n.buffer),m=FCt(o,r,f,h,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(Fd.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var YI=bc;function wH(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(wH.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function w$(e,t){let n=[];for(let i=0;i<e.length;i++){let o=G.byteToFloat(e[i]);i<3?n.push(IS(o)):n.push(o)}return n.length===3&&(c(t)?n.push(1-t/100):n.push(1)),n}function LS(e,t){let n={edges:void 0,material:void 0};if(c(e)&&c(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(c(r)?(n.edges={},c(r.color)&&(n.edges.color=w$(r.color,r.transparency))):c(s)&&(n.edges={},c(s.color)&&(n.edges.color=w$(s.color,s.transparency))),!t){let a=o.material;c(a)&&(n.material={colorMixMode:a.colorMixMode},c(a.color)&&(n.material.color=w$(a.color,a.transparency)))}break}}return n}function kCt(e,t){if(c(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(c(o))for(let r=0;r<o.length;r++){let s=LS(o[r].symbol,t),a=o[r].values;for(let l=0;l<a.length;l++){let u=a[l],f=n;for(let h=0;h<u.length;h++){let p=u[h];h===u.length-1?f[p]=s:(c(f[p])||(f[p]={}),f=f[p])}}}}return n}if(c(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=LS(o.symbol,t)}return n}}function UCt(e,t){if(c(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=o.classMaxValue??o.classMinValue,a=r.classMaxValue??r.classMinValue;return s-a});let i={ranges:[],symbols:[]};c(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];c(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),c(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(LS(r.symbol,t)))}return i.symbols.push(void 0),i}}wH.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(c(e)&&c(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=c(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=LS(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=LS(i.defaultSymbol,n),this._valueFields.push(i.field1),c(i.field2)&&this._valueFields.push(i.field2),c(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=kCt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=LS(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=UCt(i,n))}};function FAe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return c(s)&&++n<t.length?FAe(s,t,n,i):s}}function VCt(e,t){let n=0,i=e.length;if(n<i)do{let o=n+i>>>1;e[o]<t?n=o+1:i=o}while(n<i);return n}function zCt(e,t,n){let i=t[n],o=VCt(e.ranges,i);return e.symbols[o]}wH.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let r=0;r<this._valueFields.length;r++)n.push(e.loadField(this._valueFields[r]));await Promise.all(n);let i=[];for(let r=0;r<this._valueFields.length;r++)i.push(e.fields[this._valueFields[r]].values);let o;if(c(this._uniqueValueHash)?o=r=>FAe(this._uniqueValueHash,i,0,r):c(this._classBreaksHash)&&(o=r=>zCt(this._classBreaksHash,i[0],r)),c(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);c(a)&&(t[s]=a)}}}return t};var vH=wH;function Wl(e,t,n){this._dataProvider=e,this._parent=n,!c(t.href)&&c(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),o="";i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new we({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(Wl.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(c(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});Wl.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new ae(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new vH(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};Wl.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],c(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(c(r.compressedAttributes)&&e){a=!0;let l=r.compressedAttributes.attributes;for(let u=0;u<l.length;u++)s.push(l[u])}else for(let l in r)l!=="offset"&&s.push(l);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};Wl.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(c(n)){for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(c(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};Wl.prototype._loadRootNode=function(e){if(c(this._data.nodePages)){let t=0;c(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new YI(this,t,!0)}else this._rootNode=new YI(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};Wl.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};Wl._fetchJson=function(e){return e.fetchJson()};Wl.prototype._loadNodePage=function(e){let t=this;if(!c(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Wl._fetchJson(n).then(function(o){return c(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};Wl.prototype._computeExtent=function(){c(this._data.fullExtent)?this._extent=ce.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):c(this._data.store.extent)&&(this._extent=ce.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Wl.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),o=this._symbology?.defaultSymbology?.edges?.color;c(o)&&!c(e?.outlineColor)&&(e=c(e)?We(e):{},e.outlineColor=G.fromCartesian4(se.fromArray(o))),this._tileset=await As.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){c(r._i3sNode)&&r._i3sNode._loadChildren()})};Wl.prototype._updateVisibility=function(){c(this._tileset)&&(this._tileset.show=this._parent.show)};Wl.prototype.filterByAttributes=function(e){this._filters=c(e)?We(e,!0):[];let t=this._rootNode;return c(t)?t._filterFeatures():Promise.resolve()};var NS=Wl;function DH(e,t){this._dataProvider=e,this._resource=new we({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(DH.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(c(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});DH.prototype.load=async function(){return this._data=await Jm.loadJson(this._resource),this._data};DH.prototype._getValues=function(e){let t=this._data.summary;if(c(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return c(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var PH=DH;function XI(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(XI.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(T.defined("value",e),this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});XI._fromData=async function(e,t,n,i){let o=new XI(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(c(r)){let s=[];for(let l=0;l<r.length;l++){let u=XI._fromData(e,t,r[l],o);s.push(u)}let a=await Promise.all(s);for(let l=0;l<a.length;l++){let u=a[l];o._sublayers.push(u),o._i3sLayers.push(...u._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new we({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await Jm.loadJson(o._resource),l=new NS(e,a,o);o._i3sLayers.push(l)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var IH=XI;var UAe=jr(BAe(),1);function hs(e){e=e??W.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??W.EMPTY_OBJECT,this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(hs.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(T.defined("value",e),this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});hs.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)c(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return de(this)};hs.prototype.isDestroyed=function(){return!1};hs.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};hs.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};hs.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)c(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};hs.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)c(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function HCt(e,t){let n=e.resource.getUrlComponent(),i="";return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function kAe(e,t,n){if(t.layerType==="Building"){c(n.showFeatures)||(e._showFeatures=!0),c(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),c(n.applySymbology)||(e._applySymbology=!0),c(n.calculateNormals)||(e._calculateNormals=!0);let i=HCt(e,t.id);if(c(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=IH._fromData(e,i,t.sublayers[s],e);o.push(a)}let r=await Promise.all(o);for(let s=0;s<r.length;s++){let a=r[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(c(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new PH(e,o);await r.load(),e._attributeStatistics.push(r)}if(c(t.fullExtent)){let o=ce.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(o)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!c(n.calculateNormals)&&!c(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new NS(e,t,e);e._layers.push(i),c(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}hs.fromUrl=async function(e,t){T.defined("url",e),t=t??W.EMPTY_OBJECT;let n=we.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await hs.loadJson(n),o=new hs(t);if(o._resource=n,o._data=i,c(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let l=kAe(o,i.layers[a],t);s.push(l)}await Promise.all(s)}else await kAe(o,i,t);o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};hs._fetchJson=function(e){return e.fetchJson()};hs.loadJson=async function(e){let t=await hs._fetchJson(e);if(c(t.error)){if(console.error("Failed to fetch I3S ",e.url),c(t.error.message)&&console.error(t.error.message),c(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new ae(t.error)}return t};hs.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new ae(`Failed to load binary: ${e.url}`);return t};hs.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]=103,o.magic[1]=108,o.magic[2]=84,o.magic[3]=70,o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};var GCt=new z;function jCt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),l=n.positionToTileXY(s,r),u=n.positionToTileXY(a,r);for(let h=l.x;h<=u.x;h++)for(let p=l.y;p<=u.y;p++){let g=z.fromElements(h,p,GCt),m=g.toString();if(!o.hasOwnProperty(m)){let y={x:g.x,y:g.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[m]=y,i.push(y)}}let f=[];for(let h=0;h<i.length;++h){let p=i[h],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(h){let p=[];for(let g=0;g<h.length;g++){let m={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},y=h[g],b="Geographic";n._projection instanceof Li&&(b="WebMercator");let x={projectionType:b,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===ih.LERC){let A=UAe.default.decode(y._buffer);x.buffer=A.pixels[0]}else x.buffer=y._buffer;p.push(x)}return p})}async function WCt(e){let t=e._geoidTiledTerrainProvider;if(c(t))try{let n=await jCt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}hs.prototype.loadGeoidData=async function(){return c(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=WCt(this),this._geoidDataPromise)};hs.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];c(e)?ce.union(e,n,e):e=ce.clone(n)}this._extent=e};hs.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};hs.prototype.getAttributeValues=function(e){T.defined("name",e);for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(c(n))return n}return[]};hs.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var Jm=hs;var KI={};KI.createTilesetFromIModelId=async function(e,t){let{exports:n}=await ds.getExports(e);if(n.length>0&&n.every(a=>a.status===ds.ExportStatus.Invalid))throw new ae(`All exports for this iModel are Invalid: ${e}`);let i=n.find(a=>a.status===ds.ExportStatus.Complete);if(!c(i))return;let o=new URL(i._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let r=o.toString(),s=new we({url:r});return As.fromUrl(s,t)};KI.createTilesetForRealityDataId=async function(e,t,n,i){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),c(n)&&T.typeOf.string("type",n),c(i)&&T.typeOf.string("rootDocument",i),!c(n)||!c(i)){let s=await ds.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![ds.RealityDataType.Cesium3DTiles,ds.RealityDataType.PNTS,ds.RealityDataType.RealityMesh3DTiles,ds.RealityDataType.Terrain3DTiles].includes(n))throw new ae(`Reality data type is not a mesh type: ${n}`);let r=await ds.getRealityDataURL(e,t,i);return As.fromUrl(r,{maximumScreenSpaceError:4})};KI.createDataSourceForRealityDataId=async function(e,t,n,i){if(T.typeOf.string("iTwinId",e),T.typeOf.string("realityDataId",t),c(n)&&T.typeOf.string("type",n),c(i)&&T.typeOf.string("rootDocument",i),!c(n)||!c(i)){let s=await ds.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![ds.RealityDataType.KML,ds.RealityDataType.GeoJSON].includes(n))throw new ae(`Reality data type is not a data source type: ${n}`);let r=await ds.getRealityDataURL(e,t,i);return n===ds.RealityDataType.GeoJSON?hx.load(r):wE.load(r)};KI.loadGeospatialFeatures=async function(e,t,n){if(T.typeOf.string("iTwinId",e),T.typeOf.string("collectionId",t),c(n)&&(T.typeOf.number("limit",n),T.typeOf.number.lessThanOrEquals("limit",n,1e4),T.typeOf.number.greaterThanOrEquals("limit",n,1)),!c(ds.defaultAccessToken)&&!c(ds.defaultShareKey))throw new C("Must set ITwinPlatform.defaultAccessToken or ITwinPlatform.defaultShareKey first");let i=n??1e4,o=`${ds.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new we({url:o,headers:{Authorization:ds._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return hx.load(r)};var VAe=KI;function zAe(){}Object.defineProperties(zAe.prototype,{color:{get:C.throwInstantiationError},intensity:{get:C.throwInstantiationError}});var HAe=zAe;var qCt=/\/$/,GAe=new At('&copy; <a href="https://www.mapbox.com/about/maps/">Mapbox</a> &copy; <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function FS(e){e=e??W.EMPTY_OBJECT;let t=e.styleId;if(!c(t))throw new C("options.styleId is required.");let n=e.accessToken;if(!c(n))throw new C("options.accessToken is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=we.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let o=e.tilesize??512;this._tilesize=o;let r=e.username??"mapbox";this._username=r;let s=c(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();qCt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let l;c(e.credit)?(l=e.credit,typeof l=="string"&&(l=new At(l))):l=GAe,this._resource=i,this._imageryProvider=new hc({url:i,credit:l,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(FS.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});FS.prototype.getTileCredits=function(e,t,n){};FS.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};FS.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};FS._defaultCredit=GAe;var jAe=FS;function v$(e){}v$.prototype.isReady=function(){return!0};v$.prototype.shouldDiscardImage=function(e){return!1};var WAe=v$;var YCt=new At("MapQuest, Open Street Map and contributors, CC-BY-SA");function RH(e){e=e??W.EMPTY_OBJECT;let t=we.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new fs({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,l=n.positionToTileXY(ce.southwest(a),r),u=n.positionToTileXY(ce.northeast(a),r),f=(Math.abs(u.x-l.x)+1)*(Math.abs(u.y-l.y)+1);if(f>4)throw new C(`The rectangle and minimumLevel indicate that there are ${f} tiles at the minimum level. Imagery providers with more than four tiles at the minimum level are not supported.`);let h=e.credit??YCt;typeof h=="string"&&(h=new At(h)),hc.call(this,{url:t,credit:h,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}c(Object.create)&&(RH.prototype=Object.create(hc.prototype),RH.prototype.constructor=RH);var T0=RH;var XCt=new z(1,1);function D$(e){e=e??W.EMPTY_OBJECT,this.mass=e.mass??1,this.position=d.clone(e.position??d.ZERO),this.velocity=d.clone(e.velocity??d.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=G.clone(e.startColor??G.WHITE),this.endColor=G.clone(e.endColor??G.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=z.clone(e.imageSize??XCt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(D$.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var qAe=new d;D$.prototype.update=function(e,t){return d.multiplyByScalar(this.velocity,e,qAe),d.add(this.position,qAe,this.position),c(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var $I=D$;function YAe(e){e=e??W.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(YAe.prototype,{complete:{get:function(){return this._complete}}});var XAe=YAe;function KAe(e){throw new C("This type should not be instantiated directly. Instead, use BoxEmitter, CircleEmitter, ConeEmitter or SphereEmitter.")}KAe.prototype.emit=function(e){C.throwInstantiationError()};var $Ae=KAe;var ZAe=new z(1,1);function ZI(e){e=e??W.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;c(t)||(t=new hH(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=F.clone(e.modelMatrix??F.IDENTITY),this._emitterModelMatrix=F.clone(e.emitterModelMatrix??F.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new F,this._startColor=G.clone(e.color??e.startColor??G.WHITE),this._endColor=G.clone(e.color??e.endColor??G.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=z.clone(e.imageSize??e.minimumImageSize??ZAe),this._maximumImageSize=z.clone(e.imageSize??e.maximumImageSize??ZAe),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=e.lifetime??Number.MAX_VALUE,this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new pe,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(ZI.prototype,{emitter:{get:function(){return this._emitter},set:function(e){T.defined("value",e),this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){T.defined("value",e),this._matrixDirty=this._matrixDirty||!F.equals(this._modelMatrix,e),F.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){T.defined("value",e),this._matrixDirty=this._matrixDirty||!F.equals(this._emitterModelMatrix,e),F.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){T.defined("value",e),G.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){T.defined("value",e),G.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){T.typeOf.object("value",e),T.typeOf.number.greaterThanOrEquals("value.x",e.x,0),T.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){T.typeOf.object("value",e),T.typeOf.number.greaterThanOrEquals("value.x",e.x,0),T.typeOf.number.greaterThanOrEquals("value.y",e.y,0),this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){T.typeOf.bool("value",e),this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){T.typeOf.number.greaterThanOrEquals("value",e,0),this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function KCt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(c(o)){let h=o.length;for(let p=0;p<h;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),l=e._particles,u=e._particlePool,f=Math.max(a-l.length-u.length,0);for(let h=0;h<f;++h){let p=new $I;p._billboard=r.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function $Ct(e){let t=e._particlePool.pop();return c(t)||(t=new $I),t}function ZCt(e,t){e._particlePool.push(t)}function QCt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let l=a;l<r;++l){let u=n[l];i.remove(u._billboard)}n.length=a}function JCt(e){c(e._billboard)&&(e._billboard.show=!1)}function QAe(e,t){let n=t._billboard;c(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=O.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=O.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=O.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=O.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new G(i,o,r,s),n.scale=O.lerp(t.startScale,t.endScale,t.normalizedAge)}function eEt(e,t){t.startColor=G.clone(e._startColor,t.startColor),t.endColor=G.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=O.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=O.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=O.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=O.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=O.randomBetween(e._minimumSpeed,e._maximumSpeed);d.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function tEt(e,t){if(e._isComplete)return 0;t=O.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),c(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;c(s)&&!s._complete&&a>s.time&&(i+=O.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var MH=new d;ZI.prototype.update=function(e){if(!this.show)return;c(this._billboardCollection)||(this._billboardCollection=new Cf),this._updateParticlePool&&(KCt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=Q.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?QAe(this,s):(JCt(s),ZCt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let l=tEt(this,t);if(l>0&&c(i)){this._matrixDirty&&(this._combinedMatrix=F.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(r=0;r<l;r++)s=$Ct(this),this._emitter.emit(s),d.add(s.position,s.velocity,MH),F.multiplyByPoint(u,MH,MH),s.position=F.multiplyByPoint(u,s.position,s.position),d.subtract(MH,s.position,s.velocity),d.normalize(s.velocity,s.velocity),eEt(this,s),QAe(this,s)}if(this._billboardCollection.update(e),this._previousTime=Q.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=O.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(r=0;r<u;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&QCt(this)};ZI.prototype.isDestroyed=function(){return!1};ZI.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),de(this)};var JAe=ZI;function Uu(){C.throwInstantiationError()}Uu.computeDefaultLevelZeroMaximumGeometricError=function(e){return e.ellipsoid.maximumRadius*2*Math.PI*.25/(65*e.getNumberOfXTilesAtLevel(0))};Object.defineProperties(Uu.prototype,{quadtree:{get:C.throwInstantiationError,set:C.throwInstantiationError},tilingScheme:{get:C.throwInstantiationError},errorEvent:{get:C.throwInstantiationError}});Uu.prototype.update=C.throwInstantiationError;Uu.prototype.beginUpdate=C.throwInstantiationError;Uu.prototype.endUpdate=C.throwInstantiationError;Uu.prototype.getLevelMaximumGeometricError=C.throwInstantiationError;Uu.prototype.loadTile=C.throwInstantiationError;Uu.prototype.computeTileVisibility=C.throwInstantiationError;Uu.prototype.showTileThisFrame=C.throwInstantiationError;Uu.prototype.computeDistanceToTile=C.throwInstantiationError;Uu.prototype.isDestroyed=C.throwInstantiationError;Uu.prototype.destroy=C.throwInstantiationError;var eCe=Uu;function P$(e){e=e??1,T.typeOf.number.greaterThan("radius",e,0),this._radius=e??1}Object.defineProperties(P$.prototype,{radius:{get:function(){return this._radius},set:function(e){T.typeOf.number.greaterThan("value",e,0),this._radius=e}}});P$.prototype.emit=function(e){let t=O.randomBetween(0,O.TWO_PI),n=O.randomBetween(0,O.PI),i=O.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=d.fromElements(o,r,s,e.position),e.velocity=d.normalize(e.position,e.velocity)};var tCe=P$;function QI(){}QI.prototype.evaluate=function(e,t){C.throwInstantiationError()};QI.prototype.evaluateColor=function(e,t){C.throwInstantiationError()};QI.prototype.getShaderFunction=function(e,t,n,i){C.throwInstantiationError()};QI.prototype.getVariables=function(){C.throwInstantiationError()};var nCe=QI;function BS(e){T.typeOf.object("terrainProviderPromise",e),this._ready=!1,this._provider=void 0,this._errorEvent=new pe,this._readyEvent=new pe,iEt(this,e)}Object.defineProperties(BS.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});BS.fromWorldTerrain=function(e){return new BS(ES(e))};BS.fromWorldBathymetry=function(e){return new BS(Q8(e))};function nEt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function iEt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){nEt(e._errorEvent,i)}}var LH=BS;function kS(){}kS.prototype.boundingVolume=void 0;kS.prototype.boundingSphere=void 0;kS.prototype.distanceToCamera=function(e){C.throwInstantiationError()};kS.prototype.intersectPlane=function(e){C.throwInstantiationError()};kS.prototype.createDebugVolume=function(e){C.throwInstantiationError()};var iCe=kS;function JI(e){e=e??W.EMPTY_OBJECT,this._tilingScheme=c(e.tilingScheme)?e.tilingScheme:new Ki({ellipsoid:e.ellipsoid}),this._color=e.color??G.YELLOW,this._errorEvent=new pe,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(JI.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});JI.prototype.getTileCredits=function(e,t,n){};JI.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};JI.prototype.pickFeatures=function(e,t,n,i,o){};var NH=JI;function I$(e){C.throwInstantiationError()}I$.prototype.isReady=C.throwInstantiationError;I$.prototype.shouldDiscardImage=C.throwInstantiationError;var oCe=I$;var oEt={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3},rCe=Object.freeze(oEt);function FH(e,t){this.show=!0,c(e)||(e=new Ke),this.rectangle=Ke.clone(e),c(t)||(t=Xi.fromType(Xi.ColorType,{color:new G(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}FH.prototype.update=function(e){if(!this.show)return;if(!c(this.material))throw new C("this.material must be defined.");if(!c(this.rectangle))throw new C("this.rectangle must be defined.");let t=this._rs;if((!c(t)||!Ke.equals(t.viewport,this.rectangle))&&(this._rs=ze.fromCache({blending:un.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!c(this._overlayCommand)){this._material=this.material,c(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new He({sources:[this._material.shaderSource,DV]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=De.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};FH.prototype.isDestroyed=function(){return!1};FH.prototype.destroy=function(){return c(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),de(this)};var sCe=FH;function O$(){C.throwInstantiationError()}Object.defineProperties(O$.prototype,{globalTransform:{get:C.throwInstantiationError},shapeTransform:{get:C.throwInstantiationError},shape:{get:C.throwInstantiationError},minBounds:{get:C.throwInstantiationError},maxBounds:{get:C.throwInstantiationError},dimensions:{get:C.throwInstantiationError},paddingBefore:{get:C.throwInstantiationError},paddingAfter:{get:C.throwInstantiationError},names:{get:C.throwInstantiationError},types:{get:C.throwInstantiationError},componentTypes:{get:C.throwInstantiationError},minimumValues:{get:C.throwInstantiationError},maximumValues:{get:C.throwInstantiationError},maximumTileCount:{get:C.throwInstantiationError},availableLevels:{get:C.throwInstantiationError},keyframeCount:{get:C.throwInstantiationError},timeIntervalCollection:{get:C.throwInstantiationError}});O$.prototype.requestData=function(e){C.throwInstantiationError()};var aCe=O$;function $x(){C.throwInstantiationError()}Object.defineProperties($x.prototype,{orientedBoundingBox:{get:C.throwInstantiationError},boundingSphere:{get:C.throwInstantiationError},boundTransform:{get:C.throwInstantiationError},shapeTransform:{get:C.throwInstantiationError},shaderUniforms:{get:C.throwInstantiationError},shaderDefines:{get:C.throwInstantiationError},shaderMaximumIntersectionsLength:{get:C.throwInstantiationError}});$x.prototype.update=C.throwInstantiationError;$x.prototype.computeOrientedBoundingBoxForTile=C.throwInstantiationError;$x.prototype.computeOrientedBoundingBoxForSample=C.throwInstantiationError;$x.DefaultMinBounds=C.throwInstantiationError;$x.DefaultMaxBounds=C.throwInstantiationError;var cCe=$x;var lCe=`uniform sampler2D u_depthTexture;
in vec2 v_textureCoordinates;
void main()
{
float z_window = czm_unpackDepth(texture(u_depthTexture, v_textureCoordinates));
z_window = czm_reverseLogDepth(z_window);
float n_range = czm_depthRange.near;
float f_range = czm_depthRange.far;
float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range);
float scale = pow(z_ndc * 0.5 + 0.5, 8.0);
out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0);
}
`;function rEt(e){e=e??W.EMPTY_OBJECT;let t=c(e.typedArray),n=c(e.url);if(t===n)throw new C("exactly one of options.typedArray, options.url must be defined");if(t&&(!c(e.width)||!c(e.height)))throw new C("options.width and options.height are required when options.typedArray is defined");this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??ke.RGBA,this.pixelDatatype=e.pixelDatatype??Ue.UNSIGNED_BYTE;let i=e.url;typeof i=="string"&&(i=we.createIfNeeded(i)),this.resource=i;let r=e.repeat??!0?gn.REPEAT:gn.CLAMP_TO_EDGE;this.sampler=new Qt({wrapS:r,wrapT:r,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var uCe=rEt;var sEt={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"},fCe=Object.freeze(sEt);var aEt={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"},dCe=Object.freeze(aEt);function cEt(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${g_(s)}
with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var hCe=cEt;globalThis.CESIUM_VERSION="1.129";var eO;typeof ko<"u"&&(eO=ko);(function(){/*!
* Knockout JavaScript library v3.5.1
* (c) The Knockout.js team - http://knockoutjs.com/
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
*/(function(){(function(e){var t=this||(0,eval)("this"),n=t.document,i=t.navigator,o=t.jQuery,r=t.JSON;o||typeof jQuery>"u"||(o=jQuery),function(s){s(t.ko={})}(function(s,a){function l(_,w){return _===null||typeof _ in y?_===w:!1}function u(_,w){var D;return function(){D||(D=m.a.setTimeout(function(){D=e,_()},w))}}function f(_,w){var D;return function(){clearTimeout(D),D=m.a.setTimeout(_,w)}}function h(_,w){w&&w!=="change"?w==="beforeChange"?this.pc(_):this.gb(_,w):this.qc(_)}function p(_,w){w!==null&&w.s&&w.s()}function g(_,w){var D=this.qd,I=D[S];I.ra||(this.Qb&&this.mb[w]?(D.uc(w,_,this.mb[w]),this.mb[w]=null,--this.Qb):I.I[w]||D.uc(w,_,I.J?{da:_}:D.$c(_)),_.Ja&&_.gd())}var m=typeof s<"u"?s:{};m.b=function(_,w){for(var D=_.split("."),I=m,N=0;N<D.length-1;N++)I=I[D[N]];I[D[D.length-1]]=w},m.L=function(_,w,D){_[w]=D},m.version="3.5.1",m.b("version",m.version),m.options={deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1},m.a=function(){function _(K,Z){for(var ee in K)N.call(K,ee)&&Z(ee,K[ee])}function w(K,Z){if(Z)for(var ee in Z)N.call(Z,ee)&&(K[ee]=Z[ee]);return K}function D(K,Z){return K.__proto__=Z,K}function I(K,Z,ee,me){var xe=K[Z].match(X)||[];m.a.D(ee.match(X),function(ue){m.a.Na(xe,ue,me)}),K[Z]=xe.join(" ")}var N=Object.prototype.hasOwnProperty,k={__proto__:[]}instanceof Array,H=typeof Symbol=="function",V={},j={};V[i&&/Firefox\/2/i.test(i.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],V.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),_(V,function(K,Z){if(Z.length)for(var ee=0,me=Z.length;ee<me;ee++)j[Z[ee]]=K});var U={propertychange:!0},q=n&&function(){for(var K=3,Z=n.createElement("div"),ee=Z.getElementsByTagName("i");Z.innerHTML="<!--[if gt IE "+ ++K+"]><i></i><![endif]-->",ee[0];);return 4<K?K:e}(),X=/\S+/g,te;return{Jc:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],D:function(K,Z,ee){for(var me=0,xe=K.length;me<xe;me++)Z.call(ee,K[me],me,K)},A:typeof Array.prototype.indexOf=="function"?function(K,Z){return Array.prototype.indexOf.call(K,Z)}:function(K,Z){for(var ee=0,me=K.length;ee<me;ee++)if(K[ee]===Z)return ee;return-1},Lb:function(K,Z,ee){for(var me=0,xe=K.length;me<xe;me++)if(Z.call(ee,K[me],me,K))return K[me];return e},Pa:function(K,Z){var ee=m.a.A(K,Z);0<ee?K.splice(ee,1):ee===0&&K.shift()},wc:function(K){var Z=[];return K&&m.a.D(K,function(ee){0>m.a.A(Z,ee)&&Z.push(ee)}),Z},Mb:function(K,Z,ee){var me=[];if(K)for(var xe=0,ue=K.length;xe<ue;xe++)me.push(Z.call(ee,K[xe],xe));return me},jb:function(K,Z,ee){var me=[];if(K)for(var xe=0,ue=K.length;xe<ue;xe++)Z.call(ee,K[xe],xe)&&me.push(K[xe]);return me},Nb:function(K,Z){if(Z instanceof Array)K.push.apply(K,Z);else for(var ee=0,me=Z.length;ee<me;ee++)K.push(Z[ee]);return K},Na:function(K,Z,ee){var me=m.a.A(m.a.bc(K),Z);0>me?ee&&K.push(Z):ee||K.splice(me,1)},Ba:k,extend:w,setPrototypeOf:D,Ab:k?D:w,P:_,Ga:function(K,Z,ee){if(!K)return K;var me={},xe;for(xe in K)N.call(K,xe)&&(me[xe]=Z.call(ee,K[xe],xe,K));return me},Tb:function(K){for(;K.firstChild;)m.removeNode(K.firstChild)},Yb:function(K){K=m.a.la(K);for(var Z=(K[0]&&K[0].ownerDocument||n).createElement("div"),ee=0,me=K.length;ee<me;ee++)Z.appendChild(m.oa(K[ee]));return Z},Ca:function(K,Z){for(var ee=0,me=K.length,xe=[];ee<me;ee++){var ue=K[ee].cloneNode(!0);xe.push(Z?m.oa(ue):ue)}return xe},va:function(K,Z){if(m.a.Tb(K),Z)for(var ee=0,me=Z.length;ee<me;ee++)K.appendChild(Z[ee])},Xc:function(K,Z){var ee=K.nodeType?[K]:K;if(0<ee.length){for(var me=ee[0],xe=me.parentNode,ue=0,ye=Z.length;ue<ye;ue++)xe.insertBefore(Z[ue],me);for(ue=0,ye=ee.length;ue<ye;ue++)m.removeNode(ee[ue])}},Ua:function(K,Z){if(K.length){for(Z=Z.nodeType===8&&Z.parentNode||Z;K.length&&K[0].parentNode!==Z;)K.splice(0,1);for(;1<K.length&&K[K.length-1].parentNode!==Z;)K.length--;if(1<K.length){var ee=K[0],me=K[K.length-1];for(K.length=0;ee!==me;)K.push(ee),ee=ee.nextSibling;K.push(me)}}return K},Zc:function(K,Z){7>q?K.setAttribute("selected",Z):K.selected=Z},Db:function(K){return K===null||K===e?"":K.trim?K.trim():K.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Ud:function(K,Z){return K=K||"",Z.length>K.length?!1:K.substring(0,Z.length)===Z},vd:function(K,Z){if(K===Z)return!0;if(K.nodeType===11)return!1;if(Z.contains)return Z.contains(K.nodeType!==1?K.parentNode:K);if(Z.compareDocumentPosition)return(Z.compareDocumentPosition(K)&16)==16;for(;K&&K!=Z;)K=K.parentNode;return!!K},Sb:function(K){return m.a.vd(K,K.ownerDocument.documentElement)},kd:function(K){return!!m.a.Lb(K,m.a.Sb)},R:function(K){return K&&K.tagName&&K.tagName.toLowerCase()},Ac:function(K){return m.onError?function(){try{return K.apply(this,arguments)}catch(Z){throw m.onError&&m.onError(Z),Z}}:K},setTimeout:function(K,Z){return setTimeout(m.a.Ac(K),Z)},Gc:function(K){setTimeout(function(){throw m.onError&&m.onError(K),K},0)},B:function(K,Z,ee){var me=m.a.Ac(ee);if(ee=U[Z],m.options.useOnlyNativeEvents||ee||!o)if(ee||typeof K.addEventListener!="function")if(typeof K.attachEvent<"u"){var xe=function(ye){me.call(K,ye)},ue="on"+Z;K.attachEvent(ue,xe),m.a.K.za(K,function(){K.detachEvent(ue,xe)})}else throw Error("Browser doesn't support addEventListener or attachEvent");else K.addEventListener(Z,me,!1);else te||(te=typeof o(K).on=="function"?"on":"bind"),o(K)[te](Z,me)},Fb:function(K,Z){if(!K||!K.nodeType)throw Error("element must be a DOM node when calling triggerEvent");var ee;if(m.a.R(K)==="input"&&K.type&&Z.toLowerCase()=="click"?(ee=K.type,ee=ee=="checkbox"||ee=="radio"):ee=!1,m.options.useOnlyNativeEvents||!o||ee)if(typeof n.createEvent=="function")if(typeof K.dispatchEvent=="function")ee=n.createEvent(j[Z]||"HTMLEvents"),ee.initEvent(Z,!0,!0,t,0,0,0,0,0,!1,!1,!1,!1,0,K),K.dispatchEvent(ee);else throw Error("The supplied element doesn't support dispatchEvent");else if(ee&&K.click)K.click();else if(typeof K.fireEvent<"u")K.fireEvent("on"+Z);else throw Error("Browser doesn't support triggering events");else o(K).trigger(Z)},f:function(K){return m.O(K)?K():K},bc:function(K){return m.O(K)?K.v():K},Eb:function(K,Z,ee){var me;Z&&(typeof K.classList=="object"?(me=K.classList[ee?"add":"remove"],m.a.D(Z.match(X),function(xe){me.call(K.classList,xe)})):typeof K.className.baseVal=="string"?I(K.className,"baseVal",Z,ee):I(K,"className",Z,ee))},Bb:function(K,Z){var ee=m.a.f(Z);(ee===null||ee===e)&&(ee="");var me=m.h.firstChild(K);!me||me.nodeType!=3||m.h.nextSibling(me)?m.h.va(K,[K.ownerDocument.createTextNode(ee)]):me.data=ee,m.a.Ad(K)},Yc:function(K,Z){if(K.name=Z,7>=q)try{var ee=K.name.replace(/[&<>'"]/g,function(me){return"&#"+me.charCodeAt(0)+";"});K.mergeAttributes(n.createElement("<input name='"+ee+"'/>"),!1)}catch{}},Ad:function(K){9<=q&&(K=K.nodeType==1?K:K.parentNode,K.style&&(K.style.zoom=K.style.zoom))},wd:function(K){if(q){var Z=K.style.width;K.style.width=0,K.style.width=Z}},Pd:function(K,Z){K=m.a.f(K),Z=m.a.f(Z);for(var ee=[],me=K;me<=Z;me++)ee.push(me);return ee},la:function(K){for(var Z=[],ee=0,me=K.length;ee<me;ee++)Z.push(K[ee]);return Z},Da:function(K){return H?Symbol(K):K},Zd:q===6,$d:q===7,W:q,Lc:function(K,Z){for(var ee=m.a.la(K.getElementsByTagName("input")).concat(m.a.la(K.getElementsByTagName("textarea"))),me=typeof Z=="string"?function(ye){return ye.name===Z}:function(ye){return Z.test(ye.name)},xe=[],ue=ee.length-1;0<=ue;ue--)me(ee[ue])&&xe.push(ee[ue]);return xe},Nd:function(K){return typeof K=="string"&&(K=m.a.Db(K))?r&&r.parse?r.parse(K):new Function("return "+K)():null},hc:function(K,Z,ee){if(!r||!r.stringify)throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");return r.stringify(m.a.f(K),Z,ee)},Od:function(K,Z,ee){ee=ee||{};var me=ee.params||{},xe=ee.includeFields||this.Jc,ue=K;if(typeof K=="object"&&m.a.R(K)==="form")for(var ue=K.action,ye=xe.length-1;0<=ye;ye--)for(var Ae=m.a.Lc(K,xe[ye]),Pe=Ae.length-1;0<=Pe;Pe--)me[Ae[Pe].name]=Ae[Pe].value;Z=m.a.f(Z);var Ee=n.createElement("form");Ee.style.display="none",Ee.action=ue,Ee.method="post";for(var Ve in Z)K=n.createElement("input"),K.type="hidden",K.name=Ve,K.value=m.a.hc(m.a.f(Z[Ve])),Ee.appendChild(K);_(me,function(je,it){var Dt=n.createElement("input");Dt.type="hidden",Dt.name=je,Dt.value=it,Ee.appendChild(Dt)}),n.body.appendChild(Ee),ee.submitter?ee.submitter(Ee):Ee.submit(),setTimeout(function(){Ee.parentNode.removeChild(Ee)},0)}}}(),m.b("utils",m.a),m.b("utils.arrayForEach",m.a.D),m.b("utils.arrayFirst",m.a.Lb),m.b("utils.arrayFilter",m.a.jb),m.b("utils.arrayGetDistinctValues",m.a.wc),m.b("utils.arrayIndexOf",m.a.A),m.b("utils.arrayMap",m.a.Mb),m.b("utils.arrayPushAll",m.a.Nb),m.b("utils.arrayRemoveItem",m.a.Pa),m.b("utils.cloneNodes",m.a.Ca),m.b("utils.createSymbolOrString",m.a.Da),m.b("utils.extend",m.a.extend),m.b("utils.fieldsIncludedWithJsonPost",m.a.Jc),m.b("utils.getFormFields",m.a.Lc),m.b("utils.objectMap",m.a.Ga),m.b("utils.peekObservable",m.a.bc),m.b("utils.postJson",m.a.Od),m.b("utils.parseJson",m.a.Nd),m.b("utils.registerEventHandler",m.a.B),m.b("utils.stringifyJson",m.a.hc),m.b("utils.range",m.a.Pd),m.b("utils.toggleDomNodeCssClass",m.a.Eb),m.b("utils.triggerEvent",m.a.Fb),m.b("utils.unwrapObservable",m.a.f),m.b("utils.objectForEach",m.a.P),m.b("utils.addOrRemoveItem",m.a.Na),m.b("utils.setTextContent",m.a.Bb),m.b("unwrap",m.a.f),Function.prototype.bind||(Function.prototype.bind=function(_){var w=this;if(arguments.length===1)return function(){return w.apply(_,arguments)};var D=Array.prototype.slice.call(arguments,1);return function(){var I=D.slice(0);return I.push.apply(I,arguments),w.apply(_,I)}}),m.a.g=new function(){var _=0,w="__ko__"+new Date().getTime(),D={},I,N;return m.a.W?(I=function(k,H){var V=k[w];if(!V||V==="null"||!D[V]){if(!H)return e;V=k[w]="ko"+_++,D[V]={}}return D[V]},N=function(k){var H=k[w];return H?(delete D[H],k[w]=null,!0):!1}):(I=function(k,H){var V=k[w];return!V&&H&&(V=k[w]={}),V},N=function(k){return k[w]?(delete k[w],!0):!1}),{get:function(k,H){var V=I(k,!1);return V&&V[H]},set:function(k,H,V){(k=I(k,V!==e))&&(k[H]=V)},Ub:function(k,H,V){return k=I(k,!0),k[H]||(k[H]=V)},clear:N,Z:function(){return _+++w}}},m.b("utils.domData",m.a.g),m.b("utils.domData.clear",m.a.g.clear),m.a.K=new function(){function _(H,V){var j=m.a.g.get(H,I);return j===e&&V&&(j=[],m.a.g.set(H,I,j)),j}function w(H){var V=_(H,!1);if(V)for(var V=V.slice(0),j=0;j<V.length;j++)V[j](H);m.a.g.clear(H),m.a.K.cleanExternalData(H),k[H.nodeType]&&D(H.childNodes,!0)}function D(H,V){for(var j=[],U,q=0;q<H.length;q++)if((!V||H[q].nodeType===8)&&(w(j[j.length]=U=H[q]),H[q]!==U))for(;q--&&m.a.A(j,H[q])==-1;);}var I=m.a.g.Z(),N={1:!0,8:!0,9:!0},k={1:!0,9:!0};return{za:function(H,V){if(typeof V!="function")throw Error("Callback must be a function");_(H,!0).push(V)},yb:function(H,V){var j=_(H,!1);j&&(m.a.Pa(j,V),j.length==0&&m.a.g.set(H,I,e))},oa:function(H){return m.u.G(function(){N[H.nodeType]&&(w(H),k[H.nodeType]&&D(H.getElementsByTagName("*")))}),H},removeNode:function(H){m.oa(H),H.parentNode&&H.parentNode.removeChild(H)},cleanExternalData:function(H){o&&typeof o.cleanData=="function"&&o.cleanData([H])}}},m.oa=m.a.K.oa,m.removeNode=m.a.K.removeNode,m.b("cleanNode",m.oa),m.b("removeNode",m.removeNode),m.b("utils.domNodeDisposal",m.a.K),m.b("utils.domNodeDisposal.addDisposeCallback",m.a.K.za),m.b("utils.domNodeDisposal.removeDisposeCallback",m.a.K.yb),function(){var _=[0,"",""],w=[1,"<table>","</table>"],D=[3,"<table><tbody><tr>","</tr></tbody></table>"],I=[1,"<select multiple='multiple'>","</select>"],N={thead:w,tbody:w,tfoot:w,tr:[2,"<table><tbody>","</tbody></table>"],td:D,th:D,option:I,optgroup:I},k=8>=m.a.W;m.a.ua=function(H,V){var j;if(o){if(o.parseHTML)j=o.parseHTML(H,V)||[];else if((j=o.clean([H],V))&&j[0]){for(var U=j[0];U.parentNode&&U.parentNode.nodeType!==11;)U=U.parentNode;U.parentNode&&U.parentNode.removeChild(U)}}else{(j=V)||(j=n);var U=j.parentWindow||j.defaultView||t,q=m.a.Db(H).toLowerCase(),X=j.createElement("div"),te;for(te=(q=q.match(/^(?:\x3c!--.*?--\x3e\s*?)*?<([a-z]+)[\s>]/))&&N[q[1]]||_,q=te[0],te="ignored<div>"+te[1]+H+te[2]+"</div>",typeof U.innerShiv=="function"?X.appendChild(U.innerShiv(te)):(k&&j.body.appendChild(X),X.innerHTML=te,k&&X.parentNode.removeChild(X));q--;)X=X.lastChild;j=m.a.la(X.lastChild.childNodes)}return j},m.a.Md=function(H,V){var j=m.a.ua(H,V);return j.length&&j[0].parentElement||m.a.Yb(j)},m.a.fc=function(H,V){if(m.a.Tb(H),V=m.a.f(V),V!==null&&V!==e)if(typeof V!="string"&&(V=V.toString()),o)o(H).html(V);else for(var j=m.a.ua(V,H.ownerDocument),U=0;U<j.length;U++)H.appendChild(j[U])}}(),m.b("utils.parseHtmlFragment",m.a.ua),m.b("utils.setHtml",m.a.fc),m.aa=function(){function _(D,I){if(D){if(D.nodeType==8){var N=m.aa.Uc(D.nodeValue);N!=null&&I.push({ud:D,Kd:N})}else if(D.nodeType==1)for(var N=0,k=D.childNodes,H=k.length;N<H;N++)_(k[N],I)}}var w={};return{Xb:function(D){if(typeof D!="function")throw Error("You can only pass a function to ko.memoization.memoize()");var I=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return w[I]=D,"<!--[ko_memo:"+I+"]-->"},bd:function(D,I){var N=w[D];if(N===e)throw Error("Couldn't find any memo with ID "+D+". Perhaps it's already been unmemoized.");try{return N.apply(null,I||[]),!0}finally{delete w[D]}},cd:function(D,I){var N=[];_(D,N);for(var k=0,H=N.length;k<H;k++){var V=N[k].ud,j=[V];I&&m.a.Nb(j,I),m.aa.bd(N[k].Kd,j),V.nodeValue="",V.parentNode&&V.parentNode.removeChild(V)}},Uc:function(D){return(D=D.match(/^\[ko_memo\:(.*?)\]$/))?D[1]:null}}}(),m.b("memoization",m.aa),m.b("memoization.memoize",m.aa.Xb),m.b("memoization.unmemoize",m.aa.bd),m.b("memoization.parseMemoText",m.aa.Uc),m.b("memoization.unmemoizeDomNodeAndDescendants",m.aa.cd),m.na=function(){function _(){if(N){for(var V=N,j=0,U;H<N;)if(U=I[H++]){if(H>V){if(5e3<=++j){H=N,m.a.Gc(Error("'Too much recursion' after processing "+j+" task groups."));break}V=N}try{U()}catch(q){m.a.Gc(q)}}}}function w(){_(),H=N=I.length=0}var D,I=[],N=0,k=1,H=0;return t.MutationObserver?D=function(V){var j=n.createElement("div");return new MutationObserver(V).observe(j,{attributes:!0}),function(){j.classList.toggle("foo")}}(w):D=n&&"onreadystatechange"in n.createElement("script")?function(V){var j=n.createElement("script");j.onreadystatechange=function(){j.onreadystatechange=null,n.documentElement.removeChild(j),j=null,V()},n.documentElement.appendChild(j)}:function(V){setTimeout(V,0)},{scheduler:D,zb:function(V){return N||m.na.scheduler(w),I[N++]=V,k++},cancel:function(V){V=V-(k-N),V>=H&&V<N&&(I[V]=null)},resetForTesting:function(){var V=N-H;return H=N=I.length=0,V},Sd:_}}(),m.b("tasks",m.na),m.b("tasks.schedule",m.na.zb),m.b("tasks.runEarly",m.na.Sd),m.Ta={throttle:function(_,w){_.throttleEvaluation=w;var D=null;return m.$({read:_,write:function(I){clearTimeout(D),D=m.a.setTimeout(function(){_(I)},w)}})},rateLimit:function(_,w){var D,I,N;typeof w=="number"?D=w:(D=w.timeout,I=w.method),_.Hb=!1,N=typeof I=="function"?I:I=="notifyWhenChangesStop"?f:u,_.ub(function(k){return N(k,D,w)})},deferred:function(_,w){if(w!==!0)throw Error("The 'deferred' extender only accepts the value 'true', because it is not supported to turn deferral off once enabled.");_.Hb||(_.Hb=!0,_.ub(function(D){var I,N=!1;return function(){if(!N){m.na.cancel(I),I=m.na.zb(D);try{N=!0,_.notifySubscribers(e,"dirty")}finally{N=!1}}}}))},notify:function(_,w){_.equalityComparer=w=="always"?null:l}};var y={undefined:1,boolean:1,number:1,string:1};m.b("extenders",m.Ta),m.ic=function(_,w,D){this.da=_,this.lc=w,this.mc=D,this.Ib=!1,this.fb=this.Jb=null,m.L(this,"dispose",this.s),m.L(this,"disposeWhenNodeIsRemoved",this.l)},m.ic.prototype.s=function(){this.Ib||(this.fb&&m.a.K.yb(this.Jb,this.fb),this.Ib=!0,this.mc(),this.da=this.lc=this.mc=this.Jb=this.fb=null)},m.ic.prototype.l=function(_){this.Jb=_,m.a.K.za(_,this.fb=this.s.bind(this))},m.T=function(){m.a.Ab(this,b),b.qb(this)};var b={qb:function(_){_.U={change:[]},_.sc=1},subscribe:function(_,w,D){var I=this;D=D||"change";var N=new m.ic(I,w?_.bind(w):_,function(){m.a.Pa(I.U[D],N),I.hb&&I.hb(D)});return I.Qa&&I.Qa(D),I.U[D]||(I.U[D]=[]),I.U[D].push(N),N},notifySubscribers:function(_,w){if(w=w||"change",w==="change"&&this.Gb(),this.Wa(w)){var D=w==="change"&&this.ed||this.U[w].slice(0);try{m.u.xc();for(var I=0,N;N=D[I];++I)N.Ib||N.lc(_)}finally{m.u.end()}}},ob:function(){return this.sc},Dd:function(_){return this.ob()!==_},Gb:function(){++this.sc},ub:function(_){var w=this,D=m.O(w),I,N,k,H,V;w.gb||(w.gb=w.notifySubscribers,w.notifySubscribers=h);var j=_(function(){w.Ja=!1,D&&H===w&&(H=w.nc?w.nc():w());var U=N||V&&w.sb(k,H);V=N=I=!1,U&&w.gb(k=H)});w.qc=function(U,q){q&&w.Ja||(V=!q),w.ed=w.U.change.slice(0),w.Ja=I=!0,H=U,j()},w.pc=function(U){I||(k=U,w.gb(U,"beforeChange"))},w.rc=function(){V=!0},w.gd=function(){w.sb(k,w.v(!0))&&(N=!0)}},Wa:function(_){return this.U[_]&&this.U[_].length},Bd:function(_){if(_)return this.U[_]&&this.U[_].length||0;var w=0;return m.a.P(this.U,function(D,I){D!=="dirty"&&(w+=I.length)}),w},sb:function(_,w){return!this.equalityComparer||!this.equalityComparer(_,w)},toString:function(){return"[object Object]"},extend:function(_){var w=this;return _&&m.a.P(_,function(D,I){var N=m.Ta[D];typeof N=="function"&&(w=N(w,I)||w)}),w}};m.L(b,"init",b.qb),m.L(b,"subscribe",b.subscribe),m.L(b,"extend",b.extend),m.L(b,"getSubscriptionsCount",b.Bd),m.a.Ba&&m.a.setPrototypeOf(b,Function.prototype),m.T.fn=b,m.Qc=function(_){return _!=null&&typeof _.subscribe=="function"&&typeof _.notifySubscribers=="function"},m.b("subscribable",m.T),m.b("isSubscribable",m.Qc),m.S=m.u=function(){function _(k){D.push(I),I=k}function w(){I=D.pop()}var D=[],I,N=0;return{xc:_,end:w,cc:function(k){if(I){if(!m.Qc(k))throw Error("Only subscribable things can act as dependencies");I.od.call(I.pd,k,k.fd||(k.fd=++N))}},G:function(k,H,V){try{return _(),k.apply(H,V||[])}finally{w()}},qa:function(){if(I)return I.o.qa()},Va:function(){if(I)return I.o.Va()},Ya:function(){if(I)return I.Ya},o:function(){if(I)return I.o}}}(),m.b("computedContext",m.S),m.b("computedContext.getDependenciesCount",m.S.qa),m.b("computedContext.getDependencies",m.S.Va),m.b("computedContext.isInitial",m.S.Ya),m.b("computedContext.registerDependency",m.S.cc),m.b("ignoreDependencies",m.Yd=m.u.G);var x=m.a.Da("_latestValue");m.ta=function(_){function w(){return 0<arguments.length?(w.sb(w[x],arguments[0])&&(w.ya(),w[x]=arguments[0],w.xa()),this):(m.u.cc(w),w[x])}return w[x]=_,m.a.Ba||m.a.extend(w,m.T.fn),m.T.fn.qb(w),m.a.Ab(w,A),m.options.deferUpdates&&m.Ta.deferred(w,!0),w};var A={equalityComparer:l,v:function(){return this[x]},xa:function(){this.notifySubscribers(this[x],"spectate"),this.notifySubscribers(this[x])},ya:function(){this.notifySubscribers(this[x],"beforeChange")}};m.a.Ba&&m.a.setPrototypeOf(A,m.T.fn);var E=m.ta.Ma="__ko_proto__";A[E]=m.ta,m.O=function(_){if((_=typeof _=="function"&&_[E])&&_!==A[E]&&_!==m.o.fn[E])throw Error("Invalid object that looks like an observable; possibly from another Knockout instance");return!!_},m.Za=function(_){return typeof _=="function"&&(_[E]===A[E]||_[E]===m.o.fn[E]&&_.Nc)},m.b("observable",m.ta),m.b("isObservable",m.O),m.b("isWriteableObservable",m.Za),m.b("isWritableObservable",m.Za),m.b("observable.fn",A),m.L(A,"peek",A.v),m.L(A,"valueHasMutated",A.xa),m.L(A,"valueWillMutate",A.ya),m.Ha=function(_){if(_=_||[],typeof _!="object"||!("length"in _))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return _=m.ta(_),m.a.Ab(_,m.Ha.fn),_.extend({trackArrayChanges:!0})},m.Ha.fn={remove:function(_){for(var w=this.v(),D=[],I=typeof _!="function"||m.O(_)?function(H){return H===_}:_,N=0;N<w.length;N++){var k=w[N];if(I(k)){if(D.length===0&&this.ya(),w[N]!==k)throw Error("Array modified during remove; cannot remove item");D.push(k),w.splice(N,1),N--}}return D.length&&this.xa(),D},removeAll:function(_){if(_===e){var w=this.v(),D=w.slice(0);return this.ya(),w.splice(0,w.length),this.xa(),D}return _?this.remove(function(I){return 0<=m.a.A(_,I)}):[]},destroy:function(_){var w=this.v(),D=typeof _!="function"||m.O(_)?function(k){return k===_}:_;this.ya();for(var I=w.length-1;0<=I;I--){var N=w[I];D(N)&&(N._destroy=!0)}this.xa()},destroyAll:function(_){return _===e?this.destroy(function(){return!0}):_?this.destroy(function(w){return 0<=m.a.A(_,w)}):[]},indexOf:function(_){var w=this();return m.a.A(w,_)},replace:function(_,w){var D=this.indexOf(_);0<=D&&(this.ya(),this.v()[D]=w,this.xa())},sorted:function(_){var w=this().slice(0);return _?w.sort(_):w.sort()},reversed:function(){return this().slice(0).reverse()}},m.a.Ba&&m.a.setPrototypeOf(m.Ha.fn,m.ta.fn),m.a.D("pop push reverse shift sort splice unshift".split(" "),function(_){m.Ha.fn[_]=function(){var w=this.v();this.ya(),this.zc(w,_,arguments);var D=w[_].apply(w,arguments);return this.xa(),D===w?this:D}}),m.a.D(["slice"],function(_){m.Ha.fn[_]=function(){var w=this();return w[_].apply(w,arguments)}}),m.Pc=function(_){return m.O(_)&&typeof _.remove=="function"&&typeof _.push=="function"},m.b("observableArray",m.Ha),m.b("isObservableArray",m.Pc),m.Ta.trackArrayChanges=function(_,w){function D(){function X(){if(V){var te=[].concat(_.v()||[]),K;_.Wa("arrayChange")&&((!N||1<V)&&(N=m.a.Pb(j,te,_.Ob)),K=N),j=te,N=null,V=0,K&&K.length&&_.notifySubscribers(K,"arrayChange")}}I?X():(I=!0,H=_.subscribe(function(){++V},null,"spectate"),j=[].concat(_.v()||[]),N=null,k=_.subscribe(X))}if(_.Ob={},w&&typeof w=="object"&&m.a.extend(_.Ob,w),_.Ob.sparse=!0,!_.zc){var I=!1,N=null,k,H,V=0,j,U=_.Qa,q=_.hb;_.Qa=function(X){U&&U.call(_,X),X==="arrayChange"&&D()},_.hb=function(X){q&&q.call(_,X),X!=="arrayChange"||_.Wa("arrayChange")||(k&&k.s(),H&&H.s(),H=k=null,I=!1,j=e)},_.zc=function(X,te,K){function Z(Ee,Ve,je){return ee[ee.length]={status:Ee,value:Ve,index:je}}if(I&&!V){var ee=[],me=X.length,xe=K.length,ue=0;switch(te){case"push":ue=me;case"unshift":for(te=0;te<xe;te++)Z("added",K[te],ue+te);break;case"pop":ue=me-1;case"shift":me&&Z("deleted",X[ue],ue);break;case"splice":te=Math.min(Math.max(0,0>K[0]?me+K[0]:K[0]),me);for(var me=xe===1?me:Math.min(te+(K[1]||0),me),xe=te+xe-2,ue=Math.max(me,xe),ye=[],Ae=[],Pe=2;te<ue;++te,++Pe)te<me&&Ae.push(Z("deleted",X[te],te)),te<xe&&ye.push(Z("added",K[Pe],te));m.a.Kc(Ae,ye);break;default:return}N=ee}}}};var S=m.a.Da("_state");m.o=m.$=function(_,w,D){function I(){if(0<arguments.length){if(typeof N=="function")N.apply(k.nb,arguments);else throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");return this}return k.ra||m.u.cc(I),(k.ka||k.J&&I.Xa())&&I.ha(),k.X}if(typeof _=="object"?D=_:(D=D||{},_&&(D.read=_)),typeof D.read!="function")throw Error("Pass a function that returns the value of the ko.computed");var N=D.write,k={X:e,sa:!0,ka:!0,rb:!1,jc:!1,ra:!1,wb:!1,J:!1,Wc:D.read,nb:w||D.owner,l:D.disposeWhenNodeIsRemoved||D.l||null,Sa:D.disposeWhen||D.Sa,Rb:null,I:{},V:0,Ic:null};return I[S]=k,I.Nc=typeof N=="function",m.a.Ba||m.a.extend(I,m.T.fn),m.T.fn.qb(I),m.a.Ab(I,v),D.pure?(k.wb=!0,k.J=!0,m.a.extend(I,P)):D.deferEvaluation&&m.a.extend(I,M),m.options.deferUpdates&&m.Ta.deferred(I,!0),k.l&&(k.jc=!0,k.l.nodeType||(k.l=null)),k.J||D.deferEvaluation||I.ha(),k.l&&I.ja()&&m.a.K.za(k.l,k.Rb=function(){I.s()}),I};var v={equalityComparer:l,qa:function(){return this[S].V},Va:function(){var _=[];return m.a.P(this[S].I,function(w,D){_[D.Ka]=D.da}),_},Vb:function(_){if(!this[S].V)return!1;var w=this.Va();return m.a.A(w,_)!==-1?!0:!!m.a.Lb(w,function(D){return D.Vb&&D.Vb(_)})},uc:function(_,w,D){if(this[S].wb&&w===this)throw Error("A 'pure' computed must not be called recursively");this[S].I[_]=D,D.Ka=this[S].V++,D.La=w.ob()},Xa:function(){var _,w,D=this[S].I;for(_ in D)if(Object.prototype.hasOwnProperty.call(D,_)&&(w=D[_],this.Ia&&w.da.Ja||w.da.Dd(w.La)))return!0},Jd:function(){this.Ia&&!this[S].rb&&this.Ia(!1)},ja:function(){var _=this[S];return _.ka||0<_.V},Rd:function(){this.Ja?this[S].ka&&(this[S].sa=!0):this.Hc()},$c:function(_){if(_.Hb){var w=_.subscribe(this.Jd,this,"dirty"),D=_.subscribe(this.Rd,this);return{da:_,s:function(){w.s(),D.s()}}}return _.subscribe(this.Hc,this)},Hc:function(){var _=this,w=_.throttleEvaluation;w&&0<=w?(clearTimeout(this[S].Ic),this[S].Ic=m.a.setTimeout(function(){_.ha(!0)},w)):_.Ia?_.Ia(!0):_.ha(!0)},ha:function(_){var w=this[S],D=w.Sa,I=!1;if(!w.rb&&!w.ra){if(w.l&&!m.a.Sb(w.l)||D&&D()){if(!w.jc){this.s();return}}else w.jc=!1;w.rb=!0;try{I=this.zd(_)}finally{w.rb=!1}return I}},zd:function(_){var w=this[S],I=!1,D=w.wb?e:!w.V,I={qd:this,mb:w.I,Qb:w.V};m.u.xc({pd:I,od:g,o:this,Ya:D}),w.I={},w.V=0;var N=this.yd(w,I);return w.V?I=this.sb(w.X,N):(this.s(),I=!0),I&&(w.J?this.Gb():this.notifySubscribers(w.X,"beforeChange"),w.X=N,this.notifySubscribers(w.X,"spectate"),!w.J&&_&&this.notifySubscribers(w.X),this.rc&&this.rc()),D&&this.notifySubscribers(w.X,"awake"),I},yd:function(_,w){try{var D=_.Wc;return _.nb?D.call(_.nb):D()}finally{m.u.end(),w.Qb&&!_.J&&m.a.P(w.mb,p),_.sa=_.ka=!1}},v:function(_){var w=this[S];return(w.ka&&(_||!w.V)||w.J&&this.Xa())&&this.ha(),w.X},ub:function(_){m.T.fn.ub.call(this,_),this.nc=function(){return this[S].J||(this[S].sa?this.ha():this[S].ka=!1),this[S].X},this.Ia=function(w){this.pc(this[S].X),this[S].ka=!0,w&&(this[S].sa=!0),this.qc(this,!w)}},s:function(){var _=this[S];!_.J&&_.I&&m.a.P(_.I,function(w,D){D.s&&D.s()}),_.l&&_.Rb&&m.a.K.yb(_.l,_.Rb),_.I=e,_.V=0,_.ra=!0,_.sa=!1,_.ka=!1,_.J=!1,_.l=e,_.Sa=e,_.Wc=e,this.Nc||(_.nb=e)}},P={Qa:function(_){var w=this,D=w[S];if(!D.ra&&D.J&&_=="change"){if(D.J=!1,D.sa||w.Xa())D.I=null,D.V=0,w.ha()&&w.Gb();else{var I=[];m.a.P(D.I,function(N,k){I[k.Ka]=N}),m.a.D(I,function(N,k){var H=D.I[N],V=w.$c(H.da);V.Ka=k,V.La=H.La,D.I[N]=V}),w.Xa()&&w.ha()&&w.Gb()}D.ra||w.notifySubscribers(D.X,"awake")}},hb:function(_){var w=this[S];w.ra||_!="change"||this.Wa("change")||(m.a.P(w.I,function(D,I){I.s&&(w.I[D]={da:I.da,Ka:I.Ka,La:I.La},I.s())}),w.J=!0,this.notifySubscribers(e,"asleep"))},ob:function(){var _=this[S];return _.J&&(_.sa||this.Xa())&&this.ha(),m.T.fn.ob.call(this)}},M={Qa:function(_){_!="change"&&_!="beforeChange"||this.v()}};m.a.Ba&&m.a.setPrototypeOf(v,m.T.fn);var R=m.ta.Ma;v[R]=m.o,m.Oc=function(_){return typeof _=="function"&&_[R]===v[R]},m.Fd=function(_){return m.Oc(_)&&_[S]&&_[S].wb},m.b("computed",m.o),m.b("dependentObservable",m.o),m.b("isComputed",m.Oc),m.b("isPureComputed",m.Fd),m.b("computed.fn",v),m.L(v,"peek",v.v),m.L(v,"dispose",v.s),m.L(v,"isActive",v.ja),m.L(v,"getDependenciesCount",v.qa),m.L(v,"getDependencies",v.Va),m.xb=function(_,w){return typeof _=="function"?m.o(_,w,{pure:!0}):(_=m.a.extend({},_),_.pure=!0,m.o(_,w))},m.b("pureComputed",m.xb),function(){function _(I,N,k){if(k=k||new D,I=N(I),typeof I!="object"||I===null||I===e||I instanceof RegExp||I instanceof Date||I instanceof String||I instanceof Number||I instanceof Boolean)return I;var H=I instanceof Array?[]:{};return k.save(I,H),w(I,function(V){var j=N(I[V]);switch(typeof j){case"boolean":case"number":case"string":case"function":H[V]=j;break;case"object":case"undefined":var U=k.get(j);H[V]=U!==e?U:_(j,N,k)}}),H}function w(I,N){if(I instanceof Array){for(var k=0;k<I.length;k++)N(k);typeof I.toJSON=="function"&&N("toJSON")}else for(k in I)N(k)}function D(){this.keys=[],this.values=[]}m.ad=function(I){if(arguments.length==0)throw Error("When calling ko.toJS, pass the object you want to convert.");return _(I,function(N){for(var k=0;m.O(N)&&10>k;k++)N=N();return N})},m.toJSON=function(I,N,k){return I=m.ad(I),m.a.hc(I,N,k)},D.prototype={constructor:D,save:function(I,N){var k=m.a.A(this.keys,I);0<=k?this.values[k]=N:(this.keys.push(I),this.values.push(N))},get:function(I){return I=m.a.A(this.keys,I),0<=I?this.values[I]:e}}}(),m.b("toJS",m.ad),m.b("toJSON",m.toJSON),m.Wd=function(_,w,D){function I(N){var k=m.xb(_,D).extend({ma:"always"}),H=k.subscribe(function(V){V&&(H.s(),N(V))});return k.notifySubscribers(k.v()),H}return typeof Promise!="function"||w?I(w.bind(D)):new Promise(I)},m.b("when",m.Wd),function(){m.w={M:function(_){switch(m.a.R(_)){case"option":return _.__ko__hasDomDataOptionValue__===!0?m.a.g.get(_,m.c.options.$b):7>=m.a.W?_.getAttributeNode("value")&&_.getAttributeNode("value").specified?_.value:_.text:_.value;case"select":return 0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex]):e;default:return _.value}},cb:function(_,w,D){switch(m.a.R(_)){case"option":typeof w=="string"?(m.a.g.set(_,m.c.options.$b,e),"__ko__hasDomDataOptionValue__"in _&&delete _.__ko__hasDomDataOptionValue__,_.value=w):(m.a.g.set(_,m.c.options.$b,w),_.__ko__hasDomDataOptionValue__=!0,_.value=typeof w=="number"?w:"");break;case"select":(w===""||w===null)&&(w=e);for(var I=-1,N=0,k=_.options.length,H;N<k;++N)if(H=m.w.M(_.options[N]),H==w||H===""&&w===e){I=N;break}(D||0<=I||w===e&&1<_.size)&&(_.selectedIndex=I,m.a.W===6&&m.a.setTimeout(function(){_.selectedIndex=I},0));break;default:(w===null||w===e)&&(w=""),_.value=w}}}}(),m.b("selectExtensions",m.w),m.b("selectExtensions.readValue",m.w.M),m.b("selectExtensions.writeValue",m.w.cb),m.m=function(){function _(V){V=m.a.Db(V),V.charCodeAt(0)===123&&(V=V.slice(1,-1)),V+=`
,`;var j=[],U=V.match(I),q,X=[],te=0;if(1<U.length){for(var K=0,Z;Z=U[K];++K){var ee=Z.charCodeAt(0);if(ee===44){if(0>=te){j.push(q&&X.length?{key:q,value:X.join("")}:{unknown:q||X.join("")}),q=te=0,X=[];continue}}else if(ee===58){if(!te&&!q&&X.length===1){q=X.pop();continue}}else{if(ee===47&&1<Z.length&&(Z.charCodeAt(1)===47||Z.charCodeAt(1)===42))continue;ee===47&&K&&1<Z.length?(ee=U[K-1].match(N))&&!k[ee[0]]&&(V=V.substr(V.indexOf(Z)+1),U=V.match(I),K=-1,Z="/"):ee===40||ee===123||ee===91?++te:ee===41||ee===125||ee===93?--te:q||X.length||ee!==34&&ee!==39||(Z=Z.slice(1,-1))}X.push(Z)}if(0<te)throw Error("Unbalanced parentheses, braces, or brackets")}return j}var w=["true","false","null","undefined"],D=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,I=RegExp(`"(?:\\\\.|[^"])*"|'(?:\\\\.|[^'])*'|\`(?:\\\\.|[^\`])*\`|/\\*(?:[^*]|\\*+[^*/])*\\*+/|//.*
|/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),N=/[\])"'A-Za-z0-9_$]+$/,k={in:1,return:1,typeof:1},H={};return{Ra:[],wa:H,ac:_,vb:function(V,j){function U(ee,me){var xe;if(!K){var ue=m.getBindingHandler(ee);if(ue&&ue.preprocess&&!(me=ue.preprocess(me,ee,U)))return;(ue=H[ee])&&(xe=me,0<=m.a.A(w,xe)?xe=!1:(ue=xe.match(D),xe=ue===null?!1:ue[1]?"Object("+ue[1]+")"+ue[2]:xe),ue=xe),ue&&X.push("'"+(typeof H[ee]=="string"?H[ee]:ee)+"':function(_z){"+xe+"=_z}")}te&&(me="function(){return "+me+" }"),q.push("'"+ee+"':"+me)}j=j||{};var q=[],X=[],te=j.valueAccessors,K=j.bindingParams,Z=typeof V=="string"?_(V):V;return m.a.D(Z,function(ee){U(ee.key||ee.unknown,ee.value)}),X.length&&U("_ko_property_writers","{"+X.join(",")+" }"),q.join(",")},Id:function(V,j){for(var U=0;U<V.length;U++)if(V[U].key==j)return!0;return!1},eb:function(V,j,U,q,X){V&&m.O(V)?!m.Za(V)||X&&V.v()===q||V(q):(V=j.get("_ko_property_writers"))&&V[U]&&V[U](q)}}}(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),function(){function _(U){return U.nodeType==8&&k.test(N?U.text:U.nodeValue)}function w(U){return U.nodeType==8&&H.test(N?U.text:U.nodeValue)}function D(U,q){for(var X=U,te=1,K=[];X=X.nextSibling;){if(w(X)&&(m.a.g.set(X,j,!0),te--,te===0))return K;K.push(X),_(X)&&te++}if(!q)throw Error("Cannot find closing comment tag to match: "+U.nodeValue);return null}function I(U,q){var X=D(U,q);return X?0<X.length?X[X.length-1].nextSibling:U.nextSibling:null}var N=n&&n.createComment("test").text==="<!--test-->",k=N?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,H=N?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,V={ul:!0,ol:!0},j="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(U){return _(U)?D(U):U.childNodes},Ea:function(U){if(_(U)){U=m.h.childNodes(U);for(var q=0,X=U.length;q<X;q++)m.removeNode(U[q])}else m.a.Tb(U)},va:function(U,q){if(_(U)){m.h.Ea(U);for(var X=U.nextSibling,te=0,K=q.length;te<K;te++)X.parentNode.insertBefore(q[te],X)}else m.a.va(U,q)},Vc:function(U,q){var X;_(U)?(X=U.nextSibling,U=U.parentNode):X=U.firstChild,X?q!==X&&U.insertBefore(q,X):U.appendChild(q)},Wb:function(U,q,X){X?(X=X.nextSibling,_(U)&&(U=U.parentNode),X?q!==X&&U.insertBefore(q,X):U.appendChild(q)):m.h.Vc(U,q)},firstChild:function(U){if(_(U))return!U.nextSibling||w(U.nextSibling)?null:U.nextSibling;if(U.firstChild&&w(U.firstChild))throw Error("Found invalid end comment, as the first child of "+U);return U.firstChild},nextSibling:function(U){if(_(U)&&(U=I(U)),U.nextSibling&&w(U.nextSibling)){var q=U.nextSibling;if(w(q)&&!m.a.g.get(q,j))throw Error("Found end comment without a matching opening comment, as child of "+U);return null}return U.nextSibling},Cd:_,Vd:function(U){return(U=(N?U.text:U.nodeValue).match(k))?U[1]:null},Sc:function(U){if(V[m.a.R(U)]){var q=U.firstChild;if(q)do if(q.nodeType===1){var X;X=q.firstChild;var te=null;if(X)do if(te)te.push(X);else if(_(X)){var K=I(X,!0);K?X=K:te=[X]}else w(X)&&(te=[X]);while(X=X.nextSibling);if(X=te)for(te=q.nextSibling,K=0;K<X.length;K++)te?U.insertBefore(X[K],te):U.appendChild(X[K])}while(q=q.nextSibling)}}}}(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(_);case 8:return m.h.Cd(_);default:return!1}},getBindings:function(_,w){var D=this.getBindingsString(_,w),D=D?this.parseBindingsString(D,w,_):null;return m.j.tc(D,_,w,!1)},getBindingAccessors:function(_,w){var D=this.getBindingsString(_,w),D=D?this.parseBindingsString(D,w,_,{valueAccessors:!0}):null;return m.j.tc(D,_,w,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return m.h.Vd(_);default:return null}},parseBindingsString:function(_,w,D,I){try{var N=this.nd,k=_+(I&&I.valueAccessors||""),H;if(!(H=N[k])){var V,j="with($context){with($data||{}){return{"+m.m.vb(_,I)+"}}}";V=new Function("$context","$element",j),H=N[k]=V}return H(w,D)}catch(U){throw U.message=`Unable to parse bindings.
Bindings value: `+_+`
Message: `+U.message,U}}}),m.ga.instance=new m.ga}(),m.b("bindingProvider",m.ga),function(){function _(ue){var ye=(ue=m.a.g.get(ue,xe))&&ue.N;ye&&(ue.N=null,ye.Tc())}function w(ue,ye,Ae){this.node=ue,this.yc=ye,this.kb=[],this.H=!1,ye.N||m.a.K.za(ue,_),Ae&&Ae.N&&(Ae.N.kb.push(ue),this.Kb=Ae)}function D(ue){return function(){return ue}}function I(ue){return ue()}function N(ue){return m.a.Ga(m.u.G(ue),function(ye,Ae){return function(){return ue()[Ae]}})}function k(ue,ye,Ae){return typeof ue=="function"?N(ue.bind(null,ye,Ae)):m.a.Ga(ue,D)}function H(ue,ye){return N(this.getBindings.bind(this,ue,ye))}function V(ue,ye){var Ae=m.h.firstChild(ye);if(Ae){var Pe,Ee=m.ga.instance,Ve=Ee.preprocessNode;if(Ve){for(;Pe=Ae;)Ae=m.h.nextSibling(Pe),Ve.call(Ee,Pe);Ae=m.h.firstChild(ye)}for(;Pe=Ae;)Ae=m.h.nextSibling(Pe),j(ue,Pe)}m.i.ma(ye,m.i.H)}function j(ue,ye){var Ae=ue,Pe=ye.nodeType===1;Pe&&m.h.Sc(ye),(Pe||m.ga.instance.nodeHasBindings(ye))&&(Ae=q(ye,null,ue).bindingContextForDescendants),Ae&&!ee[m.a.R(ye)]&&V(Ae,ye)}function U(ue){var ye=[],Ae={},Pe=[];return m.a.P(ue,function Ee(Ve){if(!Ae[Ve]){var je=m.getBindingHandler(Ve);je&&(je.after&&(Pe.push(Ve),m.a.D(je.after,function(it){if(ue[it]){if(m.a.A(Pe,it)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Pe.join(", "));Ee(it)}}),Pe.length--),ye.push({key:Ve,Mc:je})),Ae[Ve]=!0}}),ye}function q(ue,ye,Ae){var Pe=m.a.g.Ub(ue,xe,{}),Ee=Pe.hd;if(!ye){if(Ee)throw Error("You cannot apply bindings multiple times to the same element.");Pe.hd=!0}Ee||(Pe.context=Ae),Pe.Zb||(Pe.Zb={});var Ve;if(ye&&typeof ye!="function")Ve=ye;else{var je=m.ga.instance,it=je.getBindingAccessors||H,Dt=m.$(function(){return(Ve=ye?ye(Ae,ue):it.call(je,ue,Ae))&&(Ae[te]&&Ae[te](),Ae[Z]&&Ae[Z]()),Ve},null,{l:ue});Ve&&Dt.ja()||(Dt=null)}var Gt=Ae,$e;if(Ve){var ln=function(){return m.a.Ga(Dt?Dt():Ve,I)},Vt=Dt?function(Ct){return function(){return I(Dt()[Ct])}}:function(Ct){return Ve[Ct]};ln.get=function(Ct){return Ve[Ct]&&I(Vt(Ct))},ln.has=function(Ct){return Ct in Ve},m.i.H in Ve&&m.i.subscribe(ue,m.i.H,function(){var Ct=(0,Ve[m.i.H])();if(Ct){var gi=m.h.childNodes(ue);gi.length&&Ct(gi,m.Ec(gi[0]))}}),m.i.pa in Ve&&(Gt=m.i.Cb(ue,Ae),m.i.subscribe(ue,m.i.pa,function(){var Ct=(0,Ve[m.i.pa])();Ct&&m.h.firstChild(ue)&&Ct(ue)})),Pe=U(Ve),m.a.D(Pe,function(Ct){var gi=Ct.Mc.init,an=Ct.Mc.update,_e=Ct.key;if(ue.nodeType===8&&!m.h.ea[_e])throw Error("The binding '"+_e+"' cannot be used with virtual elements");try{typeof gi=="function"&&m.u.G(function(){var Ce=gi(ue,Vt(_e),ln,Gt.$data,Gt);if(Ce&&Ce.controlsDescendantBindings){if($e!==e)throw Error("Multiple bindings ("+$e+" and "+_e+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");$e=_e}}),typeof an=="function"&&m.$(function(){an(ue,Vt(_e),ln,Gt.$data,Gt)},null,{l:ue})}catch(Ce){throw Ce.message='Unable to process binding "'+_e+": "+Ve[_e]+`"
Message: `+Ce.message,Ce}})}return Pe=$e===e,{shouldBindDescendants:Pe,bindingContextForDescendants:Pe&&Gt}}function X(ue,ye){return ue&&ue instanceof m.fa?ue:new m.fa(ue,e,e,ye)}var te=m.a.Da("_subscribable"),K=m.a.Da("_ancestorBindingInfo"),Z=m.a.Da("_dataDependency");m.c={};var ee={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(ue){return m.c[ue]};var me={};m.fa=function(ue,ye,Ae,Pe,Ee){function Ve(){var Vt=Gt?Dt():Dt,Ct=m.a.f(Vt);return ye?(m.a.extend(je,ye),K in ye&&(je[K]=ye[K])):(je.$parents=[],je.$root=Ct,je.ko=m),je[te]=$e,it?Ct=je.$data:(je.$rawData=Vt,je.$data=Ct),Ae&&(je[Ae]=Ct),Pe&&Pe(je,ye,Ct),ye&&ye[te]&&!m.S.o().Vb(ye[te])&&ye[te](),ln&&(je[Z]=ln),je.$data}var je=this,it=ue===me,Dt=it?e:ue,Gt=typeof Dt=="function"&&!m.O(Dt),$e,ln=Ee&&Ee.dataDependency;Ee&&Ee.exportDependencies?Ve():($e=m.xb(Ve),$e.v(),$e.ja()?$e.equalityComparer=null:je[te]=e)},m.fa.prototype.createChildContext=function(ue,ye,Ae,Pe){if(!Pe&&ye&&typeof ye=="object"&&(Pe=ye,ye=Pe.as,Ae=Pe.extend),ye&&Pe&&Pe.noChildContext){var Ee=typeof ue=="function"&&!m.O(ue);return new m.fa(me,this,null,function(Ve){Ae&&Ae(Ve),Ve[ye]=Ee?ue():ue},Pe)}return new m.fa(ue,this,ye,function(Ve,je){Ve.$parentContext=je,Ve.$parent=je.$data,Ve.$parents=(je.$parents||[]).slice(0),Ve.$parents.unshift(Ve.$parent),Ae&&Ae(Ve)},Pe)},m.fa.prototype.extend=function(ue,ye){return new m.fa(me,this,null,function(Ae){m.a.extend(Ae,typeof ue=="function"?ue(Ae):ue)},ye)};var xe=m.a.g.Z();w.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},w.prototype.sd=function(ue){m.a.Pa(this.kb,ue),!this.kb.length&&this.H&&this.Cc()},w.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,_),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(ue,ye,Ae,Pe,Ee){var Ve=m.a.g.Ub(ue,xe,{});return Ve.Fa||(Ve.Fa=new m.T),Ee&&Ee.notifyImmediately&&Ve.Zb[ye]&&m.u.G(Ae,Pe,[ue]),Ve.Fa.subscribe(Ae,Pe,ye)},ma:function(ue,ye){var Ae=m.a.g.get(ue,xe);if(Ae&&(Ae.Zb[ye]=!0,Ae.Fa&&Ae.Fa.notifySubscribers(ue,ye),ye==m.i.H)){if(Ae.N)Ae.N.Cc();else if(Ae.N===e&&Ae.Fa&&Ae.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(ue,ye){var Ae=m.a.g.Ub(ue,xe,{});return Ae.N||(Ae.N=new w(ue,Ae,ye[K])),ye[K]==Ae?ye:ye.extend(function(Pe){Pe[K]=Ae})}},m.Td=function(ue){return(ue=m.a.g.get(ue,xe))&&ue.context},m.ib=function(ue,ye,Ae){return ue.nodeType===1&&m.h.Sc(ue),q(ue,ye,X(Ae))},m.ld=function(ue,ye,Ae){return Ae=X(Ae),m.ib(ue,k(ye,Ae,ue),Ae)},m.Oa=function(ue,ye){ye.nodeType!==1&&ye.nodeType!==8||V(X(ue),ye)},m.vc=function(ue,ye,Ae){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(ye=n.body,!ye)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!ye||ye.nodeType!==1&&ye.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");j(X(ue,Ae),ye)},m.Dc=function(ue){return!ue||ue.nodeType!==1&&ue.nodeType!==8?e:m.Td(ue)},m.Ec=function(ue){return(ue=m.Dc(ue))?ue.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)}(),function(_){function w(H,V){var j=Object.prototype.hasOwnProperty.call(N,H)?N[H]:_,U;j?j.subscribe(V):(j=N[H]=new m.T,j.subscribe(V),D(H,function(q,X){var te=!(!X||!X.synchronous);k[H]={definition:q,Gd:te},delete N[H],U||te?j.notifySubscribers(q):m.na.zb(function(){j.notifySubscribers(q)})}),U=!0)}function D(H,V){I("getConfig",[H],function(j){j?I("loadComponent",[H,j],function(U){V(U,j)}):V(null,null)})}function I(H,V,j,U){U||(U=m.j.loaders.slice(0));var q=U.shift();if(q){var X=q[H];if(X){var te=!1;if(X.apply(q,V.concat(function(K){te?j(null):K!==null?j(K):I(H,V,j,U)}))!==_&&(te=!0,!q.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else I(H,V,j,U)}else j(null)}var N={},k={};m.j={get:function(H,V){var j=Object.prototype.hasOwnProperty.call(k,H)?k[H]:_;j?j.Gd?m.u.G(function(){V(j.definition)}):m.na.zb(function(){V(j.definition)}):w(H,V)},Bc:function(H){delete k[H]},oc:I},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)}(),function(){function _(j,U,q,X){function te(){--Z===0&&X(K)}var K={},Z=2,ee=q.template;q=q.viewModel,ee?N(U,ee,function(me){m.j.oc("loadTemplate",[j,me],function(xe){K.template=xe,te()})}):te(),q?N(U,q,function(me){m.j.oc("loadViewModel",[j,me],function(xe){K[V]=xe,te()})}):te()}function w(j,U,q){if(typeof U=="function")q(function(te){return new U(te)});else if(typeof U[V]=="function")q(U[V]);else if("instance"in U){var X=U.instance;q(function(){return X})}else"viewModel"in U?w(j,U.viewModel,q):j("Unknown viewModel value: "+U)}function D(j){switch(m.a.R(j)){case"script":return m.a.ua(j.text);case"textarea":return m.a.ua(j.value);case"template":if(I(j.content))return m.a.Ca(j.content.childNodes)}return m.a.Ca(j.childNodes)}function I(j){return t.DocumentFragment?j instanceof DocumentFragment:j&&j.nodeType===11}function N(j,U,q){typeof U.require=="string"?a||t.require?(a||t.require)([U.require],function(X){X&&typeof X=="object"&&X.Xd&&X.default&&(X=X.default),q(X)}):j("Uses require, but no AMD loader is present"):q(U)}function k(j){return function(U){throw Error("Component '"+j+"': "+U)}}var H={};m.j.register=function(j,U){if(!U)throw Error("Invalid configuration for "+j);if(m.j.tb(j))throw Error("Component "+j+" is already registered");H[j]=U},m.j.tb=function(j){return Object.prototype.hasOwnProperty.call(H,j)},m.j.unregister=function(j){delete H[j],m.j.Bc(j)},m.j.Fc={getConfig:function(j,U){U(m.j.tb(j)?H[j]:null)},loadComponent:function(j,U,q){var X=k(j);N(X,U,function(te){_(j,X,te,q)})},loadTemplate:function(j,U,q){if(j=k(j),typeof U=="string")q(m.a.ua(U));else if(U instanceof Array)q(U);else if(I(U))q(m.a.la(U.childNodes));else if(U.element)if(U=U.element,t.HTMLElement?U instanceof HTMLElement:U&&U.tagName&&U.nodeType===1)q(D(U));else if(typeof U=="string"){var X=n.getElementById(U);X?q(D(X)):j("Cannot find element with ID "+U)}else j("Unknown element type: "+U);else j("Unknown template value: "+U)},loadViewModel:function(j,U,q){w(k(j),U,q)}};var V="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=H}(),function(){function _(D,I){var N=D.getAttribute("params");if(N){var N=w.parseBindingsString(N,I,D,{valueAccessors:!0,bindingParams:!0}),N=m.a.Ga(N,function(V){return m.o(V,null,{l:D})}),k=m.a.Ga(N,function(V){var j=V.v();return V.ja()?m.o({read:function(){return m.a.f(V())},write:m.Za(j)&&function(U){V()(U)},l:D}):j});return Object.prototype.hasOwnProperty.call(k,"$raw")||(k.$raw=N),k}return{$raw:{}}}m.j.getComponentNameForNode=function(D){var I=m.a.R(D);if(m.j.tb(I)&&(I.indexOf("-")!=-1||""+D=="[object HTMLUnknownElement]"||8>=m.a.W&&D.tagName===I))return I},m.j.tc=function(D,I,N,k){if(I.nodeType===1){var H=m.j.getComponentNameForNode(I);if(H){if(D=D||{},D.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var V={name:H,params:_(I,N)};D.component=k?function(){return V}:V}}return D};var w=new m.ga;9>m.a.W&&(m.j.register=function(D){return function(I){return D.apply(this,arguments)}}(m.j.register),n.createDocumentFragment=function(D){return function(){var I=D(),N=m.j.dd,k;for(k in N);return I}}(n.createDocumentFragment))}(),function(){function _(I,N,k){if(N=N.template,!N)throw Error("Component '"+I+"' has no template");I=m.a.Ca(N),m.h.va(k,I)}function w(I,N,k){var H=I.createViewModel;return H?H.call(I,N,k):N}var D=0;m.c.component={init:function(I,N,k,H,V){function j(){var K=U&&U.dispose;typeof K=="function"&&K.call(U),X&&X.s(),q=U=X=null}var U,q,X,te=m.a.la(m.h.childNodes(I));return m.h.Ea(I),m.a.K.za(I,j),m.o(function(){var K=m.a.f(N()),Z,ee;if(typeof K=="string"?Z=K:(Z=m.a.f(K.name),ee=m.a.f(K.params)),!Z)throw Error("No component name specified");var me=m.i.Cb(I,V),xe=q=++D;m.j.get(Z,function(ue){if(q===xe){if(j(),!ue)throw Error("Unknown component '"+Z+"'");_(Z,ue,I);var ye=w(ue,ee,{element:I,templateNodes:te});ue=me.createChildContext(ye,{extend:function(Ae){Ae.$component=ye,Ae.$componentTemplateNodes=te}}),ye&&ye.koDescendantsComplete&&(X=m.i.subscribe(I,m.i.pa,ye.koDescendantsComplete,ye)),U=ye,m.Oa(ue,I)}})},null,{l:I}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0}();var L={class:"className",for:"htmlFor"};m.c.attr={update:function(_,w){var D=m.a.f(w())||{};m.a.P(D,function(I,N){N=m.a.f(N);var k=I.indexOf(":"),k="lookupNamespaceURI"in _&&0<k&&_.lookupNamespaceURI(I.substr(0,k)),H=N===!1||N===null||N===e;H?k?_.removeAttributeNS(k,I):_.removeAttribute(I):N=N.toString(),8>=m.a.W&&I in L?(I=L[I],H?_.removeAttribute(I):_[I]=N):H||(k?_.setAttributeNS(k,I,N):_.setAttribute(I,N)),I==="name"&&m.a.Yc(_,H?"":N)})}},function(){m.c.checked={after:["value","attr"],init:function(_,w,D){function I(){var K=_.checked,Z=k();if(!m.S.Ya()&&(K||!V&&!m.S.qa())){var ee=m.u.G(w);if(U){var me=q?ee.v():ee,xe=te;te=Z,xe!==Z?K&&(m.a.Na(me,Z,!0),m.a.Na(me,xe,!1)):m.a.Na(me,Z,K),q&&m.Za(ee)&&ee(me)}else H&&(Z===e?Z=K:K||(Z=e)),m.m.eb(ee,D,"checked",Z,!0)}}function N(){var K=m.a.f(w()),Z=k();U?(_.checked=0<=m.a.A(K,Z),te=Z):_.checked=H&&Z===e?!!K:k()===K}var k=m.xb(function(){if(D.has("checkedValue"))return m.a.f(D.get("checkedValue"));if(X)return D.has("value")?m.a.f(D.get("value")):_.value}),H=_.type=="checkbox",V=_.type=="radio";if(H||V){var j=w(),U=H&&m.a.f(j)instanceof Array,q=!(U&&j.push&&j.splice),X=V||U,te=U?k():e;V&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(I,null,{l:_}),m.a.B(_,"click",I),m.o(N,null,{l:_}),j=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(_,w){_.value=m.a.f(w())}}}(),m.c.class={update:function(_,w){var D=m.a.Db(m.a.f(w()));m.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=D,m.a.Eb(_,D,!0)}},m.c.css={update:function(_,w){var D=m.a.f(w());D!==null&&typeof D=="object"?m.a.P(D,function(I,N){N=m.a.f(N),m.a.Eb(_,I,N)}):m.c.class.update(_,w)}},m.c.enable={update:function(_,w){var D=m.a.f(w());D&&_.disabled?_.removeAttribute("disabled"):D||_.disabled||(_.disabled=!0)}},m.c.disable={update:function(_,w){m.c.enable.update(_,function(){return!m.a.f(w())})}},m.c.event={init:function(_,w,D,I,N){var k=w()||{};m.a.P(k,function(H){typeof H=="string"&&m.a.B(_,H,function(V){var j,U=w()[H];if(U){try{var q=m.a.la(arguments);I=N.$data,q.unshift(I),j=U.apply(I,q)}finally{j!==!0&&(V.preventDefault?V.preventDefault():V.returnValue=!1)}D.get(H+"Bubble")===!1&&(V.cancelBubble=!0,V.stopPropagation&&V.stopPropagation())}})})}},m.c.foreach={Rc:function(_){return function(){var w=_(),D=m.a.bc(w);return!D||typeof D.length=="number"?{foreach:w,templateEngine:m.ba.Ma}:(m.a.f(w),{foreach:D.data,as:D.as,noChildContext:D.noChildContext,includeDestroyed:D.includeDestroyed,afterAdd:D.afterAdd,beforeRemove:D.beforeRemove,afterRender:D.afterRender,beforeMove:D.beforeMove,afterMove:D.afterMove,templateEngine:m.ba.Ma})}},init:function(_,w){return m.c.template.init(_,m.c.foreach.Rc(w))},update:function(_,w,D,I,N){return m.c.template.update(_,m.c.foreach.Rc(w),D,I,N)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,w,D){function I(H){_.__ko_hasfocusUpdating=!0;var V=_.ownerDocument;if("activeElement"in V){var j;try{j=V.activeElement}catch{j=V.body}H=j===_}V=w(),m.m.eb(V,D,"hasfocus",H,!0),_.__ko_hasfocusLastValue=H,_.__ko_hasfocusUpdating=!1}var N=I.bind(null,!0),k=I.bind(null,!1);m.a.B(_,"focus",N),m.a.B(_,"focusin",N),m.a.B(_,"blur",k),m.a.B(_,"focusout",k),_.__ko_hasfocusLastValue=!1},update:function(_,w){var D=!!m.a.f(w());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===D||(D?_.focus():_.blur(),!D&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[_,D?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,w){m.a.fc(_,w())}},function(){function _(w,D,I){m.c[w]={init:function(N,k,H,V,j){var U,q,X={},te,K,Z;if(D){V=H.get("as");var ee=H.get("noChildContext");Z=!(V&&ee),X={as:V,noChildContext:ee,exportDependencies:Z}}return K=(te=H.get("completeOn")=="render")||H.has(m.i.pa),m.o(function(){var me=m.a.f(k()),xe=!I!=!me,ue=!q,ye;(Z||xe!==U)&&(K&&(j=m.i.Cb(N,j)),xe&&((!D||Z)&&(X.dataDependency=m.S.o()),ye=D?j.createChildContext(typeof me=="function"?me:k,X):m.S.qa()?j.extend(null,X):j),ue&&m.S.qa()&&(q=m.a.Ca(m.h.childNodes(N),!0)),xe?(ue||m.h.va(N,m.a.Ca(q)),m.Oa(ye,N)):(m.h.Ea(N),te||m.i.ma(N,m.i.H)),U=xe)},null,{l:N}),{controlsDescendantBindings:!0}}},m.m.Ra[w]=!1,m.h.ea[w]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)}(),m.c.let={init:function(_,w,D,I,N){return w=N.extend(w),m.Oa(w,_),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var B={};m.c.options={init:function(_){if(m.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,w,D){function I(){return m.a.jb(_.options,function(ee){return ee.selected})}function N(ee,me,xe){var ue=typeof me;return ue=="function"?me(ee):ue=="string"?ee[me]:xe}function k(ee,me){if(K&&U)m.i.ma(_,m.i.H);else if(te.length){var xe=0<=m.a.A(te,m.w.M(me[0]));m.a.Zc(me[0],xe),K&&!xe&&m.u.G(m.a.Fb,null,[_,"change"])}}var H=_.multiple,V=_.length!=0&&H?_.scrollTop:null,j=m.a.f(w()),U=D.get("valueAllowUnset")&&D.has("value"),q=D.get("optionsIncludeDestroyed");w={};var X,te=[];U||(H?te=m.a.Mb(I(),m.w.M):0<=_.selectedIndex&&te.push(m.w.M(_.options[_.selectedIndex]))),j&&(typeof j.length>"u"&&(j=[j]),X=m.a.jb(j,function(ee){return q||ee===e||ee===null||!m.a.f(ee._destroy)}),D.has("optionsCaption")&&(j=m.a.f(D.get("optionsCaption")),j!==null&&j!==e&&X.unshift(B)));var K=!1;if(w.beforeRemove=function(ee){_.removeChild(ee)},j=k,D.has("optionsAfterRender")&&typeof D.get("optionsAfterRender")=="function"&&(j=function(ee,me){k(0,me),m.u.G(D.get("optionsAfterRender"),null,[me[0],ee!==B?ee:e])}),m.a.ec(_,X,function(ee,me,xe){return xe.length&&(te=!U&&xe[0].selected?[m.w.M(xe[0])]:[],K=!0),me=_.ownerDocument.createElement("option"),ee===B?(m.a.Bb(me,D.get("optionsCaption")),m.w.cb(me,e)):(xe=N(ee,D.get("optionsValue"),ee),m.w.cb(me,m.a.f(xe)),ee=N(ee,D.get("optionsText"),xe),m.a.Bb(me,ee)),[me]},w,j),!U){var Z;H?Z=te.length&&I().length<te.length:Z=te.length&&0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex])!==te[0]:te.length||0<=_.selectedIndex,Z&&m.u.G(m.a.Fb,null,[_,"change"])}(U||m.S.Ya())&&m.i.ma(_,m.i.H),m.a.wd(_),V&&20<Math.abs(V-_.scrollTop)&&(_.scrollTop=V)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,w,D){function I(){var H=w(),V=[];m.a.D(_.getElementsByTagName("option"),function(j){j.selected&&V.push(m.w.M(j))}),m.m.eb(H,D,"selectedOptions",V)}function N(){var H=m.a.f(w()),V=_.scrollTop;H&&typeof H.length=="number"&&m.a.D(_.getElementsByTagName("option"),function(j){var U=0<=m.a.A(H,m.w.M(j));j.selected!=U&&m.a.Zc(j,U)}),_.scrollTop=V}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var k;m.i.subscribe(_,m.i.H,function(){k?I():(m.a.B(_,"change",I),k=m.o(N,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(_,w){var D=m.a.f(w()||{});m.a.P(D,function(I,N){if(N=m.a.f(N),(N===null||N===e||N===!1)&&(N=""),o)o(_).css(I,N);else if(/^--/.test(I))_.style.setProperty(I,N);else{I=I.replace(/-(\w)/g,function(H,V){return V.toUpperCase()});var k=_.style[I];_.style[I]=N,N===k||_.style[I]!=k||isNaN(N)||(_.style[I]=N+"px")}})}},m.c.submit={init:function(_,w,D,I,N){if(typeof w()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(k){var H,V=w();try{H=V.call(N.$data,_)}finally{H!==!0&&(k.preventDefault?k.preventDefault():k.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,w){m.a.Bb(_,w())}},m.h.ea.text=!0,function(){if(t&&t.navigator){var _=function(X){if(X)return parseFloat(X[1])},w=t.navigator.userAgent,D,I,N,k,H;(D=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(H=_(w.match(/Edge\/([^ ]+)$/)))||_(w.match(/Chrome\/([^ ]+)/))||(I=_(w.match(/Version\/([^ ]+) Safari/)))||(N=_(w.match(/Firefox\/([^ ]+)/)))||(k=m.a.W||_(w.match(/MSIE ([^ ]+)/)))||(k=_(w.match(/rv:([^ )]+)/)))}if(8<=k&&10>k)var V=m.a.g.Z(),j=m.a.g.Z(),U=function(X){var te=this.activeElement;(te=te&&m.a.g.get(te,j))&&te(X)},q=function(X,te){var K=X.ownerDocument;m.a.g.get(K,V)||(m.a.g.set(K,V,!0),m.a.B(K,"selectionchange",U)),m.a.g.set(X,j,te)};m.c.textInput={init:function(X,te,K){function Z(Ve,je){m.a.B(X,Ve,je)}function ee(){var Ve=m.a.f(te());(Ve===null||Ve===e)&&(Ve=""),Ae!==e&&Ve===Ae?m.a.setTimeout(ee,4):X.value!==Ve&&(Ee=!0,X.value=Ve,Ee=!1,ue=X.value)}function me(){ye||(Ae=X.value,ye=m.a.setTimeout(xe,4))}function xe(){clearTimeout(ye),Ae=ye=e;var Ve=X.value;ue!==Ve&&(ue=Ve,m.m.eb(te(),K,"textInput",Ve))}var ue=X.value,ye,Ae,Pe=m.a.W==9?me:xe,Ee=!1;k&&Z("keypress",xe),11>k&&Z("propertychange",function(Ve){Ee||Ve.propertyName!=="value"||Pe(Ve)}),k==8&&(Z("keyup",xe),Z("keydown",xe)),q&&(q(X,Pe),Z("dragend",me)),(!k||9<=k)&&Z("input",Pe),5>I&&m.a.R(X)==="textarea"?(Z("keydown",me),Z("paste",me),Z("cut",me)):11>D?Z("keydown",me):4>N?(Z("DOMAutoComplete",xe),Z("dragdrop",xe),Z("drop",xe)):H&&X.type==="number"&&Z("keydown",me),Z("change",xe),Z("blur",xe),m.o(ee,null,{l:X})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(X,te,K){K("textInput",X)}}}(),m.c.uniqueName={init:function(_,w){if(w()){var D="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(_,D)}}},m.c.uniqueName.rd=0,m.c.using={init:function(_,w,D,I,N){var k;return D.has("as")&&(k={as:D.get("as"),noChildContext:D.get("noChildContext")}),w=N.createChildContext(w,k),m.Oa(w,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,w,D){var I=m.a.R(_),N=I=="input";if(!N||_.type!="checkbox"&&_.type!="radio"){var k=[],H=D.get("valueUpdate"),V=!1,j=null;H&&(typeof H=="string"?k=[H]:k=m.a.wc(H),m.a.Pa(k,"change"));var U=function(){j=null,V=!1;var te=w(),K=m.w.M(_);m.m.eb(te,D,"value",K)};!m.a.W||!N||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(k,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){V=!0}),m.a.B(_,"focus",function(){V=!1}),m.a.B(_,"blur",function(){V&&U()})),m.a.D(k,function(te){var K=U;m.a.Ud(te,"after")&&(K=function(){j=m.w.M(_),m.a.setTimeout(U,0)},te=te.substring(5)),m.a.B(_,te,K)});var q;if(q=N&&_.type=="file"?function(){var te=m.a.f(w());te===null||te===e||te===""?_.value="":m.u.G(U)}:function(){var te=m.a.f(w()),K=m.w.M(_);j!==null&&te===j?m.a.setTimeout(q,0):(te!==K||K===e)&&(I==="select"?(K=D.get("valueAllowUnset"),m.w.cb(_,te,K),K||te===m.w.M(_)||m.u.G(U)):m.w.cb(_,te))},I==="select"){var X;m.i.subscribe(_,m.i.H,function(){X?D.get("valueAllowUnset")?q():U():(m.a.B(_,"change",U),X=m.o(q,null,{l:_}))},null,{notifyImmediately:!0})}else m.a.B(_,"change",U),m.o(q,null,{l:_})}else m.ib(_,{checkedValue:w})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(_,w){var D=m.a.f(w()),I=_.style.display!="none";D&&!I?_.style.display="":!D&&I&&(_.style.display="none")}},m.c.hidden={update:function(_,w){m.c.visible.update(_,function(){return!m.a.f(w())})}},function(_){m.c[_]={init:function(w,D,I,N,k){return m.c.event.init.call(this,w,function(){var H={};return H[_]=D(),H},I,N,k)}}}("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(_,w){if(typeof _=="string"){w=w||n;var D=w.getElementById(_);if(!D)throw Error("Cannot find template with ID "+_);return new m.C.F(D)}if(_.nodeType==1||_.nodeType==8)return new m.C.ia(_);throw Error("Unknown template type: "+_)},m.ca.prototype.renderTemplate=function(_,w,D,I){return _=this.makeTemplateSource(_,I),this.renderTemplateSource(_,w,D,I)},m.ca.prototype.isTemplateRewritten=function(_,w){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,w).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(_,w,D){_=this.makeTemplateSource(_,D),w=w(_.text()),_.text(w),_.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=function(){function _(I,N,k,H){I=m.m.ac(I);for(var V=m.m.Ra,j=0;j<I.length;j++){var U=I[j].key;if(Object.prototype.hasOwnProperty.call(V,U)){var q=V[U];if(typeof q=="function"){if(U=q(I[j].value))throw Error(U)}else if(!q)throw Error("This template engine does not support the '"+U+"' binding within its templates")}}return k="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(I,{valueAccessors:!0})+" } })()},'"+k.toLowerCase()+"')",H.createJavaScriptEvaluatorBlock(k)+N}var w=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,D=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(I,N,k){N.isTemplateRewritten(I,k)||N.rewriteTemplate(I,function(H){return m.kc.Ld(H,N)},k)},Ld:function(I,N){return I.replace(w,function(k,H,V,j,U){return _(U,H,V,N)}).replace(D,function(k,H){return _(H,"<!-- ko -->","#comment",N)})},md:function(I,N){return m.aa.Xb(function(k,H){var V=k.nextSibling;V&&V.nodeName.toLowerCase()===N&&m.ib(V,I,H)})}}}(),m.b("__tr_ambtns",m.kc.md),function(){m.C={},m.C.F=function(D){if(this.F=D){var I=m.a.R(D);this.ab=I==="script"?1:I==="textarea"?2:I=="template"&&D.content&&D.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var D=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[D];var I=arguments[0];D==="innerHTML"?m.a.fc(this.F,I):this.F[D]=I};var _=m.a.g.Z()+"_";m.C.F.prototype.data=function(D){if(arguments.length===1)return m.a.g.get(this.F,_+D);m.a.g.set(this.F,_+D,arguments[1])};var w=m.a.g.Z();m.C.F.prototype.nodes=function(){var D=this.F;if(arguments.length==0){var I=m.a.g.get(D,w)||{},N=I.lb||(this.ab===3?D.content:this.ab===4?D:e);if(!N||I.jd){var k=this.text();k&&k!==I.bb&&(N=m.a.Md(k,D.ownerDocument),m.a.g.set(D,w,{lb:N,bb:k,jd:!0}))}return N}I=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(D,w,{lb:I})},m.C.ia=function(D){this.F=D},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var D=m.a.g.get(this.F,w)||{};return D.bb===e&&D.lb&&(D.bb=D.lb.innerHTML),D.bb}m.a.g.set(this.F,w,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)}(),function(){function _(j,U,q){var X;for(U=m.h.nextSibling(U);j&&(X=j)!==U;)j=m.h.nextSibling(X),q(X,j)}function w(j,U){if(j.length){var q=j[0],X=j[j.length-1],te=q.parentNode,K=m.ga.instance,Z=K.preprocessNode;if(Z){if(_(q,X,function(ee,me){var xe=ee.previousSibling,ue=Z.call(K,ee);ue&&(ee===q&&(q=ue[0]||me),ee===X&&(X=ue[ue.length-1]||xe))}),j.length=0,!q)return;q===X?j.push(q):(j.push(q,X),m.a.Ua(j,te))}_(q,X,function(ee){ee.nodeType!==1&&ee.nodeType!==8||m.vc(U,ee)}),_(q,X,function(ee){ee.nodeType!==1&&ee.nodeType!==8||m.aa.cd(ee,[U])}),m.a.Ua(j,te)}}function D(j){return j.nodeType?j:0<j.length?j[0]:null}function I(j,U,q,X,te){te=te||{};var K=(j&&D(j)||q||{}).ownerDocument,Z=te.templateEngine||k;if(m.kc.xd(q,Z,K),q=Z.renderTemplate(q,X,te,K),typeof q.length!="number"||0<q.length&&typeof q[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(K=!1,U){case"replaceChildren":m.h.va(j,q),K=!0;break;case"replaceNode":m.a.Xc(j,q),K=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+U)}return K&&(w(q,X),te.afterRender&&m.u.G(te.afterRender,null,[q,X[te.as||"$data"]]),U=="replaceChildren"&&m.i.ma(j,m.i.H)),q}function N(j,U,q){return m.O(j)?j():typeof j=="function"?j(U,q):j}var k;m.gc=function(j){if(j!=e&&!(j instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");k=j},m.dc=function(j,U,q,X,te){if(q=q||{},(q.templateEngine||k)==e)throw Error("Set a template engine before calling renderTemplate");if(te=te||"replaceChildren",X){var K=D(X);return m.$(function(){var ee=U&&U instanceof m.fa?U:new m.fa(U,null,null,null,{exportDependencies:!0}),Z=N(j,ee.$data,ee),ee=I(X,te,Z,ee,q);te=="replaceNode"&&(X=ee,K=D(X))},null,{Sa:function(){return!K||!m.a.Sb(K)},l:K&&te=="replaceNode"?K.parentNode:K})}return m.aa.Xb(function(Z){m.dc(j,U,q,Z,"replaceNode")})},m.Qd=function(j,U,q,X,te){function K(Ae,Pe){m.u.G(m.a.ec,null,[X,Ae,ee,q,Z,Pe]),m.i.ma(X,m.i.H)}function Z(Ae,Pe){w(Pe,me),q.afterRender&&q.afterRender(Pe,Ae),me=null}function ee(Ae,Pe){me=te.createChildContext(Ae,{as:xe,noChildContext:q.noChildContext,extend:function(Ve){Ve.$index=Pe,xe&&(Ve[xe+"Index"]=Pe)}});var Ee=N(j,Ae,me);return I(X,"ignoreTargetNode",Ee,me,q)}var me,xe=q.as,ue=q.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!q.includeDestroyed;if(ue||q.beforeRemove||!m.Pc(U))return m.$(function(){var Ae=m.a.f(U)||[];typeof Ae.length>"u"&&(Ae=[Ae]),ue&&(Ae=m.a.jb(Ae,function(Pe){return Pe===e||Pe===null||!m.a.f(Pe._destroy)})),K(Ae)},null,{l:X});K(U.v());var ye=U.subscribe(function(Ae){K(U(),Ae)},null,"arrayChange");return ye.l(X),ye};var H=m.a.g.Z(),V=m.a.g.Z();m.c.template={init:function(j,U){var q=m.a.f(U());if(typeof q=="string"||"name"in q)m.h.Ea(j);else if("nodes"in q){if(q=q.nodes||[],m.O(q))throw Error('The "nodes" option must be a plain, non-observable array.');var X=q[0]&&q[0].parentNode;X&&m.a.g.get(X,V)||(X=m.a.Yb(q),m.a.g.set(X,V,!0)),new m.C.ia(j).nodes(X)}else if(q=m.h.childNodes(j),0<q.length)X=m.a.Yb(q),new m.C.ia(j).nodes(X);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(j,U,q,X,te){var K=U();U=m.a.f(K),q=!0,X=null,typeof U=="string"?U={}:(K="name"in U?U.name:j,"if"in U&&(q=m.a.f(U.if)),q&&"ifnot"in U&&(q=!m.a.f(U.ifnot)),q&&!K&&(q=!1)),"foreach"in U?X=m.Qd(K,q&&U.foreach||[],U,j,te):q?(q=te,"data"in U&&(q=te.createChildContext(U.data,{as:U.as,noChildContext:U.noChildContext,exportDependencies:!0})),X=m.dc(K,q,U,j)):m.h.Ea(j),te=X,(U=m.a.g.get(j,H))&&typeof U.s=="function"&&U.s(),m.a.g.set(j,H,!te||te.ja&&!te.ja()?e:te)}},m.m.Ra.template=function(j){return j=m.m.ac(j),j.length==1&&j[0].unknown||m.m.Id(j,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0}(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(_,w,D){if(_.length&&w.length){var I,N,k,H,V;for(I=N=0;(!D||I<D)&&(H=_[N]);++N){for(k=0;V=w[k];++k)if(H.value===V.value){H.moved=V.index,V.moved=H.index,w.splice(k,1),I=k=0;break}I+=k}}},m.a.Pb=function(){function _(w,D,I,N,k){var H=Math.min,V=Math.max,j=[],U,q=w.length,X,te=D.length,K=te-q||1,Z=q+te+1,ee,me,xe;for(U=0;U<=q;U++)for(me=ee,j.push(ee=[]),xe=H(te,U+K),X=V(0,U-1);X<=xe;X++)ee[X]=X?U?w[U-1]===D[X-1]?me[X-1]:H(me[X]||Z,ee[X-1]||Z)+1:X+1:U+1;for(H=[],V=[],K=[],U=q,X=te;U||X;)te=j[U][X]-1,X&&te===j[U][X-1]?V.push(H[H.length]={status:I,value:D[--X],index:X}):U&&te===j[U-1][X]?K.push(H[H.length]={status:N,value:w[--U],index:U}):(--X,--U,k.sparse||H.push({status:"retained",value:D[X]}));return m.a.Kc(K,V,!k.dontLimitMoves&&10*q),H.reverse()}return function(w,D,I){return I=typeof I=="boolean"?{dontLimitMoves:I}:I||{},w=w||[],D=D||[],w.length<D.length?_(w,D,"added","deleted",I):_(D,w,"deleted","added",I)}}(),m.b("utils.compareArrays",m.a.Pb),function(){function _(I,N,k,H,V){var j=[],U=m.$(function(){var q=N(k,V,m.a.Ua(j,I))||[];0<j.length&&(m.a.Xc(j,q),H&&m.u.G(H,null,[k,q,V])),j.length=0,m.a.Nb(j,q)},null,{l:I,Sa:function(){return!m.a.kd(j)}});return{Y:j,$:U.ja()?U:e}}var w=m.a.g.Z(),D=m.a.g.Z();m.a.ec=function(I,N,k,H,V,j){function U(Ct){Ee={Aa:Ct,pb:m.ta(me++)},Z.push(Ee),K||Pe.push(Ee)}function q(Ct){Ee=te[Ct],me!==Ee.pb.v()&&Ae.push(Ee),Ee.pb(me++),m.a.Ua(Ee.Y,I),Z.push(Ee)}function X(Ct,gi){if(Ct)for(var an=0,_e=gi.length;an<_e;an++)m.a.D(gi[an].Y,function(Ce){Ct(Ce,an,gi[an].Aa)})}N=N||[],typeof N.length>"u"&&(N=[N]),H=H||{};var te=m.a.g.get(I,w),K=!te,Z=[],ee=0,me=0,xe=[],ue=[],ye=[],Ae=[],Pe=[],Ee,Ve=0;if(K)m.a.D(N,U);else{if(!j||te&&te._countWaitingForRemove){var je=m.a.Mb(te,function(Ct){return Ct.Aa});j=m.a.Pb(je,N,{dontLimitMoves:H.dontLimitMoves,sparse:!0})}for(var je=0,it,Dt,Gt;it=j[je];je++)switch(Dt=it.moved,Gt=it.index,it.status){case"deleted":for(;ee<Gt;)q(ee++);Dt===e&&(Ee=te[ee],Ee.$&&(Ee.$.s(),Ee.$=e),m.a.Ua(Ee.Y,I).length&&(H.beforeRemove&&(Z.push(Ee),Ve++,Ee.Aa===D?Ee=null:ye.push(Ee)),Ee&&xe.push.apply(xe,Ee.Y))),ee++;break;case"added":for(;me<Gt;)q(ee++);Dt!==e?(ue.push(Z.length),q(Dt)):U(it.value)}for(;me<N.length;)q(ee++);Z._countWaitingForRemove=Ve}m.a.g.set(I,w,Z),X(H.beforeMove,Ae),m.a.D(xe,H.beforeRemove?m.oa:m.removeNode);var $e,ln,Vt;try{Vt=I.ownerDocument.activeElement}catch{}if(ue.length)for(;(je=ue.shift())!=e;){for(Ee=Z[je],$e=e;je;)if((ln=Z[--je].Y)&&ln.length){$e=ln[ln.length-1];break}for(N=0;ee=Ee.Y[N];$e=ee,N++)m.h.Wb(I,ee,$e)}for(je=0;Ee=Z[je];je++){for(Ee.Y||m.a.extend(Ee,_(I,k,Ee.Aa,V,Ee.pb)),N=0;ee=Ee.Y[N];$e=ee,N++)m.h.Wb(I,ee,$e);!Ee.Ed&&V&&(V(Ee.Aa,Ee.Y,Ee.pb),Ee.Ed=!0,$e=Ee.Y[Ee.Y.length-1])}for(Vt&&I.ownerDocument.activeElement!=Vt&&Vt.focus(),X(H.beforeRemove,ye),je=0;je<ye.length;++je)ye[je].Aa=D;X(H.afterMove,Ae),X(H.afterAdd,Pe)}}(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(_,w,D,I){return(w=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(w.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,I))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),function(){m.$a=function(){var w=this.Hd=function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1}();this.renderTemplateSource=function(D,I,N,k){if(k=k||n,N=N||{},2>w)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var H=D.data("precompiled");return H||(H=D.text()||"",H=o.template(null,"{{ko_with $item.koBindingContext}}"+H+"{{/ko_with}}"),D.data("precompiled",H)),D=[I.$data],I=o.extend({koBindingContext:I},N.templateOptions),I=o.tmpl(H,D,I),I.appendTo(k.createElement("div")),o.fragments={},I},this.createJavaScriptEvaluatorBlock=function(D){return"{{ko_code ((function() { return "+D+" })()) }}"},this.addTemplate=function(D,I){n.write("<script type='text/html' id='"+D+"'>"+I+"<\/script>")},0<w&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var _=new m.$a;0<_.Hd&&m.gc(_),m.b("jqueryTmplTemplateEngine",m.$a)}()})})()})()})();var lEt=ko;typeof window<"u"?(ko=window.ko,typeof eO<"u"?window.ko=eO:delete window.ko):(ko=global.ko,typeof eO<"u"?global.ko=eO:delete global.ko);var US=lEt;/**
* @license
* Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5
* Copyright (c) Steve Sanderson
* MIT license
*/var R$="__knockoutObservables",M$="__knockoutSubscribable";function mCe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=pCe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===R$||o===M$)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&fEt(n,a)}}),e}function pCe(e,t){var n=e[R$];return!n&&t&&(n={},Object.defineProperty(e,R$,{value:n})),n}function uEt(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=n.get,o.write=n.set}return e[t]=i.computed(o),mCe.call(i,e,[t]),e}function fEt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=dEt(e,t,i))})}function dEt(e,t,n){var i=hEt(e,n);return i.subscribe(t)}function hEt(e,t){var n=t[M$];if(!n){n=new e.subscribable,Object.defineProperty(t,M$,{value:n});var i={};mEt(t,n,i),pEt(e,t,n,i)}return n}function mEt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function pEt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function _Ce(e,t){if(!e)return null;var n=pCe(e,!1);return n&&n[t]||null}function _Et(e,t){var n=_Ce(e,t);n&&n.valueHasMutated()}function gEt(e){e.track=mCe,e.getObservable=_Ce,e.valueHasMutated=_Et,e.defineProperty=uEt}var BH={attachToKo:gEt};var gCe="http://www.w3.org/2000/svg",yCe="cesium-svgPath-svg",yEt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(gCe,"svg:svg");i.setAttribute("class",yCe);let o=document.createElementNS(gCe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${yCe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},kH=yEt;BH.attachToKo(US);kH.register(US);var Te=US;function tO(e){c(e)||(e=new mm),this._clock=e,this._eventHelper=new Ar,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Te.observable(Q.now()),this.systemTime.equalityComparer=Q.equals,this.startTime=Te.observable(e.startTime),this.startTime.equalityComparer=Q.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Te.observable(e.stopTime),this.stopTime.equalityComparer=Q.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Te.observable(e.currentTime),this.currentTime.equalityComparer=Q.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Te.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Te.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Te.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Te.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Te.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Te.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(tO.prototype,{clock:{get:function(){return this._clock}}});tO.prototype.synchronize=function(){let e=this._clock;this.systemTime=Q.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};tO.prototype.isDestroyed=function(){return!1};tO.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var UH=tO;function bEt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,C.throwInstantiationError()}var bCe=bEt;function xEt(e,t){if(!c(e))throw new C("func is required.");t=t??!0;let n=new pe,i=new pe;function o(){if(!o.canExecute)throw new C("Cannot execute command, canExecute is false.");let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,Te.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var wn=xEt;var VS={};VS.createCheckbox=function(e,t,n){T.typeOf.string("labelText",e),T.typeOf.string("checkedBinding",t);let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return c(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};VS.createSection=function(e,t,n,i){T.defined("panel",e),T.typeOf.string("headerText",t),T.typeOf.string("sectionVisibleBinding",n),T.typeOf.string("toggleSectionVisibilityBinding",i);let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};VS.createRangeInput=function(e,t,n,i,o,r){T.typeOf.string("rangeText",e),T.typeOf.string("sliderValueBinding",t),T.typeOf.number("min",n),T.typeOf.number("max",i),r=r??t;let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=o??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let l=document.createElement("div");l.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(l),u};VS.createRangeInputWithDynamicMinMax=function(e,t,n,i){T.typeOf.string("rangeText",e),T.typeOf.string("sliderValueBinding",t),i=i??t;let o=document.createElement("input");o.setAttribute("data-bind",`value: ${i}`),o.type="number";let r=document.createElement("input");r.type="range",r.step=n??"any",r.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(r);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(o),a.appendChild(s),a};VS.createButton=function(e,t,n){T.typeOf.string("buttonText",e),T.typeOf.string("clickedBinding",t);let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return c(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var Vu=VS;function TEt(e,t,n,i,o){return n.call(i,e[t]),Te.getObservable(e,t).subscribe(n,i,o)}var Ba=TEt;function xCe(e,t){if(!c(e))throw new C("command is required.");this._command=e,t=t??W.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",Te.track(this,["toggled","tooltip"])}Object.defineProperties(xCe.prototype,{command:{get:function(){return this._command}}});var Zx=xCe;var Qx="http://www.w3.org/2000/svg",CCe="http://www.w3.org/1999/xlink",VH,nO=G.fromCssColorString("rgba(247,250,255,0.384)"),zH=G.fromCssColorString("rgba(143,191,255,0.216)"),L$=G.fromCssColorString("rgba(153,197,255,0.098)"),HH=G.fromCssColorString("rgba(255,255,255,0.086)"),AEt=G.fromCssColorString("rgba(255,255,255,0.267)"),CEt=G.fromCssColorString("rgba(255,255,255,0)"),TCe=G.fromCssColorString("rgba(66,67,68,0.3)"),ACe=G.fromCssColorString("rgba(0,0,0,0.5)");function A0(e){return G.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var iO={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function bh(e){let t=document.createElementNS(Qx,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild(bh(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(CCe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function N$(e,t,n){let i=document.createElementNS(Qx,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(Qx,"tspan");return o.textContent=n,i.appendChild(o),i}function EEt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var GH=new G;function Jr(e,t){let n=t.alpha,i=1-n;return GH.red=e.red*i+t.red*n,GH.green=e.green*i+t.green*n,GH.blue=e.blue*i+t.blue*n,GH.toCssColorString()}function F$(e,t,n){let i=iO[n],o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return bh(o)}function SEt(e,t,n){let i=iO[n],o=iO.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return bh(r)}function wEt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&VH!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),l,u;if(t.type==="touchstart"||t.type==="touchmove"?(l=t.touches[0].clientX,u=t.touches[0].clientY):(l=t.clientX,u=t.clientY),!i&&(l>a.right||l<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),h=l-o-a.left,p=u-r-a.top,g=Math.atan2(p,h)*180/Math.PI+90;g>180&&(g-=360);let m=n.shuttleRingAngle;i||l<f.right&&l>f.left&&u>f.top&&u<f.bottom?(VH=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===VH&&(VH=void 0),n.shuttleRingDragging=!1}function L_(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[Ba(t,"toggled",this.setToggled,this),Ba(t,"tooltip",this.setTooltip,this),Ba(t.command,"canExecute",this.setEnabled,this)]}L_.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();de(this)};L_.prototype.isDestroyed=function(){return!1};L_.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};L_.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};L_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function zS(e,t){if(!c(e))throw new C("container is required.");if(!c(t))throw new C("viewModel is required.");e=Rn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(Qx,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",CCe);let s=document.createElementNS(Qx,"g");this._topG=s,this._realtimeSVG=new L_(SEt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new L_(F$(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new L_(F$(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new L_(F$(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(Qx,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let l=bh({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=l;let u=iO.animation_pathSwooshFX,f=iO.animation_pathPointer,h=bh({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=h,this._shuttleRingPointer=bh({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=bh({tagName:"g",transform:"translate(100,100)"});this._knobOuter=bh({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=bh({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g});this._knobDate=N$(0,-24,""),this._knobTime=N$(0,-7,""),this._knobStatus=N$(0,-41,"");let y=bh({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),b=document.createElementNS(Qx,"g");b.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(b),s.appendChild(p),s.appendChild(a),b.appendChild(l),b.appendChild(h),b.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobDate),p.appendChild(this._knobTime),p.appendChild(this._knobStatus),p.appendChild(y),r.appendChild(s),e.appendChild(r);let x=this;function A(M){wEt(x,M)}this._mouseCallback=A,l.addEventListener("mousedown",A,!0),l.addEventListener("touchstart",A,!0),h.addEventListener("mousedown",A,!0),h.addEventListener("touchstart",A,!0),n.addEventListener("mousemove",A,!0),n.addEventListener("touchmove",A,!0),n.addEventListener("mouseup",A,!0),n.addEventListener("touchend",A,!0),n.addEventListener("touchcancel",A,!0),this._shuttleRingPointer.addEventListener("mousedown",A,!0),this._shuttleRingPointer.addEventListener("touchstart",A,!0),this._knobOuter.addEventListener("mousedown",A,!0),this._knobOuter.addEventListener("touchstart",A,!0);let E=this._knobTime.childNodes[0],S=this._knobDate.childNodes[0],v=this._knobStatus.childNodes[0],P;this._subscriptions=[Ba(t.pauseViewModel,"toggled",function(M){P!==M&&(P=M,P?x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):x._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Ba(t,"shuttleRingAngle",function(M){EEt(x._shuttleRingPointer,x._knobOuter,M)}),Ba(t,"dateLabel",function(M){S.textContent!==M&&(S.textContent=M)}),Ba(t,"timeLabel",function(M){E.textContent!==M&&(E.textContent=M)}),Ba(t,"multiplierLabel",function(M){v.textContent!==M&&(v.textContent=M)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(zS.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});zS.prototype.isDestroyed=function(){return!1};zS.prototype.destroy=function(){c(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0),this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let n=this._subscriptions;for(let i=0,o=n.length;i<o;i++)n[i].dispose();return de(this)};zS.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,l=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${l})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*l),this._lastHeight=e,this._lastWidth=t};zS.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(c(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=A0(this._themeNormal),n=A0(this._themeHover),i=A0(this._themeSelect),o=A0(this._themeDisabled),r=A0(this._themeKnob),s=A0(this._themePointer),a=A0(this._themeSwoosh),l=A0(this._themeSwooshHover),u=bh({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(t,nO)},{tagName:"stop",offset:"12%","stop-color":Jr(t,zH)},{tagName:"stop",offset:"46%","stop-color":Jr(t,L$)},{tagName:"stop",offset:"81%","stop-color":Jr(t,HH)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(n,nO)},{tagName:"stop",offset:"12%","stop-color":Jr(n,zH)},{tagName:"stop",offset:"46%","stop-color":Jr(n,L$)},{tagName:"stop",offset:"81%","stop-color":Jr(n,HH)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(i,nO)},{tagName:"stop",offset:"12%","stop-color":Jr(i,zH)},{tagName:"stop",offset:"46%","stop-color":Jr(i,L$)},{tagName:"stop",offset:"81%","stop-color":Jr(i,HH)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Jr(o,AEt)},{tagName:"stop",offset:"75%","stop-color":Jr(o,CEt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":l.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":l.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":l.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Jr(s,ACe)},{tagName:"stop",offset:"100%","stop-color":Jr(s,ACe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Jr(r,nO)},{tagName:"stop",offset:"60%","stop-color":Jr(r,TCe)},{tagName:"stop",offset:"85%","stop-color":Jr(r,zH)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Jr(r,TCe)},{tagName:"stop",offset:"60%","stop-color":Jr(r,nO)},{tagName:"stop",offset:"85%","stop-color":Jr(r,HH)}]}]});c(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var jH=zS;var vEt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],C0=15,HS=105;function ECe(e,t){return e-t}function B$(e,t){let n=Mo(t,e,ECe);return n<0?~n:n}function DEt(e,t){if(Math.abs(e)<=C0)return e/C0;let n=C0,i=HS,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function PEt(e,t,n){if(n.clockStep===_o.SYSTEM_CLOCK)return C0;if(Math.abs(e)<=1)return e*C0;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=C0,r=HS,s,a=0,l;return e>0?(s=Math.log(i),l=(s-a)/(r-o),(Math.log(e)-a)/l+o):(s=Math.log(-t[0]),l=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/l+o))}function nd(e){if(!c(e))throw new C("clockViewModel is required.");let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=nd.defaultDateFormatter,this._timeFormatter=nd.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Te.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(nd.defaultTicks),this.timeLabel=void 0,Te.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Te.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Te.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===_o.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Te.defineProperty(this,"shuttleRingAngle",{get:function(){return PEt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,HS),-HS);let a=t._allShuttleRingTicks,l=t._clockViewModel;if(l.clockStep=_o.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===HS){l.multiplier=s>0?a[a.length-1]:a[0];return}let u=DEt(s,a);if(t.snapToTicks)u=a[B$(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let h=f.toFixed(0).length-2,p=Math.pow(10,h);u=Math.round(u/p)*p|0}else f>C0?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}l.multiplier=u}}),this._canAnimate=void 0,Te.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===$r.UNBOUNDED)return!0;let l=s.multiplier,u=s.currentTime,f=s.startTime,h=!1;if(a===$r.LOOP_STOP)h=Q.greaterThan(u,f)||u.equals(f)&&l>0;else{let p=s.stopTime;h=Q.greaterThan(u,f)&&Q.lessThan(u,p)||u.equals(f)&&l>0||u.equals(p)&&l<0}return h||(s.shouldAnimate=!1),h}),this._isSystemTimeAvailable=void 0,Te.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===$r.UNBOUNDED)return!0;let l=s.systemTime;return Q.greaterThanOrEquals(l,s.startTime)&&Q.lessThanOrEquals(l,s.stopTime)}),this._isAnimating=void 0,Te.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=wn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Zx(n,{toggled:Te.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=wn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Zx(i,{toggled:Te.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=wn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Zx(o,{toggled:Te.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==_o.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=wn(function(){t._clockViewModel.clockStep=_o.SYSTEM_CLOCK},Te.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Zx(r,{toggled:Te.computed(function(){return e.clockStep===_o.SYSTEM_CLOCK}),tooltip:Te.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=wn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,l=s.multiplier,u=B$(l,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=wn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,l=s.multiplier,u=B$(l,a)+1;u<a.length&&(s.multiplier=a[u])})}nd.defaultDateFormatter=function(e,t){let n=Q.toGregorianDate(e);return`${vEt[n.month-1]} ${n.day} ${n.year}`};nd.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];nd.defaultTimeFormatter=function(e,t){let n=Q.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};nd.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};nd.prototype.setShuttleRingTicks=function(e){if(!c(e))throw new C("positiveTicks is required.");let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(ECe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);Array.prototype.push.apply(s,r),this._allShuttleRingTicks=s};Object.defineProperties(nd.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){if(typeof e!="function")throw new C("dateFormatter must be a function");this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){if(typeof e!="function")throw new C("timeFormatter must be a function");this._timeFormatter=e}}});nd._maxShuttleRingAngle=HS;nd._realtimeShuttleRingAngle=C0;var WH=nd;function SCe(e){e=e??W.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??W.EMPTY_ARRAY,i=e.terrainProviderViewModels??W.EMPTY_ARRAY;if(!c(t))throw new C("globe is required");this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Te.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Te.getObservable(this,"imageryProviderViewModels"),r=Te.pureComputed(function(){let h=o(),p={},g;for(g=0;g<h.length;g++){let b=h[g],x=b.category;c(p[x])?p[x].push(b):p[x]=[b]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let b=m[g];y.push({name:b,providers:p[b]})}return y});this._imageryProviders=r;let s=Te.getObservable(this,"terrainProviderViewModels"),a=Te.pureComputed(function(){let h=s(),p={},g;for(g=0;g<h.length;g++){let b=h[g],x=b.category;c(p[x])?p[x].push(b):p[x]=[b]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let b=m[g];y.push({name:b,providers:p[b]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,Te.defineProperty(this,"buttonTooltip",function(){let h=this.selectedImagery,p=this.selectedTerrain,g=c(h)?h.name:void 0,m=c(p)?p.name:void 0;return c(g)&&c(m)?`${g}
${m}`:c(g)?g:m}),this.buttonImageUrl=void 0,Te.defineProperty(this,"buttonImageUrl",function(){let h=this.selectedImagery;if(c(h))return h.iconUrl}),this.selectedImagery=void 0;let l=Te.observable();this._currentImageryLayers=[],Te.defineProperty(this,"selectedImagery",{get:function(){return l()},set:function(h){if(l()===h){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,m=g.length,y=this._globe.imageryLayers,b=!1;for(p=0;p<m;p++){let x=y.length;for(let A=0;A<x;A++){let E=y.get(A);if(E===g[p]){y.remove(E),b=!0;break}}}if(c(h)){let x=h.creationCommand();if(Array.isArray(x)){let A=x.length;for(this._currentImageryLayers=[],p=A-1;p>=0;p--){let E=mc.fromProviderAsync(x[p]);y.add(E,0),this._currentImageryLayers.push(E)}}else{this._currentImageryLayers=[];let A=mc.fromProviderAsync(x);if(A.name=h.name,b)y.add(A,0);else{let E=y.get(0);c(E)&&y.remove(E),y.add(A,0)}this._currentImageryLayers.push(A)}}l(h),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=Te.observable();Te.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(h){if(u()===h){this.dropDownVisible=!1;return}let p;if(c(h)&&(p=h.creationCommand()),c(p)&&!c(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof b_),this._globe.terrainProvider=p;else if(c(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),b=new LH(p).readyEvent.addEventListener(x=>{g||(this._globe.depthTestAgainstTerrain=!(x instanceof b_),this._globe.terrainProvider=x,b())})}u(h),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=wn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(SCe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var qH=SCe;function YH(e,t){if(!c(e))throw new C("container is required.");e=Rn(e);let n=new qH(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let l=document.createElement("div");l.className="cesium-baseLayerPicker-category",a.appendChild(l);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),l.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),l.appendChild(f);let h=document.createElement("div");h.className="cesium-baseLayerPicker-item",h.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(h);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),h.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),h.appendChild(g);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",r.appendChild(m);let y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(y);let b=document.createElement("div");b.className="cesium-baseLayerPicker-category",y.appendChild(b);let x=document.createElement("div");x.className="cesium-baseLayerPicker-categoryTitle",x.setAttribute("data-bind","text: name"),b.appendChild(x);let A=document.createElement("div");A.className="cesium-baseLayerPicker-choices",A.setAttribute("data-bind","foreach: providers"),b.appendChild(A);let E=document.createElement("div");E.className="cesium-baseLayerPicker-item",E.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),A.appendChild(E);let S=document.createElement("img");S.className="cesium-baseLayerPicker-itemIcon",S.setAttribute("data-bind","attr: { src: iconUrl }"),S.setAttribute("draggable","false"),E.appendChild(S);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),E.appendChild(v),Te.applyBindings(n,i),Te.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(P){i.contains(P.target)||r.contains(P.target)||(n.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(YH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});YH.prototype.isDestroyed=function(){return!1};YH.prototype.destroy=function(){return zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._element),Te.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),de(this)};var XH=YH;function wCe(e){if(!c(e.name))throw new C("options.name is required.");if(!c(e.tooltip))throw new C("options.tooltip is required.");if(!c(e.iconUrl))throw new C("options.iconUrl is required.");if(typeof e.creationFunction!="function")throw new C("options.creationFunction is required.");let t=e.creationFunction;c(t.canExecute)||(t=wn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",Te.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(wCe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var ms=wCe;function IEt(){let e=[],t=devicePixelRatio>=2;return e.push(new ms({name:"Bing Maps Aerial",iconUrl:tn("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ky({style:Xy.AERIAL})}})),e.push(new ms({name:"Bing Maps Aerial with Labels",iconUrl:tn("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ky({style:Xy.AERIAL_WITH_LABELS})}})),e.push(new ms({name:"Bing Maps Roads",iconUrl:tn("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ky({style:Xy.ROAD})}})),e.push(new ms({name:"ArcGIS World Imagery",iconUrl:tn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at
https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return qy.fromBasemapType(km.SATELLITE,{enablePickFeatures:!1})}})),e.push(new ms({name:"ArcGIS World Hillshade",iconUrl:tn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at
https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return qy.fromBasemapType(km.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new ms({name:"Esri World Ocean",iconUrl:tn("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at
https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return qy.fromBasemapType(km.OCEANS,{enablePickFeatures:!1})}})),e.push(new ms({name:"Open\xADStreet\xADMap",iconUrl:tn("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.
http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new T0({url:"https://tile.openstreetmap.org/"})}})),e.push(new ms({name:"Stadia x Stamen Watercolor",iconUrl:tn("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.
https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new T0({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
&copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
&copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ms({name:"Stadia x Stamen Toner",iconUrl:tn("Widgets/Images/ImageryProviders/stamenToner.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and the most popular of the excellent styles from Stamen Design, these high-contrast B+W (black and white) maps are the perfect backdrop for your colorful and eye-catching overlays.
https://docs.stadiamaps.com/map-styles/stamen-toner/`,category:"Other",creationFunction:function(){return new T0({url:"https://tiles.stadiamaps.com/tiles/stamen_toner/",retinaTiles:t,credit:`&copy; <a href="https://stamen.com/" target="_blank">Stamen Design</a>
&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
&copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
&copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ms({name:"Stadia Alidade Smooth",iconUrl:tn("Widgets/Images/ImageryProviders/stadiaAlidadeSmooth.png"),tooltip:`Stadia's custom Alidade Smooth style is designed for maps that use a lot of markers or overlays. It features a muted color scheme and fewer points of interest to allow your added data to shine.
https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creationFunction:function(){return new T0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
&copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
&copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ms({name:"Stadia Alidade Smooth Dark",iconUrl:tn("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine.
https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new T0({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`&copy; <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a>
&copy; <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a>
&copy; <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new ms({name:"Sentinel-2",iconUrl:tn("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return Yy.fromAssetId(3954)}})),e.push(new ms({name:"Blue Marble",iconUrl:tn("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Yy.fromAssetId(3845)}})),e.push(new ms({name:"Earth at night",iconUrl:tn("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return Yy.fromAssetId(3812)}})),e.push(new ms({name:"Natural Earth\xA0II",iconUrl:tn("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast.
http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return _x.fromUrl(tn("Assets/Textures/NaturalEarthII"))}})),e}var KH=IEt;function OEt(){let e=[];return e.push(new ms({name:"WGS84 Ellipsoid",iconUrl:tn("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new b_({ellipsoid:ie.WGS84})}})),e.push(new ms({name:"Cesium World Terrain",iconUrl:tn("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return ES({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var $H=OEt;function REt(e){return function(t){let n=e._scene.pick(t.position);c(n)&&n.primitive instanceof As&&(e.tileset=n.primitive),e.pickActive=!1}}function DCe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);c(i)&&i.primitive instanceof As&&(e.tileset=i.primitive)},Cn.MOUSE_MOVE):(e._eventHandler.removeInputAction(Cn.MOUSE_MOVE),e.picking=e.picking)}var MEt={maximumFractionDigits:3};function oO(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,MEt):Math.round(t).toLocaleString()}function rO(e,t){if(!c(e))return"";let n=t?e._statisticsPerPass[Uo.PICK]:e._statisticsPerPass[Uo.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${oO(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${oO(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${oO(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function PCe(){let e=Di.statistics;return`
<ul class="cesium-cesiumInspector-statistics">
<li><strong>Geometry Memory (MB): </strong>${oO(e.geometryByteLength)}</li>
<li><strong>Texture Memory (MB): </strong>${oO(e.texturesByteLength)}</li>
</ul>
`}var LEt=[{text:"Highlight",value:nu.HIGHLIGHT},{text:"Replace",value:nu.REPLACE},{text:"Mix",value:nu.MIX}],vCe=new G(1,1,0,.4),NEt=new G,ZH=new G;function xa(e,t){T.typeOf.object("scene",e),T.typeOf.object("performanceContainer",t);let n=this,i=e.canvas;this._eventHandler=new $f(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new t0({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Te.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Te.observable({}),this.properties=[],Te.defineProperty(this,"properties",function(){let U=[],q=n._properties();for(let X in q)q.hasOwnProperty(X)&&U.push(X);return U});let o=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(U){o(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceError=U)}}),this.dynamicScreenSpaceError=!1;let r=Te.observable();Te.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(U){r(U),c(n._tileset)&&(n._tileset.colorBlendMode=U,n._scene.requestRender())}}),this.colorBlendMode=nu.HIGHLIGHT;let s=Te.observable(),a=Te.observable();Te.defineProperty(this,"picking",{get:function(){return a()},set:function(U){a(U),U?n._eventHandler.setInputAction(function(q){let X=e.pick(q.endPosition);if(X instanceof ta?(n.feature=X,n.tile=X.content.tile):c(X)&&c(X.content)?(n.feature=void 0,n.tile=X.content.tile):(n.feature=void 0,n.tile=void 0),!!c(n._tileset)){if(s&&c(X)&&c(X.content)){let te;e.pickPositionSupported&&(te=e.pickPosition(q.endPosition),c(te)&&(n._tileset.debugPickPosition=te)),n._tileset.debugPickedTile=X.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},Cn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(Cn.MOUSE_MOVE))}}),this.picking=!0;let l=Te.observable();Te.defineProperty(this,"colorize",{get:function(){return l()},set:function(U){l(U),c(n._tileset)&&(n._tileset.debugColorizeTiles=U,n._scene.requestRender())}}),this.colorize=!1;let u=Te.observable();Te.defineProperty(this,"wireframe",{get:function(){return u()},set:function(U){u(U),c(n._tileset)&&(n._tileset.debugWireframe=U,n._scene.requestRender())}}),this.wireframe=!1;let f=Te.observable();Te.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(U){f(U),c(n._tileset)&&(n._tileset.debugShowBoundingVolume=U,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let h=Te.observable();Te.defineProperty(this,"showContentBoundingVolumes",{get:function(){return h()},set:function(U){h(U),c(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=U,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Te.observable();Te.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(U){p(U),c(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=U,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Te.observable();Te.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(U){g(U),c(n._tileset)&&(n._tileset.debugFreezeFrame=U,n._scene.debugShowFrustumPlanes=U,n._scene.requestRender())}}),this.freezeFrame=!1,Te.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(U){s(U),c(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=U,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=Te.observable();Te.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(U){m(U),c(n._tileset)&&(n._tileset.debugShowGeometricError=U,n._scene.requestRender())}}),this.showGeometricError=!1;let y=Te.observable();Te.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(U){y(U),c(n._tileset)&&(n._tileset.debugShowRenderingStatistics=U,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let b=Te.observable();Te.defineProperty(this,"showMemoryUsage",{get:function(){return b()},set:function(U){b(U),c(n._tileset)&&(n._tileset.debugShowMemoryUsage=U,n._scene.requestRender())}}),this.showMemoryUsage=!1;let x=Te.observable();Te.defineProperty(this,"showUrl",{get:function(){return x()},set:function(U){x(U),c(n._tileset)&&(n._tileset.debugShowUrl=U,n._scene.requestRender())}}),this.showUrl=!1;let A=Te.observable();Te.defineProperty(this,"maximumScreenSpaceError",{get:function(){return A()},set:function(U){U=Number(U),isNaN(U)||(A(U),c(n._tileset)&&(n._tileset.maximumScreenSpaceError=U))}}),this.maximumScreenSpaceError=16;let E=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return E()},set:function(U){U=Number(U),isNaN(U)||(E(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=U))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Te.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(E(),1/6)},set:function(U){let q=Math.pow(U,6);E(q),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=q)}});let S=Te.observable();Te.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return S()},set:function(U){U=Number(U),isNaN(U)||(S(U),c(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=U))}}),this.dynamicScreenSpaceErrorFactor=24;let v=REt(this),P=Te.observable();Te.defineProperty(this,"pickActive",{get:function(){return P()},set:function(U){P(U),U?n._eventHandler.setInputAction(v,Cn.LEFT_CLICK):n._eventHandler.removeInputAction(Cn.LEFT_CLICK)}});let M=Te.observable();Te.defineProperty(this,"pointCloudShading",{get:function(){return M()},set:function(U){M(U),c(n._tileset)&&(n._tileset.pointCloudShading.attenuation=U)}}),this.pointCloudShading=!1;let R=Te.observable();Te.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(U){U=Number(U),isNaN(U)||(R(U),c(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=U))}}),this.geometricErrorScale=1;let L=Te.observable();Te.defineProperty(this,"maximumAttenuation",{get:function(){return L()},set:function(U){U=Number(U),isNaN(U)||(L(U),c(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=U===0?void 0:U))}}),this.maximumAttenuation=0;let B=Te.observable();Te.defineProperty(this,"baseResolution",{get:function(){return B()},set:function(U){U=Number(U),isNaN(U)||(B(U),c(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=U===0?void 0:U))}}),this.baseResolution=0;let _=Te.observable();Te.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(U){_(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=U)}}),this.eyeDomeLighting=!1;let w=Te.observable();Te.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return w()},set:function(U){U=Number(U),isNaN(U)||(w(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=U))}}),this.eyeDomeLightingStrength=1;let D=Te.observable();Te.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return D()},set:function(U){U=Number(U),isNaN(U)||(D(U),c(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=U))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let I=Te.observable();Te.defineProperty(this,"skipLevelOfDetail",{get:function(){return I()},set:function(U){I(U),c(n._tileset)&&(n._tileset.skipLevelOfDetail=U)}}),this.skipLevelOfDetail=!0;let N=Te.observable();Te.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return N()},set:function(U){U=Number(U),isNaN(U)||(N(U),c(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=U))}}),this.skipScreenSpaceErrorFactor=16;let k=Te.observable();Te.defineProperty(this,"baseScreenSpaceError",{get:function(){return k()},set:function(U){U=Number(U),isNaN(U)||(k(U),c(n._tileset)&&(n._tileset.baseScreenSpaceError=U))}}),this.baseScreenSpaceError=1024;let H=Te.observable();Te.defineProperty(this,"skipLevels",{get:function(){return H()},set:function(U){U=Number(U),isNaN(U)||(H(U),c(n._tileset)&&(n._tileset.skipLevels=U))}}),this.skipLevels=1;let V=Te.observable();Te.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return V()},set:function(U){V(U),c(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=U)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let j=Te.observable();Te.defineProperty(this,"loadSiblings",{get:function(){return j()},set:function(U){j(U),c(n._tileset)&&(n._tileset.loadSiblings=U)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),c(this._tileset)||DCe(this,!0)}Object.defineProperties(xa.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return LEt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,c(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let o=0;o<n;++o){let r=t[o];this[r]=this[r]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=rO(e,!1),this._pickStatisticsText=rO(e,!0),this._resourceCacheStatisticsText=PCe(),DCe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;c(t)&&!t.content.isDestroyed()&&(!this.colorize&&c(this._style)?t.color=c(this._style.color)?this._style.color.evaluateColor(t,NEt):G.WHITE:t.color=ZH,this._scene.requestRender()),c(e)&&(G.clone(e.color,ZH),e.color=vCe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;c(t)&&!t.isDestroyed()&&!k$(t.content)&&(t.color=ZH,this._scene.requestRender()),c(e)&&!k$(e.content)&&(G.clone(e.color,ZH),e.color=vCe,this._scene.requestRender()),this._tile=e}}});function k$(e){if(!c(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(c(t)){let n=t.length;for(let i=0;i<n;++i)if(!k$(t[i]))return!1;return!0}return!1}xa.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};xa.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};xa.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};xa.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};xa.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};xa.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};xa.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};xa.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};xa.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};xa.prototype.trimTilesCache=function(){c(this._tileset)&&this._tileset.trimLoadedTiles()};xa.prototype.compileStyle=function(){let e=this._tileset;if(!(!c(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new RS(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};xa.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(`
`),l=a.length,u;if(t.shiftKey)for(u=0;u<l;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<l;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(`
`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};xa.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),c(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=rO(e,!1),this._pickStatisticsText=rO(e,!0),this._resourceCacheStatisticsText=PCe())};xa.prototype.isDestroyed=function(){return!1};xa.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Te.getObservable(e,t).dispose()}),de(this)};xa.getStatistics=rO;var QH=xa;function JH(e,t){T.defined("container",e),T.typeOf.object("scene",t),e=Rn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new QH(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Vu.createSection,l=Vu.createCheckbox,u=Vu.createRangeInput,f=Vu.createButton,h=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),b=a(s,"Style","styleVisible","toggleStyle"),x=a(s,"Optimization","optimizationVisible","toggleOptimization"),A=document.createElement("div");A.className="field-group";let E=document.createElement("label");E.className="field-label",E.appendChild(document.createTextNode("Properties: "));let S=document.createElement("div");S.setAttribute("data-bind","text: properties"),A.appendChild(E),A.appendChild(S),h.appendChild(A),h.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),h.appendChild(f("Trim Tiles Cache","trimTilesCache")),h.appendChild(l("Enable Picking","picking")),p.appendChild(l("Colorize","colorize"));let v=p.appendChild(l("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),P=document.createElement("p");P.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),P.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),P.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(P),p.appendChild(l("Bounding Volumes","showBoundingVolumes")),p.appendChild(l("Content Volumes","showContentBoundingVolumes")),p.appendChild(l("Request Volumes","showRequestVolumes")),p.appendChild(l("Point Cloud Shading","pointCloudShading"));let M=document.createElement("div");M.setAttribute("data-bind","visible: pointCloudShading"),M.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),M.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),M.appendChild(u("Base Resolution","baseResolution",0,1,.01)),M.appendChild(l("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(M);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),M.appendChild(R),g.appendChild(l("Freeze Frame","freezeFrame")),g.appendChild(l("Dynamic Screen Space Error","dynamicScreenSpaceError"));let L=document.createElement("div");L.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(L);let B=document.createElement("div");B.setAttribute("data-bind","visible: dynamicScreenSpaceError"),B.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),B.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(B),m.appendChild(l("Performance","performance")),m.appendChild(i),m.appendChild(l("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(_),m.appendChild(l("Pick Statistics","showPickStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(w),m.appendChild(l("Resource Cache Statistics","showResourceCacheStatistics"));let D=document.createElement("div");D.className="cesium-3dTilesInspector-statistics",D.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(D);let I=document.createElement("div");b.appendChild(I),I.appendChild(document.createTextNode("Color Blend Mode: "));let N=document.createElement("select");N.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),I.appendChild(N);let k=document.createElement("textarea");k.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),I.className="cesium-cesiumInspector-styleEditor",I.appendChild(k);let H=f("Compile (Ctrl+Enter)","compileStyle");I.appendChild(H);let V=document.createElement("div");V.className="cesium-cesiumInspector-error",V.setAttribute("data-bind","text: editorError"),I.appendChild(V),y.appendChild(l("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(l("Geometric Error","showGeometricError")),y.appendChild(l("Rendering Statistics","showRenderingStatistics")),y.appendChild(l("Memory Usage (MB)","showMemoryUsage")),y.appendChild(l("Url","showUrl")),x.appendChild(l("Skip Tile LODs","skipLevelOfDetail"));let j=document.createElement("div");j.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),x.appendChild(j);let U=document.createElement("div");U.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),x.appendChild(U);let q=document.createElement("div");q.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),x.appendChild(q),x.appendChild(l("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),x.appendChild(l("Load siblings of visible tiles","loadSiblings")),Te.applyBindings(o,n)}Object.defineProperties(JH.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});JH.prototype.isDestroyed=function(){return!1};JH.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};var eG=JH;function FEt(e){let t;if(c(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let l=Math.pow(2,a);o>=l&&(s.push(a+1),o-=l)}r=s.reverse().join(" and ")}t+=`<br>&nbsp;&nbsp;&nbsp;&nbsp;${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function U$(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var BEt=new _n,kEt=new d;function sO(e,t){if(!c(e))throw new C("scene is required");if(!c(t))throw new C("performanceContainer is required");let n=this,i=e.canvas,o=new $f(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Te.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=wn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=wn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=wn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=wn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Te.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=Te.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=Te.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new t0({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=wn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Te.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=wn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new gH({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else c(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Te.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=wn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return c(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:c(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Te.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Te.getObservable(this,"wireframe").subscribe(function(u){r._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=Te.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=wn(function(){let u=n.depthFrustum+1;return n.depthFrustum=U$(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=wn(function(){let u=n.depthFrustum-1;return n.depthFrustum=U$(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Te.getObservable(this,"suspendUpdates").subscribe(function(u){r._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=wn(function(){return n.tileCoordinates&&!c(s)?s=e.imageryLayers.addImageryProvider(new NH({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&c(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Te.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Te.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=wn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=wn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],c(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Te.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});c(f)&&(n.primitive=c(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=wn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Te.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?o.setInputAction(a,Cn.LEFT_CLICK):o.removeInputAction(Cn.LEFT_CLICK)});function l(u){let f,h=r.ellipsoid,p=n._scene.camera.getPickRay(u.position,BEt),g=r.pick(p,n._scene,kEt);if(c(g)){let m=h.cartesianToCartographic(g),y=r._surface.tileProvider._tilesToRenderByTextureCount;for(let b=0;!f&&b<y.length;++b){let x=y[b];if(c(x))for(let A=0;!f&&A<x.length;++A){let E=x[A];ce.contains(E.rectangle,m)&&(f=E)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=wn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Te.getObservable(this,"pickTileActive").subscribe(function(u){u?o.setInputAction(l,Cn.LEFT_CLICK):o.removeInputAction(Cn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(sO.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return wn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return wn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return wn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return wn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return wn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,c(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,c(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(c(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;c(n)&&c(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});sO.prototype._update=function(){this.frustums&&(this.frustumStatisticText=FEt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=U$(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};sO.prototype.isDestroyed=function(){return!1};sO.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),de(this)};var tG=sO;function nG(e,t){if(!c(e))throw new C("container is required.");if(!c(t))throw new C("scene is required.");e=Rn(e);let n=document.createElement("div"),i=new tG(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=Vu.createSection,l=Vu.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=l("Show Frustums","frustums"),h=document.createElement("div");h.className="cesium-cesiumInspector-frustumStatistics",h.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(h),u.appendChild(f),u.appendChild(l("Show Frustum Planes","frustumPlanes")),u.appendChild(l("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let m=document.createElement("span");m.setAttribute("data-bind",'html: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Frustum:"'),g.appendChild(m);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(y);let b=document.createElement("input");b.type="button",b.value="-",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(b);let x=document.createElement("input");x.type="button",x.value="+",x.className="cesium-cesiumInspector-pickButton",x.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(x);let A=a(s,"Primitives","primitivesVisible","togglePrimitives"),E=document.createElement("div");E.className="cesium-cesiumInspector-pickSection",A.appendChild(E);let S=document.createElement("input");S.type="button",S.value="Pick a primitive",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(S),E.appendChild(v),E.appendChild(l("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),E.appendChild(l("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=l("Show only selected","filterPrimitive","hasPickedPrimitive"),E.appendChild(this._primitiveOnly);let P=a(s,"Terrain","terrainVisible","toggleTerrain"),M=document.createElement("div");M.className="cesium-cesiumInspector-pickSection",P.appendChild(M);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",M.appendChild(v);let L=document.createElement("div");M.appendChild(L);let B=document.createElement("input");B.type="button",B.value="Parent",B.className="cesium-cesiumInspector-pickButton",B.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let w=document.createElement("input");w.type="button",w.value="NE",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectNE");let D=document.createElement("input");D.type="button",D.value="SW",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: selectSW");let I=document.createElement("input");I.type="button",I.value="SE",I.className="cesium-cesiumInspector-pickButton",I.setAttribute("data-bind","click: selectSE");let N=document.createElement("div");N.className="cesium-cesiumInspector-tileText",L.className="cesium-cesiumInspector-frustumStatistics",L.appendChild(N),L.setAttribute("data-bind","visible: hasPickedTile"),N.setAttribute("data-bind","html: tileText");let k=document.createElement("div");k.className="cesium-cesiumInspector-relativeText",k.textContent="Select relative:",L.appendChild(k);let H=document.createElement("table"),V=document.createElement("tr"),j=document.createElement("tr"),U=document.createElement("td");U.appendChild(B);let q=document.createElement("td");q.appendChild(_);let X=document.createElement("td");X.appendChild(w),V.appendChild(U),V.appendChild(q),V.appendChild(X);let te=document.createElement("td"),K=document.createElement("td");K.appendChild(D);let Z=document.createElement("td");Z.appendChild(I),j.appendChild(te),j.appendChild(K),j.appendChild(Z),H.appendChild(V),H.appendChild(j),L.appendChild(H),M.appendChild(l("Show bounding volume","tileBoundingSphere","hasPickedTile")),M.appendChild(l("Show only selected","filterTile","hasPickedTile")),P.appendChild(l("Wireframe","wireframe")),P.appendChild(l("Suspend LOD update","suspendUpdates")),P.appendChild(l("Show tile coordinates","tileCoordinates")),Te.applyBindings(i,this._element)}Object.defineProperties(nG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});nG.prototype.isDestroyed=function(){return!1};nG.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};var iG=nG;function oG(e,t){c(t)||(t=document.body),t=Rn(t);let n=this,i=Te.observable(Ir.fullscreen),o=Te.observable(Ir.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Te.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Te.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&Ir.enabled)}}),this.tooltip=void 0,Te.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=wn(function(){Ir.fullscreen?Ir.exitFullscreen():Ir.requestFullscreen(n._fullscreenElement)},Te.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Rn(e)??r.body,this._callback=function(){i(Ir.fullscreen)},r.addEventListener(Ir.changeEventName,this._callback)}Object.defineProperties(oG.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){if(!(e instanceof Element))throw new C("value must be a valid Element.");this._fullscreenElement=e}},command:{get:function(){return this._command}}});oG.prototype.isDestroyed=function(){return!1};oG.prototype.destroy=function(){document.removeEventListener(Ir.changeEventName,this._callback),de(this)};var rG=oG;var UEt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",VEt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function sG(e,t){if(!c(e))throw new C("container is required.");e=Rn(e);let n=new rG(t,e);n._exitFullScreenPath=VEt,n._enterFullScreenPath=UEt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Te.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(sG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});sG.prototype.isDestroyed=function(){return!1};sG.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var aG=sG;function ICe(e,t){if(!c(e))throw new C("scene is required.");this._scene=e,this._duration=t;let n=this;this._command=wn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Te.track(this,["tooltip"])}Object.defineProperties(ICe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){if(c(e)&&e<0)throw new C("value must be positive.");this._duration=e}}});var cG=ICe;function lG(e,t,n){if(!c(e))throw new C("container is required.");e=Rn(e);let i=new cG(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),Te.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(lG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});lG.prototype.isDestroyed=function(){return!1};lG.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var uG=lG;var OCe=1e3;function id(e){if(!c(e)||!c(e.scene))throw new C("options.scene is required.");c(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new vS({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new pe,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=MCe,this._handleArrowUp=RCe;let t=this;this._suggestionsVisible=Te.pureComputed(function(){let o=Te.getObservable(t,"_suggestions")().length>0,r=Te.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=wn(function(i){if(i=i??Gx.SEARCH,t._focusTextbox=!1,c(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)qEt(t);else return jEt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?RCe(t):r?MCe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;FCe(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=e.autocomplete??!0,this.destinationFound=e.destinationFound??id.flyToDestination,this._focusTextbox=!1,Te.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Te.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){id._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Te.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Te.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){if(typeof i!="string")throw new C("value must be a valid string.");this._searchText=i}}),this.flightDuration=void 0,Te.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){if(c(i)&&i<0)throw new C("value must be positive.");this._flightDuration=i}})}Object.defineProperties(id.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});id.prototype.destroy=function(){this._suggestionSubscription.dispose()};function RCe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],id._adjustSuggestionsScroll(e,n)}function MCe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],id._adjustSuggestionsScroll(e,i)}function zEt(e,t){let n=c(t)?t.availability:void 0;return c(n)?vE(t,[e]).then(function(i){return e=i[0],e.height+=OCe,e}):(e.height+=OCe,Promise.resolve(e))}function HEt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof ce?O.equalsEpsilon(t.south,t.north,O.EPSILON7)&&O.equalsEpsilon(t.east,t.west,O.EPSILON7)?t=ce.center(t):a=DE(t,n):t=i.cartesianToCartographic(t),c(a)||(a=zEt(t,r)),a.then(function(l){s=i.cartographicToCartesian(l)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:F.IDENTITY})})}async function GEt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function jEt(e,t,n){let i=e._searchText;if(NCe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await GEt(t[o],i,n),c(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,z$(e);let s=r.value;if(r.state==="fulfilled"&&c(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=LCe(e,BI.getCreditsFromResult(s[0]));c(a)||V$(e,t[o].credit);return}e._searchText=`${i} (not found)`}function V$(e,t){c(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function LCe(e,t){return c(t)&&t.forEach(n=>V$(e,n)),t}function z$(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function WEt(e,t){let n=Rn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function qEt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function NCe(e){return/^\s*$/.test(e)}function FCe(e){Te.getObservable(e,"_suggestions").removeAll()}async function YEt(e){if(!e.autoComplete)return;let t=e._searchText;if(FCe(e),z$(e),!NCe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Gx.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=BI.getCreditsFromResult(r);o=o&&!c(s),LCe(e,s)}),o&&V$(e,n.credit)}if(e._suggestions.length>=5)return}}id.flyToDestination=HEt;id._updateSearchSuggestions=YEt;id._adjustSuggestionsScroll=WEt;id.prototype.isDestroyed=function(){return!1};id.prototype.destroy=function(){return z$(this),de(this)};var fG=id;var XEt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",KEt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function dG(e){if(!c(e)||!c(e.container))throw new C("options.container is required.");if(!c(e.scene))throw new C("options.scene is required.");let t=Rn(e.container),n=new fG(e);n._startSearchPath=XEt,n._stopSearchPath=KEt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let l=document.createElement("li");a.appendChild(l),l.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Te.applyBindings(n,i),Te.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},zt.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(dG.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});dG.prototype.isDestroyed=function(){return!1};dG.prototype.destroy=function(){let e=this._container;return zt.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Te.cleanNode(this._form),Te.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),de(this)};var hG=dG;function $Et(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function kCe(e,t){Te.track(e);for(let n=0;n<e.sublayers.length;n++)kCe(e.sublayers[n],t)}function mG(e){return e.modelName==="FullModel"}function UCe(e){return e.modelName==="Overview"}function VCe(e){return UCe(e)||mG(e)}function BCe(e,t){if(VCe(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:Te.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function ZEt(e,t){if(VCe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");mG(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function QEt(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let o=e.getAttributeValues(n[i]);for(let r=0;r<o.length;r++)t.push(o[r])}t.sort((i,o)=>i-o),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function JEt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Te.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Te.observable(!0),index:-1}],currentLayer:Te.observable(),expandClickHandler:$Et,setOptionDisable:function(i,o){Te.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){ZEt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){kCe(n[i],this.viewModel);let o=BCe(n[i],this.viewModel);c(o)&&(UCe(o)||!c(this.viewModel.defaultLayer)&&mG(o))&&(this.viewModel.defaultLayer=o)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=BCe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=mG(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return QEt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var pG=JEt;function eSt(e,t){let n=document.getElementById(e);T.defined("container",n),T.defined("i3sProvider",t);let i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=`
<h3>Building explorer</h3>
<select
data-bind="options: topLayers, optionsText: 'name', optionsAfterRender: setOptionDisable, value: currentLayer"
></select>
<div id="bsl-wrapper">
<h3>Select Level</h3>
<select data-bind="options: levels, value: currentLevel"></select>
<h3>Disciplines & Categories</h3>
<ul class="layersList" data-bind="foreach: sublayers">
<ul class="layersList" data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
<li>
<div class="li-wrapper">
<span
class="expandItem"
data-bind="click: $root.expandClickHandler"
>+</span
>
<input
type="checkbox"
data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
/>
<label data-bind="attr: { for: name}">
<span data-bind="text: name"></span>
</label>
</div>
<ul class="nested" data-bind="attr: { id: name + '-expander'}">
<li data-bind="foreach: sublayers.sort(function (l, r) { return l.name.localeCompare(r.name) })">
<div class="li-wrapper">
<input
type="checkbox"
data-bind="checked: visibility, valueUpdate: 'input', attr: { id: name}"
/>
<label data-bind="attr: { for: name}">
<span data-bind="text: name"></span>
</label>
</div>
</li>
</ul>
</li>
</ul>
</ul>
</div>`,n.appendChild(i);let o=new pG(t);Te.track(o),Te.applyBindings(o,n),c(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var zCe=eSt;var tSt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",nSt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function H$(){this._cameraClicked=new pe,this._closeClicked=new pe,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Te.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Te.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?nSt:tSt}}),Te.defineProperty(this,"_bodyless",{get:function(){return!c(this.description)||this.description.length===0}})}H$.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(H$.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var _G=H$;function gG(e){T.defined("container",e),e=Rn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-infoBox-camera",i.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-infoBox-close",o.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),o.innerHTML="&times;",t.appendChild(o);let r=document.createElement("iframe");r.className="cesium-infoBox-iframe",r.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),r.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),r.setAttribute("allowfullscreen",!0),t.appendChild(r);let s=new _G;Te.applyBindings(s,t),this._container=e,this._element=t,this._frame=r,this._viewModel=s,this._descriptionSubscription=void 0;let a=this;r.addEventListener("load",function(){let l=r.contentDocument,u=l.createElement("link");u.href=tn("Widgets/InfoBox/InfoBoxDescription.css"),u.rel="stylesheet",u.type="text/css";let f=l.createElement("div");f.className="cesium-infoBox-description",l.head.appendChild(u),l.body.appendChild(f),a._descriptionSubscription=Ba(s,"description",function(h){r.style.height="5px",f.innerHTML=h;let p=null,g=f.firstElementChild;if(g!==null&&f.childNodes.length===1){let y=window.getComputedStyle(g);if(y!==null){let b=y["background-color"],x=G.fromCssColorString(b);c(x)&&x.alpha!==0&&(p=y["background-color"])}}t.style["background-color"]=p;let m=f.getBoundingClientRect().height;r.style.height=`${m}px`})}),r.setAttribute("src","about:blank")}Object.defineProperties(gG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});gG.prototype.isDestroyed=function(){return!1};gG.prototype.destroy=function(){let e=this._container;return Te.cleanNode(this._element),e.removeChild(this._element),c(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),de(this)};var yG=gG;function bG(e){if(!c(e))throw new C("scene is required.");this._scene=e,this._orthographic=e.camera.frustum instanceof on,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Te.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Te.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=wn(function(){t.sceneMode===oe.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Ar,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===oe.SCENE2D||t._scene.camera.frustum instanceof on}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=c(e.camera._currentFlight)}),this._switchToPerspective=wn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=wn(function(){t.sceneMode!==oe.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=oe}Object.defineProperties(bG.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});bG.prototype.isDestroyed=function(){return!1};bG.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var xG=bG;var iSt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",oSt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function TG(e,t){if(!c(e))throw new C("container is required.");if(!c(t))throw new C("scene is required.");e=Rn(e);let n=new xG(t);n._perspectivePath=iSt,n._orthographicPath=oSt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Te.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(TG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});TG.prototype.isDestroyed=function(){return!1};TG.prototype.destroy=function(){return this._viewModel.destroy(),zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),de(this)};var AG=TG;function G$(e){if(!c(e)||!c(e.scene))throw new C("options.scene is required.");this._scene=e.scene,this.lowFrameRateMessage=e.lowFrameRateMessage??"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.",this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Te.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=wn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=xH.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(G$.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});G$.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),de(this)};var CG=G$;function EG(e){if(!c(e)||!c(e.container))throw new C("options.container is required.");if(!c(e.scene))throw new C("options.scene is required.");let t=Rn(e.container),n=new CG(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="&times;",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),Te.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(EG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});EG.prototype.isDestroyed=function(){return!1};EG.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var SG=EG;function HCe(){this.showInstructions=!1;let e=this;this._command=wn(function(){e.showInstructions=!e.showInstructions}),this._showClick=wn(function(){e._touch=!1}),this._showTouch=wn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Te.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(HCe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var wG=HCe;function vG(e){if(!c(e)||!c(e.container))throw new C("options.container is required.");let t=Rn(e.container),n=new wG,i=e.instructionsInitiallyVisible??!1;n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let l=document.createElement("img");l.src=tn("Widgets/Images/NavigationHelp/Mouse.svg"),l.className="cesium-navigation-button-icon",l.style.width="25px",l.style.height="25px",a.appendChild(l),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=tn("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let h=document.createElement("div");h.className="cesium-click-navigation-help cesium-navigation-help-instructions",h.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),h.innerHTML=` <table> <tr> <td><img src="${tn("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${tn("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${tn("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(h);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${tn("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${tn("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${tn("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${tn("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Te.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(g){o.contains(g.target)||(n.showInstructions=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(vG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});vG.prototype.isDestroyed=function(){return!1};vG.prototype.destroy=function(){return zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),de(this)};var DG=vG;var rSt=new z,PG="-1000px";function aO(e,t,n){if(!c(e))throw new C("scene is required.");if(!c(t))throw new C("selectionIndicatorElement is required.");if(!c(n))throw new C("container is required.");this._scene=e,this._screenPositionX=PG,this._screenPositionY=PG,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Te.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Te.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&c(this.position)}}),Te.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return Hi.worldToWindowCoordinates(e,i,o)}}aO.prototype.update=function(){if(this.showSelection&&c(this.position)){let e=this.computeScreenSpacePosition(this.position,rSt);if(!c(e))this._screenPositionX=PG,this._screenPositionY=PG;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};aO.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Qr.EXPONENTIAL_OUT})};aO.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Qr.EXPONENTIAL_OUT})};Object.defineProperties(aO.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var IG=aO;function OG(e,t){if(!c(e))throw new C("container is required.");e=Rn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let l=new IG(t,this._element,this._container);this._viewModel=l,Te.applyBindings(this._viewModel,this._element)}Object.defineProperties(OG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});OG.prototype.isDestroyed=function(){return!1};OG.prototype.destroy=function(){let e=this._container;return Te.cleanNode(this._element),e.removeChild(this._element),de(this)};var RG=OG;function MG(e,t){if(!c(e))throw new C("scene is required.");this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Ar,this._eventHelper.add(e.morphStart,i),this._duration=t??2,this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Te.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Te.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===oe.SCENE2D?n.tooltip2D:o===oe.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=wn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=wn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=wn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=wn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=oe}Object.defineProperties(MG.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){if(e<0)throw new C("duration value must be positive.");this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});MG.prototype.isDestroyed=function(){return!1};MG.prototype.destroy=function(){this._eventHelper.removeAll(),de(this)};var LG=MG;var sSt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",aSt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",cSt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function NG(e,t,n){if(!c(e))throw new C("container is required.");if(!c(t))throw new C("scene is required.");e=Rn(e);let i=new LG(t,n);i._globePath=sSt,i._flatMapPath=aSt,i._columbusViewPath=cSt;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let l=document.createElement("button");l.type="button",l.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",l.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(l),Te.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(u){o.contains(u.target)||(i.dropDownVisible=!1)},zt.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(NG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});NG.prototype.isDestroyed=function(){return!1};NG.prototype.destroy=function(){return this._viewModel.destroy(),zt.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Te.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),de(this)};var FG=NG;function Jx(e,t,n){this._color=e,this._height=t,this._base=n??0}Jx.prototype.getHeight=function(){return this._height};Jx.prototype.getBase=function(){return this._base};Jx.prototype.getStartTime=function(){return this._start};Jx.prototype.getStopTime=function(){return this._stop};Jx.prototype.setRange=function(e,t){this._start=e,this._stop=t};Jx.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=Q.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=Q.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var BG=Jx;function GCe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new G(.5,.5,.5,1),this.backgroundColor=i||new G(0,0,0,0)}GCe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=Q.addSeconds(t.startJulian,t.duration,new Q);if(Q.lessThan(n,o)&&Q.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(Q.lessThanOrEquals(n,r)&&Q.greaterThanOrEquals(i,o)){let s,a,l;for(s=0;s<t.timeBarWidth;++s){let u=Q.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new Q);!c(a)&&Q.greaterThanOrEquals(u,n)?a=s:!c(l)&&Q.greaterThanOrEquals(u,i)&&(l=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),c(a)&&(c(l)||(l=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(l-a,1),this.height))}};var kG=GCe;var j$=1e12,od={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},nl={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},E0=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],lSt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function il(e,t){if(!c(e))throw new C("container is required.");if(!c(t))throw new C("clock is required.");e=Rn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=od.none,this._touchMode=nl.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=uSt(this),this._onMouseUp=fSt(this),this._onMouseMove=dSt(this),this._onMouseWheel=hSt(this),this._onTouchStart=mSt(this),this._onTouchMove=_St(this),this._onTouchEnd=pSt(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}il.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};il.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};il.prototype.isDestroyed=function(){return!1};il.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),de(this)};il.prototype.addHighlightRange=function(e,t,n){let i=new BG(e,t,n);return this._highlightRanges.push(i),this.resize(),i};il.prototype.addTrack=function(e,t,n,i){let o=new kG(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};il.prototype.zoomTo=function(e,t){if(!c(e))throw new C("startTime is required.");if(!c(t))throw new C("stopTime is required");if(Q.lessThanOrEquals(t,e))throw new C("Start time must come before end time.");if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=Q.secondsDifference(t,e),this._clock&&this._clock.clockRange!==$r.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=Q.secondsDifference(o,i),s=Q.secondsDifference(i,this._startJulian),a=Q.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=Q.addSeconds(this._endJulian,s,new Q),this._startJulian=i,this._timeBarSecondsSpan=Q.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=Q.addSeconds(this._startJulian,a,new Q),this._endJulian=o,this._timeBarSecondsSpan=Q.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};il.prototype.zoomFrom=function(e){let t=Q.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(Q.addSeconds(this._startJulian,t-t*e,new Q),Q.addSeconds(this._endJulian,n*e-n,new Q))};function W$(e){return e<10?`0${e.toString()}`:e.toString()}il.prototype.makeLabel=function(e){let t=Q.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${lSt[t.month-1]} ${t.day} ${t.year} ${W$(t.hour)}:${W$(t.minute)}:${W$(t.second)}${i}`};il.prototype.smallestTicInPixels=7;il.prototype._makeTics=function(){let e=this._timeBarEle,t=Q.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,l=31536e6,u=1e-10,f=0,h=this._timeBarSecondsSpan;h<a?(h=a,this._timeBarSecondsSpan=a,this._endJulian=Q.addSeconds(this._startJulian,a,new Q)):h>l&&(h=l,this._timeBarSecondsSpan=l,this._endJulian=Q.addSeconds(this._startJulian,l,new Q));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,m=Math.min(h/p*1e-5,.4),y,b=Q.toGregorianDate(g);h>31536e4?y=Q.fromDate(new Date(Date.UTC(Math.floor(b.year/100)*100,0))):h>31536e3?y=Q.fromDate(new Date(Date.UTC(Math.floor(b.year/10)*10,0))):h>86400?y=Q.fromDate(new Date(Date.UTC(b.year,0))):y=Q.fromDate(new Date(Date.UTC(b.year,b.month,b.day)));let x=Q.secondsDifference(this._startJulian,Q.addSeconds(y,m,new Q)),A=x+h;this._epochJulian=y;function E(U){return Math.floor(x/U)*U}function S(U,q){return Math.ceil(U/q+.5)*q}function v(U){return(U-x)/h}function P(U,q){return U-q*Math.round(U/q)}this._rulerEle.innerHTML=this.makeLabel(Q.addSeconds(this._endJulian,-a,new Q));let M=this._rulerEle.offsetWidth+20;M<30&&(M=180);let R=f;f-=u;let L={startTime:x,startJulian:g,epochJulian:y,duration:h,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(U){s+=U.render(L)});let B=0,_=0,w=0,D=M/p;D>1&&(D=1),D*=this._timeBarSecondsSpan;let I=-1,N=-1,k=E0.length,H;for(H=0;H<k;++H){let U=E0[H];if(++I,B=U,U>D&&U>f)break;N<0&&p*(U/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=I)}if(I>0){for(;I>0;)if(--I,Math.abs(P(B,E0[I]))<1e-5){E0[I]>=f&&(_=E0[I]);break}if(N>=0)for(;N<I;){if(Math.abs(P(_,E0[N]))<1e-5&&E0[N]>=f){w=E0[N];break}++N}}f=R,f>u&&w<1e-5&&Math.abs(f-B)>u&&(w=f,f<=B+u&&(_=0));let V=-999999,j;if(p*(w/this._timeBarSecondsSpan)>=3)for(o=E(w);o<=A;o=S(o,w))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(o=E(_);o<=A;o=S(o,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(o)).toString()}px;"></span>`;if(p*(B/this._timeBarSecondsSpan)>=2){this._mainTicSpan=B,A+=B,o=E(B);let U=Q.computeTaiMinusUtc(y);for(;o<=A;){let q=Q.addSeconds(g,o-x,new Q);if(B>2.1){let Z=Q.computeTaiMinusUtc(q);Math.abs(Z-U)>.1&&(o+=Z-U,q=Q.addSeconds(g,o-x,new Q))}let X=Math.round(p*v(o)),te=this.makeLabel(q);this._rulerEle.innerHTML=te,j=this._rulerEle.offsetWidth,j<10&&(j=M);let K=X-(j/2-1);K>V?(V=K+j+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${X.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${K.toString()}px;">${te}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${X.toString()}px;"></span>`,o=S(o,B)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),L.y=0,this._trackList.forEach(function(U){U.render(r._context,L),L.y+=U.height})};il.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(c(this._scrubElement)){let t=Q.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}c(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(Q.addSeconds(this._startJulian,this._timelineDrag,new Q),Q.addSeconds(this._endJulian,this._timelineDrag,new Q)))};il.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=Q.addSeconds(this._startJulian,t,new Q),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function uSt(e){return function(t){e._mouseMode!==od.touchOnly&&(t.button===0?(e._mouseMode=od.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=od.zoom:e._mouseMode=od.slide)),t.preventDefault()}}function fSt(e){return function(t){e._mouseMode=od.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function dSt(e){return function(t){let n;if(e._mouseMode===od.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===od.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(Q.addSeconds(e._startJulian,i,new Q),Q.addSeconds(e._endJulian,i,new Q))}}else e._mouseMode===od.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function hSt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;j$=Math.max(Math.min(Math.abs(n),j$),1),n/=j$,e.zoomFrom(Math.pow(1.05,-n))}}function mSt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=od.touchOnly,n===1?(i=Q.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=nl.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=nl.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=nl.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=nl.ignore}}function pSt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===nl.singleTap?(e._touchMode=nl.scrub,e._onTouchMove(t)):e._touchMode===nl.scrub&&e._onTouchMove(t),e._mouseMode=od.touchOnly,n!==1?e._touchMode=n>0?nl.ignore:nl.none:e._touchMode===nl.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function _St(e){return function(t){let n,i,o,r,s,a,l=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===nl.singleTap&&(e._touchMode=nl.slideZoom),e._mouseMode=od.touchOnly,e._touchMode===nl.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===nl.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-u,s=0),c(r)&&(s>0&&e._touchState.spanX>0?(l=e._touchState.spanX/s,a=Q.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*l)/e._topDiv.clientWidth,new Q)):(n=e._touchState.centerX-r,a=Q.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new Q)),e.zoomTo(a,Q.addSeconds(a,e._timeBarSecondsSpan*l,new Q)),e._touchState.centerX=r,e._touchState.spanX=s))}}il.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var UG=il;function jCe(e){let t=e.split(`
`),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",o=/^\s*/,s=t[n].match(o)[0].length;for(let a=n;a<t.length;a++){let l=t[a];l.match(o)[0].length>=s&&(l=l.slice(s)),i+=`${l}
`}return i}function rd(e){T.typeOf.object("scene",e),this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[r]=f});let l=o.getPrimitiveFunction;l===!0&&(l=function(){t[r]=t._voxelPrimitive[r]}),c(l)&&t._getPrimitiveFunctions.push(l);let u=Te.observable();return Te.defineProperty(t,r,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),c(a)&&c(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[r]=s,u}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=jCe(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===Na.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Na.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Na.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-O.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:O.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-O.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:O.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-O.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:O.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-O.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:O.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-O.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:O.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-O.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:O.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.translationX=F.getTranslation(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.translationY=F.getTranslation(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.translationZ=F.getTranslation(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.scaleX=F.getScale(t._voxelPrimitive.modelMatrix,new d).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.scaleY=F.getScale(t._voxelPrimitive.modelMatrix,new d).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)},getPrimitiveFunction:function(){t.scaleZ=F.getScale(t._voxelPrimitive.modelMatrix,new d).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&ep(t)}})}var gSt=new d,ySt=new d,bSt=new Xa,xSt=new J;function ep(e){let t=d.fromElements(e.translationX,e.translationY,e.translationZ,gSt),n=d.fromElements(e.scaleX,e.scaleY,e.scaleZ,ySt),i=bSt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=J.fromHeadingPitchRoll(i,xSt),r=J.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=F.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(rd.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(c(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!c(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=jCe(i),c(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,ep(t)}}});rd.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};rd.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};rd.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};rd.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};rd.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};rd.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};rd.prototype.compileShader=function(){c(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new aS({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};rd.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(`
`),l=a.length,u;if(t.shiftKey)for(u=0;u<l;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),r-=2):(a[u]=a[u].substr(1),r-=1));else for(u=0;u<l;++u)a[u]=` ${a[u]}`,r+=2;let f=a.join(`
`);n.value=n.value.slice(0,i)+f+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};rd.prototype.isDestroyed=function(){return!1};rd.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Te.getObservable(e,t).dispose()}),de(this)};var VG=rd;function zG(e,t){T.defined("container",e),T.typeOf.object("scene",t),e=Rn(e);let n=document.createElement("div"),i=new VG(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let{createSection:s,createCheckbox:a,createRangeInput:l,createButton:u}=Vu,f=s(r,"Display","displayVisible","toggleDisplay"),h=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Clipping","clippingVisible","toggleClipping"),g=s(r,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(l("Screen Space Error","screenSpaceError",0,128)),f.appendChild(l("Step Size","stepSize",0,2));let m=10,y=10,b=O.PI;h.appendChild(l("Translation X","translationX",-m,+m)),h.appendChild(l("Translation Y","translationY",-m,+m)),h.appendChild(l("Translation Z","translationZ",-m,+m)),h.appendChild(l("Scale X","scaleX",0,+y)),h.appendChild(l("Scale Y","scaleY",0,+y)),h.appendChild(l("Scale Z","scaleZ",0,+y)),h.appendChild(l("Heading","angleX",-b,+b)),h.appendChild(l("Pitch","angleY",-b,+b)),h.appendChild(l("Roll","angleZ",-b,+b)),q$("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),q$("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),q$("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let x=document.createElement("div");g.appendChild(x);let A=document.createElement("textarea");A.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),x.className="cesium-cesiumInspector-styleEditor",x.appendChild(A);let E=u("Compile (Ctrl+Enter)","compileShader");x.appendChild(E);let S=document.createElement("label");S.style.display="block",S.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),x.appendChild(S),Te.applyBindings(i,n)}Object.defineProperties(zG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});zG.prototype.isDestroyed=function(){return!1};zG.prototype.destroy=function(){return Te.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),de(this)};function q$(e,t,n,i,o,r,s,a,l,u,f,h,p,g){let m=Vu.createRangeInputWithDynamicMinMax,y=g.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(m(e,s)),y.appendChild(m(t,a)),y.appendChild(m(n,l)),y.appendChild(m(i,u)),y.appendChild(m(o,f)),y.appendChild(m(r,h))}var HG=zG;var KCe=jr(XCe(),1);function CSt(e){let t=!1,n=window.screen;return c(n)&&(c(n.lockOrientation)?t=n.lockOrientation(e):c(n.mozLockOrientation)?t=n.mozLockOrientation(e):c(n.msLockOrientation)?t=n.msLockOrientation(e):c(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function $Ce(){let e=window.screen;c(e)&&(c(e.unlockOrientation)?e.unlockOrientation():c(e.mozUnlockOrientation)?e.mozUnlockOrientation():c(e.msUnlockOrientation)?e.msUnlockOrientation():c(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function ESt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&($Ce(),e._locked=!1),e._noSleep.disable(),Ir.exitFullscreen(),n(!1)):(Ir.fullscreen||Ir.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=CSt("landscape")),t.useWebVR=!0,n(!0)))}function GG(e,t){if(!c(e))throw new C("scene is required.");let n=this,i=Te.observable(Ir.enabled),o=Te.observable(!1);this.isVRMode=void 0,Te.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Te.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&Ir.enabled)}}),this.tooltip=void 0,Te.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Te.observable(!1);this._isOrthographic=void 0,Te.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new Ar,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof on)}),this._locked=!1,this._noSleep=new KCe.default,this._command=wn(function(){ESt(n,e,o,r)},Te.getObservable(this,"isVREnabled")),this._vrElement=Rn(t)??document.body,this._callback=function(){!Ir.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&($Ce(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(Ir.changeEventName,this._callback)}Object.defineProperties(GG.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){if(!(e instanceof Element))throw new C("value must be a valid Element.");this._vrElement=e}},command:{get:function(){return this._command}}});GG.prototype.isDestroyed=function(){return!1};GG.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(Ir.changeEventName,this._callback),de(this)};var jG=GG;var SSt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",wSt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function WG(e,t,n){if(!c(e))throw new C("container is required.");if(!c(t))throw new C("scene is required.");e=Rn(e);let i=new jG(t,n);i._exitVRPath=wSt,i._enterVRPath=SSt;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),Te.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(WG.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});WG.prototype.isDestroyed=function(){return!1};WG.prototype.destroy=function(){return this._viewModel.destroy(),Te.cleanNode(this._element),this._container.removeChild(this._element),de(this)};var qG=WG;var ZCe=new le;function eEe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function vSt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);c(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function DSt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(c(r)&&r!=="")return r}return"Unnamed Feature"}function QCe(e,t){let n=e.scene.pick(t.position);if(c(n)){let i=n.id??n.primitive.id;if(i instanceof rr)return i;if(n instanceof ta)return new rr({name:DSt(n),description:vSt(n),feature:n})}if(c(e.scene.globe))return OSt(e,t.position)}var PSt=new Q;function $$(e,t){if(c(t)){let n=t.clock;if(c(n)&&c(e)){let i=n.startTime,o=n.stopTime;Q.equals(i,o)&&(o=Q.addSeconds(i,O.EPSILON2,PSt)),e.updateFromClock(),e.zoomTo(i,o)}}}var ISt=new d;function OSt(e,t){let n=e.scene,i=n.camera.getPickRay(t),o=n.imageryLayers.pickImageryLayerFeatures(i,n);if(!c(o))return;let r=new rr({id:"Loading...",description:"Loading feature information..."});return o.then(function(s){if(e.selectedEntity!==r)return;if(!c(s)||s.length===0){e.selectedEntity=JCe();return}let a=s[0],l=new rr({id:a.name,description:a.description});if(c(a.position)){let u=e.scene.ellipsoid.cartographicToCartesian(a.position,ISt);l.position=new gl(u)}e.selectedEntity=l},function(){e.selectedEntity===r&&(e.selectedEntity=JCe())}),r}function JCe(){return new rr({id:"None",description:"No features found."})}function RSt(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,l=e._timeline,u=e._fullscreenButton,f=e._infoBox,h=e._selectionIndicator,p=t?"hidden":"visible";if(c(n)&&(n.container.style.visibility=p),c(i)&&(i.container.style.visibility=p),c(o)&&(o.container.style.visibility=p),c(r)&&(r.container.style.visibility=p),c(s)&&(s.container.style.visibility=p),c(a)&&(a.container.style.visibility=p),c(l)&&(l.container.style.visibility=p),c(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),c(f)&&(f.container.style.visibility=p),c(h)&&(h.container.style.visibility=p),e._container){let g=t||!c(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function qi(e,t){if(!c(e))throw new C("container is required.");if(e=Rn(e),t=t??W.EMPTY_OBJECT,t.globe===!1&&c(t.baseLayer)&&t.baseLayer!==!1)throw new C("Cannot use baseLayer when globe is disabled.");let n=(!c(t.globe)||t.globe!==!1)&&(!c(t.baseLayerPicker)||t.baseLayerPicker!==!1);if(!n&&c(t.selectedImageryProviderViewModel))throw new C("options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.baseLayer instead or set options.baseLayerPicker to true.");if(!n&&c(t.selectedTerrainProviderViewModel))throw new C("options.selectedTerrainProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.terrainProvider instead or set options.baseLayerPicker to true.");let i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=t.scene3DOnly??!1,l,u,f=!1;c(t.clockViewModel)?(u=t.clockViewModel,l=u.clock):(l=new mm,u=new UH(l),f=!0);let h=new Y8(r,{baseLayer:n&&c(t.selectedImageryProviderViewModel)||c(t.baseLayer)||c(t.imageryProvider)?!1:void 0,clock:l,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:c(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=h.scene,g=new Ar;g.add(l.onTick,qi.prototype._onTick,this);let m;if(!c(t.selectionIndicator)||t.selectionIndicator!==!1){let q=document.createElement("div");q.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(q),m=new RG(q,p)}let y;if(!c(t.infoBox)||t.infoBox!==!1){let q=document.createElement("div");q.className="cesium-viewer-infoBoxContainer",o.appendChild(q),y=new yG(q);let X=y.viewModel;g.add(X.cameraClicked,qi.prototype._onInfoBoxCameraClicked,this),g.add(X.closeClicked,qi.prototype._onInfoBoxClockClicked,this)}let b=document.createElement("div");b.className="cesium-viewer-toolbar",o.appendChild(b);let x;if(!c(t.geocoder)||t.geocoder!==!1){let q=document.createElement("div");q.className="cesium-viewer-geocoderContainer",b.appendChild(q);let X;typeof t.geocoder=="string"?X=[new vS({scene:p,geocodeProviderType:t.geocoder})]:c(t.geocoder)&&typeof t.geocoder!="boolean"&&(X=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),x=new hG({container:q,geocoderServices:X,scene:p}),g.add(x.viewModel.search.beforeExecute,qi.prototype._clearObjects,this)}let A;if((!c(t.homeButton)||t.homeButton!==!1)&&(A=new uG(b,p),c(x)&&g.add(A.viewModel.command.afterExecute,function(){let q=x.viewModel;q.searchText="",q.isSearchInProgress&&q.search()}),g.add(A.viewModel.command.beforeExecute,qi.prototype._clearTrackedObject,this)),t.sceneModePicker===!0&&a)throw new C("options.sceneModePicker is not available when options.scene3DOnly is set to true.");let E;!a&&(!c(t.sceneModePicker)||t.sceneModePicker!==!1)&&(E=new FG(b,p));let S;t.projectionPicker&&(S=new AG(b,p));let v,P;if(n){let q=t.imageryProviderViewModels??KH(),X=t.terrainProviderViewModels??$H();v=new XH(b,{globe:p.globe,imageryProviderViewModels:q,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:X,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),P=b.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}if(c(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),c(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),c(t.terrain)){if(c(t.terrainProvider))throw new C("Specify either options.terrainProvider or options.terrain.");n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain)}let M;if(!c(t.navigationHelpButton)||t.navigationHelpButton!==!1){let q=!0;try{if(c(window.localStorage)){let X=window.localStorage.getItem("cesium-hasSeenNavHelp");c(X)&&X?q=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}M=new DG({container:b,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??q})}let R;if(!c(t.animation)||t.animation!==!1){let q=document.createElement("div");q.className="cesium-viewer-animationContainer",o.appendChild(q),R=new jH(q,new WH(u))}let L;if(!c(t.timeline)||t.timeline!==!1){let q=document.createElement("div");q.className="cesium-viewer-timelineContainer",o.appendChild(q),L=new UG(q,l),L.addEventListener("settime",eEe,!1),L.zoomTo(l.startTime,l.stopTime)}let B,_,w;(!c(t.fullscreenButton)||t.fullscreenButton!==!1)&&(w=document.createElement("div"),w.className="cesium-viewer-fullscreenContainer",o.appendChild(w),B=new aG(w,t.fullscreenElement),_=Ba(B.viewModel,"isFullscreenEnabled",function(q){w.style.display=q?"block":"none",c(L)&&(L.container.style.right=`${w.clientWidth}px`,L.resize())}));let D,I,N;if(t.vrButton){let q=document.createElement("div");q.className="cesium-viewer-vrContainer",o.appendChild(q),D=new qG(q,p,t.fullScreenElement),I=Ba(D.viewModel,"isVREnabled",function(X){q.style.display=X?"block":"none",c(B)&&(q.style.right=`${w.clientWidth}px`),c(L)&&(L.container.style.right=`${q.clientWidth}px`,L.resize())}),N=Ba(D.viewModel,"isVRMode",function(X){RSt(i,X)})}this._baseLayerPickerDropDown=P,this._fullscreenSubscription=_,this._vrSubscription=I,this._vrModeSubscription=N,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=h,this._selectionIndicator=m,this._infoBox=y,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=b,this._homeButton=A,this._sceneModePicker=E,this._projectionPicker=S,this._baseLayerPicker=v,this._navigationHelpButton=M,this._animation=R,this._timeline=L,this._fullscreenButton=B,this._vrButton=D,this._geocoder=x,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=c(y)||c(m),this._selectedEntity=void 0,this._selectedEntityChanged=new pe;let k=this._cesiumWidget.dataSources,H=this._cesiumWidget.dataSourceDisplay;g.add(k.dataSourceAdded,qi.prototype._onDataSourceAdded,this),g.add(k.dataSourceRemoved,qi.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,qi.prototype.resize,this);let V=k.length;for(let q=0;q<V;q++)this._dataSourceAdded(k,k.get(q));this._dataSourceAdded(void 0,H.defaultDataSource),g.add(k.dataSourceAdded,qi.prototype._dataSourceAdded,this),g.add(k.dataSourceRemoved,qi.prototype._dataSourceRemoved,this);function j(q){let X=QCe(i,q);c(X)?Y.getValueOrUndefined(X.position,i.clock.currentTime)?i.trackedEntity=X:i.zoomTo(X):c(i.trackedEntity)&&(i.trackedEntity=void 0)}function U(q){i.selectedEntity=QCe(i,q)}h.screenSpaceEventHandler.setInputAction(U,Cn.LEFT_CLICK),h.screenSpaceEventHandler.setInputAction(j,Cn.LEFT_DOUBLE_CLICK),h._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(qi.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=c(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;c(e)?c(t)&&t.animateAppear():c(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,$$(this._timeline,e))}}});qi.prototype.extend=function(e,t){if(!c(e))throw new C("mixin is required.");e(this,t)};qi.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=c(this._animation),r=c(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(c(a)&&(a.style.maxHeight=`${s}px`),c(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}c(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let l=this._timeline,u,f=0,h=5,p=3,g=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),h=f+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,y=this._vrButton,b=l.container,x=b.style;p=b.clientHeight+3,x.left=`${f}px`;let A=0;c(m)&&(A+=m.container.clientWidth),c(y)&&(A+=y.container.clientWidth),x.right=`${A}px`,l.resize()}!r&&c(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${h}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};qi.prototype.forceResize=function(){this._lastWidth=0,this.resize()};qi.prototype.render=function(){this._cesiumWidget.render()};qi.prototype.isDestroyed=function(){return!1};qi.prototype.destroy=function(){return c(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(Cn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(Cn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),c(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),c(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),c(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),c(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),c(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),c(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),c(this._timeline)&&(this._timeline.removeEventListener("settime",eEe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),c(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),c(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),c(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),c(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),de(this)};qi.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(qi.prototype._onEntityCollectionChanged,this)};qi.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(qi.prototype._onEntityCollectionChanged,this),c(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};qi.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};qi.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=c(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,ZCe)!==lt.FAILED?n=ZCe.center:c(o.position)&&(n=o.position.getValue(t,n)),i=c(n));let s=c(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;c(s)&&(s.position=d.clone(n,s.position),s.showSelection=r&&i,s.update());let a=c(this._infoBox)?this._infoBox.viewModel:void 0;c(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=o.name??o.id,a.description=Y.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};qi.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.selectedEntity===r&&(this.selectedEntity=void 0)}};qi.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;c(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};qi.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};qi.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};qi.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};qi.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&$$(this.timeline,e)};qi.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&$$(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,qi.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};qi.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};qi.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};qi.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var tEe=qi;function MSt(e){T.typeOf.object("viewer",e);let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new eG(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var nEe=MSt;function LSt(e){if(!c(e))throw new C("viewer is required.");let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new iG(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var iEe=LSt;function NSt(e,t){if(!c(e))throw new C("viewer is required.");if(e.hasOwnProperty("dropTarget"))throw new C("dropTarget is already defined by another mixin.");if(e.hasOwnProperty("dropEnabled"))throw new C("dropEnabled is already defined by another mixin.");if(e.hasOwnProperty("dropError"))throw new C("dropError is already defined by another mixin.");if(e.hasOwnProperty("clearOnDrop"))throw new C("clearOnDrop is already defined by another mixin.");if(e.hasOwnProperty("flyToOnDrop"))throw new C("flyToOnDrop is already defined by another mixin.");t=t??W.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new pe,r=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,l=t.proxy;s=Rn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){if(!c(f))throw new C("value is required.");oEe(s,u),s=f,Z$(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?Z$(s,u):oEe(s,u),n=f)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(f){r=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return l},set:function(f){l=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){eT(f),r&&(e.entities.removeAll(),e.dataSources.removeAll());let h=f.dataTransfer.files,p=h.length;for(let g=0;g<p;g++){let m=h[g],y=new FileReader;y.onload=FSt(e,m,l,a),y.onerror=BSt(e,m),y.readAsText(m)}}Z$(s,u),e.destroy=uH(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function eT(e){e.stopPropagation(),e.preventDefault()}function oEe(e,t){let n=e;c(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",eT,!1),n.removeEventListener("dragover",eT,!1),n.removeEventListener("dragexit",eT,!1))}function Z$(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",eT,!1),e.addEventListener("dragover",eT,!1),e.addEventListener("dragexit",eT,!1)}function FSt(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=G3.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=hx.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=wE.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=YU.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}c(a)&&e.dataSources.add(a).then(function(l){e.flyToOnDrop&&e.flyTo(l)}).catch(function(l){e.dropError.raiseEvent(e,s,l)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function BSt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var rEe=NSt;function kSt(e,t){if(!c(e))throw new C("viewer is required.");t=t??W.EMPTY_OBJECT;let n=new SG({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var sEe=kSt;function USt(e){T.typeOf.object("viewer",e);let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new HG(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var aEe=USt;globalThis.CESIUM_VERSION="1.129";var Cyo="1.129";export{Ip as AlphaMode,y2 as AlphaPipelineStage,yF as AnchorPointDirect,bF as AnchorPointIndirect,jH as Animation,WH as AnimationViewModel,no as Appearance,fi as ApproximateTerrainHeights,aTe as ArcGISTiledElevationTerrainProvider,km as ArcGisBaseMapType,qy as ArcGisMapServerImageryProvider,jf as ArcGisMapService,qt as ArcType,Uc as ArticulationStageType,Et as AssociativeArray,IA as Atmosphere,ZF as AtmospherePipelineStage,Ln as AttributeCompression,nn as AttributeType,V4 as AutoExposure,N_ as AutomaticUniforms,Fo as Axis,q0 as AxisAlignedBoundingBox,OF as B3dmLoader,IF as B3dmParser,XH as BaseLayerPicker,qH as BaseLayerPickerViewModel,zT as BatchTable,fA as BatchTableHierarchy,Tl as BatchTexture,b2 as BatchTexturePipelineStage,ao as Billboard,Cf as BillboardCollection,wc as BillboardGraphics,ss as BillboardLoadState,Wg as BillboardTexture,dL as BillboardVisualizer,lTe as BingMapsGeocoderService,UV as BingMapsImageryProvider,zP as BingMapsStyle,Qa as BlendEquation,vo as BlendFunction,Po as BlendOption,un as BlendingState,Ke as BoundingRectangle,le as BoundingSphere,lt as BoundingSphereState,CA as BoundingVolumeSemantics,aAe as BoxEmitter,Za as BoxGeometry,cN as BoxGeometryUpdater,KT as BoxGraphics,Mh as BoxOutlineGeometry,Mz as BrdfLutGenerator,bt as Buffer,pA as BufferLoader,Be as BufferUsage,C2 as CPUStylingPipelineStage,lN as CallbackPositionProperty,Vh as CallbackProperty,ro as Camera,W4 as CameraEventAggregator,Vi as CameraEventType,Lz as CameraFlightPath,z as Cartesian2,d as Cartesian3,se as Cartesian4,he as Cartographic,uTe as CartographicGeocoderService,dTe as CatmullRomSpline,uA as Cesium3DContentGroup,Fd as Cesium3DTile,cg as Cesium3DTileBatchTable,nu as Cesium3DTileColorBlendMode,cAe as Cesium3DTileContent,iC as Cesium3DTileContentFactory,$o as Cesium3DTileContentState,Us as Cesium3DTileContentType,ta as Cesium3DTileFeature,tm as Cesium3DTileFeatureTable,Ld as Cesium3DTileOptimizationHint,i3 as Cesium3DTileOptimizations,Uo as Cesium3DTilePass,lh as Cesium3DTilePassState,qg as Cesium3DTilePointFeature,Yo as Cesium3DTileRefine,RS as Cesium3DTileStyle,c3 as Cesium3DTileStyleEngine,eG as Cesium3DTilesInspector,QH as Cesium3DTilesInspectorViewModel,uAe as Cesium3DTilesVoxelProvider,As as Cesium3DTileset,u3 as Cesium3DTilesetBaseTraversal,r3 as Cesium3DTilesetCache,nA as Cesium3DTilesetGraphics,a3 as Cesium3DTilesetHeatmap,_C as Cesium3DTilesetMetadata,l3 as Cesium3DTilesetMostDetailedTraversal,d3 as Cesium3DTilesetSkipTraversal,fm as Cesium3DTilesetStatistics,ca as Cesium3DTilesetTraversal,m3 as Cesium3DTilesetVisualizer,iG as CesiumInspector,tG as CesiumInspectorViewModel,AS as CesiumTerrainProvider,Y8 as CesiumWidget,T as Check,TD as CheckerboardMaterialProperty,hH as CircleEmitter,TTe as CircleGeometry,ATe as CircleOutlineGeometry,mB as ClassificationModelDrawCommand,x2 as ClassificationPipelineStage,Ew as ClassificationPrimitive,Un as ClassificationType,ti as ClearCommand,SA as ClippingPlane,xs as ClippingPlaneCollection,vv as ClippingPolygon,Zh as ClippingPolygonCollection,mm as Clock,$r as ClockRange,_o as ClockStep,UH as ClockViewModel,gAe as CloudCollection,MS as CloudType,G as Color,kc as ColorBlendMode,jt as ColorGeometryInstanceAttribute,Ut as ColorMaterialProperty,bCe as Command,$ as ComponentDatatype,mN as Composite3DTileContent,wle as CompositeEntityCollection,SD as CompositeMaterialProperty,Pa as CompositePositionProperty,Gc as CompositeProperty,c1 as CompressedTextureBuffer,cl as ComputeCommand,a1 as ComputeEngine,fH as ConditionsExpression,yAe as ConeEmitter,gl as ConstantPositionProperty,Xn as ConstantProperty,UF as ConstantSpline,WB as ContentMetadata,aL as Context,ut as ContextLimits,ck as CoplanarPolygonGeometry,Zg as CoplanarPolygonGeometryLibrary,Nd as CoplanarPolygonOutlineGeometry,ki as CornerType,xF as CorrelationGroup,SC as CorridorGeometry,Gi as CorridorGeometryLibrary,E3 as CorridorGeometryUpdater,ZT as CorridorGraphics,C3 as CorridorOutlineGeometry,At as Credit,jz as CreditDisplay,Go as CubeMap,A1 as CubeMapFace,ET as CubicRealPolynomial,Ti as CullFace,ys as CullingVolume,td as CumulusCloud,P3 as CustomDataSource,CTe as CustomHeightmapTerrainProvider,aS as CustomShader,zg as CustomShaderMode,I2 as CustomShaderPipelineStage,Eb as CustomShaderTranslucencyMode,I3 as CylinderGeometry,vC as CylinderGeometryLibrary,R3 as CylinderGeometryUpdater,QT as CylinderGraphics,O3 as CylinderOutlineGeometry,G3 as CzmlDataSource,Kr as DataSource,pm as DataSourceClock,W3 as DataSourceCollection,Mk as DataSourceDisplay,vAe as DebugAppearance,T_ as DebugCameraPrimitive,r8 as DebugInspector,gH as DebugModelMatrixPrimitive,STe as DefaultProxy,Dc as DepthFunction,Kz as DepthPlane,O2 as DequantizationPipelineStage,A_ as DerivedCommand,C as DeveloperError,Zz as DeviceOrientationCameraController,DAe as DirectionalLight,GP as DiscardEmptyTileImagePolicy,BV as DiscardMissingTileImagePolicy,Lt as DistanceDisplayCondition,kn as DistanceDisplayConditionGeometryInstanceAttribute,dS as DoubleEndedPriorityQueue,o3 as DoublyLinkedList,yg as DracoLoader,Je as DrawCommand,Ig as DynamicAtmosphereLightingType,Og as DynamicEnvironmentMapManager,UC as DynamicGeometryBatch,ii as DynamicGeometryUpdater,GO as EarthOrientationParameters,D0 as EarthOrientationParametersSample,Qr as EasingFunction,Rl as EllipseGeometry,_u as EllipseGeometryLibrary,ek as EllipseGeometryUpdater,JT as EllipseGraphics,kf as EllipseOutlineGeometry,ie as Ellipsoid,J_ as EllipsoidGeodesic,da as EllipsoidGeometry,tk as EllipsoidGeometryUpdater,eA as EllipsoidGraphics,If as EllipsoidOutlineGeometry,Sz as EllipsoidPrimitive,Ja as EllipsoidRhumbLine,PAe as EllipsoidSurfaceAppearance,is as EllipsoidTangentPlane,b_ as EllipsoidTerrainProvider,cy as EllipsoidalOccluder,cD as Empty3DTileContent,Hn as EncodedCartesian3,rr as Entity,Lf as EntityCluster,la as EntityCollection,Fk as EntityView,pe as Event,Ar as EventHelper,bd as Expression,_t as ExpressionNodeType,Il as ExtrapolationType,zt as FeatureDetection,Cb as FeatureIdPipelineStage,Qz as Fog,Oe as ForEach,xH as FrameRateMonitor,Jz as FrameState,Wr as Framebuffer,pi as FramebufferManager,W as Frozen,s4 as FrustumCommands,jE as FrustumGeometry,qz as FrustumOutlineGeometry,Ir as Fullscreen,aG as FullscreenButton,rG as FullscreenButtonViewModel,hx as GeoJsonDataSource,MF as GeoJsonLoader,Gx as GeocodeType,hG as Geocoder,BI as GeocoderService,fG as GeocoderViewModel,Oi as GeographicProjection,Ki as GeographicTilingScheme,ct as Geometry,TN as Geometry3DTileContent,ve as GeometryAttribute,hn as GeometryAttributes,PTe as GeometryFactory,St as GeometryInstance,Pc as GeometryInstanceAttribute,Zt as GeometryOffsetAttribute,Nn as GeometryPipeline,L2 as GeometryPipelineStage,ld as GeometryType,oi as GeometryUpdater,tE as GeometryUpdaterSet,Ck as GeometryVisualizer,FE as GetFeatureInfoFormat,xz as Globe,a4 as GlobeDepth,NV as GlobeSurfaceShaderSet,rh as GlobeSurfaceTile,cz as GlobeSurfaceTileProvider,lz as GlobeTranslucency,c4 as GlobeTranslucencyFramebuffer,e4 as GlobeTranslucencyState,av as GltfBufferViewLoader,cv as GltfDracoLoader,AF as GltfGpmLoader,Mv as GltfGpmLocal,lv as GltfImageLoader,uv as GltfIndexBufferLoader,dv as GltfJsonLoader,em as GltfLoader,ru as GltfLoaderUtil,wF as GltfMeshPrimitiveGpmLoader,mF as GltfStructuralMetadataLoader,_v as GltfTextureLoader,gv as GltfVertexBufferLoader,OAe as GoogleEarthEnterpriseImageryProvider,WV as GoogleEarthEnterpriseMapsProvider,m0 as GoogleEarthEnterpriseMetadata,kI as GoogleEarthEnterpriseTerrainData,kTe as GoogleEarthEnterpriseTerrainProvider,tH as GoogleEarthEnterpriseTileInformation,VTe as GoogleGeocoderService,wS as GoogleMaps,YU as GpxDataSource,op as GregorianDate,RAe as GridImageryProvider,ND as GridMaterialProperty,Gn as GroundGeometryUpdater,qT as GroundPolylineGeometry,Nh as GroundPolylinePrimitive,_l as GroundPrimitive,dD as GroupMetadata,$d as HeadingPitchRange,Xa as HeadingPitchRoll,kO as Heap,qe as HeightReference,ih as HeightmapEncoding,dc as HeightmapTerrainData,VP as HeightmapTessellator,L3 as HermitePolynomialApproximation,xb as HermiteSpline,iv as HilbertOrder,uG as HomeButton,cG as HomeButtonViewModel,xi as HorizontalOrigin,zCe as I3SBuildingSceneLayerExplorer,pG as I3SBuildingSceneLayerExplorerViewModel,Jm as I3SDataProvider,TH as I3SDecoder,AH as I3SFeature,EH as I3SField,qI as I3SGeometry,NS as I3SLayer,YI as I3SNode,PH as I3SStatistics,IH as I3SSublayer,vH as I3SSymbology,kF as I3dmLoader,NF as I3dmParser,VAe as ITwinData,ds as ITwinPlatform,Az as Iau2000Orientation,qO as Iau2006XysData,gT as Iau2006XysSample,Cz as IauOrientationAxes,Tz as IauOrientationParameters,lA as ImageBasedLighting,JF as ImageBasedLightingPipelineStage,Q0 as ImageMaterialProperty,XP as Imagery,mc as ImageryLayer,fz as ImageryLayerCollection,Bm as ImageryLayerFeatureInfo,Ul as ImageryProvider,ai as ImageryState,Av as Implicit3DTileContent,ov as ImplicitAvailabilityBitstream,rv as ImplicitMetadataView,cr as ImplicitSubdivisionScheme,TA as ImplicitSubtree,dH as ImplicitSubtreeCache,SN as ImplicitSubtreeMetadata,bC as ImplicitTileCoordinates,yC as ImplicitTileset,Fe as IndexDatatype,yG as InfoBox,_G as InfoBoxViewModel,Vu as InspectorShared,rs as InstanceAttributeSemantic,m2 as InstancingPipelineStage,zTe as InterpolationAlgorithm,Jh as InterpolationType,Wt as Intersect,Qn as IntersectionTests,d0 as Intersections2D,$a as Interval,fI as InvertClassification,Gh as Ion,_0 as IonGeocodeProviderType,vS as IonGeocoderService,Yy as IonImageryProvider,uf as IonResource,Xy as IonWorldImageryStyle,Ge as Iso8601,n4 as JobScheduler,wa as JobType,Rg as JsonMetadataTable,Q as JulianDate,l1 as KTX2Transcoder,ba as KeyboardEventModifier,go as KeyframeNode,XU as KmlCamera,wE as KmlDataSource,KU as KmlLookAt,ZU as KmlTour,JU as KmlTourFlyTo,eV as KmlTourWait,Ob as Label,Gp as LabelCollection,Bh as LabelGraphics,Ko as LabelStyle,Ek as LabelVisualizer,N3 as LagrangePolynomialApproximation,Yi as LeapSecond,HAe as Light,Up as LightingModel,F2 as LightingPipelineStage,jb as LinearApproximation,bb as LinearSpline,xl as ManagedArray,Pu as MapMode2D,jTe as MapProjection,qV as MapboxImageryProvider,jAe as MapboxStyleImageryProvider,Xi as Material,so as MaterialAppearance,k2 as MaterialPipelineStage,or as MaterialProperty,O as Math,Ri as Matrix2,J as Matrix3,F as Matrix4,vI as Megatexture,SF as MeshPrimitiveGpmLocal,Kh as MetadataClass,vp as MetadataClassProperty,Nt as MetadataComponentType,Bn as MetadataEntity,XN as MetadataEnum,qN as MetadataEnumValue,o4 as MetadataPicking,yf as MetadataPickingPipelineStage,wd as MetadataPipelineStage,pf as MetadataSchema,bv as MetadataSchemaLoader,AA as MetadataSemantic,Td as MetadataTable,vN as MetadataTableProperty,at as MetadataType,hd as MipmapHint,om as Model,bf as Model3DTileContent,nB as ModelAlphaOptions,GF as ModelAnimation,HF as ModelAnimationChannel,WF as ModelAnimationCollection,au as ModelAnimationLoop,nm as ModelAnimationState,n2 as ModelArticulation,e2 as ModelArticulationStage,r2 as ModelClippingPlanesPipelineStage,c2 as ModelClippingPolygonsPipelineStage,Ab as ModelColorPipelineStage,An as ModelComponents,_B as ModelDrawCommand,bB as ModelDrawCommands,qF as ModelFeature,YF as ModelFeatureTable,ng as ModelGraphics,dB as ModelLightingOptions,p2 as ModelMatrixUpdateStage,l2 as ModelNode,iB as ModelRenderResources,g2 as ModelRuntimeNode,eB as ModelRuntimePrimitive,TB as ModelSceneGraph,aB as ModelSilhouettePipelineStage,tB as ModelSkin,uB as ModelSplitterPipelineStage,AB as ModelStatistics,Tr as ModelType,$t as ModelUtility,wk as ModelVisualizer,Dz as Moon,V2 as MorphTargetsPipelineStage,WTe as MorphWeightSpline,Ub as MortonOrder,XB as Multiple3DTileContent,cL as MultisampleFramebuffer,DG as NavigationHelpButton,wG as NavigationHelpButtonViewModel,Bt as NearFarScalar,WAe as NeverTileDiscardPolicy,fB as NodeRenderResources,_2 as NodeStatisticsPipelineStage,tA as NodeTransformationProperty,l4 as OIT,Rz as Occluder,Ji as OffsetGeometryInstanceAttribute,qTe as OpenCageGeocoderService,T0 as OpenStreetMapImageryProvider,Y3 as OrderedGroundPrimitiveCollection,Pn as OrientedBoundingBox,on as OrthographicFrustum,jo as OrthographicOffCenterFrustum,YTe as Packable,XTe as PackableForInterpolation,$I as Particle,XAe as ParticleBurst,$Ae as ParticleEmitter,JAe as ParticleSystem,De as Pass,Cc as PassState,ig as PathGraphics,vk as PathVisualizer,rH as PeliasGeocoderService,rn as PerInstanceColorAppearance,t0 as PerformanceDisplay,SG as PerformanceWatchdog,CG as PerformanceWatchdogViewModel,wi as PerspectiveFrustum,zl as PerspectiveOffCenterFrustum,r4 as PickDepth,u4 as PickDepthFramebuffer,f4 as PickFramebuffer,N8 as PickedMetadataInfo,T4 as Picking,z2 as PickingPipelineStage,Ny as PinBuilder,Ue as PixelDatatype,ke as PixelFormat,sn as Plane,ok as PlaneGeometry,ak as PlaneGeometryUpdater,aN as PlaneGraphics,sk as PlaneOutlineGeometry,EB as PntsLoader,KA as PntsParser,q8 as PointCloud,Ng as PointCloudEyeDomeLighting,Mp as PointCloudShading,G2 as PointCloudStylingPipelineStage,iA as PointGraphics,Hs as PointPrimitive,OD as PointPrimitiveCollection,Dk as PointVisualizer,Pg as PolygonGeometry,zn as PolygonGeometryLibrary,fk as PolygonGeometryUpdater,kh as PolygonGraphics,ec as PolygonHierarchy,uk as PolygonOutlineGeometry,si as PolygonPipeline,Dd as Polyline,FD as PolylineArrowMaterialProperty,cm as PolylineCollection,os as PolylineColorAppearance,BD as PolylineDashMaterialProperty,wy as PolylineGeometry,Ik as PolylineGeometryUpdater,kD as PolylineGlowMaterialProperty,Oc as PolylineGraphics,Ea as PolylineMaterialAppearance,qb as PolylineOutlineMaterialProperty,Bi as PolylinePipeline,Rk as PolylineVisualizer,dk as PolylineVolumeGeometry,dm as PolylineVolumeGeometryLibrary,mk as PolylineVolumeGeometryUpdater,oA as PolylineVolumeGraphics,hk as PolylineVolumeOutlineGeometry,Fh as PositionProperty,uy as PositionPropertyArray,fo as PostProcessStage,z4 as PostProcessStageCollection,Ou as PostProcessStageComposite,Kf as PostProcessStageLibrary,Xf as PostProcessStageSampleMode,JE as PostProcessStageTextureCache,EF as PpeMetadata,dCe as PpeSource,CF as PpeTexture,In as Primitive,Ol as PrimitiveCollection,LA as PrimitiveLoadPlan,MA as PrimitiveOutlineGenerator,q2 as PrimitiveOutlinePipelineStage,HT as PrimitivePipeline,hB as PrimitiveRenderResources,Mr as PrimitiveState,Y2 as PrimitiveStatisticsPipelineStage,Me as PrimitiveType,AG as ProjectionPicker,xG as ProjectionPickerViewModel,Y as Property,UD as PropertyArray,OA as PropertyAttribute,fF as PropertyAttributeProperty,bl as PropertyBag,Cl as PropertyTable,Mg as PropertyTexture,uF as PropertyTextureProperty,ms as ProviderViewModel,ZTe as Proxy,ul as QuadraticRealPolynomial,dz as QuadtreeOccluders,bz as QuadtreePrimitive,mz as QuadtreeTile,_a as QuadtreeTileLoadState,eCe as QuadtreeTileProvider,TS as QuantizedMeshTerrainData,f1 as QuarticRealPolynomial,Le as Quaternion,zF as QuaternionSpline,pb as Queue,_n as Ray,ce as Rectangle,oE as RectangleCollisionChecker,ZC as RectangleGeometry,zs as RectangleGeometryLibrary,pk as RectangleGeometryUpdater,Uh as RectangleGraphics,cC as RectangleOutlineGeometry,zi as ReferenceFrame,dy as ReferenceProperty,ze as RenderState,tf as Renderbuffer,Ec as RenderbufferFormat,ir as Request,sp as RequestErrorEvent,Tc as RequestScheduler,Zn as RequestState,gs as RequestType,we as Resource,Di as ResourceCache,su as ResourceCacheKey,ZN as ResourceCacheStatistics,$i as ResourceLoader,gt as ResourceLoaderState,Vd as Rotation,ae as RuntimeError,_g as S2Cell,sa as SDFSettings,Ia as SampledPositionProperty,Ff as SampledProperty,Qt as Sampler,f_ as ScaledPositionProperty,U8 as Scene,KE as SceneFramebuffer,oe as SceneMode,X2 as SceneMode2DPipelineStage,FG as SceneModePicker,LG as SceneModePickerViewModel,Hi as SceneTransforms,j4 as SceneTransitioner,t8 as ScreenSpaceCameraController,$f as ScreenSpaceEventHandler,Cn as ScreenSpaceEventType,Sb as SelectedFeatureIdPipelineStage,RG as SelectionIndicator,IG as SelectionIndicatorViewModel,HD as SensorVolumePortionToDisplay,MT as ShaderBuilder,tL as ShaderCache,ge as ShaderDestination,fL as ShaderFunction,en as ShaderProgram,He as ShaderSource,uL as ShaderStruct,i0 as ShadowMap,S_ as ShadowMapShader,Tn as ShadowMode,sf as ShadowVolumeAppearance,xn as ShowGeometryInstanceAttribute,z0 as Simon1994PlanetaryPositions,QTe as SimplePolylineGeometry,YV as SingleTileImageryProvider,$2 as SkinningPipelineStage,V8 as SkyAtmosphere,z8 as SkyBox,O8 as SpatialNode,TF as Spdcf,Hh as SpecularEnvironmentCubeMap,tCe as SphereEmitter,JTe as SphereGeometry,Jg as SphereOutlineGeometry,F3 as Spherical,Ni as Spline,qr as SplitDirection,OI as Splitter,Wd as StaticGeometryColorBatch,Yd as StaticGeometryPerMaterialBatch,tP as StaticGroundGeometryColorBatch,Ak as StaticGroundGeometryPerMaterialBatch,Ok as StaticGroundPolylinePerMaterialBatch,nP as StaticOutlineGeometryBatch,kt as StencilConstants,Vn as StencilFunction,ft as StencilOperation,VF as SteppedSpline,Bc as Stereographic,Rp as StorageType,VD as StripeMaterialProperty,_m as StripeOrientation,oa as StructuralMetadata,im as StyleCommandsNeeded,nCe as StyleExpression,H8 as Sun,Y_ as SunLight,o8 as SunPostProcess,gF as SupportedImageFormats,kH as SvgPathBindingHandler,bi as TaskProcessor,LH as Terrain,Fm as TerrainData,Zc as TerrainEncoding,ZP as TerrainFillMesh,oh as TerrainMesh,aA as TerrainOffsetProperty,us as TerrainProvider,pa as TerrainQuantization,uo as TerrainState,Rt as Texture,LT as TextureAtlas,iL as TextureCache,ui as TextureMagnificationFilter,v8 as TextureManager,Yt as TextureMinificationFilter,hw as TexturePacker,uCe as TextureUniform,gn as TextureWrap,$m as TileAvailability,Pf as TileBoundingRegion,QB as TileBoundingS2Cell,ey as TileBoundingSphere,iCe as TileBoundingVolume,NH as TileCoordinatesImageryProvider,oCe as TileDiscardPolicy,yn as TileEdge,KP as TileImagery,_x as TileMapServiceImageryProvider,qB as TileMetadata,fu as TileOrientedBoundingBox,Io as TileProviderError,_z as TileReplacementQueue,Yn as TileSelectionResult,rCe as TileState,wB as Tileset3DTileContent,n3 as TilesetMetadata,XF as TilesetPipelineStage,eAe as TilingScheme,qn as TimeConstants,BE as TimeDynamicImagery,MI as TimeDynamicPointCloud,Sn as TimeInterval,Xr as TimeIntervalCollection,my as TimeIntervalCollectionPositionProperty,py as TimeIntervalCollectionProperty,Wn as TimeStandard,UG as Timeline,BG as TimelineHighlightRange,kG as TimelineTrack,m1 as Tipsify,Zx as ToggleButtonViewModel,r0 as Tonemapper,Q_ as TrackingReferenceFrame,Ot as Transforms,eb as TranslationRotationScale,h4 as TranslucentTileClassification,Bv as TridiagonalSystemSolver,KS as TrustedServers,nS as TweenCollection,sL as UniformState,rS as UniformType,hc as UrlTemplateImageryProvider,Cyo as VERSION,qG as VRButton,jG as VRButtonViewModel,oAe as VRTheWorldTerrainProvider,fCe as VaryingType,Cp as Vector3DTileBatch,HB as Vector3DTileClampedPolylines,jB as Vector3DTileContent,fg as Vector3DTileGeometry,BB as Vector3DTilePoints,kB as Vector3DTilePolygons,nC as Vector3DTilePolylines,hA as Vector3DTilePrimitive,k3 as VelocityOrientationProperty,_y as VelocityVectorProperty,ni as VertexArray,X_ as VertexArrayFacade,ht as VertexAttributeSemantic,Ie as VertexFormat,Rr as VerticalExaggeration,Q2 as VerticalExaggerationPipelineStage,Fn as VerticalOrigin,tAe as VideoSynchronizer,ZE as View,tEe as Viewer,sCe as ViewportQuad,Sr as Visibility,j_e as Visualizer,lS as VoxelBoxShape,s8 as VoxelCell,cS as VoxelContent,uS as VoxelCylinderShape,fS as VoxelEllipsoidShape,HG as VoxelInspector,VG as VoxelInspectorViewModel,hh as VoxelMetadataOrder,Bx as VoxelPrimitive,aCe as VoxelProvider,T8 as VoxelRenderResources,cCe as VoxelShape,Na as VoxelShapeType,M8 as VoxelTraversal,rAe as VulkanConstants,gk as WallGeometry,JC as WallGeometryLibrary,bk as WallGeometryUpdater,og as WallGraphics,yk as WallOutlineGeometry,ne as WebGLConstants,KV as WebMapServiceImageryProvider,$V as WebMapTileServiceImageryProvider,Li as WebMercatorProjection,fs as WebMercatorTilingScheme,ts as WindingOrder,Gv as WireframeIndexGenerator,J2 as WireframePipelineStage,A4 as _shadersAcesTonemappingStage,n8 as _shadersAdditiveBlend,NP as _shadersAdjustTranslucentFS,mL as _shadersAllMaterialAppearanceFS,pL as _shadersAllMaterialAppearanceVS,C4 as _shadersAmbientOcclusionGenerate,E4 as _shadersAmbientOcclusionModulate,xL as _shadersAspectRampMaterial,Qh as _shadersAtmosphereCommon,KF as _shadersAtmosphereStageFS,$F as _shadersAtmosphereStageVS,_L as _shadersBasicMaterialAppearanceFS,gL as _shadersBasicMaterialAppearanceVS,vB as _shadersBillboardCollectionFS,DB as _shadersBillboardCollectionVS,S4 as _shadersBlackAndWhite,w4 as _shadersBloomComposite,aV as _shadersBrdfLutGeneratorFS,i8 as _shadersBrightPass,v4 as _shadersBrightness,TL as _shadersBumpMapMaterial,A2 as _shadersCPUStylingStageFS,T2 as _shadersCPUStylingStageVS,AL as _shadersCheckerboardMaterial,cV as _shadersCloudCollectionFS,lV as _shadersCloudCollectionVS,uV as _shadersCloudNoiseFS,fV as _shadersCloudNoiseVS,dV as _shadersCompareAndPackTranslucentDepth,hV as _shadersCompositeOITFS,$E as _shadersCompositeTranslucentClassification,sF as _shadersComputeIrradianceFS,aF as _shadersComputeRadianceMapFS,D4 as _shadersContrastBias,cF as _shadersConvolveSpecularMapFS,lF as _shadersConvolveSpecularMapVS,S2 as _shadersCustomShaderStageFS,E2 as _shadersCustomShaderStageVS,PT as _shadersCzmBuiltins,P4 as _shadersDepthOfField,mV as _shadersDepthPlaneFS,pV as _shadersDepthPlaneVS,I4 as _shadersDepthView,lCe as _shadersDepthViewPacked,CL as _shadersDotMaterial,O4 as _shadersEdgeDetection,EL as _shadersElevationBandMaterial,SL as _shadersElevationContourMaterial,wL as _shadersElevationRampMaterial,FP as _shadersEllipsoidFS,yH as _shadersEllipsoidSurfaceAppearanceFS,bH as _shadersEllipsoidSurfaceAppearanceVS,BP as _shadersEllipsoidVS,L4 as _shadersFXAA,_V as _shadersFXAA3_11,vL as _shadersFadeMaterial,w2 as _shadersFeatureIdStageFS,v2 as _shadersFeatureIdStageVS,R4 as _shadersFilmicTonemapping,wx as _shadersGaussianBlur1D,R2 as _shadersGeometryStageFS,M2 as _shadersGeometryStageVS,gV as _shadersGlobeFS,yV as _shadersGlobeVS,DL as _shadersGridMaterial,kP as _shadersGroundAtmosphere,eM as _shadersHSBToRGB,tM as _shadersHSLToRGB,QF as _shadersImageBasedLightingStageFS,u2 as _shadersInstancingStageCommon,f2 as _shadersInstancingStageVS,h8 as _shadersIntersectBox,d8 as _shadersIntersectClippingPlanes,m8 as _shadersIntersectCylinder,f8 as _shadersIntersectDepth,p8 as _shadersIntersectEllipsoid,CI as _shadersIntersectLongitude,oS as _shadersIntersection,u8 as _shadersIntersectionUtils,d2 as _shadersLegacyInstancingStageVS,N4 as _shadersLensFlare,N2 as _shadersLightingStageFS,B2 as _shadersMaterialStageFS,x8 as _shadersMegatexture,D2 as _shadersMetadataStageFS,P2 as _shadersMetadataStageVS,o2 as _shadersModelClippingPlanesStageFS,a2 as _shadersModelClippingPolygonsStageFS,s2 as _shadersModelClippingPolygonsStageVS,i2 as _shadersModelColorStageFS,yB as _shadersModelFS,oB as _shadersModelSilhouetteStageFS,rB as _shadersModelSilhouetteStageVS,cB as _shadersModelSplitterStageFS,gB as _shadersModelVS,F4 as _shadersModifiedReinhardTonemapping,U2 as _shadersMorphTargetsStageVS,B4 as _shadersNightVision,PL as _shadersNormalMapMaterial,b8 as _shadersOctree,Iu as _shadersPassThrough,Cx as _shadersPassThroughDepth,M4 as _shadersPbrNeutralTonemapping,UL as _shadersPerInstanceColorAppearanceFS,VL as _shadersPerInstanceColorAppearanceVS,UT as _shadersPerInstanceFlatColorAppearanceFS,zL as _shadersPerInstanceFlatColorAppearanceVS,PF as _shadersPointCloudEyeDomeLighting,H2 as _shadersPointCloudStylingStageVS,Hb as _shadersPointPrimitiveCollectionFS,v3 as _shadersPointPrimitiveCollectionVS,rF as _shadersPolygonSignedDistanceFS,IL as _shadersPolylineArrowMaterial,rN as _shadersPolylineColorAppearanceVS,af as _shadersPolylineCommon,OL as _shadersPolylineDashMaterial,YT as _shadersPolylineFS,RL as _shadersPolylineGlowMaterial,sN as _shadersPolylineMaterialAppearanceVS,ML as _shadersPolylineOutlineMaterial,tN as _shadersPolylineShadowVolumeFS,nN as _shadersPolylineShadowVolumeMorphFS,iN as _shadersPolylineShadowVolumeMorphVS,oN as _shadersPolylineShadowVolumeVS,RB as _shadersPolylineVS,W2 as _shadersPrimitiveOutlineStageFS,j2 as _shadersPrimitiveOutlineStageVS,vM as _shadersRGBToHSB,DM as _shadersRGBToHSL,PM as _shadersRGBToXYZ,k4 as _shadersReinhardTonemapping,bV as _shadersReprojectWebMercatorFS,xV as _shadersReprojectWebMercatorVS,LL as _shadersRimLightingMaterial,zv as _shadersSelectedFeatureIdStageCommon,Cw as _shadersShadowVolumeAppearanceFS,WL as _shadersShadowVolumeAppearanceVS,Y0 as _shadersShadowVolumeFS,U4 as _shadersSilhouette,K2 as _shadersSkinningStageVS,UP as _shadersSkyAtmosphereCommon,TV as _shadersSkyAtmosphereFS,AV as _shadersSkyAtmosphereVS,CV as _shadersSkyBoxFS,EV as _shadersSkyBoxVS,NL as _shadersSlopeRampMaterial,FL as _shadersStripeMaterial,SV as _shadersSunFS,wV as _shadersSunTextureFS,vV as _shadersSunVS,yL as _shadersTexturedMaterialAppearanceFS,bL as _shadersTexturedMaterialAppearanceVS,zB as _shadersVector3DTileClampedPolylinesFS,VB as _shadersVector3DTileClampedPolylinesVS,UB as _shadersVector3DTilePolylinesVS,tv as _shadersVectorTileVS,Z2 as _shadersVerticalExaggerationStageVS,DV as _shadersViewportQuadFS,xT as _shadersViewportQuadVS,c8 as _shadersVoxelFS,a8 as _shadersVoxelUtils,l8 as _shadersVoxelVS,kL as _shadersWater,BL as _shadersWaterMaskMaterial,JM as _shadersXYZToRGB,yR as _shadersacesTonemapping,bR as _shadersalphaWeight,xR as _shadersantialias,TR as _shadersapplyHSBShift,AR as _shadersapproximateSphericalCoordinates,CR as _shadersapproximateTanh,ER as _shadersbackFacing,SR as _shadersbranchFreeTernary,wR as _shaderscascadeColor,vR as _shaderscascadeDistance,DR as _shaderscascadeMatrix,PR as _shaderscascadeWeights,IR as _shadersclipPolygons,OR as _shaderscolumbusViewMorph,RR as _shaderscomputeAtmosphereColor,MR as _shaderscomputeGroundAtmosphereScattering,LR as _shaderscomputePosition,NR as _shaderscomputeScattering,_8 as _shadersconvertUvToBox,g8 as _shadersconvertUvToCylinder,y8 as _shadersconvertUvToEllipsoid,FR as _shaderscosineAndSine,BR as _shadersdecompressTextureCoordinates,w1 as _shadersdegreesPerRadian,kR as _shadersdepthClamp,v1 as _shadersdepthRange,uR as _shadersdepthRangeStruct,UR as _shaderseastNorthUpToEyeCoordinates,VR as _shadersellipsoidContainsPoint,zR as _shadersellipsoidTextureCoordinates,D1 as _shadersepsilon1,P1 as _shadersepsilon2,I1 as _shadersepsilon3,O1 as _shadersepsilon4,R1 as _shadersepsilon5,M1 as _shadersepsilon6,L1 as _shadersepsilon7,HR as _shadersequalsEpsilon,GR as _shaderseyeOffset,jR as _shaderseyeToWindowCoordinates,WR as _shadersfastApproximateAtan,qR as _shadersfog,YR as _shadersgammaCorrect,XR as _shadersgeodeticSurfaceNormal,KR as _shadersgetDefaultMaterial,$R as _shadersgetDynamicAtmosphereLightDirection,ZR as _shadersgetLambertDiffuse,QR as _shadersgetSpecular,JR as _shadersgetWaterNoise,nM as _shadershue,N1 as _shadersinfinity,iM as _shadersinverseGamma,oM as _shadersisEmpty,rM as _shadersisFull,sM as _shaderslatitudeToWebMercatorFraction,cM as _shaderslineDistance,aM as _shaderslinearToSrgb,lM as _shadersluminance,fR as _shadersmaterial,dR as _shadersmaterialInput,uM as _shadersmaximumComponent,fM as _shadersmetersPerPixel,hR as _shadersmodelMaterial,dM as _shadersmodelToWindowCoordinates,mR as _shadersmodelVertexOutput,hM as _shadersmultiplyWithColorBalance,mM as _shadersnearFarScalar,pM as _shadersoctDecode,F1 as _shadersoneOverPi,B1 as _shadersoneOverTwoPi,_M as _shaderspackDepth,k1 as _shaderspassCesium3DTile,U1 as _shaderspassCesium3DTileClassification,V1 as _shaderspassCesium3DTileClassificationIgnoreShow,z1 as _shaderspassClassification,H1 as _shaderspassCompute,G1 as _shaderspassEnvironment,j1 as _shaderspassGlobe,W1 as _shaderspassOpaque,q1 as _shaderspassOverlay,Y1 as _shaderspassTerrainClassification,X1 as _shaderspassTranslucent,K1 as _shaderspassVoxels,gM as _shaderspbrLighting,yM as _shaderspbrNeutralTonemapping,bM as _shadersphong,$1 as _shaderspi,Z1 as _shaderspiOverFour,Q1 as _shaderspiOverSix,J1 as _shaderspiOverThree,eR as _shaderspiOverTwo,xM as _shadersplaneDistance,TM as _shaderspointAlongRay,tR as _shadersradiansPerDegree,pR as _shadersray,AM as _shadersrayEllipsoidIntersectionInterval,_R as _shadersraySegment,CM as _shadersraySphereIntersectionInterval,EM as _shadersreadDepth,SM as _shadersreadNonPerspective,wM as _shadersreverseLogDepth,IM as _shadersround,OM as _shaderssaturation,nR as _shaderssceneMode2D,iR as _shaderssceneMode3D,oR as _shaderssceneModeColumbusView,rR as _shaderssceneModeMorphing,RM as _shadersshadowDepthCompare,gR as _shadersshadowParameters,MM as _shadersshadowVisibility,LM as _shaderssignNotZero,sR as _shaderssolarRadius,NM as _shaderssphericalHarmonics,FM as _shaderssrgbToLinear,BM as _shaderstangentToEyeSpaceMatrix,kM as _shaderstextureCube,aR as _shadersthreePiOver2,UM as _shaderstransformPlane,VM as _shaderstranslateRelativeToEye,zM as _shaderstranslucentPhong,HM as _shaderstranspose,cR as _shaderstwoPi,GM as _shadersunpackClippingExtents,jM as _shadersunpackDepth,WM as _shadersunpackFloat,qM as _shadersunpackUint,YM as _shadersvalueTransform,XM as _shadersvertexLogDepth,lR as _shaderswebMercatorMaxLatitude,KM as _shaderswindowToEyeCoordinates,$M as _shaderswriteDepthClamp,ZM as _shaderswriteLogDepth,QM as _shaderswriteNonPerspective,kN as addBuffer,DN as addDefaults,NN as addExtensionsRequired,Ad as addExtensionsUsed,ub as addPipelineExtras,Bs as addToArray,LO as appendForwardSlash,xo as arrayRemoveDuplicates,CT as barycentricCoordinates,Mo as binarySearch,tn as buildModuleUrl,E8 as buildVoxelDrawCommands,We as clone,xt as combine,DE as computeFlyToLocationForRectangle,ZA as createBillboardPointCallback,wn as createCommand,KH as createDefaultImageryProviderViewModels,$H as createDefaultTerrainProviderViewModels,AAe as createElevationBandMaterial,EAe as createGooglePhotorealistic3DTileset,jn as createGuid,No as createMaterialPropertyDescriptor,SAe as createOsmBuildingsAsync,fe as createPropertyDescriptor,yl as createRawPropertyDescriptor,wAe as createTangentSpaceDebugPrimitive,hCe as createTaskProcessorWorker,i1 as createUniform,o1 as createUniformArray,Q8 as createWorldBathymetryAsync,Ky as createWorldImageryAsync,ES as createWorldTerrainAsync,J8 as decodeGoogleEarthEnterpriseData,GB as decodeVectorPolylinePositions,vTe as defaultValue,Yl as defer,c as defined,eL as demodernizeShader,Ns as deprecationWarning,de as destroyObject,tpe as exportKml,yA as findAccessorMinMax,oC as findContentMetadata,rC as findGroupMetadata,YB as findTileMetadata,fv as forEachTextureInMaterial,g_ as formatError,t1 as freezeRenderState,rp as getAbsoluteUri,ou as getAccessorByteStride,NO as getBaseUri,df as getBinaryAccessor,G8 as getClipAndStyleCode,jy as getClippingFunction,Tg as getComponentReader,Rn as getElement,uT as getExtensionFromUri,ly as getFilenameFromUri,S8 as getImageFromTypedArray,Ah as getImagePixels,sr as getJsonFromTypedArray,Wh as getMagic,L8 as getMetadataClassProperty,F8 as getMetadataProperty,tu as getStringFromTypedArray,Ei as getTimestamp,ri as hasExtension,rg as heightReferenceOnEntityPropertyChanged,tl as isBitSet,fT as isBlobUri,P0 as isCrossOriginUrl,k_ as isDataUri,Th as isLeapYear,Te as knockout,US as knockout_3_5_1,BH as knockout_es5,dT as loadAndExecuteScript,lL as loadCubeMap,_A as loadImageFromTypedArray,Xl as loadKTX2,Zy as mergeSort,LN as moveTechniqueRenderStates,FN as moveTechniquesToExtension,mf as numberOfComponentsForType,hT as objectToQuery,dt as oneTimeWarning,Fg as parseBatchTable,hF as parseFeatureMetadataLegacy,ON as parseGlb,BO as parseResponseHeaders,dF as parseStructuralMetadata,qv as pickModel,KTe as pointInsideTriangle,$g as preprocess3DTileContent,C8 as processVoxelProperties,Ku as queryToObject,UN as readAccessorPacked,bA as removeExtension,IN as removeExtensionsRequired,gA as removeExtensionsUsed,MN as removePipelineExtras,BN as removeUnusedElements,db as resizeImageToNextPowerOfTwo,PV as sampleTerrain,vE as sampleTerrainMostDetailed,sT as scaleToGeodeticSurface,IS as srgbToLinear,qL as subdivideArray,Ba as subscribeAndEvaluate,zN as updateAccessorComponentTypes,GN as updateVersion,br as usesExtension,nEe as viewerCesium3DTilesInspectorMixin,iEe as viewerCesiumInspectorMixin,rEe as viewerDragDropMixin,sEe as viewerPerformanceWatchdogMixin,aEe as viewerVoxelInspectorMixin,sAe as webGLConstantToGlslType,uH as wrapFunction,JA as writeTextToCanvas};
//# sourceMappingURL=index.js.map