/** * @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>>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>>1^t[e&1];for(;n>>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=55296&&X<=56319&&U65535&&(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=128&&P("not-basic"),j.push(V.charCodeAt(ee));for(me=Z>0?Z+1:0;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,!(AeE(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=j&&ueE((r-U)/Pe)&&P("overflow"),U+=(Z-j)*Pe,j=Z,K=0;Kr&&P("overflow"),ue==j){for(ee=U,me=s;xe=me<=te?a:me>=te+l?l:me-te,!(ee{/*! * 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;u1);p++)f.splice(0,1);s[h]=f.join("")}var g=-1,m=0,y=0,b=-1,x=!1;for(h=0;hm&&(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{/*! * 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]+|\(([^\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-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-1?k:w.length-1),V;return H>-1&&(k===-1||H-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{"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{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);j0;)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 bx?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=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=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=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;l1&&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>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;y1)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;l0?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;l191&&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>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)<>>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)<>>0,this.buf[this.pos++]<128)return m}return m.lo=(m.lo|(this.buf[this.pos++]&127)<>>0,m}if(this.len-this.pos>4){for(;y<5;++y)if(m.hi=(m.hi|(this.buf[this.pos]&127)<>>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)<>>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-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;u127;)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>>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>>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;_>3],X<<=k&7),B=0;B>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;_P?P:v,M[k++]=P;k+=H}else for(v=v>q?q:v,_=0;_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(A0?1:0),R=P+(g.height%P>0?1:0);g.pixels.blocks=new Array(M*R);for(var L=0,B=0;B3)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)v=P>>>S-h&x,S-=h;else{var L=h-S;v=(P&x)<>>S}y[E]=v=f?(S=v>>>E-f&b,E-=f):(P=f-E,S=(v&b)<>>E),u[A]=p[S];else for(M=Math.ceil((y-g)/m),A=0;A=f?(S=v>>>E-f&b,E-=f):(P=f-E,S=(v&b)<>>E),u[A]=S=u?(E=S>>>A-u&m,A-=u):(x=u-A,E=(S&m)<>>A),v[b]=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<=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<=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<=f?(b=x>>>y-f&p,y-=f):(A=f-y,b=(x&p)<>>y),u[m]=b;return u},originalUnstuff2:function(l,u,f,h){var p=(1<=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<=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;y0){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>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=y)return!1;var b=new Uint32Array(y-m);r.decodeBits(l,u,b);var x=[],A,E,S,v;for(A=m;A0&&(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=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;A0)if(V=[v,E],v<=N)for(j=x[E].second<=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;Z1&&(K=new f(te.buffer,y*Z,y),U=0),u.headerInfo.numValidPixel===m*g)for(V=0,k=0;k>>32-P,I=D,32-v>>64-v-P,I=D),x[I])B=x[I][1],v+=x[I][0];else for(D=q<>>32-M,I=D,32-v>>64-v-M,I=D),L=A,j=0;j>>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>>32-P,I=D,32-v>>64-v-P,I=D),x[I])B=x[I][1],v+=x[I][0];else for(D=q<>>32-M,I=D,32-v>>64-v-M,I=D),L=A,j=0;j>>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;v1&&(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=N1)for(g=0;g=-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;h1&&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{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),t0?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?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)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),en?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;oi&&(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(;rl;)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=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&&nn&&ts)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{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;oO.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=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(;n0){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;r0){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;r0){for(o.sort(ZSe),e=0;e=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(oi&&(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(ee;){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;e0&&(Eh[e-n]=t)}Eh.length-=n;let o=qa.internalArray,r=qa.length;for(e=0;e0;){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;t0}},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{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?(st.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"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;u0)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=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=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=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;e0?i+=O.TWO_PI:r0&&(r+=O.TWO_PI),i=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;i0?i+=O.TWO_PI:r0&&(r+=O.TWO_PI),io||O.equalsEpsilon(n,o,O.EPSILON14))&&(n=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;an.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.widthr+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;li)throw new C("The number of color attachments exceeds the number supported.");for(let l=0;li)throw new C("The number of color attachments exceeds the number supported.");for(let l=0;l=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;nut.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;p0&&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=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;y4)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;rs.x&&d.clone(n,s),La.y&&d.clone(n,a),Bl.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;fM&&(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 El.x&&d.clone(o,l),_u.y&&d.clone(o,u),wf.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;pL&&(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 va.x&&d.clone(i,a),Bl.y&&d.clone(i,l),_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;hR&&(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=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:rO.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>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)))u&&u/l0?[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)=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]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=_[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)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)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 ls))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,pu){f=s*s-u,h=-s+Math.sqrt(f);let m=h/l,y=a/h;return m0?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;LM&&(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)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(;an&&(n=l),++a,l=t[a]}let r=[];for(let a=0;ai&&(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(;o0)return++o,o-1;++o}return-1}function s(_,w,D,I,N,k,H){let V=-1,j,U=-1,q=0;for(;qU||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(;ul&&(l=f),++u,f=t[u];if(l===-1)return 0;++l}let p=[],g;for(g=0;gi&&(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=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;r0){let t=e.length-1,n=(t-1)*6,i=Fe.createTypedArray(t,n),o=e[0],r=0;for(let s=1;so&&(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.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=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;fb&&(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;r0&&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;u0){for(f=0;f3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;oo?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;S3){let I=D.positions,N=D.indices,k=N.length;for(let H=0;H0)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+30||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;i0&&(l=!0),c(s[r].value)&&(u=!0);let h={};for(r=0;r0)for(r=WJ(e[o[0]]),t=1;t0){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=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;s0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function APe(e,t){let n=e._attributes,i=n.length;for(let o=0;oc(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;s1&&!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;o0;){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=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-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;out.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;fn.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;ae.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;rqPe;++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"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=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;i0&&(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;s1){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!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;ia?(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;gnew 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=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;Aa?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=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;h0?$.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;r0){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;l0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=c(n);if(!o||n.sizeInBytes=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;i0){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;t0&&(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-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-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<=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;h0?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;oO.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)=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=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;iml.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=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;ur&&(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;f0&&(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(;s0){let v=b.length/x;for(S=Fe.createTypedArray(v,y),i=0;i= 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;o0){let y=new Float64Array(h);for(m=[y.buffer],r=0;r0?(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;a0?(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;i0||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;i0){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;u4)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;o0&&(l=o[0].attributes,p=sf.hasAttributesForSphericalExtents(l),g=sf.hasAttributesForTextureCoordinatePlanes(l),h=l.color),s=0;s{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{!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;sO.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)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;ipne||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;apne?(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 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{!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{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;o2&&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/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=""+Se;else{let Ta=Fne(Se,/^[\r\n\t ]+/);pn=Ta&&Ta[0]}yo==="application/xhtml+xml"&&ot===Ne&&(Se=''+Se+"");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=" `+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{f[h]=void 0});for(let h=r;h0||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=` This application is using Cesium's default ion access token. Please assign Cesium.Ion.defaultAccessToken with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at https://cesium.com.`;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(et.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>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;l0){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;n0){let i=e._pickIds,o=Zne(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let l=0;l=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;f0;){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=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;u0?(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>>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.index0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.lengthr.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=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":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=0&&r=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;l1)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"?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;a1)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" 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;a1){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;p0;){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;u0;){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=y&&s{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;s0)for(i=new Uint16Array(l),s=0;s0)for(o=new Uint16Array(u),s=0;s0)for(r=new Uint16Array(f),s=0;s0&&(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(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>>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)<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<=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<>2&i)<=.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<>>0}function gie(e){return 1/hBe*e}function mg(e,t,n,i,o,r){if(e===dg){let s=(t<>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)<>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:e1;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;n1;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;i1?Cie(e,t,n):void 0}if(eNt.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=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>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<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)<96?b-97:b>64?b-39:b+4}for(var x=0,y=0;y=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;E96?S-97:S>64?S-39:S+4}for(var v=0,E=0;E0?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;b96?x-97:x>64?x-39:x+4}for(var A=0,b=0;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=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;b96?x-97:x>64?x-39:x+4}for(var A=0,b=0;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{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;i0)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;r0){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(;i0){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-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;at&&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;st&&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;ht&&--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;ut&&--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;st&&--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;r0&&(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;f0)for(s.mesh=n.meshes[l[0]],t=1;t0&&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=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=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=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;E0;f=f||h;for(let p=0;p>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;o0&&(r=Wt.OUTSIDE);for(let s=0;s80*n){a=1/0,l=1/0;let f=-1/0,h=-1/0;for(let p=n;pf&&(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=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=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.x&&n.x>=l&&i!==n.x&&Aoe(os.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;u0||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=(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;r0?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;a0;){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;a0;){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;a10&&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;l0;){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;u0?new Array(o):void 0;for(let a=0;aO.PI){let l=s;s=a,a=l}if(!(r.longitudea))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(;ut.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=0&&l!==r&&a.lengthu.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;g1){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;gMath.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=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_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=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 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;ivv.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;rce.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;ns+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{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= 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._activeComputeCommandCounts,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;hh/(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=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=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>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;a1;)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{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{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;vn[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=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;a0&&(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;i0&&(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;on[i-1])throw new C("time is out of range.");if(t=t??0,e>=n[t]){if(t+1=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o=n[o]&&e=0&&!(e>=n[o]&&en&&(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=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=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=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;s0&&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;sO.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 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=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=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;o1&&(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;yIGe(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;fRGe(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;af),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;n1?(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;g0,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;n0,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 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;as||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<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<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=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;r0&&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.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;r0&&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;s0,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;r0)&&(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{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;R0){this._vaf=Y9e(t,i,this._buffersUsage,this._instanced,this._batchTable,this._sdf),h=this._vaf.writers;for(let R=0;R0){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;Bi*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;k0}},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=0;--x)if(m[x]!==255){S=x/b|0;break}let v=-1;for(x=0;x]/,o=[],r="",s=as.LTR,a="",l=e.length;for(let u=0;u";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;iu+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,i0,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;g0&&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;D0?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;L0&&(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;L0?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;o0){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;g2&&(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;r2){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;l0){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;j0&&(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;o1){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;s0,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;H0||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;te2&&(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;r0&&(l=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let h=0;h0)g[0]=y;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let y=0;for(let b=0;bO.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;o0){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.lengthl&&(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;b0||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{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{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{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 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{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;f0&&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;r0)for(i=new Uint16Array(a),r=0;r0)for(o=new Uint16Array(l),r=0;r0&&(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;te0){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=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;sg7e(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;ea?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.longitudeO.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=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;S0){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(s0?(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),h3)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;l0&&(m=!0,h+=u),s1||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;se.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>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<=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<this.level)throw new C("ancestor cannot be above the tileset root");let t=1<>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._selectedFrame0;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;o0;){_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;o0;){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;p0;){xD.stackMaximumLength=Math.max(xD.stackMaximumLength,r.length);let a=r.pop().children;for(let l=0;ln._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;ut: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;ffi._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;fb.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=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;n0?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;i0&&(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;ls){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.totalMemoryUsageInBytes0&&_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;n0&&(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;a0;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=0;--b)i[h+y+b]=i[h+b];for(let b=0;b0&&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{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;oi.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{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a{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-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-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;rthis._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=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=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;t0&&(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-10&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i0&&(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}))));i0||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=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=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;p0){let y=u?2:1;for(let b=0;b=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;HPe;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;p0;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-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;s0: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;n0&&(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;l0){this._vaf=$Ke(l,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v0){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;Mn*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>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);as;)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;s0){let N=new LD(A.length,64,Uint32Array);for(let k=0;k=f)for(Mue(k.position,w,_,e),p.push(k),S=0;S=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;S0?(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;n0&&!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;f0){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;p0)for(p=0;p0){for(l=0;l=t;i--)e[i]=e[a--]}for(i=0;i=0||c(h)&&Q.compare(f,h)>=0));){for(pq[p++]=f,r=r+1,s=0;s0&&(_q.length=g,Hue(n,u,_q),pq.length=p,Hue(t,l,pq))}else{for(s=0;so)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;Px&&(M=x,P=M-y,P0){n=new Array(t);for(let i=0;i0&&(!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;ol&&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;il),!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. 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-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;fthis._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;n1;--_){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;w1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;aO.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),i0){let m=Math.min(u,l);g=Math.round(l/m);let y=Math.min(g*u,l);for(p=0;p0&&(S=!0,x+=l-1),s0&&f!==y-1&&h!==0&&h!==b-1&&(B[X]=!0),X++;p=0;let te,K;for(f=1;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;_1||v>1))for(let w=0;w0;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;f0)for(s=new Array(o),i=0;i0)for(a=new Array(o),i=0;i0)for(s=new Array(o),i=0;i0)for(a=new Array(o),i=0;i{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;r0){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=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;r0)for(r=0;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;u0){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=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;l0)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=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;o0)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=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;l0)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;r0)for(h=!0,t=0;t0)for(h=!0,t=0;t-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-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-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-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(;p0&&!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&&A0){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-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;i0?(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-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;s0?new Array(o):void 0;for(i=0;i0){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;l0)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=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-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-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;unew 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;tDtt*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=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=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<>>16-ee,ee+=Ze-16):(Z|=Ne<=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,te8?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<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]&&XeHt){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=Er&&(p=(p<=Er)if(Xe=Vt(v-P,A-Er),M-=A,A<=B&&M>=Er){A--;do v++,p=(p<=Er&&(p=(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<Ntt||Ze!=qq||Xe<9||Xe>15||ot<0||ot>9||Ht<0||Ht>2?-2:(Ne.dstate=e,s=Xe,r=1<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(Zer-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<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;Xen&&(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,_R&&(_=R),b[0]=_,H=1<N+_;){if(M++,N+=_,V=P-N,V=V>_?_:V,(v=1<<(L=B-N))>S+1&&(v-=S+1,k=B,LXhe)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]>>N;L>>=1)R^=L;for(R^=L,w=(1<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>=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)<>=L[te+1],D-=L[te+1],_&16){for(_&=15;D<_;)N--,w|=(M.read_byte(I++)&255)<>=_,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>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>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>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>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=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>>=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,M-=E,r=f,i=g,o=m,t=Ohe;case Ohe:for(E=r;M>=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,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,_=B7&&(M-=8,L++,R--),b.write=B,A=b.inflate_flush(x,A),B=b.write,_=By.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>>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)<>>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=Pv&&(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)<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>>=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)<>>=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,E-=x,a[s++]=V;else{for(R=V==18?7:V-14,H=V==18?11:3;E>>=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=P15?(e.inflateEnd(n),-2):(e.wbits=i,n.istate.blocks=new Jtt(n,1<>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<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>>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;n0&&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>>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>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n9007199254740991)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<>>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>>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>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>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;ao&&(e=new n().update(e).finalize());for(let r=0;rthis.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;bthis.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>>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!x.busy);if(b)return vme(b),new yE(b,e,t,y);if(lx.lengthl7.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;i2?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||on&&(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;nthis[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_.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>>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(;lt[o]==r);for(let o=0,r=0;o=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;z7Gme.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),_;nQq?_=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;h0){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;P1){let v=i.createElement("MultiGeometry");for(let P=0;P0){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;p1){let x=r.createElementNS(Jd,"MultiTrack");for(p=0;p0&&(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;f0&&(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;m0&&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=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${i}${ape(o)}`:n+=`${i}${o}`)}return n.length>0&&(n=`${n}
`),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;i2?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;st&&(n==null?(n="…",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(),""].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="…",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).length0&&(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="…",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=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=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"?(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=/( | |<|<|>|>|"|"|')/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;nr?n:n+1;t.splice(a,1);continue}if(t[n+1].getOffset()/g,">"));for(var n=this.parse(t),i=[],o=0,r=0,s=n.length;r{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${h.text}: ${h.value}

`)}if(!c(i)||i==="")return;i=Iot.link(i),PP.innerHTML=i;let s=PP.querySelectorAll("a");for(n=0;n',u+=`${PP.innerHTML}`,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;a0?(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=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=e1e4?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;n0;){this._tweensAddedDuringUpdate={};for(var o=0;o1?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[n1;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"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;tl)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;gthis._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("",t),i,o,r;for(;t!==-1&&t0?(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:clampToSeaFloor is currently not supported, using :clampToGround."),qe.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(dt("kml-gx:altitudeMode-relativeToSeaFloor","KML - :relativeToSeaFloor is currently not supported, using :relativeToGround."),qe.RELATIVE_TO_GROUND):(c(e)?dt("kml-altitudeMode-unknown",`KML - Unknown :${e}, using :CLAMP_TO_GROUND.`):dt("kml-gx:altitudeMode-unknown",`KML - Unknown :${t}, using :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;r0&&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;x0&&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;y0)){for(m='',r=0;r`;m+="
${y.displayName??s}${y.value??""}
"}if(!c(m))return;m=$ot.link(m),lo.innerHTML=m;let b=lo.querySelectorAll("a");for(r=0;r1&&(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='
',x+=`${lo.innerHTML}
`,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;uO.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;v0||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&&w0;)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&&Lf.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;r0&&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)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=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=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=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.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;s0?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<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;Rh.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<=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=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;l0;--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<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;$e0?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=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=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<=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=' This application is using a default ArcGIS access token. Please assign Cesium.ArcGisMapService.defaultAccessToken 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 https://developers.arcgis.com/.';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&&f0&&(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;r1&&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='';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];c(r)&&(typeof r=="object"?i+=``:i+=``)}return i+="
${o}${t(r)}
${o}${r}
",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;yo.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(``),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<=0;--o){let r=1<=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)&&it.rectangle.east&&(e.east=t.rectangle.east),e.southt.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`),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('© Mapbox © OpenStreetMap Improve this map');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;i0)for(let r=0;r\s*<\/body>/im,Rat=//im,Mat=/([\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="×",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('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <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:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> © <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:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> © <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:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> © <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:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> © <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>    ${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: "     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="×",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="×",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